7 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
9 * @package Magic3 Framework
10 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
11 * @copyright Copyright 2006-2012 Magic3 Project.
12 * @license http://www.gnu.org/copyleft/gpl.html GPL License
13 * @version SVN: $Id: ec_mainChangepwdWidgetContainer.php 5440 2012-12-08 09:37:39Z fishbone $
14 * @link http://www.magic3.org
16 require_once($gEnvManager->getCurrentWidgetContainerPath() . '/ec_mainBaseWidgetContainer.php');
18 class ec_mainChangepwdWidgetContainer extends ec_mainBaseWidgetContainer
23 function __construct()
26 parent::__construct();
31 * _assign()でデータを埋め込むテンプレートファイルのファイル名を返す。
32 * 読み込むディレクトリは、「自ウィジェットディレクトリ/include/template」に固定。
34 * @param RequestManager $request HTTPリクエスト処理クラス
35 * @param object $param 任意使用パラメータ。そのまま_assign()に渡る
36 * @return string テンプレートファイル名。テンプレートライブラリを使用しない場合は空文字列「''」を返す。
38 function _setTemplate($request, &$param)
40 return 'changepwd.tmpl.html';
45 * _setTemplate()で指定したテンプレートファイルにデータを埋め込む。
47 * @param RequestManager $request HTTPリクエスト処理クラス
48 * @param object $param 任意使用パラメータ。_setTemplate()と共有。
51 function _assign($request, &$param)
53 $act = $request->trimValueOf('act');
54 $password = $request->trimValueOf('password');
55 $length = $request->trimValueOf('length'); // パスワード長
56 if ($act == 'update'){ // パスワード更新のとき
58 $ret = $this->_db->updateLoginUserPassword($this->gEnv->getCurrentUserId(), $password, true/*MD5化されているパスワード*/);
60 //$this->tmpl->addVar("_widget", "message", 'パスワード変更が完了しました');
61 $this->setGuidanceMsg('パスワード変更が完了しました');
62 $this->tmpl->addVar("_widget", "button_disabled", 'disabled'); // ボタン使用不可
63 $this->tmpl->addVar("_widget", "pwd1_disabled", 'disabled'); // 入力フィールド不可
64 $this->tmpl->addVar("_widget", "pwd2_disabled", 'disabled'); // 入力フィールド不可
66 $this->tmpl->addVar("_widget", "pwd_value", str_repeat('*', $length)); // ダミー値を設定
69 $this->tmpl->setAttribute('show_complete', 'visibility', 'visible');
70 $this->tmpl->addVar("show_complete", "menu_url", $this->getUrl($this->gEnv->createCurrentPageUrl() . '&task=membermenu', true));
72 //$this->tmpl->addVar("_widget", "message", 'パスワード変更に失敗しました');
73 $this->setUserErrorMsg('パスワード変更に失敗しました');
76 $this->tmpl->addVar("_widget", "button_label", 'パスワード変更'); // ボタンのラベル