From e89466212bba459a3f6f58425abdbb3fdda09207 Mon Sep 17 00:00:00 2001 From: wangchunsheng Date: Thu, 25 Mar 2010 12:29:43 +0000 Subject: [PATCH] + add the require fields of user module. --- module/user/config.php | 3 +++ module/user/model.php | 4 ++-- module/user/view/create.html.php | 18 ++++++++---------- module/user/view/edit.html.php | 25 ++++++++++--------------- 4 files changed, 23 insertions(+), 27 deletions(-) create mode 100644 module/user/config.php diff --git a/module/user/config.php b/module/user/config.php new file mode 100644 index 0000000000..ac33415cb8 --- /dev/null +++ b/module/user/config.php @@ -0,0 +1,3 @@ +user->create->requiredFields = 'account,realname,password,password1,password2'; +$config->user->edit->requiredFields = 'account,realname'; diff --git a/module/user/model.php b/module/user/model.php index c6374b4e11..c2832cbf06 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -96,7 +96,7 @@ class userModel extends model $this->dao->insert(TABLE_USER)->data($user) ->autoCheck() - ->batchCheck('account, realname, password', 'notempty') + ->batchCheck($this->config->user->create->requiredFields, 'notempty') ->check('account', 'unique') ->check('account', 'account') ->checkIF($this->post->email != false, 'email', 'email') @@ -119,7 +119,7 @@ class userModel extends model $this->dao->update(TABLE_USER)->data($user) ->autoCheck() - ->batchCheck('account, realname', 'notempty') + ->batchCheck($this->config->user->edit->requiredFields, 'notempty') ->check('account', 'unique', "id != '$userID'") ->check('account', 'account') ->checkIF($this->post->email != false, 'email', 'email') diff --git a/module/user/view/create.html.php b/module/user/view/create.html.php index ec6bffeb30..d789822d56 100644 --- a/module/user/view/create.html.php +++ b/module/user/view/create.html.php @@ -30,23 +30,23 @@ user->create;?> user->dept;?> - + user->account;?> - + user->realname;?> - + user->email;?> - + user->join;?> - + user->gendar;?> @@ -54,15 +54,13 @@ user->password;?> - + user->password2;?> - + - - - + diff --git a/module/user/view/edit.html.php b/module/user/view/edit.html.php index cb1c390b4c..393ab23971 100644 --- a/module/user/view/edit.html.php +++ b/module/user/view/edit.html.php @@ -26,46 +26,41 @@
- +
- - + - + - + - + - + - + - + - - - - +
user->edit;?>
user->dept;?>dept);?> + dept, "class='select-3'");?>
user->account;?>account, "class='text-3'");?>
user->realname;?>realname, "class='text-3'");?>
user->email;?>email, "class='text-3'");?>
user->join;?>
user->gendar;?>user->gendarList, $user->gendar)?>user->gendarList, $user->gendar);?>
user->password;?>
user->password2;?>
- -