From 457f8c53bd671ef30df9fb2c7872507414389c2b Mon Sep 17 00:00:00 2001 From: zhujinyong Date: Mon, 20 Feb 2012 01:43:07 +0000 Subject: [PATCH] + finish task #669. --- module/admin/control.php | 6 ++- module/admin/lang/en.php | 4 +- module/admin/model.php | 4 +- module/admin/view/index.html.php | 2 +- module/install/control.php | 59 +++++++++++++++++++++++++-- module/install/lang/en.php | 10 ++++- module/install/lang/zh-cn.php | 9 +++- module/install/lang/zh-tw.php | 9 +++- module/install/view/login.html.php | 30 ++++++++++++++ module/install/view/register.html.php | 51 +++++++++++++++++++++++ module/install/view/step5.html.php | 21 ++++++++++ 11 files changed, 191 insertions(+), 14 deletions(-) create mode 100644 module/install/view/login.html.php create mode 100644 module/install/view/register.html.php create mode 100644 module/install/view/step5.html.php diff --git a/module/admin/control.php b/module/admin/control.php index 44cf044d6f..02e9fa1919 100644 --- a/module/admin/control.php +++ b/module/admin/control.php @@ -65,7 +65,8 @@ class admin extends control { if($_POST) { - $this->admin->registerByAPI(); + $response = $this->admin->registerByAPI(); + if($response == 'success') die(js::locate(inlink('index'), 'parent')); } $this->view->sn = $this->admin->getSN(); $this->display(); @@ -81,7 +82,8 @@ class admin extends control { if($_POST) { - $this->admin->loginByAPI(); + $response = $this->admin->loginByAPI(); + if($response == 'success') die(js::locate(inlink('index'), 'parent')); } $this->view->sn = $this->admin->getSN(); $this->display(); diff --git a/module/admin/lang/en.php b/module/admin/lang/en.php index 140ad9b898..04e3f14752 100644 --- a/module/admin/lang/en.php +++ b/module/admin/lang/en.php @@ -45,7 +45,7 @@ $lang->admin->register->notice->realname = 'The realname must not be empty'; $lang->admin->register->notice->email = 'Please input your correct email address'; $lang->admin->register->notice->notEqual = 'The password and confirm password is not equal'; $lang->admin->register->notice->registered = 'The username has been registered'; -$lang->admin->register->notice->success = 'Register success'; +$lang->admin->register->notice->success = 'Register successfully'; $lang->admin->register->notice->failed = 'Register failed'; $lang->admin->login->caption = 'Login zentao community'; @@ -53,5 +53,5 @@ $lang->admin->login->join = 'login'; $lang->admin->login->notice->account = 'The account must be a series of letters and/or numbers, at least three'; $lang->admin->login->notice->password = 'The password must be a series of letters and/or numbers, at least six'; -$lang->admin->login->notice->success = 'Login success'; +$lang->admin->login->notice->success = 'Login successfully'; $lang->admin->login->notice->failed = 'Login failed'; diff --git a/module/admin/model.php b/module/admin/model.php index 6f5f26fb17..900a75691d 100644 --- a/module/admin/model.php +++ b/module/admin/model.php @@ -121,7 +121,6 @@ class adminModel extends model ->set('value')->eq($this->post->account) ->exec(false); echo js::alert($this->lang->admin->register->notice->success); - die(js::locate(inlink('index'), 'parent')); break; case 'failed': echo js::alert($this->lang->admin->register->notice->failed); @@ -147,6 +146,7 @@ class adminModel extends model default: echo js::alert($this->lang->admin->register->notice->failed); } + return $response; } /** @@ -170,7 +170,6 @@ class adminModel extends model ->set('value')->eq($this->post->account) ->exec(false); echo js::alert($this->lang->admin->login->notice->success); - die(js::locate(inlink('index'), 'parent')); break; case 'userError': echo js::alert($this->lang->admin->login->notice->account); @@ -184,6 +183,7 @@ class adminModel extends model default: echo js::alert($this->lang->admin->login->notice->failed); } + return $response; } /** diff --git a/module/admin/view/index.html.php b/module/admin/view/index.html.php index cb2f4babc7..48c92ccc54 100644 --- a/module/admin/view/index.html.php +++ b/module/admin/view/index.html.php @@ -26,7 +26,7 @@ - + diff --git a/module/install/control.php b/module/install/control.php index 00c88ce27a..7e2ccce802 100644 --- a/module/install/control.php +++ b/module/install/control.php @@ -21,6 +21,8 @@ class install extends control { if(!defined('IN_INSTALL')) die(); parent::__construct(); + $this->loadModel('admin'); + $this->loadModel('user'); $this->config->webRoot = $this->install->getWebRoot(); } @@ -119,14 +121,16 @@ class install extends control { if(!empty($_POST)) { + $this->session->set('account', $this->post->account); $this->install->grantPriv(); if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('setting')->updateVersion($this->config->version); $this->setting->setSN(); - echo (js::alert($this->lang->install->success)); - unset($_SESSION['installing']); - session_destroy(); - die(js::locate('index.php', 'parent')); + //echo (js::alert($this->lang->install->success)); + //unset($_SESSION['installing']); + //session_destroy(); + //die(js::locate('index.php', 'parent')); + die(js::locate(inlink('step5'), 'parent')); } $this->view->header->title = $this->lang->install->getPriv; @@ -141,4 +145,51 @@ class install extends control $this->display(); } } + + /** + * Join zentao community or login pms. + * + * @access public + * @return void + */ + public function step5() + { + $this->display(); + } + + /** + * Register zentao. + * + * @access public + * @return void + */ + public function register() + { + if($_POST) + { + $this->app->user->account = $this->session->account; + $response = $this->admin->registerByAPI(); + if($response == 'success') die(js::locate('index.php', 'parent')); + } + $this->view->sn = $this->admin->getSN(); + $this->display(); + } + + /** + * Login zentao. + * + * @access public + * @return void + */ + public function login() + { + if($_POST) + { + $this->app->user->account = $this->session->account; + $response = $this->admin->loginByAPI(); + if($response == 'success') die(js::locate('index.php', 'parent')); + } + $this->view->sn = $this->admin->getSN(); + $this->display(); + } } diff --git a/module/install/lang/en.php b/module/install/lang/en.php index 571ca89f68..0fd33ae1f8 100644 --- a/module/install/lang/en.php +++ b/module/install/lang/en.php @@ -102,4 +102,12 @@ $lang->install->account = 'Administrator'; $lang->install->password = 'Admin password'; $lang->install->errorEmptyPassword = "Can't be empty"; -$lang->install->success = "Success installed, please login into ZenTaoPMS, create groups and grant priviledges."; +$lang->install->success = "Success installed"; + +$lang->install->joinZentao = <<Please remove install.php in time。Now, you can: + +Register or login into Zetao community, feed back and get support. + +Login into ZenTaoPMS, create groups and grant priviledges. +EOT; diff --git a/module/install/lang/zh-cn.php b/module/install/lang/zh-cn.php index 7a503f8dc8..02aa11ed56 100644 --- a/module/install/lang/zh-cn.php +++ b/module/install/lang/zh-cn.php @@ -102,5 +102,12 @@ $lang->install->account = '管理员帐号'; $lang->install->password = '管理员密码'; $lang->install->errorEmptyPassword = '密码不能为空'; -$lang->install->success = "安装成功!请删除install.php,登录禅道管理系统,设置用户及分组!"; +$lang->install->success = "安装成功"; +$lang->install->joinZentao = <<请及时删除install.php。现在,您可以: + +注册或登录禅道社区,反馈建议并获得技术支持。 + +登录禅道管理系统,设置用户及分组! +EOT; diff --git a/module/install/lang/zh-tw.php b/module/install/lang/zh-tw.php index 1b556a84b6..6d33f61ac9 100644 --- a/module/install/lang/zh-tw.php +++ b/module/install/lang/zh-tw.php @@ -102,5 +102,12 @@ $lang->install->account = '管理員帳號'; $lang->install->password = '管理員密碼'; $lang->install->errorEmptyPassword = '密碼不能為空'; -$lang->install->success = "安裝成功!請刪除install.php,登錄禪道管理系統,設置用戶及分組!"; +$lang->install->success = "安裝成功"; +$lang->install->joinZentao = <<請及時刪除install.php。現在,您可以: + +註冊或登錄禪道社區,反饋建議並獲得技術支持。 + +登錄禪道管理系統,設置用戶及分組! +EOT; diff --git a/module/install/view/login.html.php b/module/install/view/login.html.php new file mode 100644 index 0000000000..09153b8bde --- /dev/null +++ b/module/install/view/login.html.php @@ -0,0 +1,30 @@ + + * @package ZenTaoPMS + * @version $Id: step5.html.php 2568 2012-02-18 16:32:05Z zhujinyong@cnezsoft.com$ + */ +?> + + +
+
admin->info->caption;?>
admin->info->currentVersion;?>admin->info->currentVersion;?> version;?>
+ + + + + + + + + + + + +
admin->login->caption;?>
user->account;?>
user->password;?>
+ + diff --git a/module/install/view/register.html.php b/module/install/view/register.html.php new file mode 100644 index 0000000000..c74f159287 --- /dev/null +++ b/module/install/view/register.html.php @@ -0,0 +1,51 @@ + + * @package ZenTaoPMS + * @version $Id: step4.html.php 2568 2012-02-09 06:56:35Z shiyangyangwork@yahoo.cn $ + */ +?> + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
admin->register->caption;?>
user->account;?>*' . $lang->admin->register->lblAccount;?>
user->realname;?>*';?>
user->company;?>
user->phone;?>
user->email;?> + *';?>
user->password;?>*' . $lang->admin->register->lblPasswd;?>
user->password2;?> + *';?>
+
+ diff --git a/module/install/view/step5.html.php b/module/install/view/step5.html.php new file mode 100644 index 0000000000..0b3db491be --- /dev/null +++ b/module/install/view/step5.html.php @@ -0,0 +1,21 @@ + + * @package ZenTaoPMS + * @version $Id: step5.html.php 2568 2012-02-18 15:53:35Z zhujinyong@cnezsoft.com$ + */ +?> + + + + + + +
install->success;?>
+install->joinZentao, $config->version, inlink('register'), inlink('login')));?> +
+