Ignore:
Timestamp:
2007/03/10 21:35:02 (20 years ago)
Author:
nanasess
Message:

UTF-8 へ変換

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu/data/class/SC_Customer.php

    r15 r11729  
    66 */ 
    77 
    8 /*  [̾¾Î] SC_Customer 
    9  *  [³µÍ×] ²ñ°÷´ÉÍý¥¯¥é¥¹ 
     8/*  [名称] SC_Customer 
     9 *  [概要] 会員管理クラス 
    1010 */ 
    1111class SC_Customer { 
     
    1313    var $conn; 
    1414    var $email; 
    15     var $customer_data;     // ²ñ°÷¾ðÊó    
     15    var $customer_data;     // 会員情報    
    1616         
    1717    function SC_Customer( $conn = '', $email = '', $pass = '' ) { 
    18         // ¥»¥Ã¥·¥ç¥ó³«»Ï 
    19         /* startSession¤«¤é°Üư 2005/11/04 ÃæÀî */ 
     18        // セッション開始 
     19        /* startSessionから移動 2005/11/04 中川 */ 
    2020        sfDomainSessionStart(); 
    2121         
    22         // DBÀܳ¥ª¥Ö¥¸¥§¥¯¥ÈÀ¸À® 
     22        // DB接続オブジェクト生成 
    2323        $DB_class_name = "SC_DbConn"; 
    2424        if ( is_object($conn)){ 
    2525            if ( is_a($conn, $DB_class_name)){ 
    26                 // $conn¤¬$DB_class_name¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤Ç¤¢¤ë 
     26                // $connが$DB_class_nameのインスタンスである 
    2727                $this->conn = $conn; 
    2828            } 
    2929        } else { 
    3030            if (class_exists($DB_class_name)){ 
    31                 //$DB_class_name¤Î¥¤¥ó¥¹¥¿¥ó¥¹¤òºîÀ®¤¹¤ë 
     31                //$DB_class_nameのインスタンスを作成する 
    3232                $this->conn = new SC_DbConn();           
    3333            } 
     
    3535             
    3636        if ( is_object($this->conn) ) {  
    37             // Àµ¾ï¤ËDB¤ËÀܳ¤Ç¤­¤ë 
     37            // 正常にDBに接続できる 
    3838            if ( $email ){ 
    39                 // email¤«¤é¸ÜµÒ¾ðÊó¤ò¼èÆÀ¤¹¤ë 
     39                // emailから顧客情報を取得する 
    4040                // $this->setCustomerDataFromEmail( $email ); 
    4141            } 
    4242        } else { 
    43             echo "DBÀܳ¥ª¥Ö¥¸¥§¥¯¥È¤ÎÀ¸À®¤Ë¼ºÇÔ¤·¤Æ¤¤¤Þ¤¹"; 
     43            echo "DB接続オブジェクトの生成に失敗しています"; 
    4444            exit; 
    4545        } 
     
    5151     
    5252    function getCustomerDataFromEmailPass( $pass, $email ) { 
    53         // ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤Î¤ß 
     53        // 本登録された会員のみ 
    5454        $sql = "SELECT * FROM dtb_customer WHERE email ILIKE ? AND del_flg = 0 AND status = 2"; 
    5555        $result = $this->conn->getAll($sql, array($email)); 
    5656        $data = $result[0]; 
    5757         
    58         // ¥Ñ¥¹¥ï¡¼¥É¤¬¹ç¤Ã¤Æ¤¤¤ì¤Ð¸ÜµÒ¾ðÊó¤òcustomer_data¤Ë¥»¥Ã¥È¤·¤Ætrue¤òÊÖ¤¹ 
     58        // パスワードが合っていれば顧客情報をcustomer_dataにセットしてtrueを返す 
    5959        if ( sha1($pass . ":" . AUTH_MAGIC) == $data['password'] ){ 
    6060            $this->customer_data = $data; 
     
    6565    } 
    6666     
    67     // ¥Ñ¥¹¥ï¡¼¥É¤ò³Îǧ¤»¤º¤Ë¥í¥°¥¤¥ó 
     67    // パスワードを確認せずにログイン 
    6868    function setLogin($email) { 
    69         // ËÜÅÐÏ¿¤µ¤ì¤¿²ñ°÷¤Î¤ß 
     69        // 本登録された会員のみ 
    7070        $sql = "SELECT * FROM dtb_customer WHERE email ILIKE ? AND del_flg = 0 AND status = 2"; 
    7171        $result = $this->conn->getAll($sql, array($email)); 
     
    7575    } 
    7676     
    77     // ¥»¥Ã¥·¥ç¥ó¾ðÊó¤òºÇ¿·¤Î¾ðÊó¤Ë¹¹¿·¤¹¤ë 
     77    // セッション情報を最新の情報に更新する 
    7878    function updateSession() { 
    7979        $sql = "SELECT * FROM dtb_customer WHERE customer_id = ? AND del_flg = 0"; 
     
    8484    } 
    8585         
    86     // ¥í¥°¥¤¥ó¾ðÊó¤ò¥»¥Ã¥·¥ç¥ó¤ËÅÐÏ¿¤·¡¢¥í¥°¤Ë½ñ¤­¹þ¤à 
     86    // ログイン情報をセッションに登録し、ログに書き込む 
    8787    function startSession() { 
    8888        sfDomainSessionStart(); 
    8989        $_SESSION['customer'] = $this->customer_data; 
    90         // ¥»¥Ã¥·¥ç¥ó¾ðÊó¤ÎÊݸ 
     90        // セッション情報の保存 
    9191        gfPrintLog("access : user=".$this->customer_data['customer_id'] ."\t"."ip=". $_SERVER['REMOTE_HOST'], CUSTOMER_LOG_PATH ); 
    9292    } 
    9393 
    94     // ¥í¥°¥¢¥¦¥È¡¡$_SESSION['customer']¤ò²òÊü¤·¡¢¥í¥°¤Ë½ñ¤­¹þ¤à 
     94    // ログアウト $_SESSION['customer']を解放し、ログに書き込む 
    9595    function EndSession() { 
    96         // $_SESSION['customer']¤Î²òÊü 
     96        // $_SESSION['customer']の解放 
    9797        unset($_SESSION['customer']); 
    98         // ¥í¥°¤Ëµ­Ï¿¤¹¤ë 
     98        // ログに記録する 
    9999        gfPrintLog("logout : user=".$this->customer_data['customer_id'] ."\t"."ip=". $_SERVER['REMOTE_HOST'], CUSTOMER_LOG_PATH ); 
    100100    } 
    101101     
    102     // ¥í¥°¥¤¥ó¤ËÀ®¸ù¤·¤Æ¤¤¤ë¤«È½Äꤹ¤ë¡£ 
     102    // ログインに成功しているか判定する。 
    103103    function isLoginSuccess() { 
    104         // ¥í¥°¥¤¥ó»þ¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤ÈDB¤Î¥á¡¼¥ë¥¢¥É¥ì¥¹¤¬°ìÃפ·¤Æ¤¤¤ë¾ì¹ç 
     104        // ログイン時のメールアドレスとDBのメールアドレスが一致している場合 
    105105        if(sfIsInt($_SESSION['customer']['customer_id'])) { 
    106106            $objQuery = new SC_Query(); 
     
    113113    } 
    114114         
    115     // ¥Ñ¥é¥á¡¼¥¿¤Î¼èÆÀ 
     115    // パラメータの取得 
    116116    function getValue($keyname) { 
    117117        return $_SESSION['customer'][$keyname]; 
    118118    } 
    119119     
    120     // ¥Ñ¥é¥á¡¼¥¿¤Î¥»¥Ã¥È 
     120    // パラメータのセット 
    121121    function setValue($keyname, $val) { 
    122122        $_SESSION['customer'][$keyname] = $val; 
    123123    } 
    124124     
    125     // ÃÂÀ¸Æü·î¤Ç¤¢¤ë¤«¤É¤¦¤«¤ÎȽÄê 
     125    // 誕生日月であるかどうかの判定 
    126126    function isBirthMonth() { 
    127127        $arrRet = split("[- :/]", $_SESSION['customer']['birth']); 
Note: See TracChangeset for help on using the changeset viewer.