Source for file LC_Page_Admin_System_AdminArea.php
Documentation is available at LC_Page_Admin_System_AdminArea.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_System_AdminArea.php 20970 2011-06-10 10:27:24Z Seasoft $
$this->tpl_mainpage = 'system/adminarea.tpl';
$this->tpl_subno = 'adminarea';
$this->tpl_mainno = 'system';
$this->tpl_maintitle = 'システム設定';
$this->tpl_subtitle = '管理画面設定';
$this->tpl_enable_ssl = FALSE;
if(strpos(HTTPS_URL,"https://") !== FALSE){
$this->tpl_enable_ssl = TRUE;
$arrErr = $objFormParam->checkError();
$this->arrForm = $objFormParam->getHashArray();
$arrErr['all'] = CONFIG_REALFILE . ' を変更する権限がありません。';
$this->tpl_onload = "window.alert('管理機能の設定を変更しました。URLを変更した場合は、新しいURLにアクセスしてください。');";
$this->tpl_onload = "window.alert('設定内容に誤りがあります。設定内容を確認してください。');";
$this->arrForm = array("admin_dir"=> $admin_dir,"admin_force_ssl"=> ADMIN_FORCE_SSL,"admin_allow_hosts"=> "");
$this->arrForm["admin_allow_hosts"] = implode("\n",$allow_hosts);
* @param object $objFormParam
* @param array $arrParams $_POST値
function initParam(&$objFormParam, &$arrParams) {
$objFormParam->addParam('ディレクトリ名', 'admin_dir', ID_MAX_LEN, 'a', array('EXIST_CHECK', 'SPTAB_CHECK', 'ALNUM_CHECK'));
$objFormParam->addParam('SSL制限', 'admin_force_ssl', 1, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->addParam('IP制限', 'admin_allow_hosts', LTEXT_LEN, 'a', array('IP_CHECK', 'MAX_LENGTH_CHECK'));
$objFormParam->setParam($arrParams);
$objFormParam->convParam();
* @param array $arrForm $this->arrForm値
* @param array $arrErr エラーがあった項目用配列
$admin_dir = trim($arrForm['admin_dir']). "/";
$installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES);
foreach($installData as $key=> $line){
if(strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir){
if(file_exists(HTML_REALDIR. $admin_dir) and $admin_dir != "admin/"){
$arrErr["admin_dir"] .= ROOT_URLPATH. $admin_dir. "は既に存在しています。別のディレクトリ名を指定してください。";
$arrErr["admin_dir"] .= ROOT_URLPATH. ADMIN_DIR. "のディレクトリ名を変更する権限がありません。";
//管理機能ディレクトリのリネームと CONFIG_REALFILE の変更
$admin_dir = trim($arrForm['admin_dir']). "/";
$admin_force_ssl = 'FALSE';
if($arrForm['admin_force_ssl'] == 1){
$admin_force_ssl = 'TRUE';
$admin_allow_hosts = explode("\n",$arrForm['admin_allow_hosts']);
foreach($admin_allow_hosts as $key=> $host){
$admin_allow_hosts[$key] = $host;
unset ($admin_allow_hosts[$key]);
$admin_allow_hosts = serialize($admin_allow_hosts);
$installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES);
foreach($installData as $key=> $line){
if(strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir){
$installData[$key] = 'define("ADMIN_DIR","'. $admin_dir. '");';
if (!rename(HTML_REALDIR. ADMIN_DIR,HTML_REALDIR. $admin_dir)) {
$this->arrErr["admin_dir"] .= ROOT_URLPATH. ADMIN_DIR. "のディレクトリ名を変更できませんでした。";
if(strpos($line,"ADMIN_FORCE_SSL") !== false){
$installData[$key] = 'define("ADMIN_FORCE_SSL",'. $admin_force_ssl. ');';
if(strpos($line,"ADMIN_ALLOW_HOSTS") !== false and ADMIN_ALLOW_HOSTS != $admin_allow_hosts) {
$installData[$key] = "define('ADMIN_ALLOW_HOSTS','". $admin_allow_hosts. "');";
$fp = fopen(CONFIG_REALFILE,'wb');
$installData = implode("\n",$installData);
Documentation generated on Fri, 24 Feb 2012 14:01:46 +0900 by Seasoft
|