Changeset 19996
- Timestamp:
- 2011/01/20 03:52:23 (12 years ago)
- Location:
- branches/version-2_5-dev
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/admin/basis/index.tpl
r19972 r19996 244 244 </table> 245 245 246 <h2>管理機能設定</h2>247 <table id="basis-index-admin">248 <tr>249 <th>ディレクトリ名</th>250 <td>251 <!--{assign var=key value="admin_dir"}-->252 <span class="attention"><!--{$arrErr[$key]}--></span>253 <!--{$smarty.const.ROOT_URLPATH}--><input type="text" name="<!--{$key}-->" value="<!--{$arrForm[$key]|h}-->" maxlength="<!--{$smarty.const.ID_MAX_LEN}-->" size="40" class="box40" style="<!--{if $arrErr[$key] != ""}-->background-color: <!--{$smarty.const.ERR_COLOR}-->;<!--{/if}-->"/>/254 </td>255 </tr>256 <tr>257 <th>SSL制限</th>258 <td>259 <!--{assign var=key value="admin_force_ssl"}-->260 <span class="attention"><!--{$arrErr[$key]}--></span>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>262 </td>263 </tr>264 <tr>265 <th>IP制限</th>266 <td>267 <!--{assign var=key value="admin_allow_hosts"}-->268 <span class="attention"><!--{$arrErr[$key]}--></span>269 <textarea name="<!--{$key}-->" cols="60" rows="8" class="area60" style="<!--{$arrErr[$key]|sfGetErrorColor}-->" ><!--{$arrForm[$key]|h}--></textarea>270 <span class="attention"> (上限<!--{$smarty.const.LTEXT_LEN}-->文字)</span><br />271 <span>※管理機能へのアクセスを特定のIPアドレスからの接続のみに制限します。<br />272 アクセスを許可するIPアドレスを1行づつ入力してください。何も入力しない場合は全てを許可します。</span><br />273 </td>274 </tr>275 </table>276 277 278 246 <h2>定休日設定</h2> 279 247 <table id="basis-index-holiday"> -
branches/version-2_5-dev/data/Smarty/templates/admin/system/subnavi.tpl
r19972 r19996 27 27 <li<!--{if $tpl_subno == 'parameter'}--> class="on"<!--{/if}--> id="navi-system-parameter"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->system/parameter.php"><span>パラメータ設定</span></a></li> 28 28 <li<!--{if $tpl_subno == 'masterdata'}--> class="on"<!--{/if}--> id="navi-system-masterdata"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->system/masterdata.php"><span>マスタデータ管理</span></a></li> 29 <li<!--{if $tpl_subno == 'masterdata'}--> class="on"<!--{/if}--> id="navi-system-adminarea"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->system/adminarea.php"><span>管理画面設定</span></a></li> 29 30 <li<!--{if $tpl_subno == 'system'}--> class="on"<!--{/if}--> id="navi-system-system"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->system/system.php"><span>システム情報</span></a></li> 30 31 <li<!--{if $tpl_subno == 'plugin'}--> class="on"<!--{/if}--> id="navi-system-plugin"><a href="<!--{$smarty.const.ROOT_URLPATH}--><!--{$smarty.const.ADMIN_DIR}-->system/plugin.php"><span>プラグイン管理</span></a></li> -
branches/version-2_5-dev/data/class/SC_View.php
r19987 r19996 201 201 $this->_smarty->compile_dir = COMPILE_ADMIN_REALDIR; 202 202 $this->assign('TPL_URLPATH_DEFAULT', ROOT_URLPATH . USER_DIR . USER_PACKAGE_DIR . DEFAULT_TEMPLATE_NAME . '/'); 203 $this->assign('TPL_URLPATH', ROOT_URLPATH . USER_DIR . USER_PACKAGE_DIR . ADMIN_DIR);203 $this->assign('TPL_URLPATH', ROOT_URLPATH . USER_DIR . USER_PACKAGE_DIR . "admin/"); 204 204 $this->initpath(); 205 205 } -
branches/version-2_5-dev/data/class/pages/admin/basis/LC_Page_Admin_Basis.php
r19972 r19996 52 52 $this->arrTAXRULE = $masterData->getMasterData("mtb_taxrule"); 53 53 $this->tpl_subtitle = 'SHOPマスタ'; 54 $this->tpl_enable_ssl = FALSE;55 if(strpos(HTTPS_URL,"https://") !== FALSE){56 $this->tpl_enable_ssl = TRUE;57 }58 54 59 55 //定休日用配列 … … 118 114 break; 119 115 } 120 $this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "'); window.alert('SHOPマスタの登録が完了しました。 管理機能のURLを変更した場合は、新しいURLにアクセスしてください。');";116 $this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "'); window.alert('SHOPマスタの登録が完了しました。');"; 121 117 } 122 118 if( empty($this->arrForm['regular_holiday_ids']) ) { … … 133 129 $regular_holiday_ids = explode('|', $this->arrForm['regular_holiday_ids']); 134 130 $this->arrForm['regular_holiday_ids'] = $regular_holiday_ids; 135 $admin_dir = str_replace("/","",ADMIN_DIR);136 $this->arrForm += array("admin_dir"=>$admin_dir);137 $this->arrForm += array("admin_force_ssl"=>ADMIN_FORCE_SSL);138 if(defined("ADMIN_ALLOW_HOSTS")){139 $allow_hosts = unserialize(ADMIN_ALLOW_HOSTS);140 $this->arrForm += array("admin_allow_hosts"=>implode("\n",$allow_hosts));141 }else{142 $this->arrForm += array("admin_allow_hosts"=>"");143 }144 131 $this->tpl_onload = "fnCheckLimit('downloadable_days', 'downloadable_days_unlimited', '" . DISABLED_RGB . "');"; 145 132 } … … 205 192 } 206 193 $sqlval['update_date'] = 'Now()'; 207 $this->lfUpdateAdminData($array);208 194 // UPDATEの実行 209 195 $ret = $objQuery->update("dtb_baseinfo", $sqlval); … … 217 203 } 218 204 $sqlval['update_date'] = 'Now()'; 219 $this->lfUpdateAdminData($array);220 205 // INSERTの実行 221 206 $ret = $objQuery->insert("dtb_baseinfo", $sqlval); 222 207 } 223 208 224 //管理機能ディレクトリのリネームと CONFIG_REALFILE の変更225 function lfUpdateAdminData($array){226 $admin_dir = trim($array['admin_dir'])."/";227 $admin_force_ssl = "FALSE";228 if($array['admin_force_ssl'] == 1){229 $admin_force_ssl = "TRUE";230 }231 $admin_allow_hosts = explode("\n",$array['admin_allow_hosts']);232 foreach($admin_allow_hosts as $key=>$host){233 $host = trim($host);234 if(strlen($host) >= 8){235 $admin_allow_hosts[$key] = $host;236 }else{237 unset($admin_allow_hosts[$key]);238 }239 }240 $admin_allow_hosts = serialize($admin_allow_hosts);241 242 // 権限チェック243 if(!is_writable(CONFIG_REALFILE)){244 $this->arrErr["admin_force_ssl"] = CONFIG_REALFILE . ' を変更する権限がありません。';245 return false;246 }247 248 // CONFIG_REALFILE の書き換え249 $installData = file(CONFIG_REALFILE, FILE_IGNORE_NEW_LINES);250 $diff = 0;251 foreach($installData as $key=>$line){252 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 //権限チェック261 if(!is_writable(HTML_REALDIR . ADMIN_DIR)){262 $this->arrErr["admin_dir"] .= ROOT_URLPATH.ADMIN_DIR."のディレクトリ名を変更する権限がありません。";263 }264 if(!is_writable(USER_TEMPLATE_REALDIR . ADMIN_DIR)){265 $this->arrErr["admin_dir"] .= USER_TEMPLATE_REALDIR . ADMIN_DIR."のディレクトリ名を変更する権限がありません。";266 }267 if(count($this->arrErr) == 0 ){268 $installData[$key] = 'define("ADMIN_DIR","'.$admin_dir.'");';269 //管理機能ディレクトリのリネーム270 rename(HTML_REALDIR.ADMIN_DIR,HTML_REALDIR.$admin_dir);271 rename(USER_TEMPLATE_REALDIR.ADMIN_DIR,USER_TEMPLATE_REALDIR.$admin_dir);272 $diff ++;273 }274 }275 276 if(strpos($line,"ADMIN_FORCE_SSL") !== false and ADMIN_FORCE_SSL !== (boolean)$array['admin_force_ssl']){277 $installData[$key] = 'define("ADMIN_FORCE_SSL",'.$admin_force_ssl.');';278 $diff ++;279 }280 if(strpos($line,"ADMIN_ALLOW_HOSTS") !== false and ADMIN_ALLOW_HOSTS != $admin_allow_hosts) {281 $installData[$key] = "define('ADMIN_ALLOW_HOSTS','".$admin_allow_hosts."');";282 $diff ++;283 }284 }285 286 if($diff > 0) {287 $fp = fopen(DATA_REALDIR . "install.php","wb");288 $installData = implode("\n",$installData);289 echo $installData;290 fwrite($fp, $installData);291 fclose($fp);292 }293 return true;294 }295 209 296 210 /* 取得文字列の変換 */ … … 326 240 $arrConvList['email03'] = "a"; 327 241 $arrConvList['email04'] = "a"; 328 $arrConvList['admin_dir'] = "a";329 $arrConvList['admin_force_ssl'] = "n";330 $arrConvList['admin_allow_hosts'] = "a";331 242 $arrConvList['tax'] = "n"; 332 243 $arrConvList['free_rule'] = "n"; … … 362 273 $objErr->doFunc(array('メール送信元メールアドレス', "email03", STEXT_LEN) ,array("EXIST_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK", "MAX_LENGTH_CHECK")); 363 274 $objErr->doFunc(array('送信エラー受付メールアドレス', "email04", STEXT_LEN) ,array("EXIST_CHECK", "EMAIL_CHECK", "EMAIL_CHAR_CHECK","MAX_LENGTH_CHECK")); 364 //管理機能設定チェック365 $objErr->doFunc(array('ディレクトリ名', "admin_dir", ID_MAX_LEN) ,array("EXIST_CHECK","SPTAB_CHECK", "ALNUM_CHECK"));366 $objErr->doFunc(array('SSL制限', "admin_force_ssl", 1) ,array("NUM_CHECK", "MAX_LENGTH_CHECK"));367 $objErr->doFunc(array('IP制限', "admin_allow_hosts", LTEXT_LEN) ,array("IP_CHECK", "MAX_LENGTH_CHECK"));368 369 275 370 276 // 電話番号チェック -
branches/version-2_5-dev/html/install/index.php
r19986 r19996 410 410 DATA_REALDIR . "upload/", 411 411 HTML_REALDIR . ADMIN_DIR, 412 HTML_REALDIR 412 413 ); 413 414 … … 417 418 // listdirsの保持データを初期化 418 419 initdirs(); 419 if (is_dir($val) ) {420 if (is_dir($val) and $val != HTML_REALDIR .ADMIN_DIR and $val != HTML_REALDIR) { 420 421 $arrDirs = listdirs($val); 421 422 } else { … … 745 746 $oldAdminDir = SC_Utils_Ex::sfTrimURL(ADMIN_DIR); 746 747 $newAdminDir = $objFormParam->getValue('admin_dir'); 747 if ($oldAdminDir !== $newAdminDir AND (file_exists(HTML_REALDIR . $newAdminDir) OR file_exists(USER_TEMPLATE_REALDIR . $newAdminDir))) {748 if ($oldAdminDir !== $newAdminDir AND file_exists(HTML_REALDIR . $newAdminDir) and $newAdminDir != "admin") { 748 749 $objErr->arrErr["admin_dir"] = "※ 指定した管理機能ディレクトリは既に存在しています。別の名前を指定してください。"; 749 750 } … … 1065 1066 return true; 1066 1067 } 1067 if (file_exists(HTML_REALDIR . $adminDir) OR file_exists(USER_TEMPLATE_REALDIR . $adminDir)) {1068 if (file_exists(HTML_REALDIR . $adminDir)) { 1068 1069 return '※ 指定した管理機能ディレクトリは既に存在しています。別の名前を指定してください。'; 1069 1070 } … … 1071 1072 return '※ ' . HTML_REALDIR . $adminDir . 'へのリネームに失敗しました。ディレクトリの権限を確認してください。'; 1072 1073 } 1073 if (!rename(USER_TEMPLATE_REALDIR . $oldAdminDir, USER_TEMPLATE_REALDIR . $adminDir)) {1074 return '※ ' . USER_TEMPLATE_REALDIR . $adminDir . 'へのリネームに失敗しました。ディレクトリの権限を確認してください。';1075 }1076 1074 return true; 1077 1075 }
Note: See TracChangeset
for help on using the changeset viewer.