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_SUB_LIBRARY = True
|
||||||
|
|
||||||
ENABLE_GUEST = False
|
|
||||||
|
|
||||||
############################
|
############################
|
||||||
# Settings for Seahub Priv #
|
# Settings for Seahub Priv #
|
||||||
############################
|
############################
|
||||||
|
@@ -35,7 +35,7 @@
|
|||||||
<h3>{% trans "Add user" %}</h3>
|
<h3>{% trans "Add user" %}</h3>
|
||||||
<label for="id_email">{% trans "Email" %}</label><br />
|
<label for="id_email">{% trans "Email" %}</label><br />
|
||||||
<input type="text" name="email" id="id_email" class="input" /><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>
|
<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">
|
<select name="role" class="w100">
|
||||||
<option value={{default_user}} selected="selected">{% trans "Default"%}</option>
|
<option value={{default_user}} selected="selected">{% trans "Default"%}</option>
|
||||||
@@ -88,7 +88,7 @@ $('#add-user-form').submit(function() {
|
|||||||
var form = $(this),
|
var form = $(this),
|
||||||
form_id = $(this).attr('id'),
|
form_id = $(this).attr('id'),
|
||||||
email = $.trim(form.children('[name="email"]').val()),
|
email = $.trim(form.children('[name="email"]').val()),
|
||||||
{% if enable_guest %}
|
{% if is_pro %}
|
||||||
role = $('select[name="role"]', form).val(),
|
role = $('select[name="role"]', form).val(),
|
||||||
{% endif %}
|
{% endif %}
|
||||||
pwd1 = $.trim(form.children('[name="password1"]').val()),
|
pwd1 = $.trim(form.children('[name="password1"]').val()),
|
||||||
@@ -121,7 +121,7 @@ $('#add-user-form').submit(function() {
|
|||||||
beforeSend: prepareCSRFToken,
|
beforeSend: prepareCSRFToken,
|
||||||
data: {
|
data: {
|
||||||
'email': email,
|
'email': email,
|
||||||
{% if enable_guest %}
|
{% if is_pro %}
|
||||||
'role': role,
|
'role': role,
|
||||||
{% endif %}
|
{% endif %}
|
||||||
'password1': pwd1,
|
'password1': pwd1,
|
||||||
|
@@ -76,11 +76,11 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
||||||
{% endif %}
|
{% 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" />
|
<img src="{{MEDIA_URL}}img/edit_12.png" alt="{% trans "Edit"%}" title="{% trans "Edit"%}" class="user-role-edit-icon cspt vh" />
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% if enable_guest %}
|
{% if id_pro %}
|
||||||
<select name="role" class="user-role-select hide">
|
<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={{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>
|
<option value={{guest_user}} {%if user.is_guest %}selected="selected"{% endif %}>{% trans "Guest"%}</option>
|
||||||
|
@@ -1,9 +1,14 @@
|
|||||||
{% load seahub_tags i18n %}
|
{% load seahub_tags i18n %}
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
|
{% if is_pro %}
|
||||||
<th width="24%">{% trans "Email" %}</th>
|
<th width="24%">{% trans "Email" %}</th>
|
||||||
<th width="12%">{% trans "Status" %}</th>
|
<th width="12%">{% trans "Status" %}</th>
|
||||||
<th width="12%">{% trans "Role" %}</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="16%">{% trans "Space Used" %}</th>
|
||||||
<th width="22%">{% trans "Create At / Last Login" %}</th>
|
<th width="22%">{% trans "Create At / Last Login" %}</th>
|
||||||
<th width="14%">{% trans "Operations" %}</th>
|
<th width="14%">{% trans "Operations" %}</th>
|
||||||
@@ -35,6 +40,7 @@
|
|||||||
</select>
|
</select>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
{% if is_pro %}
|
||||||
<td>
|
<td>
|
||||||
{% if user.source != 'LDAP' %}
|
{% if user.source != 'LDAP' %}
|
||||||
<div class="user-role">
|
<div class="user-role">
|
||||||
@@ -43,18 +49,15 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
<span class="user-role-cur-value">{% trans "Default" %}</span>
|
||||||
{% endif %}
|
{% 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" />
|
<img src="{{MEDIA_URL}}img/edit_12.png" alt="{% trans "Edit"%}" title="{% trans "Edit"%}" class="user-role-edit-icon cspt vh" />
|
||||||
{% endif %}
|
|
||||||
</div>
|
</div>
|
||||||
{% if enable_guest %}
|
|
||||||
<select name="role" class="user-role-select hide">
|
<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={{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>
|
<option value={{guest_user}} {%if user.is_guest %}selected="selected"{% endif %}>{% trans "Guest"%}</option>
|
||||||
</select>
|
</select>
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
<td style="font-size:11px;">
|
<td style="font-size:11px;">
|
||||||
<p> {{ user.space_usage|filesizeformat }} {% if user.space_quota > 0 %} / {{ user.space_quota|filesizeformat }} {% endif %} </p>
|
<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
|
from seahub.share.models import FileShare, UploadLinkShare
|
||||||
import seahub.settings as settings
|
import seahub.settings as settings
|
||||||
from seahub.settings import INIT_PASSWD, SITE_NAME, \
|
from seahub.settings import INIT_PASSWD, SITE_NAME, \
|
||||||
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER, SEND_EMAIL_ON_RESETTING_USER_PASSWD, \
|
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER, SEND_EMAIL_ON_RESETTING_USER_PASSWD
|
||||||
ENABLE_GUEST
|
|
||||||
from seahub.utils import send_html_email, get_user_traffic_list, \
|
from seahub.utils import send_html_email, get_user_traffic_list, \
|
||||||
get_server_id, clear_token
|
get_server_id, clear_token
|
||||||
from seahub.utils.rpc import mute_seafile_api
|
from seahub.utils.rpc import mute_seafile_api
|
||||||
@@ -393,7 +392,7 @@ def sys_user_admin(request):
|
|||||||
'server_id': server_id[:8],
|
'server_id': server_id[:8],
|
||||||
'default_user': DEFAULT_USER,
|
'default_user': DEFAULT_USER,
|
||||||
'guest_user': GUEST_USER,
|
'guest_user': GUEST_USER,
|
||||||
'enable_guest': ENABLE_GUEST,
|
'is_pro': is_pro_version(),
|
||||||
'pro_server': pro_server,
|
'pro_server': pro_server,
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
@@ -437,7 +436,7 @@ def sys_user_admin_ldap(request):
|
|||||||
'next_page': current_page+1,
|
'next_page': current_page+1,
|
||||||
'per_page': per_page,
|
'per_page': per_page,
|
||||||
'page_next': page_next,
|
'page_next': page_next,
|
||||||
'enable_guest': ENABLE_GUEST,
|
'is_pro': is_pro_version(),
|
||||||
'CALC_SHARE_USAGE': CALC_SHARE_USAGE,
|
'CALC_SHARE_USAGE': CALC_SHARE_USAGE,
|
||||||
},
|
},
|
||||||
context_instance=RequestContext(request))
|
context_instance=RequestContext(request))
|
||||||
@@ -486,7 +485,7 @@ def sys_user_admin_admins(request):
|
|||||||
'have_ldap': have_ldap,
|
'have_ldap': have_ldap,
|
||||||
'default_user': DEFAULT_USER,
|
'default_user': DEFAULT_USER,
|
||||||
'guest_user': GUEST_USER,
|
'guest_user': GUEST_USER,
|
||||||
'enable_guest': ENABLE_GUEST,
|
'is_pro': is_pro_version(),
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
@@ -840,7 +839,7 @@ def user_toggle_role(request, email):
|
|||||||
return HttpResponse(json.dumps({'success': False}), status=400,
|
return HttpResponse(json.dumps({'success': False}), status=400,
|
||||||
content_type=content_type)
|
content_type=content_type)
|
||||||
|
|
||||||
if not ENABLE_GUEST:
|
if not is_pro_version():
|
||||||
return HttpResponse(json.dumps({'success': False}), status=403,
|
return HttpResponse(json.dumps({'success': False}), status=403,
|
||||||
content_type=content_type)
|
content_type=content_type)
|
||||||
|
|
||||||
@@ -1313,7 +1312,7 @@ def user_search(request):
|
|||||||
'email': email,
|
'email': email,
|
||||||
'default_user': DEFAULT_USER,
|
'default_user': DEFAULT_USER,
|
||||||
'guest_user': GUEST_USER,
|
'guest_user': GUEST_USER,
|
||||||
'enable_guest': ENABLE_GUEST,
|
'is_pro': is_pro_version(),
|
||||||
}, context_instance=RequestContext(request))
|
}, context_instance=RequestContext(request))
|
||||||
|
|
||||||
@login_required
|
@login_required
|
||||||
|
Reference in New Issue
Block a user