From 71fac4e4123ee06360dae6788caaaa9342a4a665 Mon Sep 17 00:00:00 2001 From: Li Jianxuan Date: Thu, 5 Jun 2014 09:53:18 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AD=90=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95=E5=8F=8A=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=9A=84=E7=9B=B8=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controllers/UserController.php | 71 ++--- .../admin/views/scripts/user/adminlist.phtml | 79 +++--- .../admin/views/scripts/user/index.phtml | 52 ++-- .../admin/views/scripts/user/left.phtml | 1 - .../admin/views/scripts/user/list.phtml | 136 +++++---- .../admin/views/scripts/user/show.phtml | 106 +++---- .../default/controllers/AccountController.php | 267 +++++++----------- application/module/Users/AclManager.php | 144 ++++++++++ application/module/Users/Local.php | 2 +- application/module/Users/Users.php | 31 ++ htdocs/index.php | 4 +- 11 files changed, 478 insertions(+), 415 deletions(-) create mode 100644 application/module/Users/AclManager.php diff --git a/application/admin/controllers/UserController.php b/application/admin/controllers/UserController.php index 61593c99..487238fb 100755 --- a/application/admin/controllers/UserController.php +++ b/application/admin/controllers/UserController.php @@ -1,7 +1,8 @@ db->select(); - $select->from('users') + + $select->from('users') ->where('usertype = ?', 'member') ->order('users.id desc'); - - view::addPaginator($select,$this,20); - }//listAction - -#添加本地用户 - function localAction() - { - $this->view->ac = $ac = $this->_getParam('ac'); - $submit = $this->_getParam('submit'); - $local = new Local(); + - if(empty($ac)) - { - $select=$this->db->select(); - - $select->from(array('u'=>'users','l'=>'users_local')) - ->join(array('l'=>'users_local'),'u.id=l.uid') - ->order('u.id desc'); - - view::addPaginator($select,$this,20); - return; - } - - if($ac=='addLocal') - { - if(view::isXmlHttpRequest($this)) - { - $status = $local->addLocalUser(); - if($status !== true) - { - $this->jsonexit(array('error'=>$status)); - return true; - }else{ - $this->jsonexit(array('success'=>1)); - return true; - } - }else{ - - } - } - - if($ac == 'delete') - { - view::Post($this,$local->deleteUser($this->_getParam('id')),-1); - return; - } + $paginator = Zend_Paginator::factory($select); + $paginator->setCurrentPageNumber($this->_getParam('page')); + $paginator->setItemCountPerPage(30); + $paginator->setView($this->view); + Zend_View_Helper_PaginationControl::setDefaultViewPartial('pagination.phtml'); + $this->view->paginator=$paginator; }//listAction function searchAction() @@ -204,10 +169,10 @@ class Admin_UserController extends Zend_Controller_Action if (isset($id)) { try { - $sql="select * from users where id=?"; - $result=$this->db->query($sql,$id); - $rows = $result->fetch(); - $this->view->infos=$rows; + $user = new \Users\Users; + $this->view->infos=$user->getUser($id); + $this->view->usertypes = $user->getUserType(); + } catch (Exception $e) { $this->messenger->addMessage($e->getMessage()); } @@ -276,6 +241,7 @@ class Admin_UserController extends Zend_Controller_Action $updates=array(); if (isset($id)) { + if(!empty($newpwd)&&!empty($cfnewpwd)) { if($newpwd==$cfnewpwd) @@ -303,6 +269,7 @@ class Admin_UserController extends Zend_Controller_Action } catch (Exception $e) { $this->messenger->addMessage($e->getMessage()); } + $this->_redirect("/admin/user/show/id/$id"); } else { diff --git a/application/admin/views/scripts/user/adminlist.phtml b/application/admin/views/scripts/user/adminlist.phtml index f47d1de3..3606ba74 100755 --- a/application/admin/views/scripts/user/adminlist.phtml +++ b/application/admin/views/scripts/user/adminlist.phtml @@ -2,51 +2,46 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); -# $this->headLink()->appendStylesheet('/css/admin.css'); + $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台首页'); $this->breadcrumb('用户管理'); $this->breadcrumb()->setSeparator(' > '); ?> - - -
-
partial('user/left.phtml'); ?>
- -
-

管理员列表

-
- - - - - - - - - - - - paginator)): ?> - - paginator as $item): ?> - - - - - - - - - - - -
用户名电子邮箱用户类型真实姓名电话操作
- '>查看详细 -
- -
+
+partial('user/left.phtml'); ?>
+ +
+
管理员列表
+
同步管理员到geonetwork
+ + + + + + + + + + + +paginator)): ?> + +paginator as $item): ?> + + + + + + + + + + + +
用户名电子邮箱用户类型真实姓名电话操作
+'>查看详细 +
+ +
\ No newline at end of file diff --git a/application/admin/views/scripts/user/index.phtml b/application/admin/views/scripts/user/index.phtml index 8c8853de..bd8d7911 100755 --- a/application/admin/views/scripts/user/index.phtml +++ b/application/admin/views/scripts/user/index.phtml @@ -2,26 +2,42 @@ $this->headTitle($this->config->title->site); $this->headTitle('后台管理'); $this->headTitle()->setSeparator(' - '); - $this->headLink()->appendStylesheet('/css/admin.css'); $this->breadcrumb('首页'); $this->breadcrumb('后台管理首页'); $this->breadcrumb()->setSeparator(' > '); ?> -
-partial('user/left.phtml'); ?> -
- -
-

用户总数: su['total'];?>,其中管理员: suadmin['total'];?>

-
-
-

搜索用户

-
- -
姓名
-
单位
-
项目
-
-
-
+
+
+ partial('user/left.phtml'); ?> +
+ +
+

用户总数: su['total'];?>,其中管理员: suadmin['total'];?>

+
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ + +
+
+
\ No newline at end of file diff --git a/application/admin/views/scripts/user/left.phtml b/application/admin/views/scripts/user/left.phtml index c25352ae..8e891e9e 100755 --- a/application/admin/views/scripts/user/left.phtml +++ b/application/admin/views/scripts/user/left.phtml @@ -1,7 +1,6 @@