\d+)/$', group_pubfile_download, name='group_pubfile_download'),
+ )
+
diff --git a/seahub/group/views.py b/seahub/group/views.py
index 25e6adac03..21519f83b7 100644
--- a/seahub/group/views.py
+++ b/seahub/group/views.py
@@ -84,9 +84,13 @@ def group_check(func):
if not group:
return HttpResponseRedirect(reverse('group_list', args=[]))
group.is_staff = False
+ if PublicGroup.objects.filter(group_id=group.id):
+ group.is_pub = True
+ else:
+ group.is_pub = False
if not request.user.is_authenticated():
- if not PublicGroup.objects.filter(group_id=group_id_int):
+ if not group.is_pub:
return render_to_response('group/group_pubinfo.html', {
'group': group,
}, context_instance=RequestContext(request))
@@ -104,8 +108,7 @@ def group_check(func):
group.view_perm = "sys_admin"
return func(request, group, *args, **kwargs)
- pub = PublicGroup.objects.filter(group_id=group_id_int)
- if pub:
+ if group.is_pub:
group.view_perm = "pub"
return func(request, group, *args, **kwargs)
@@ -465,12 +468,6 @@ def group_info(request, group):
request.user.username)
cmt.tp = cmt.props.desc.split(' ')[0]
- if PublicGroup.objects.filter(group_id=group.id):
- group.is_pub = True
- else:
- group.is_pub = False
-
-
return render_to_response("group/group_info.html", {
"members": members,
"repos": repos,
@@ -609,16 +606,15 @@ def group_manage(request, group_id):
contacts = Contact.objects.filter(user_email=username)
if PublicGroup.objects.filter(group_id=group.id):
- is_pub = True
+ group.is_pub = True
else:
- is_pub = False
+ group.is_pub = False
return render_to_response('group/group_manage.html', {
'group' : group,
'members': members_all,
'admins': admins,
'contacts': contacts,
- 'is_pub': is_pub,
}, context_instance=RequestContext(request))
@login_required
diff --git a/seahub/settings.py b/seahub/settings.py
index 407eed00a7..212839a231 100644
--- a/seahub/settings.py
+++ b/seahub/settings.py
@@ -169,6 +169,7 @@ INSTALLED_APPS = (
'seahub.share',
)
+
AUTHENTICATION_BACKENDS = (
'seahub.base.accounts.AuthBackend',
)
@@ -326,6 +327,12 @@ LOGGING = {
SEND_EMAIL_ON_ADDING_SYSTEM_MEMBER = True # Whether to send email when a system staff adding new member.
SEND_EMAIL_ON_RESETTING_USER_PASSWD = True # Whether to send email when a system staff resetting user's password.
+##########################
+# Settings for Extra App #
+##########################
+
+ENABLE_PUBFILE = False
+
#####################
# External settings #
#####################
@@ -388,3 +395,4 @@ SEAFILE_VERSION = '1.6'
# Put here after loading other settings files if `SITE_ROOT` is modified in
# other settings files.
LOGIN_URL = SITE_ROOT + 'accounts/login'
+
diff --git a/seahub/share/templates/repo/share_admin.html b/seahub/share/templates/repo/share_admin.html
index c5c678c394..26cbf260f4 100644
--- a/seahub/share/templates/repo/share_admin.html
+++ b/seahub/share/templates/repo/share_admin.html
@@ -40,7 +40,7 @@
{{ repo.share_permission }}
- 
+
|