リビジョン 8fa10255 app/Controller/UsersController.php
app/Controller/UsersController.php | ||
---|---|---|
14 | 14 |
|
15 | 15 |
public function beforeFilter() { |
16 | 16 |
parent::beforeFilter(); |
17 |
$this->Auth->allow('register','activate','confirm','sent','login'); |
|
17 |
$this->Auth->allow('register','activate','confirm','sent','login','index');
|
|
18 | 18 |
} |
19 | 19 |
|
20 | 20 |
/** |
... | ... | |
103 | 103 |
$Email->emailFormat('text'); |
104 | 104 |
$Email->template('user_register'); |
105 | 105 |
$Email->viewVars(array('name'=>$name,'comment'=>$comment)); |
106 |
$Email->from('hasegawa@i-hearts.jp');
|
|
106 |
$Email->from( MAIL_FROM ); //MAIL_FROM:Config/const.phpにて定義
|
|
107 | 107 |
$Email->to($mail); |
108 | 108 |
$Email->subject('[PICT CODE]問い合わせ'); |
109 | 109 |
$Email->send(); |
... | ... | |
119 | 119 |
$this->User->id = $user_id; |
120 | 120 |
if ($this->User->exists() && $in_hash == $this->User->getActivationHash()) { |
121 | 121 |
// 本登録に有効なURL |
122 |
// statusフィールドを0に更新
|
|
123 |
$this->User->saveField( 'status', 0);
|
|
122 |
// statusフィールドを1に更新
|
|
123 |
$this->User->saveField( 'status', 1);
|
|
124 | 124 |
$this->Session->setFlash( 'Your account has been activated.'); |
125 | 125 |
}else{ |
126 | 126 |
// 本登録に無効なURL |
... | ... | |
204 | 204 |
} |
205 | 205 |
if ($this->request->is('post')) { |
206 | 206 |
if ($this->Auth->login()) { |
207 |
$this->redirect('/Users/login_top'); |
|
207 |
// var_dump($this->Auth->login('User.status')); |
|
208 |
// exit; |
|
209 |
if($this->Auth->user('User.status') == 1){ |
|
210 |
$this->redirect('/Users/login_top'); |
|
211 |
}else{ |
|
212 |
$this->Flash->loginerror('まだ本登録が完了していません。送られてきたメールを見てね!', array( |
|
213 |
'key' => 'positive', |
|
214 |
)); |
|
215 |
} |
|
208 | 216 |
} else { |
209 | 217 |
$this->Flash->loginerror('ニックネームか パスワードにまちがいが あるよ!', array( |
210 | 218 |
'key' => 'positive', |
211 | 219 |
)); |
212 |
//$this->Flash->error(__('error')); |
|
213 |
// $this->Flash->error(__('<section class="caution"><p>ニックネームか パスワードに<br>まちがいが あるよ!</p></section>')); |
|
214 | 220 |
} |
215 | 221 |
} |
216 | 222 |
} |
他の形式にエクスポート: Unified diff