リビジョン 8fa10255
| app/Config/bootstrap.php | ||
|---|---|---|
| 90 | 90 |
* |
| 91 | 91 |
* )); |
| 92 | 92 |
*/ |
| 93 |
|
|
| 94 |
|
|
| 95 |
// define定義 |
|
| 96 |
config('const');
|
|
| 97 |
|
|
| 98 |
|
|
| 99 |
|
|
| 100 |
|
|
| 101 |
|
|
| 102 |
|
|
| 93 | 103 |
Configure::write('Recaptcha.publicKey', 'your-public-api-key');
|
| 94 | 104 |
Configure::write('Recaptcha.privateKey', 'your-private-api-key');
|
| 95 | 105 |
Configure::write('Dispatcher.filters', array(
|
| app/Config/const.php | ||
|---|---|---|
| 1 |
<?php |
|
| 2 |
|
|
| 3 |
// カラーミーのOAuth |
|
| 4 |
define("MAIL_FROM", "hasegawa@i-hearts.jp");
|
|
| 5 |
|
|
| 6 |
|
|
| 7 |
?> |
|
| app/Config/core.php | ||
|---|---|---|
| 215 | 215 |
* the cake shell command: cake schema create Sessions |
| 216 | 216 |
*/ |
| 217 | 217 |
Configure::write('Session', array(
|
| 218 |
'defaults' => 'database'
|
|
| 218 |
'defaults' => 'php'
|
|
| 219 | 219 |
)); |
| 220 | 220 |
|
| 221 | 221 |
/** |
| app/Controller/AppController.php | ||
|---|---|---|
| 60 | 60 |
'passwordHasher' => 'Blowfish' |
| 61 | 61 |
) |
| 62 | 62 |
), |
| 63 |
'flash' => array( |
|
| 64 |
'element' => 'alert', |
|
| 65 |
'key' => 'auth', |
|
| 66 |
'params' => array( |
|
| 67 |
'plugin' => 'BoostCake', |
|
| 68 |
'class' => 'alert-error' |
|
| 69 |
) |
|
| 70 |
) |
|
| 63 |
// 'flash' => array(
|
|
| 64 |
// 'element' => 'alert',
|
|
| 65 |
// 'key' => 'auth',
|
|
| 66 |
// 'params' => array(
|
|
| 67 |
// 'plugin' => 'BoostCake',
|
|
| 68 |
// 'class' => 'alert-error'
|
|
| 69 |
// )
|
|
| 70 |
// )
|
|
| 71 | 71 |
) |
| 72 | 72 |
); |
| 73 |
public function beforeFilter() {
|
|
| 74 |
// $this->Auth->allow('index', 'view');
|
|
| 75 |
} |
|
| 76 |
|
|
| 73 | 77 |
} |
| app/Controller/TopController.php | ||
|---|---|---|
| 114 | 114 |
$Email->emailFormat('text');
|
| 115 | 115 |
$Email->template('user_contact');
|
| 116 | 116 |
$Email->viewVars(array('name'=>$name,'comment'=>$comment));
|
| 117 |
$Email->from('yano@i-hearts.jp');
|
|
| 117 |
$Email->from( MAIL_FROM );
|
|
| 118 | 118 |
$Email->to($mail); |
| 119 | 119 |
$Email->subject('[PICT CODE]問い合わせ');
|
| 120 | 120 |
$Email->send(); |
| 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 |
} |
| app/Model/User.php | ||
|---|---|---|
| 88 | 88 |
public function passwordConfirm($check){
|
| 89 | 89 |
//2つのパスワードフィールドが一致する事を確認する |
| 90 | 90 |
if($this->data['User']['password'] === $this->data['User']['password_confirm']){
|
| 91 |
// パスワードハッシュ化 |
|
| 92 |
$this->data[$this->name]['password'] = Security::hash( $password, 'sha512', true); |
|
| 93 | 91 |
return true; |
| 94 | 92 |
}else{
|
| 95 | 93 |
return false; |
| app/webroot/css/main.css | ||
|---|---|---|
| 661 | 661 |
-moz-border-radius: 5px; |
| 662 | 662 |
border-radius: 5px; |
| 663 | 663 |
} |
| 664 |
article.contact dl dd div input span, |
|
| 665 |
article.contact dl dd div textarea span{
|
|
| 666 |
margin: 0 0 0 120px; |
|
| 667 |
} |
|
| 664 | 668 |
|
| 665 | 669 |
article.contact dl dd textarea {
|
| 666 | 670 |
height: 180px; |
他の形式にエクスポート: Unified diff