<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


//JSONを扱うためのパーサ
//require_once(WEBAPP_DIR."/JSON.php");

/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * [[機能説明]]
 *
 * @package     [[package名]]
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Customer_Mypage_Leave_Confirm
{
    var $auth;             //Authオブジェクトを取得
    var $memberCd;
    var $c_member;         //member DataBase
    var $password;         //userのメールアドレス
    var $mailaddress;
    var $title;
    var $actionChain;

    /**
     * [[機能説明]]
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Customer_Mypage_Leave_Confirmが実行されました", "Customer_Mypage_Leave_Confirm#execute");
        $errorList =& $this->actionChain->getCurErrorList();
        $this -> memberCd = $this -> auth -> getAuthData("membercd");
        if($this -> memberCd == NULL) return 'error1';

        $memberInfo = $this -> c_member -> select_one($this -> auth -> getAuthData("membercd"));
        $this -> mailaddress = $memberInfo['mailaddr'];
        if($this -> password == NULL) {
        	$errorList -> add(1, "パスワードが未入力です。");
        	return 'input';
        }
        if(sha1($this -> password) != $memberInfo['password']) {
            $errorList -> add(1, "パスワードが間違っています。");
        	return 'input';
        }

        return 'success';

    }

    function getMailaddress()
    {
        return $this -> mailaddress;
    }
}
?>