diff --git a/bin/syncext.php b/bin/syncext.php index 0800c6ac29..8f41494aff 100644 --- a/bin/syncext.php +++ b/bin/syncext.php @@ -7,9 +7,9 @@ * @version $Id$ */ -sudo pecl install channel://pecl.php.net/inotify-0.1.5 +//sudo pecl install channel://pecl.php.net/inotify-0.1.5 -extension=inotify.so" to php.ini +//extension=inotify.so" to php.ini /* Get params from argvs. */ if(!isset($argv[1])) die("php syncext.php from target sleep\n"); diff --git a/db/zentao.sql b/db/zentao.sql index 9dd71154f6..d5eec19bcd 100644 --- a/db/zentao.sql +++ b/db/zentao.sql @@ -1542,4 +1542,9 @@ INSERT INTO `zt_groupPriv` (`company`, `group`, `module`, `method`) VALUES (1, 2, 'todo', 'batchCreate'), (1, 3, 'todo', 'batchCreate'), (1, 4, 'todo', 'batchCreate'), -(1, 5, 'todo', 'batchCreate'); +(1, 5, 'todo', 'batchCreate'), +(1, 1, 'my', 'changePassword'), +(1, 2, 'my', 'changePassword'), +(1, 3, 'my', 'changePassword'), +(1, 4, 'my', 'changePassword'), +(1, 5, 'my', 'changePassword'); diff --git a/module/common/lang/en.php b/module/common/lang/en.php index a55cd70007..bf9d60c427 100644 --- a/module/common/lang/en.php +++ b/module/common/lang/en.php @@ -121,17 +121,18 @@ $lang->index->menu->product = 'Products|product|browse'; $lang->index->menu->project = 'Projects|project|browse'; /* Dashboard menu. */ -$lang->my->menu->account = ' %s' . $lang->arrow; -$lang->my->menu->index = 'Index|my|index'; -$lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo'); -$lang->my->menu->task = 'Task|my|task|'; -$lang->my->menu->bug = 'Bug|my|bug|'; -$lang->my->menu->testtask = 'Test|my|testtask|'; -$lang->my->menu->story = 'Story|my|story|'; -$lang->my->menu->myProject = 'Project|my|project|'; -$lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; -$lang->my->menu->profile = array('link' => 'Profile|my|profile|', 'alias' => 'editprofile'); -$lang->todo->menu = $lang->my->menu; +$lang->my->menu->account = ' %s' . $lang->arrow; +$lang->my->menu->index = 'Index|my|index'; +$lang->my->menu->todo = array('link' => 'Todo|my|todo|', 'subModule' => 'todo'); +$lang->my->menu->task = 'Task|my|task|'; +$lang->my->menu->bug = 'Bug|my|bug|'; +$lang->my->menu->testtask = 'Test|my|testtask|'; +$lang->my->menu->story = 'Story|my|story|'; +$lang->my->menu->myProject = 'Project|my|project|'; +$lang->my->menu->dynamic = 'Dynamic|my|dynamic|'; +$lang->my->menu->profile = array('link' => 'Profile|my|profile|', 'alias' => 'editprofile'); +$lang->my->menu->changePassword = 'Change Password|my|changePassword|'; +$lang->todo->menu = $lang->my->menu; /* Product menu. */ $lang->product->menu->list = '%s'; diff --git a/module/common/lang/zh-cn.php b/module/common/lang/zh-cn.php index 843712fc64..d0db5636e8 100644 --- a/module/common/lang/zh-cn.php +++ b/module/common/lang/zh-cn.php @@ -121,17 +121,18 @@ $lang->index->menu->product = '浏览产品|product|browse'; $lang->index->menu->project = '浏览项目|project|browse'; /* 我的地盘菜单设置。*/ -$lang->my->menu->account = ' %s' . $lang->arrow; -$lang->my->menu->index = '首页|my|index'; -$lang->my->menu->todo = array('link' => '我的TODO|my|todo|', 'subModule' => 'todo'); -$lang->my->menu->task = '我的任务|my|task|'; -$lang->my->menu->bug = '我的Bug|my|bug|'; -$lang->my->menu->testtask = '我的测试|my|testtask|'; -$lang->my->menu->story = '我的需求|my|story|'; -$lang->my->menu->myProject = '我的项目|my|project|'; -$lang->my->menu->dynamic = '我的动态|my|dynamic|'; -$lang->my->menu->profile = array('link' => '我的档案|my|profile|', 'alias' => 'editprofile'); -$lang->todo->menu = $lang->my->menu; +$lang->my->menu->account = ' %s' . $lang->arrow; +$lang->my->menu->index = '首页|my|index'; +$lang->my->menu->todo = array('link' => '我的TODO|my|todo|', 'subModule' => 'todo'); +$lang->my->menu->task = '我的任务|my|task|'; +$lang->my->menu->bug = '我的Bug|my|bug|'; +$lang->my->menu->testtask = '我的测试|my|testtask|'; +$lang->my->menu->story = '我的需求|my|story|'; +$lang->my->menu->myProject = '我的项目|my|project|'; +$lang->my->menu->dynamic = '我的动态|my|dynamic|'; +$lang->my->menu->profile = array('link' => '我的档案|my|profile|', 'alias' => 'editprofile'); +$lang->my->menu->changePassword = '修改密码|my|changePassword|'; +$lang->todo->menu = $lang->my->menu; /* 产品视图设置。*/ $lang->product->menu->list = '%s'; diff --git a/module/group/lang/en.php b/module/group/lang/en.php index fda9102837..1a6c4a6c77 100644 --- a/module/group/lang/en.php +++ b/module/group/lang/en.php @@ -40,6 +40,7 @@ $lang->group->copyOptions['copyPriv'] = 'Copy priviledge'; $lang->group->copyOptions['copyUser'] = 'Copy user'; $lang->group->versions[''] = 'Show methods added in every release'; +$lang->group->versions['3.2'] = '3.2'; $lang->group->versions['3.1'] = '3.1'; $lang->group->versions['3.0.beta2'] = '3.0.beta2'; $lang->group->versions['3.0.beta1'] = '3.0.beta1'; diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 1fe39d9cfb..e792e6490e 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -14,17 +14,18 @@ $lang->resource->index->index = 'index'; /* My module. */ -$lang->resource->my->index = 'index'; -$lang->resource->my->todo = 'todo'; -$lang->resource->my->task = 'task'; -$lang->resource->my->bug = 'bug'; -$lang->resource->my->testTask = 'testTask'; -$lang->resource->my->testCase = 'testCase'; -$lang->resource->my->story = 'story'; -$lang->resource->my->project = 'myProject'; -$lang->resource->my->profile = 'profile'; -$lang->resource->my->dynamic = 'dynamic'; -$lang->resource->my->editProfile = 'editProfile'; +$lang->resource->my->index = 'index'; +$lang->resource->my->todo = 'todo'; +$lang->resource->my->task = 'task'; +$lang->resource->my->bug = 'bug'; +$lang->resource->my->testTask = 'testTask'; +$lang->resource->my->testCase = 'testCase'; +$lang->resource->my->story = 'story'; +$lang->resource->my->project = 'myProject'; +$lang->resource->my->profile = 'profile'; +$lang->resource->my->dynamic = 'dynamic'; +$lang->resource->my->editProfile = 'editProfile'; +$lang->resource->my->changePassword = 'changePassword'; /* Todo. */ $lang->resource->todo->create = 'create'; @@ -366,3 +367,5 @@ $lang->changelog['3.0.beta2'][] = 'product-order'; $lang->changelog['3.0.beta2'][] = 'project-order'; $lang->changelog['3.1'][] = 'todo-batchCreate'; + +$lang->changelog['3.2'][] = 'my-changePassword'; diff --git a/module/group/lang/zh-cn.php b/module/group/lang/zh-cn.php index 68ed8f1c66..7230626b3b 100644 --- a/module/group/lang/zh-cn.php +++ b/module/group/lang/zh-cn.php @@ -40,6 +40,7 @@ $lang->group->copyOptions['copyPriv'] = '复制权限'; $lang->group->copyOptions['copyUser'] = '复制用户'; $lang->group->versions[''] = '显示各版本新增权限'; +$lang->group->versions['3.2'] = '禅道3.2'; $lang->group->versions['3.1'] = '禅道3.1'; $lang->group->versions['3.0.beta2'] = '禅道3.0.beta2'; $lang->group->versions['3.0.beta1'] = '禅道3.0.beta1'; diff --git a/module/my/control.php b/module/my/control.php index bec6f4dac2..6423a8191f 100644 --- a/module/my/control.php +++ b/module/my/control.php @@ -341,6 +341,29 @@ class my extends control $this->display(); } + /** + * Change password + * + * @access public + * @return void + */ + public function changePassword() + { + if($this->app->user->account == 'guest') die(js::alert('guest') . js::locate('back')); + if(!empty($_POST)) + { + $this->user->updatePassword($this->app->user->id); + if(dao::isError()) die(js::error(dao::getError())); + die(js::locate($this->createLink('my', 'profile'), 'parent')); + } + + $this->view->header->title = $this->lang->my->common . $this->lang->colon . $this->lang->my->changePassword; + $this->view->position[] = $this->lang->my->changePassword; + $this->view->user = $this->user->getById($this->app->user->id); + + $this->display(); + } + /** * View my profile. * diff --git a/module/my/lang/en.php b/module/my/lang/en.php index 19bd1f4a71..98da737aa0 100644 --- a/module/my/lang/en.php +++ b/module/my/lang/en.php @@ -2,18 +2,19 @@ $lang->my->common = 'Dashboard'; /* Methods. */ -$lang->my->index = 'Index'; -$lang->my->todo = 'Todo'; -$lang->my->task = 'Task'; -$lang->my->bug = 'Bug'; -$lang->my->testTask = 'Test task'; -$lang->my->testCase = 'Test case'; -$lang->my->story = 'Story'; -$lang->my->myProject = 'Project'; -$lang->my->team = 'Team'; -$lang->my->profile = 'Profile'; -$lang->my->dynamic = 'Dynamic'; -$lang->my->editProfile = 'Edit profile'; +$lang->my->index = 'Index'; +$lang->my->todo = 'Todo'; +$lang->my->task = 'Task'; +$lang->my->bug = 'Bug'; +$lang->my->testTask = 'Test task'; +$lang->my->testCase = 'Test case'; +$lang->my->story = 'Story'; +$lang->my->myProject = 'Project'; +$lang->my->team = 'Team'; +$lang->my->profile = 'Profile'; +$lang->my->dynamic = 'Dynamic'; +$lang->my->editProfile = 'Edit profile'; +$lang->my->changePassword = 'Change password'; $lang->my->taskMenu->assignedToMe = 'To me'; $lang->my->taskMenu->openedByMe = 'My opened'; diff --git a/module/my/lang/zh-cn.php b/module/my/lang/zh-cn.php index e96216ab0e..4447e1d756 100644 --- a/module/my/lang/zh-cn.php +++ b/module/my/lang/zh-cn.php @@ -2,18 +2,19 @@ $lang->my->common = '我的地盘'; /* 方法列表。*/ -$lang->my->index = '首页'; -$lang->my->todo = '我的TODO'; -$lang->my->task = '我的任务'; -$lang->my->bug = '我的Bug'; -$lang->my->testTask = '我的测试任务'; -$lang->my->testCase = '我的测试用例'; -$lang->my->story = '我的需求'; -$lang->my->myProject = '我的项目'; -$lang->my->team = '我的团队'; -$lang->my->profile = '我的档案'; -$lang->my->dynamic = '我的动态'; -$lang->my->editProfile = '更新信息'; +$lang->my->index = '首页'; +$lang->my->todo = '我的TODO'; +$lang->my->task = '我的任务'; +$lang->my->bug = '我的Bug'; +$lang->my->testTask = '我的测试任务'; +$lang->my->testCase = '我的测试用例'; +$lang->my->story = '我的需求'; +$lang->my->myProject = '我的项目'; +$lang->my->team = '我的团队'; +$lang->my->profile = '我的档案'; +$lang->my->dynamic = '我的动态'; +$lang->my->editProfile = '更新信息'; +$lang->my->changePassword = '修改密码'; $lang->my->taskMenu->assignedToMe = '指派给我'; $lang->my->taskMenu->openedByMe = '由我创建'; diff --git a/module/my/view/changepassword.html.php b/module/my/view/changepassword.html.php new file mode 100755 index 0000000000..3abefc8917 --- /dev/null +++ b/module/my/view/changepassword.html.php @@ -0,0 +1,34 @@ + + * @package user + * @version $Id: editprofile.html.php 2605 2012-02-21 07:22:58Z wwccss $ + * @link http://www.zentao.net + */ +?> + +
+ + + + + + + + + + + + + + + + + +
my->changePassword;?>
user->account;?>account . html::hidden('account',$user->account);?>
user->password;?>
user->password2;?>
+
+ diff --git a/module/user/model.php b/module/user/model.php index ca6f01e101..46bbf3d84f 100644 --- a/module/user/model.php +++ b/module/user/model.php @@ -205,6 +205,25 @@ class userModel extends model } } + /** + * Update password + * + * @param string $userID + * @access public + * @return void + */ + public function updatePassword($userID) + { + if(!$this->checkPassword()) return; + + $user = fixer::input('post') + ->setIF($this->post->password1 != false, 'password', md5($this->post->password1)) + ->remove('account, password1, password2') + ->get(); + + $this->dao->update(TABLE_USER)->data($user)->autoCheck()->where('id')->eq((int)$userID)->exec(); + } + /** * Check the passwds posted. *