/**
  * 共通設定
  *
  * @return	void
  * @access	public
  */
 public function beforeFilter()
 {
     //基底の設定
     parent::beforeFilter();
     /* 認証設定 */
     //専用セッションキーの指定
     BcAuthComponent::$sessionKey = "BcAuth.MobilePost";
     //未認証許可
     $this->BcAuth->allow('login', 'smartphone_login');
     // 認証時の設定
     $this->BcAuth->authenticate = array('Form' => array('userModel' => 'User', 'fields' => array('username' => 'name', 'password' => 'password')));
     //ログインアクション
     $this->BcAuth->loginAction = array('controller' => 'mobile_posts', 'action' => 'login', 'plugin' => 'mobile_post');
     $this->BcAuth->loginRedirect = array('controller' => 'mobile_posts', 'action' => 'index', 'plugin' => 'mobile_post');
     $this->BcAuth->logoutRedirect = array('controller' => 'mobile_posts', 'action' => 'login', 'plugin' => 'mobile_post');
     //自動ログイン
     $userID = $this->BcAuth->user('id');
     if (empty($userID)) {
         $cookieData = $this->Cookie->read('BcAuth');
         if (!empty($cookieData)) {
             $loginData['User']['username'] = $cookieData['MobilePost']['username'];
             $loginData['User']['password'] = $cookieData['MobilePost']['password'];
             if ($this->BcAuth->login($loginData)) {
                 $this->Session->setFlash(__('ログインしました。'));
                 $this->redirect($this->BcAuth->redirect());
             }
         }
     }
     /* 表示設定 */
     //専用レイアウト適用
     $this->layout = 'MobilePost.mobile_post';
 }
 /**
  * beforeFilter
  *
  * @return	void
  * @access 	public
  */
 public function beforeFilter()
 {
     parent::beforeFilter();
 }