Ignore:
Timestamp:
2011/01/08 18:03:43 (13 years ago)
Author:
tao
Message:

#841 リネームしたい管理ディレクトリの存在確認など、細かい点を修正

Location:
branches/version-2_5-dev/data
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/Smarty/templates/admin/basis/index.tpl

    r19856 r19859  
    259259        <!--{assign var=key value="admin_force_ssl"}--> 
    260260        <span class="attention"><!--{$arrErr[$key]}--></span> 
    261         <input type="checkbox" name="<!--{$key}-->" value="1" id="<!--{$key}-->" <!--{if $arrForm[$key] == 1}-->checked="checked"<!--{/if}--> /><label for="<!--{$key}-->">SSLを強制する。</label> 
     261        <input type="checkbox" name="<!--{$key}-->" value="1" id="<!--{$key}-->" <!--{if $arrForm[$key] == 1}-->checked="checked"<!--{/if}--><!--{if !$tpl_enable_ssl}--> disabled="disabled"<!--{/if}--> /><label for="<!--{$key}-->">SSLを強制する。</label> 
    262262      </td> 
    263263    </tr> 
  • branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php

    r19856 r19859  
    5252        $this->arrTAXRULE = $masterData->getMasterData("mtb_taxrule"); 
    5353        $this->tpl_subtitle = 'SHOPマスタ'; 
     54        $this->tpl_enable_ssl = FALSE; 
     55        if(strpos(HTTPS_URL,"https://") !== FALSE){ 
     56            $this->tpl_enable_ssl = TRUE; 
     57        } 
    5458 
    5559        //定休日用配列 
     
    218222    } 
    219223     
     224    //管理画面ディレクトリのリネームとinstall.phpの変更 
    220225    function lfUpdateAdminData($array){ 
    221226        $admin_dir = trim($array['admin_dir'])."/"; 
     
    234239        } 
    235240        $admin_allow_hosts = serialize($admin_allow_hosts); 
     241 
    236242        //権限チェック  
    237243        if(!is_writable(DATA_REALDIR . "install.php")){ 
    238244            $this->arrErr["admin_force_ssl"] = DATA_REALDIR . "install.phpを変更する権限がありません。"; 
    239         } 
    240         if(count($this->arrErr) > 0){ 
    241245            return false; 
    242246        } 
     247 
    243248        //install.phpの書き換え 
    244249        $installData = file(DATA_REALDIR."install.php",FILE_IGNORE_NEW_LINES); 
     
    246251        foreach($installData as $key=>$line){ 
    247252            if(strpos($line,"ADMIN_DIR") !== false and ADMIN_DIR != $admin_dir){ 
     253                //既存ディレクトリのチェック 
     254                if(file_exists(HTML_REALDIR.$admin_dir)){ 
     255                    $this->arrErr["admin_dir"] .= HTML_REALDIR.$admin_dir."は既に存在しています。別のディレクトリ名を指定してください。"; 
     256                } 
     257                if(file_exists(USER_TEMPLATE_REALDIR.$admin_dir)){ 
     258                    $this->arrErr["admin_dir"] .= USER_TEMPLATE_REALDIR.$admin_dir."は既に存在しています。別のディレクトリ名を指定してください。"; 
     259                } 
     260                //権限チェック 
    248261                if(!is_writable(HTML_REALDIR . ADMIN_DIR)){ 
    249                     $this->arrErr["admin_dir"] = URL_PATH.ADMIN_DIR."のディレクトリ名を変更する権限がありません。"; 
     262                    $this->arrErr["admin_dir"] .= URL_PATH.ADMIN_DIR."のディレクトリ名を変更する権限がありません。"; 
    250263                } 
    251264                if(!is_writable(USER_TEMPLATE_REALDIR . ADMIN_DIR)){ 
    252                     $this->arrErr["admin_dir"] = USER_TEMPLATE_REALDIR . ADMIN_DIR."のディレクトリ名を変更する権限がありません。";         
    253                 } 
    254                 if(count($this->arrErr) > 0 ){ 
    255                     return false; 
    256                 }else{ 
     265                    $this->arrErr["admin_dir"] .= USER_TEMPLATE_REALDIR . ADMIN_DIR."のディレクトリ名を変更する権限がありません。";         
     266                } 
     267                if(count($this->arrErr) == 0 ){ 
    257268                    $installData[$key] = 'define("ADMIN_DIR","'.$admin_dir.'");'; 
    258269                    //管理画面ディレクトリのリネーム 
Note: See TracChangeset for help on using the changeset viewer.