* finish task#793.

This commit is contained in:
chencongzhi520@gmail.com
2012-05-16 02:40:19 +00:00
parent ba49009cd8
commit 4b5f80d628
12 changed files with 150 additions and 60 deletions

View File

@@ -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");

View File

@@ -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');

View File

@@ -121,17 +121,18 @@ $lang->index->menu->product = 'Products|product|browse';
$lang->index->menu->project = 'Projects|project|browse';
/* Dashboard menu. */
$lang->my->menu->account = '<span id="mybg">&nbsp;</span>%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 = '<span id="mybg">&nbsp;</span>%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';

View File

@@ -121,17 +121,18 @@ $lang->index->menu->product = '浏览产品|product|browse';
$lang->index->menu->project = '浏览项目|project|browse';
/* 我的地盘菜单设置。*/
$lang->my->menu->account = '<span id="mybg">&nbsp;</span>%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 = '<span id="mybg">&nbsp;</span>%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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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';

View File

@@ -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.
*

View File

@@ -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';

View File

@@ -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 = '由我创建';

View File

@@ -0,0 +1,34 @@
<?php
/**
* The change password view of user module of ZenTaoPMS.
*
* @copyright Copyright 2009-2012 青岛易软天创网络科技有限公司 (QingDao Nature Easy Soft Network Technology Co,LTD www.cnezsoft.com)
* @license LGPL (http://www.gnu.org/licenses/lgpl.html)
* @author Congzhi Chen <congzhi@cnezsoft.com>
* @package user
* @version $Id: editprofile.html.php 2605 2012-02-21 07:22:58Z wwccss $
* @link http://www.zentao.net
*/
?>
<?php include '../../common/view/header.html.php';?>
<form method='post' target='hiddenwin'>
<table align='center' class='table-4 a-left'>
<caption><?php echo $lang->my->changePassword;?></caption>
<tr>
<th class='rowhead'><?php echo $lang->user->account;?></th>
<td><?php echo $user->account . html::hidden('account',$user->account);?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->password;?></th>
<td><?php echo html::password('password1');?></td>
</tr>
<tr>
<th class='rowhead'><?php echo $lang->user->password2;?></th>
<td><?php echo html::password('password2');?></td>
</tr>
<tr>
<td colspan='2' class='a-center'><?php echo html::submitButton() . html::resetButton();?></td>
</tr>
</table>
</form>
<?php include '../../common/view/footer.html.php';?>

View File

@@ -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.
*