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


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

/**
 * 仮登録メールから本登録動作
 *
 * @package     Customer.Mypage.Member.Insert.Confirm
 * @author      Your Name <mail@example.com>
 * @access      public
 */
class Customer_Mypage_Member_Insert_Confirm
{
    var $c_member;
    var $title;
    
    var $username;
    var $id;

    /**
     * execute
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Customer_Mypage_Member_Insert_Confirmが実行されました", "Customer_Mypage_Member_Insert_Confirm#execute");
        
        $mobile = &Net_UserAgent_Mobile::isMobile();
        $re_str = ($mobile) ? "mobile_" : "";
        
        $res = $this -> check();
        if($res) {
            return $re_str .'success';
        } else {
            return $re_str .'input';
        }
    }

    function check()
    {
        if(!isset($this->id)) {
            return false;
        } else {
            //$_GET['id']の値をもとに、仮会員ＤＢから値をもらってくる
            $data = $this -> c_member -> check_trial($this->id);
            if($data === false){
                return false;
            } else {
                return true;
            }
        }
    }

    function getId()
    {
        return $this -> id;
    }

    function getUsername()
    {
        return $this -> username;
    }
}
?>
