Source for file LC_Page_Admin_Index.php
Documentation is available at LC_Page_Admin_Index.php
* This file is part of EC-CUBE
* Copyright(c) 2000-2011 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_EX_REALDIR . 'page_extends/admin/LC_Page_Admin_Ex.php';
* @author LOCKON CO.,LTD.
* @version $Id: LC_Page_Admin_Index.php 20970 2011-06-10 10:27:24Z Seasoft $
$this->tpl_mainpage = 'login.tpl';
$this->httpCacheControl('nocache');
$objFormParam = new SC_FormParam_Ex();
switch ($this->getMode()) {
$objFormParam->setParam($_POST);
if (SC_Utils_Ex::isBlank($this->arrErr)) {
$this->lfDoLogin($objFormParam->getValue('login_id'));
SC_Response_Ex::sendRedirect(ADMIN_HOME_URLPATH);
SC_Utils_Ex::sfDispError(LOGIN_ERROR);
$this->setTemplate(LOGIN_FRAME);
* @param array $objFormParam フォームパラメータークラス
$objFormParam->addParam('ID', 'login_id', ID_MAX_LEN, '', array('EXIST_CHECK', 'ALNUM_CHECK' ,'MAX_LENGTH_CHECK'));
$objFormParam->addParam('PASSWORD', 'password', ID_MAX_LEN, '', array('EXIST_CHECK', 'ALNUM_CHECK', 'MAX_LENGTH_CHECK'));
* TODO: ブルートフォースアタック対策チェックの実装
* @param array $objFormParam フォームパラメータークラス
* @return array $arrErr エラー配列
$arrErr = $objFormParam->checkError();
if(SC_Utils_Ex::isBlank($arrErr)) {
$arrForm = $objFormParam->getHashArray();
$arrErr['password'] = "ログイン出来ません。";
* 有効な管理者ID/PASSかどうかチェックする
* @param string $login_id ログインID文字列
* @param string $pass ログインパスワード文字列
* @return boolean ログイン情報が有効な場合 true
$objQuery = & SC_Query_Ex::getSingletonInstance();
$cols = "password, salt";
$where = "login_id = ? AND del_flg <> 1 AND work = 1";
$arrData = $objQuery->getRow($cols, $table, $where, array($login_id));
if (SC_Utils_Ex::isBlank($arrData)) {
if (SC_Utils_Ex::sfIsMatchHashPassword($pass, $arrData['password'], $arrData['salt'])) {
* @param string $login_id ログインID文字列
$objQuery = & SC_Query_Ex::getSingletonInstance();
$cols = "member_id, authority, login_date, name";
$arrData = $objQuery->getRow($cols, $table, $where, array($login_id));
$sid = $this->lfSetLoginSession($arrData['member_id'], $login_id, $arrData['authority'], $arrData['name'], $arrData['login_date']);
$this->lfSetLoginData($sid, $arrData['member_id'], $login_id, $arrData['authority'], $arrData['login_date']);
* @param integer $member_id メンバーID
* @param string $login_id ログインID文字列
* @param integer $authority 権限ID
* @param string $login_name ログイン表示名
* @param string $last_login 最終ログイン日時(YYYY/MM/DD HH:ii:ss形式) またはNULL
* @return string $sid 設定したセッションのセッションID
function lfSetLoginSession($member_id, $login_id, $authority, $login_name, $last_login) {
$objSess = new SC_Session_Ex();
$objSess->SetSession('cert', CERT_STRING);
$objSess->SetSession('member_id', $member_id);
$objSess->SetSession('login_id', $login_id);
$objSess->SetSession('authority', $authority);
$objSess->SetSession('login_name', $login_name);
$objSess->SetSession('uniqid', $objSess->getUniqId());
if(SC_Utils_Ex::isBlank($last_login)) {
$objSess->SetSession('last_login', date("Y-m-d H:i:s"));
$objSess->SetSession('last_login', $last_login);
return $objSess->GetSID();
* @param mixed $sid セッションID
* @param integer $member_id メンバーID
* @param string $login_id ログインID文字列
* @param integer $authority 権限ID
* @param string $last_login 最終ログイン日時(YYYY/MM/DD HH:ii:ss形式) またはNULL
function lfSetLoginData($sid, $member_id, $login_id, $authority, $last_login) {
$str_log = "login: user=$login_id($member_id) auth=$authority "
. "lastlogin=$last_login sid=$sid";
GC_Utils_Ex::gfPrintLog($str_log);
$objQuery = & SC_Query_Ex::getSingletonInstance();
$sqlval['login_date'] = date("Y-m-d H:i:s");
$where = "member_id = ?";
$objQuery->update($table, $sqlval, $where, array($member_id));
* TODO: ブルートフォースアタック対策の実装
* @param string $login_id ログイン失敗時に投入されたlogin_id文字列
GC_Utils_Ex::gfPrintLog($error_login_id . " password incorrect.");
Documentation generated on Fri, 24 Feb 2012 14:01:20 +0900 by Seasoft
|