Ignore:
Timestamp:
2007/07/20 15:58:59 (17 years ago)
Author:
nanasess
Message:

r15064 から svn cp
とりあえず暫定コミット.

  • UTF-8 に変更
  • slib.php, glib.php のクラス化
  • LC_Page の抽象化(一部)
Location:
branches/feature-module-update
Files:
2 edited
2 copied

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update

    • Property svn:ignore set to
      .cache

      .settings

      .projectOptions
  • branches/feature-module-update/data/downloads/module/security/security.php

    r13402 r15078  
    88 */ 
    99  
    10 //¥Ú¡¼¥¸´ÉÍý¥¯¥é¥¹ 
     10//ページ管理クラス 
    1111class LC_Page { 
    12     //¥³¥ó¥¹¥È¥é¥¯¥¿ 
     12    //コンストラクタ 
    1313    function LC_Page() { 
    14         //¥á¥¤¥ó¥Æ¥ó¥×¥ì¡¼¥È¤Î»ØÄê 
     14        //メインテンプレートの指定 
    1515        $this->tpl_mainpage = MODULE_PATH . 'security/security.tpl'; 
    16         $this->tpl_subtitle = '¥»¥­¥å¥ê¥Æ¥£¥Á¥§¥Ã¥¯'; 
     16        $this->tpl_subtitle = 'セキュリティチェック'; 
    1717    } 
    1818} 
     
    2424case 'edit': 
    2525    $inst_inc = DATA_PATH . 'install.php'; 
    26     // install.php¤Î±£Êà
     26    // install.phpの隠蔽 
    2727    $hidden_inc = MODULE_PATH . 'security/install_inc.php'; 
    2828    if(sfIsNormalInstallInc()) { 
     
    5151$objPage->arrList = $arrList; 
    5252 
    53 $objView->assignobj($objPage);                  //ÊÑ¿ô¤ò¥Æ¥ó¥×¥ì¡¼¥È¤Ë¥¢¥µ¥¤¥ó¤¹¤ë 
    54 $objView->display($objPage->tpl_mainpage);      //¥Æ¥ó¥×¥ì¡¼¥È¤Î½ÐÎÏ 
     53$objView->assignobj($objPage);                  //変数をテンプレートにアサインする 
     54$objView->display($objPage->tpl_mainpage);      //テンプレートの出力 
    5555//------------------------------------------------------------------------------------------------------- 
    56 // ÀßÄê¥Õ¥¡¥¤¥ë(data)¤Î¥Ñ¥¹¤¬¸ø³«¥Ñ¥¹¤Ç¤Ê¤¤¤«³Îǧ¤¹¤ë 
     56// 設定ファイル(data)のパスが公開パスでないか確認する 
    5757function sfCheckOpenData() { 
    58     // ¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È¤Î¥Ñ¥¹¤ò¿ä¬¤¹¤ë¡£ 
     58    // ドキュメントルートのパスを推測する。 
    5959    $doc_root = ereg_replace(URL_DIR . "$","/",HTML_PATH); 
    6060    $data_path = realpath(DATA_PATH); 
    6161     
    62     // data¤Î¥Ñ¥¹¤¬¥É¥­¥å¥á¥ó¥È¥ë¡¼¥È°Ê²¼¤Ë¤¢¤ë¤«È½Äê 
     62    // dataのパスがドキュメントルート以下にあるか判定 
    6363    if(ereg("^".$doc_root, $data_path)) { 
    64         $arrResult['result'] = "¡ß"; 
    65         $arrResult['detail'] = "ÀßÄê¥Õ¥¡¥¤¥ë¤¬¡¢¸ø³«¤µ¤ì¤Æ¤¤¤ë²ÄǽÀ­¤¬¤¢¤ê¤Þ¤¹¡£<br>"; 
    66         $arrResult['detail'].= "/data/¥Ç¥£¥ì¥¯¥È¥ê¤Ï¡¢Èó¸ø³«¤Î¥Ñ¥¹¤ËÀßÃÖ¤·¤Æ²¼¤µ¤¤¡£"; 
     64        $arrResult['result'] = "×"; 
     65        $arrResult['detail'] = "設定ファイルが、公開されている可能性があります。<br>"; 
     66        $arrResult['detail'].= "/data/ディレクトリは、非公開のパスに設置して下さい。"; 
    6767    } else { 
    68         $arrResult['result'] = "¡û"; 
    69         $arrResult['detail'] = "ÀßÄê¥Õ¥¡¥¤¥ë¤Ï¡¢¸ø³«¥Ñ¥¹ÇÛ²¼¤Ë¸ºß¤·¤Þ¤»¤ó¡£";         
     68        $arrResult['result'] = ""; 
     69        $arrResult['detail'] = "設定ファイルは、公開パス配下に存在しません。";         
    7070    } 
    7171     
    72     $arrResult['title'] = "ÀßÄê¥Õ¥¡¥¤¥ë¤ÎÊݸ¥Ñ¥¹"; 
     72    $arrResult['title'] = "設定ファイルの保存パス"; 
    7373    return $arrResult; 
    7474} 
    7575 
    76 // ¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤¬Â¸ºß¤¹¤ë¤«³Îǧ¤¹¤ë 
     76// インストールファイルが存在するか確認する 
    7777function sfCheckInstall() { 
    78     // ¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Î¸ºß¥Á¥§¥Ã¥¯ 
     78    // インストールファイルの存在チェック 
    7979    $inst_path = HTML_PATH . "install/index.php"; 
    8080     
    8181    if(file_exists($inst_path)) { 
    82         $arrResult['result'] = "¡ß"; 
    83         $arrResult['detail'] = "/install/index.php¤Ï¡¢¥¤¥ó¥¹¥È¡¼¥ë´°Î»¸å¤Ë¥Õ¥¡¥¤¥ë¤òºï½ü¤·¤Æ¤¯¤À¤µ¤¤¡£";             
     82        $arrResult['result'] = "×"; 
     83        $arrResult['detail'] = "/install/index.phpは、インストール完了後にファイルを削除してください。";             
    8484    } else { 
    85         $arrResult['result'] = "¡û"; 
    86         $arrResult['detail'] = "/install/index.php¤Ï¡¢¸«¤Ä¤«¤ê¤Þ¤»¤ó¤Ç¤·¤¿¡£";     
     85        $arrResult['result'] = ""; 
     86        $arrResult['detail'] = "/install/index.phpは、見つかりませんでした。";     
    8787    } 
    8888     
    89     $arrResult['title'] = "¥¤¥ó¥¹¥È¡¼¥ë¥Õ¥¡¥¤¥ë¤Î¥Á¥§¥Ã¥¯"; 
     89    $arrResult['title'] = "インストールファイルのチェック"; 
    9090    return $arrResult; 
    9191} 
    9292 
    93 // ´ÉÍý¼Ô¥æ¡¼¥¶¤ÎID/¥Ñ¥¹¥ï¡¼¥É¥Á¥§¥Ã¥¯ 
     93// 管理者ユーザのID/パスワードチェック 
    9494function sfCheckIDPass($user, $password) { 
    9595    $objQuery = new SC_Query(); 
    9696    $sql = "SELECT password FROM dtb_member WHERE login_id = ? AND del_flg = 0"; 
    97     // DB¤«¤é°Å¹æ²½¥Ñ¥¹¥ï¡¼¥É¤ò¼èÆÀ¤¹¤ë¡£ 
     97    // DBから暗号化パスワードを取得する。 
    9898    $arrRet = $objQuery->getAll($sql, array($user)); 
    99     // ¥æ¡¼¥¶ÆþÎϥѥ¹¥ï¡¼¥É¤ÎȽÄê 
     99    // ユーザ入力パスワードの判定 
    100100    $ret = sha1($password . ":" . AUTH_MAGIC); 
    101101     
    102102    if($ret == $arrRet[0]['password']) { 
    103         $arrResult['result'] = "¡ß"; 
    104         $arrResult['detail'] = "Èó¾ï¤Ë¿ä¬¤Î¤·¤ä¤¹¤¤´ÉÍý¼ÔID¤È¤Ê¤Ã¤Æ¤¤¤Þ¤¹¡£¸Ä¿Í¾ðÊóϳ±Ì¤Î´í¸±À­¤¬¤¢¤ê¤Þ¤¹¡£";        
     103        $arrResult['result'] = "×"; 
     104        $arrResult['detail'] = "非常に推測のしやすい管理者IDとなっています。個人情報漏洩の危険性があります。";        
    105105    } else { 
    106106        if(count($arrRet) > 0) { 
    107             $arrResult['result'] = "¢¤"; 
    108             $arrResult['detail'] = "´ÉÍý¼Ô̾¤Ë¡Öadmin¡×¤òÍøÍѤ·¤Ê¤¤¤è¤¦¤Ë¤·¤Æ²¼¤µ¤¤¡£";                
     107            $arrResult['result'] = ""; 
     108            $arrResult['detail'] = "管理者名に「admin」を利用しないようにして下さい。";                
    109109        } else { 
    110             $arrResult['result'] = "¡û"; 
    111             $arrResult['detail'] = "Æȼ«¤ÎID¡¢¥Ñ¥¹¥ï¡¼¥É¤¬ÀßÄꤵ¤ì¤Æ¤¤¤ë¤è¤¦¤Ç¤¹¡£";                
     110            $arrResult['result'] = ""; 
     111            $arrResult['detail'] = "独自のID、パスワードが設定されているようです。";                
    112112        } 
    113113    } 
    114114     
    115     $arrResult['title'] = "ID/¥Ñ¥¹¥ï¡¼¥É¤Î¥Á¥§¥Ã¥¯"; 
     115    $arrResult['title'] = "ID/パスワードのチェック"; 
    116116    return $arrResult; 
    117117} 
    118118 
    119119 
    120 // install.php¤Î¥Õ¥¡¥¤¥ë¤ò¥Á¥§¥Ã¥¯¤¹¤ë 
     120// install.phpのファイルをチェックする 
    121121function sfCheckInstallInc() { 
    122     // install.php¤¬±£Êøå¤Î¤â¤Î¤«È½Äꤹ¤ë 
     122    // install.phpが隠蔽後のものか判定する 
    123123    if(sfIsNormalInstallInc()) { 
    124         $arrResult['result'] = "¡ß"; 
    125         $arrResult['detail'] = "install.php¤ò´Êñ¤Ëɽ¼¨¤Ç¤­¤Ê¤¯¤¹¤ë¤³¤È¤¬¤Ç¤­¤Þ¤¹¡£ÆâÍƤò±£Êä·¤Þ¤¹¤«¡©"; 
    126         $arrResult['detail'].= "<input type='submit' value='±£Ê乤ë'>";         
     124        $arrResult['result'] = "×"; 
     125        $arrResult['detail'] = "install.phpを簡単に表示できなくすることができます。内容を隠蔽しますか?"; 
     126        $arrResult['detail'].= "<input type='submit' value='隠蔽する'>";         
    127127    } else { 
    128         $arrResult['result'] = "¡û"; 
    129         $arrResult['detail'] = "install.php¤Î±£ÊÃÂкö¤¬¤È¤é¤ì¤Æ¤¤¤Þ¤¹¡£";                        
     128        $arrResult['result'] = ""; 
     129        $arrResult['detail'] = "install.phpの隠蔽対策がとられています。";                        
    130130    } 
    131     $arrResult['title'] = "install.php¤Î²ÄÆÉÀ­¥Á¥§¥Ã¥¯"; 
     131    $arrResult['title'] = "install.phpの可読性チェック"; 
    132132    return $arrResult; 
    133133} 
    134134 
    135 // install.php¤¬±£Êøå¤Î¤â¤Î¤«È½Äꤹ¤ë 
     135// install.phpが隠蔽後のものか判定する 
    136136function sfIsNormalInstallInc() { 
    137     // install.php¤Î¥Ñ¥¹¤ò¼èÆÀ¤¹¤ë 
     137    // install.phpのパスを取得する 
    138138    $inst_inc = DATA_PATH . 'install.php'; 
    139139    if(file_exists($inst_inc)) { 
  • branches/feature-module-update/data/downloads/module/security/security.tpl

    r12157 r15078  
    66 */ 
    77*}--> 
    8 <!--¡¡--> 
     8<!-- --> 
    99<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    1010<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ja" lang="ja"> 
     
    3535 
    3636<div align="center"> 
    37 <!--¡ú¡ú¡ú¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä¡ú¡ú¡ú--> 
     37<!--★★★メインコンテンツ★★★--> 
    3838<table width="500" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    3939<form name="form1" id="form1" method="post" action="<!--{$smarty.server.REQUEST_URI|escape}-->"> 
     
    4141    <tr valign="top"> 
    4242        <td class="mainbg"> 
    43             <!--¢§ÅÐÏ¿¥Æ¡¼¥Ö¥ë¤³¤³¤«¤é--> 
     43            <!--▼登録テーブルここから--> 
    4444            <table width="500" border="0" cellspacing="0" cellpadding="0" summary=" "> 
    45                 <!--¥á¥¤¥ó¥¨¥ê¥¢--> 
     45                <!--メインエリア--> 
    4646                <tr> 
    4747                    <td align="center"> 
     
    6060                                        <tr> 
    6161                                            <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_left.gif" width="22" height="12" alt=""></td> 
    62                                             <td bgcolor="#636469" width="402" class="fs14n"><span class="white"><!--¥³¥ó¥Æ¥ó¥Ä¥¿¥¤¥È¥ë--><!--{$tpl_subtitle}--></span></td> 
     62                                            <td bgcolor="#636469" width="402" class="fs14n"><span class="white"><!--コンテンツタイトル--><!--{$tpl_subtitle}--></span></td> 
    6363                                            <td background="<!--{$smarty.const.URL_DIR}-->img/contents/contents_title_right_bg.gif"><img src="<!--{$smarty.const.URL_DIR}-->img/common/_.gif" width="18" height="1" alt=""></td> 
    6464                                        </tr> 
     
    7373                                    <table width="442" border="0" cellspacing="1" cellpadding="5" summary=" "> 
    7474                                        <tr bgcolor="#f2f1ec" align="center" class="fs12n"> 
    75                                             <td width="120">¥Á¥§¥Ã¥¯ÆâÍÆ</td> 
    76                                             <td width="40">·ë²Ì</td> 
    77                                             <td width="300">¾ÜºÙ</td> 
     75                                            <td width="120">チェック内容</td> 
     76                                            <td width="40">結果</td> 
     77                                            <td width="300">詳細</td> 
    7878                                        </tr> 
    7979                                        <!--{section name=i loop=$arrList}--> 
     
    9797                    </td> 
    9898                </tr> 
    99                 <!--¥á¥¤¥ó¥¨¥ê¥¢--> 
     99                <!--メインエリア--> 
    100100            </table> 
    101             <!--¢¥ÅÐÏ¿¥Æ¡¼¥Ö¥ë¤³¤³¤Þ¤Ç--> 
     101            <!--▲登録テーブルここまで--> 
    102102        </td> 
    103103    </tr> 
    104104</form> 
    105105</table> 
    106 <!--¡ú¡ú¥á¥¤¥ó¥³¥ó¥Æ¥ó¥Ä¡ú¡ú--> 
     106<!--★★メインコンテンツ★★--> 
    107107</div> 
    108108 
Note: See TracChangeset for help on using the changeset viewer.