From d90b59191f348072a5af29c2c758fbc585d6d064 Mon Sep 17 00:00:00 2001 From: guanghongwei Date: Mon, 2 Mar 2015 18:27:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=841=20=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- juser/models.py | 30 ++++---- juser/urls.py | 2 + juser/views.py | 110 +++++++++++++++++---------- static/img/user.png | Bin 0 -> 17315 bytes templates/juser/dept_add.html | 133 +++++++++++++++++++++++++++++++++ templates/juser/dept_list.html | 110 +++++++++++++++++++++++++++ templates/juser/group_add.html | 16 ++-- templates/juser/user_add.html | 22 +----- templates/nav.html | 6 +- 9 files changed, 344 insertions(+), 85 deletions(-) create mode 100644 static/img/user.png create mode 100644 templates/juser/dept_add.html create mode 100644 templates/juser/dept_list.html diff --git a/juser/models.py b/juser/models.py index 67fe6de30..d7efd7a28 100644 --- a/juser/models.py +++ b/juser/models.py @@ -1,15 +1,17 @@ from django.db import models -class UserGroup(models.Model): - GROUP_TYPE_CHOICES = ( - ('P', 'PrivateGroup'), - ('M', 'ManageGroup'), - ('A', 'AuthorizeGroup'), - ) - +class DEPT(models.Model): name = models.CharField(max_length=80, unique=True) - type = models.CharField(max_length=1, choices=GROUP_TYPE_CHOICES, default='P') + comment = models.CharField(max_length=160, blank=True, null=True) + + def __unicode__(self): + return self.name + + +class UserGroup(models.Model): + name = models.CharField(max_length=80, unique=True) + dept = models.ForeignKey(DEPT) comment = models.CharField(max_length=160, blank=True, null=True) def __unicode__(self): @@ -19,21 +21,21 @@ class UserGroup(models.Model): class User(models.Model): USER_ROLE_CHOICES = ( ('SU', 'SuperUser'), - ('GA', 'GroupAdmin'), + ('DA', 'DeptAdmin'), ('CU', 'CommonUser'), ) username = models.CharField(max_length=80, unique=True) password = models.CharField(max_length=100) name = models.CharField(max_length=80) - email = models.EmailField(max_length=75, null=True, blank=True) + email = models.EmailField(max_length=75) role = models.CharField(max_length=2, choices=USER_ROLE_CHOICES, default='CU') - user_group = models.ManyToManyField(UserGroup) + dept = models.ForeignKey(DEPT) + group = models.ManyToManyField(UserGroup) ldap_pwd = models.CharField(max_length=100) ssh_key_pwd = models.CharField(max_length=100) - ssh_pwd = models.CharField(max_length=100) is_active = models.BooleanField(default=True) - last_login = models.IntegerField(default=0) - date_joined = models.IntegerField() + last_login = models.DateTimeField(null=True) + date_joined = models.DateTimeField(null=True) def __unicode__(self): return self.username diff --git a/juser/urls.py b/juser/urls.py index 4d8151027..8067d52bc 100644 --- a/juser/urls.py +++ b/juser/urls.py @@ -11,6 +11,8 @@ urlpatterns = patterns('juser.views', (r'^group_add/$', 'group_add'), (r'^group_add_ajax/$', 'group_add_ajax'), (r'^group_list/$', 'group_list'), + (r'^dept_list/$', 'dept_list'), + (r'^dept_add/$', 'dept_add'), (r'^user_detail/$', 'user_detail'), (r'^user_del/$', 'user_del'), (r'^user_edit/$', 'user_edit'), diff --git a/juser/views.py b/juser/views.py index d57f20428..f284cd7b1 100644 --- a/juser/views.py +++ b/juser/views.py @@ -17,7 +17,7 @@ from django.template import RequestContext from django.http import HttpResponse from django.core.paginator import Paginator, EmptyPage, InvalidPage -from juser.models import UserGroup, User +from juser.models import UserGroup, User, DEPT from connect import PyCrypt, KEY from connect import BASE_DIR from connect import CONF @@ -61,12 +61,12 @@ def gen_sha512(salt, password): return crypt.crypt(password, '$6$%s$' % salt) -def group_db_add(**kwargs): - group_name = kwargs.get('name') - group = UserGroup.objects.filter(name=group_name) +def db_add_group(**kwargs): + name = kwargs.get('name') + group = UserGroup.objects.filter(name=name) if group: - raise AddError('Group %s have been exist .' % group_name) - UserGroup.objects.create(**kwargs) + raise AddError(u'用户组 %s 已经存在' % name) + UserGroup(**kwargs).save() def group_add_user(group_name, user_id=None, username=None): @@ -210,32 +210,75 @@ def ldap_del_user(username): # ldap_conn.add(group_dn, group_attr) +# def group_add_ajax(request): +# group_type = request.POST.get('type', 'A') +# users_all = User.objects.all() +# if group_type == 'A': +# users = users_all +# else: +# users = [user for user in users_all if not user.user_group.filter(type='M')] +# +# return render_to_response('juser/group_add_ajax.html', locals(), context_instance=RequestContext(request)) + + +def dept_add(request): + header_title, path1, path2 = '添加部门', '用户管理', '添加部门' + if request.method == 'POST': + name = request.POST.get('name', '') + comment = request.POST.get('comment', '') + + try: + if not name: + raise AddError('部门名称不能为空') + if DEPT.objects.filter(name=name): + raise AddError(u'部门名称 %s 已存在' % name) + except AddError, e: + error = e + else: + DEPT(name=name, comment=comment).save() + msg = u'添加部门 %s 成功' % name + + return render_to_response('juser/dept_add.html', locals(), context_instance=RequestContext(request)) + + +def dept_list(request): + header_title, path1, path2 = '查看部门', '用户管理', '查看部门' + contact_list = DEPT.objects.all() + p = paginator = Paginator(contact_list, 10) + + try: + current_page = int(request.GET.get('page', '1')) + except ValueError: + current_page = 1 + + page_range = page_list_return(len(p.page_range), current_page) + + try: + contacts = paginator.page(current_page) + except (EmptyPage, InvalidPage): + contacts = paginator.page(paginator.num_pages) + return render_to_response('juser/dept_list.html', locals(), context_instance=RequestContext(request)) + + def group_add(request, group_type_select='A'): error = '' msg = '' - header_title, path1, path2 = '添加属组 | Group Add', '用户管理', '添加用户组' - group_types = { - 'M': '部门', - 'A': '用户组', - } - - users_all = User.objects.all() - if group_type_select == 'M': - users = [user for user in users_all if not user.user_group.filter(type='M')] - else: - users = users_all + header_title, path1, path2 = '添加属组', '用户管理', '添加用户组' + user_all = User.objects.all() + dept_all = DEPT.objects.all() if request.method == 'POST': group_name = request.POST.get('group_name', '') - group_type = request.POST.get('group_type', 'A') + dept_id = request.POST.get('dept_id', '') users_selected = request.POST.getlist('users_selected', '') comment = request.POST.get('comment', '') try: - if not group_name: - error = u'组名不能为空' - raise AddError - group_db_add(name=group_name, comment=comment, type=group_type) + if '' in [group_name, dept_id]: + error = u'组名 或 部门 不能为空' + raise AddError(error) + + group_db_add(name=group_name, comment=comment) for user_id in users_selected: group_add_user(group_name, user_id=user_id) @@ -249,17 +292,6 @@ def group_add(request, group_type_select='A'): return render_to_response('juser/group_add.html', locals(), context_instance=RequestContext(request)) -def group_add_ajax(request): - group_type = request.POST.get('type', 'A') - users_all = User.objects.all() - if group_type == 'A': - users = users_all - else: - users = [user for user in users_all if not user.user_group.filter(type='M')] - - return render_to_response('juser/group_add_ajax.html', locals(), context_instance=RequestContext(request)) - - def group_list(request): header_title, path1, path2 = '查看属组 | Show Group', '用户管理', '查看用户组' groups = contact_list = UserGroup.objects.filter(Q(type='M') | Q(type='A')).order_by('type') @@ -442,21 +474,17 @@ def user_add(request): error = '' msg = '' header_title, path1, path2 = '添加用户 | User Add', '用户管理', '添加用户' - user_role = {'SU': u'超级管理员', 'GA': u'组管理员', 'CU': u'普通用户'} - manage_groups = UserGroup.objects.filter(type='M') - auth_groups = UserGroup.objects.filter(type='A') + user_role = {'SU': u'超级管理员', 'DA': u'部门管理员', 'CU': u'普通用户'} + dept_all = DEPT.objects.all() + if request.method == 'POST': username = request.POST.get('username', None) password = request.POST.get('password', '') name = request.POST.get('name', None) email = request.POST.get('email', '') - manage_group_id = request.POST.get('manage_group') + dept_id = request.POST.get('dept_id') auth_groups = request.POST.getlist('groups', None) - groups = auth_groups - groups.append(manage_group_id) - groups_str = ' '.join(auth_groups) role_post = request.POST.get('role', 'CU') - ssh_pwd = request.POST.get('ssh_pwd', '') ssh_key_pwd = request.POST.get('ssh_key_pwd', '') is_active = request.POST.get('is_active', '1') ldap_pwd = gen_rand_pwd(16) diff --git a/static/img/user.png b/static/img/user.png new file mode 100644 index 0000000000000000000000000000000000000000..2045fc1d75226861cc1923621b52af1e73d424cf GIT binary patch literal 17315 zcmb`t2UHZ#^DjEE1OWw6q9g?r0YL#l@`6Z|AQ_30^8!nbtD>Mp0SS^;MMNY?&aC7N zlA~l;a?ZQUzQJ$!{m<{+d(M0J+=ia{Y)y4dRZVwKRrlaW@iV|>6$NDlfPjDiPy+t| z{4C%h?_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w`BnnGy2B>a>9(29K`ha2&&Qc!@<7?{%Gn2eJKHxh4*=d+KX8;`u;Ns%51(k}FwlGI;|vdlAgY@W4AffZ@?NeuxKF_VB +
+
+
+ +
+
+ {% if error %} +
{{ error }}
+ {% endif %} + {% if msg %} +
{{ msg }}
+ {% endif %} +
+ +
+ {% if error %} + + {% else %} + + {% endif %} +
+ +
+ +{#
#} +{#
#} +{# #} +{#
#} +{# #} +{#
#} +{#
#} +{#
#} +{# #} +{# #} +{#
#} +{#
#} +{#
#} +{#
#} +{# #} +{#
#} +{#
#} +{#
#} +
+
+ +
+ {% if error %} + + {% else %} + + {% endif %} +
+
+ +
+
+
+ + +
+
+
+
+
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/juser/dept_list.html b/templates/juser/dept_list.html new file mode 100644 index 000000000..1f8221f3b --- /dev/null +++ b/templates/juser/dept_list.html @@ -0,0 +1,110 @@ +{% extends 'base.html' %} +{% load mytags %} +{% block content %} +{% include 'nav_cat_bar.html' %} + +
+
+
+
+
+
查看部门
+ +
+ +
+ + + + + + + + + + + + + {% for dept in contacts.object_list %} + + + + + + + {% endfor %} + +
部门名称成员数量备注操作
{{ dept.name }} {{ dept.name }} {{ dept.comment }} + 成员 + 编辑 + 删除 +
+
+
+
+ Showing {{ contacts.start_index }} to {{ contacts.end_index }} of {{ p.count }} entries +
+
+
+
+
    + {% if contacts.has_previous %} + + {% else %} + + {% endif %} + {% for page in p.page_range %} + {% ifequal offset1 page %} +
  • {{ page }}
  • + {% else %} +
  • {{ page }}
  • + {% endifequal %} + {% endfor %} + {% if contacts.has_next %} + + {% else %} + + {% endif %} +
+
+
+
+
+
+
+
+
+ + + +{% endblock %} \ No newline at end of file diff --git a/templates/juser/group_add.html b/templates/juser/group_add.html index c5d96d522..099e4ac9f 100644 --- a/templates/juser/group_add.html +++ b/templates/juser/group_add.html @@ -7,7 +7,7 @@