commit 304d523f157352bcc507b65e216f21bfc4b69756
Author: hasse <hasegawa@i-hearts.jp>
Date:   Wed Mar 16 22:22:42 2016 -0400

    バリデーションやログイン周り、CSSの修正

diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php
index 2ebbf4c..bb66114 100755
--- a/app/Controller/UsersController.php
+++ b/app/Controller/UsersController.php
@@ -117,13 +117,21 @@ class UsersController extends AppController {
 	public function activate( $user_id = null, $in_hash = null) {
 	    // UserモデルにIDをセット
 	    $this->User->id = $user_id;
+		$mail = $this->Session->read('register.User.email');
+
+		$options = array('conditions' => array('User.email' => $mail, 'User.status' => 1));
+		$user = $this->User->find('count', $options);
+		if($user > 0){
+	    // 本登録に無効なURL
+	        $this->Session->setFlash( 'このメールアドレスは登録済みです');
+			return $this->redirect(array('controller' => 'top', 'action' => 'error'));
+		}
 	    if ($this->User->exists() && $in_hash == $this->User->activationHash()) {
 	    // 本登録に有効なURL
 	        // statusフィールドを1に更新
 	        $this->User->saveField( 'status', 1);
 	        $this->Session->setFlash( 'Your account has been activated.');
 			
-			$mail = $this->Session->read('register.User.email');
 			// exit;
 
 			$Email = new CakeEmail();
@@ -215,7 +223,7 @@ class UsersController extends AppController {
  * @return void
  */
 	public function login() {
-		if($this->Auth->user()){
+		if($this->Auth->user('status') == 1){
 					$this->redirect('/users/login_top');                          
 		}
 		if ($this->request->is('post')) {
@@ -264,10 +272,10 @@ class UsersController extends AppController {
 			if($this->User->validates()){
 				$this->Session->write('register',$this->request->data);
 				$this->redirect(array('action'=>'reset_pwd_confirm'));
-			}else{
-				$this->Flash->loginerror('メールアドレスが一致しません。誤りがないかもう一度ご確認の上、正確にご入力ください。', array(
-				    'key' => 'positive',
-					));
+			// }else{
+			// 	$this->Flash->loginerror('メールアドレスが一致しません。誤りがないかもう一度ご確認の上、正確にご入力ください。', array(
+			// 	    'key' => 'positive',
+			// 		));
 			}
 		}
 	}
