mirror of
https://github.com/haiwen/seahub.git
synced 2025-10-21 19:00:12 +00:00
Add user id list in middleware, and do some related modifications
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
|
||||
|
||||
{% block left_panel %}
|
||||
<h3>操作</h3>
|
||||
<ul>
|
||||
<li><a href="{{ SITE_ROOT }}accounts/password/change/">修改网站帐号密码</a></li>
|
||||
<li><a href="{{ SITE_ROOT}}profile/userids/">列出所有个人ID</a></li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block right_panel %}
|
||||
|
||||
<h2>当前设置</h2>
|
||||
<ul>
|
||||
{% if user_id %}
|
||||
@@ -22,5 +22,4 @@
|
||||
<li><span class="bold">帐号文件:</span>您的帐号文件还未上传,请在本地 seafile 界面 "帐号" 标签下上传</li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -6,4 +6,5 @@ urlpatterns = patterns('profile.views',
|
||||
# url(r'^edit/$', 'set_profile', name="profile_setting"),
|
||||
url(r'^edit/ccnet/$', 'set_ccnet_profile', name="ccnet_profile_setting"),
|
||||
url(r'^download/$', 'download_profile', name="profile_download"),
|
||||
url(r'userids/$', 'list_userids', name="list_userids")
|
||||
)
|
||||
|
||||
@@ -10,11 +10,11 @@ import datetime
|
||||
from forms import SetUserProfileForm
|
||||
from models import UserCcnetConf
|
||||
|
||||
from seaserv import ccnet_rpc, translate_time_usec
|
||||
from seaserv import ccnet_rpc, translate_time_usec, get_binding_userids
|
||||
|
||||
@login_required
|
||||
def show_profile(request):
|
||||
user_id = ccnet_rpc.get_binding_userid(request.user.username)
|
||||
userid_list = get_binding_userids(request.user.username)
|
||||
|
||||
try:
|
||||
profile_timestamp = ccnet_rpc.get_user_profile_timestamp(profile.ccnet_user_id)
|
||||
@@ -23,7 +23,7 @@ def show_profile(request):
|
||||
profile_timestamp = None
|
||||
|
||||
return render_to_response('profile/profile.html', {
|
||||
'user_id': user_id,
|
||||
'userid_list': userid_list,
|
||||
'profile_timestamp': profile_timestamp},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
@@ -112,3 +112,11 @@ def download_profile(request):
|
||||
return response
|
||||
else:
|
||||
return HttpResponse("Error: " + err_msg)
|
||||
|
||||
@login_required
|
||||
def list_userids(request):
|
||||
userid_list = get_binding_userids(request.user.username)
|
||||
|
||||
return render_to_response('profile/user_ids.html',
|
||||
{'userid_list': userid_list},
|
||||
context_instance=RequestContext(request))
|
||||
|
||||
Reference in New Issue
Block a user