Source for file LC_Page_Admin_System_Input.php
Documentation is available at LC_Page_Admin_System_Input.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2010 LOCKON CO.,LTD. All Rights Reserved.
* http://www.lockon.co.jp/
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(CLASS_PATH . "pages/LC_Page.php");
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_System_Input.php 18734 2010-06-22 08:45:33Z nanasess $
$this->tpl_pageno = isset ($_REQUEST['pageno']) ? $_REQUEST['pageno'] : 1;
$masterData = new SC_DB_MasterData_Ex();
$this->arrAUTHORITY = $masterData->getMasterData('mtb_authority');
// defaultアクションも実行させるためbreakしない
$objView->assignobj($this);
$objView->display('system/input.tpl');
* switchアクション振り分け用パラメータを取得する.
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
if(isset ($_GET['mode'])) $mode = $_GET['mode'];
} elseif ($_SERVER['REQUEST_METHOD'] == 'POST') {
if(isset ($_POST['mode'])) $mode = $_POST['mode'];
if (count($arrErr) > 0) {
$this->tpl_mode = $_POST['mode'];
$this->tpl_member_id = $_POST['member_id'];
$this->tpl_old_login_id = $_POST['old_login_id'];
$this->arrForm = $this->objForm->getHashArray();
$this->arrForm['password'] = '';
$this->reload(array('mode' => 'parent_reload'));
* SC_FormParamのインスタンスをメンバ変数にセットする.
$objForm->addParam('名前', 'name', STEXT_LEN, 'KV', array('EXIST_CHECK', 'MAX_LENGTH_CHECK'));
$objForm->addParam('所属', 'department', STEXT_LEN, 'KV', array('MAX_LENGTH_CHECK'));
$objForm->addParam('ログインID', 'login_id', '' , '', array('EXIST_CHECK', 'ALNUM_CHECK'));
if ($mode == "edit" && $_POST['password'] == DUMMY_PASS) {
$objForm->addParam('パスワード', 'password', '' , '', array('EXIST_CHECK'));
$objForm->addParam('パスワード', 'password', '' , '', array('EXIST_CHECK', 'ALNUM_CHECK'));
$objForm->addParam('権限', 'authority', INT_LEN, '', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objForm->setParam($_POST);
$this->objForm = $objForm;
* @return array エラー情報の連想配列
$arrErr = $this->objForm->checkError();
if (isset ($arrErr) && count($arrErr) > 0) return $arrErr;
$objErr->doFunc(array("パスワード", 'password', ID_MIN_LEN, ID_MAX_LEN), array("NUM_RANGE_CHECK"));
$objErr->doFunc(array("ログインID", 'login_id', ID_MIN_LEN, ID_MAX_LEN), array("NUM_RANGE_CHECK"));
$arrErr = $objErr->arrErr;
$arrErr['name'] = "既に登録されている名前なので利用できません。<br>";
$arrErr['login_id'] = "既に登録されているIDなので利用できません。<br>";
if (count($arrErr) > 0) {
$this->tpl_mode = $_POST['mode'];
$this->tpl_member_id = $_POST['member_id'];
$this->tpl_old_login_id = $_POST['old_login_id'];
$this->arrForm = $this->objForm->getHashArray();
$this->arrForm['password'] = '';
// 親ウィンドウを更新後、自ウィンドウを閉じる。
$url = URL_SYSTEM_TOP . "?pageno=" . $_POST['pageno'];
$this->tpl_onload = "fnUpdateParent('". $url. "'); window.close();";
* @return array エラー情報の連想配列
$arrErr = $this->objForm->checkError();
if (isset ($arrErr) && count($arrErr) > 0) return $arrErr;
$objErr->doFunc(array("パスワード", 'password', ID_MIN_LEN, ID_MAX_LEN), array("SPTAB_CHECK" ,"NUM_RANGE_CHECK"));
$objErr->doFunc(array("ログインID", 'login_id', ID_MIN_LEN, ID_MAX_LEN), array("SPTAB_CHECK" ,"NUM_RANGE_CHECK"));
$arrErr = $objErr->arrErr;
// ログインIDが変更されている場合はチェックする。
if ($_POST['login_id'] != $_POST['old_login_id']) {
$arrErr['login_id'] = "既に登録されているIDなので利用できません。<br>";
* parent_reloadアクションを実行する.
* テンプレートに親windowをリロードするjavascriptをセットする.
* $GET['id']が渡された場合、編集モードとして表示,
// $_GET['id']があれば編集モードで表示する
$this->tpl_mode = 'edit';
$this->tpl_member_id = $_GET['id'];
$this->tpl_onfocus = "fnClearText(this.name);";
$this->arrForm['password'] = DUMMY_PASS;
$this->tpl_old_login_id = $this->arrForm['login_id'];
$this->arrForm['authority'] = - 1;
* DBからmember_idに対応する管理者データを取得する
* @param integer $id メンバーID
* @return array 管理者データの連想配列, 無い場合は空の配列を返す
$columns = 'name,department,login_id,authority';
$where = 'member_id = ?';
$arrRet = $objQuery->select($columns, $table, $where, array($id));
if (is_null($arrRet)) return array();
* @param string $where WHERE句
* @param string $val 検索したい値
* @return boolean 登録済みならtrue, 未登録ならfalse
$count = $objQuery->count($table, $where, array($val));
if ($count > 0) return true;
* @param array 管理者データの連想配列
$sqlVal['name'] = $arrMemberData['name'];
$sqlVal['department'] = $arrMemberData['department'];
$sqlVal['login_id'] = $arrMemberData['login_id'];
$sqlVal['password'] = sha1($arrMemberData['password'] . ':' . AUTH_MAGIC);
$sqlVal['authority'] = $arrMemberData['authority'];
$sqlVal['rank'] = $objQuery->max('dtb_member', 'rank') + 1;
$sqlVal['work'] = '1'; // 稼働に設定
$sqlVal['del_flg'] = '0'; // 削除フラグをOFFに設定
$sqlVal['creator_id'] = $_SESSION['member_id'];
$sqlVal['create_date'] = 'NOW()';
$sqlVal['update_date'] = 'NOW()';
$objQuery->insert('dtb_member', $sqlVal);
* @param array 管理者データの連想配列
$sqlVal['name'] = $arrMemberData['name'];
$sqlVal['department'] = $arrMemberData['department'];
$sqlVal['login_id'] = $arrMemberData['login_id'];
$sqlVal['authority'] = $arrMemberData['authority'];
$sqlVal['update_date'] = 'NOW()';
if($arrMemberData['password'] != DUMMY_PASS) {
$sqlVal['password'] = sha1($arrMemberData['password'] . ":" . AUTH_MAGIC);
$where = "member_id = ?";
$objQuery->update("dtb_member", $sqlVal, $where, array($member_id));
Documentation generated on Fri, 24 Feb 2012 13:59:10 +0900 by Seasoft
|