mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 19:37:28 +00:00
remove ENABLE_GUEST setting
enable guest if is pro version else no
This commit is contained in:
@@ -504,8 +504,6 @@ ENABLE_PUBFILE = False
|
||||
|
||||
ENABLE_SUB_LIBRARY = True
|
||||
|
||||
ENABLE_GUEST = False
|
||||
|
||||
############################
|
||||
# Settings for Seahub Priv #
|
||||
############################
|
||||
|
@@ -35,7 +35,7 @@
|
||||
<h3>{% trans "Add user" %}</h3>
|
||||
<label for="id_email">{% trans "Email" %}</label><br />
|
||||
<input type="text" name="email" id="id_email" class="input" /><br />
|
||||
{% if enable_guest %}
|
||||
{% if is_pro %}
|
||||
<label>{% trans "Role"%}</label><span class="icon-question-sign" title="{% trans "You can also add a user as a guest, who will not be allowed to create libraries and groups." %}" style="color:#666; margin-left:3px;"></span>
|
||||
<select name="role" class="w100">
|
||||
<option value={{default_user}} selected="selected">{% trans "Default"%}</option>
|
||||
@@ -88,7 +88,7 @@ $('#add-user-form').submit(function() {
|
||||
var form = $(this),
|
||||
form_id = $(this).attr('id'),
|
||||
email = $.trim(form.children('[name="email"]').val()),
|
||||
{% if enable_guest %}
|
||||
{% if is_pro %}
|
||||
role = $('select[name="role"]', form).val(),
|
||||
{% endif %}
|
||||
pwd1 = $.trim(form.children('[name="password1"]').val()),
|
||||
@@ -121,7 +121,7 @@ $('#add-user-form').submit(function() {
|
||||
beforeSend: prepareCSRFToken,
|
||||
data: {
|
||||
'email': email,
|
||||
{% if enable_guest %}
|
||||
{% if is_pro %}
|
||||
'role': role,
|
||||
{% endif %}
|
||||
'password1': pwd1,
|
||||
|
@@ -76,11 +76,11 @@
|
||||
{% else %}
|
||||
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
||||
{% endif %}
|
||||
{% if enable_guest %}
|
||||
{% if is_pro %}
|
||||
<img src="{{MEDIA_URL}}img/edit_12.png" alt="{% trans "Edit"%}" title="{% trans "Edit"%}" class="user-role-edit-icon cspt vh" />
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if enable_guest %}
|
||||
{% if id_pro %}
|
||||
<select name="role" class="user-role-select hide">
|
||||
<option value={{default_user}} {%if not user.is_guest %}selected="selected"{% endif %}>{% trans "Default" %}</option>
|
||||
<option value={{guest_user}} {%if user.is_guest %}selected="selected"{% endif %}>{% trans "Guest"%}</option>
|
||||
|
@@ -1,9 +1,14 @@
|
||||
{% load seahub_tags i18n %}
|
||||
<table>
|
||||
<tr>
|
||||
{% if is_pro %}
|
||||
<th width="24%">{% trans "Email" %}</th>
|
||||
<th width="12%">{% trans "Status" %}</th>
|
||||
<th width="12%">{% trans "Role" %}</th>
|
||||
{% else %}
|
||||
<th width="36%">{% trans "Email" %}</th>
|
||||
<th width="12%">{% trans "Status" %}</th>
|
||||
{% endif %}
|
||||
<th width="16%">{% trans "Space Used" %}</th>
|
||||
<th width="22%">{% trans "Create At / Last Login" %}</th>
|
||||
<th width="14%">{% trans "Operations" %}</th>
|
||||
@@ -35,6 +40,7 @@
|
||||
</select>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if is_pro %}
|
||||
<td>
|
||||
{% if user.source != 'LDAP' %}
|
||||
<div class="user-role">
|
||||
@@ -43,18 +49,15 @@
|
||||
{% else %}
|
||||
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
||||
{% endif %}
|
||||
{% if enable_guest %}
|
||||
<img src="{{MEDIA_URL}}img/edit_12.png" alt="{% trans "Edit"%}" title="{% trans "Edit"%}" class="user-role-edit-icon cspt vh" />
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if enable_guest %}
|
||||
<select name="role" class="user-role-select hide">
|
||||
<option value={{default_user}} {%if not user.is_guest %}selected="selected"{% endif %}>{% trans "Default" %}</option>
|
||||
<option value={{guest_user}} {%if user.is_guest %}selected="selected"{% endif %}>{% trans "Guest"%}</option>
|
||||
</select>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
|
||||
<td style="font-size:11px;">
|
||||
<p> {{ user.space_usage|filesizeformat }} {% if user.space_quota > 0 %} / {{ user.space_quota|filesizeformat }} {% endif %} </p>
|
||||
|
@@ -36,8 +36,7 @@ from seahub.profile.models import Profile, DetailedProfile
|
||||
from seahub.share.models import FileShare, UploadLinkShare
|
||||
import seahub.settings as settings
|
||||
from seahub.settings import INIT_PASSWD, SITE_NAME, \
|
||||
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER, SEND_EMAIL_ON_RESETTING_USER_PASSWD, \
|
||||
ENABLE_GUEST
|
||||
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER, SEND_EMAIL_ON_RESETTING_USER_PASSWD
|
||||
from seahub.utils import send_html_email, get_user_traffic_list, \
|
||||
get_server_id, clear_token
|
||||
from seahub.utils.rpc import mute_seafile_api
|
||||
@@ -393,7 +392,7 @@ def sys_user_admin(request):
|
||||
'server_id': server_id[:8],
|
||||
'default_user': DEFAULT_USER,
|
||||
'guest_user': GUEST_USER,
|
||||
'enable_guest': ENABLE_GUEST,
|
||||
'is_pro': is_pro_version(),
|
||||
'pro_server': pro_server,
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@@ -437,7 +436,7 @@ def sys_user_admin_ldap(request):
|
||||
'next_page': current_page+1,
|
||||
'per_page': per_page,
|
||||
'page_next': page_next,
|
||||
'enable_guest': ENABLE_GUEST,
|
||||
'is_pro': is_pro_version(),
|
||||
'CALC_SHARE_USAGE': CALC_SHARE_USAGE,
|
||||
},
|
||||
context_instance=RequestContext(request))
|
||||
@@ -486,7 +485,7 @@ def sys_user_admin_admins(request):
|
||||
'have_ldap': have_ldap,
|
||||
'default_user': DEFAULT_USER,
|
||||
'guest_user': GUEST_USER,
|
||||
'enable_guest': ENABLE_GUEST,
|
||||
'is_pro': is_pro_version(),
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@login_required
|
||||
@@ -840,7 +839,7 @@ def user_toggle_role(request, email):
|
||||
return HttpResponse(json.dumps({'success': False}), status=400,
|
||||
content_type=content_type)
|
||||
|
||||
if not ENABLE_GUEST:
|
||||
if not is_pro_version():
|
||||
return HttpResponse(json.dumps({'success': False}), status=403,
|
||||
content_type=content_type)
|
||||
|
||||
@@ -1313,7 +1312,7 @@ def user_search(request):
|
||||
'email': email,
|
||||
'default_user': DEFAULT_USER,
|
||||
'guest_user': GUEST_USER,
|
||||
'enable_guest': ENABLE_GUEST,
|
||||
'is_pro': is_pro_version(),
|
||||
}, context_instance=RequestContext(request))
|
||||
|
||||
@login_required
|
||||
|
Reference in New Issue
Block a user