commit 16e57cae68f57ca57a9efadd7f41c82be8cc5223
Author: hasse <hasegawa@i-hearts.jp>
Date:   Fri Mar 11 01:01:53 2016 -0500

    パスワード再設定100％

diff --git a/app/Model/User.php b/app/Model/User.php
index 7c6022e..2b83efb 100755
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -19,9 +19,15 @@ class User extends AppModel {
  */
 	public $validate = array(
 		'login_id' => array(
+            array(
 				'rule' => array('notBlank'),
                 'message' => 'この項目は入力必須です'
 			),
+            array( 
+                'rule' => 'isUnique', 
+                'message' => '既に登録されています'
+            ),
+        ),
         'email' => array(
         	array(
 				'rule' => array('notBlank'),
@@ -133,11 +139,11 @@ class User extends AppModel {
             ), 
         ),
 	);
-	public $new_pwd_validate = array(
+    public $new_pwd_validate = array(
 
         'password' => array(
             array(
-				'rule' => array('notBlank'),
+                'rule' => array('notBlank'),
                 'message' => 'パスワードを入力してください'
             ), 
             array(
@@ -151,11 +157,28 @@ class User extends AppModel {
         ),
         'password_confirm' => array(
             array(
-				'rule' => array('notBlank'),
+                'rule' => array('notBlank'),
                 'message' => 'パスワード(確認)を入力してください'
             ), 
         ),
-	);
+    );
+    public $reset_pwd_comp_mail_validate = array(
+
+        'password' => array(
+            array(
+                'rule' => array('notBlank'),
+                'message' => 'パスワードを入力してください'
+            ), 
+            array(
+                'rule' => array('minLength', 8), 
+                'message' => 'パスワードは8文字以上入力してください', 
+            ),
+        ),
+    );
+
+
+
+
 	public function DuplicateEmailCheck(){
 		$query = array('conditions' => array('User.email' => $this->data['User']['email'],'User.status' => 1));
 		$num = $this->find('count',$query);
@@ -189,14 +212,28 @@ class User extends AppModel {
 
     }
 
-	public function getActivationHash() {
-	    // ユーザIDの有無確認
-	    if (!isset($this->id)) {
-	        return false;
-	    }
-	    // 更新日時をハッシュ化
-	    return Security::hash( $this->field('updated'), 'md5', true);
-	}
+    public function activationHash() {
+        // ユーザIDの有無確認
+        
+        if (!isset($this->id)) {
+            return false;
+        }
+        // 更新日時をハッシュ化
+        // return Security::hash( $user_id['User']['updated'], 'md5', true);
+        return Security::hash( $this->field('updated'), 'md5', true);
+    }
+    public function getActivationHash($id) {
+        // ユーザIDの有無確認
+        $query = array('conditions' => array('User.id' => $id));
+        $user_id = $this->find('first',$query);
+        if (!isset($user_id['User']['id'])) {
+        // if (!isset($this->id)) {
+            return false;
+        }
+        // 更新日時をハッシュ化
+        return Security::hash( $user_id['User']['updated'], 'md5', true);
+        // return Security::hash( $this->field('updated'), 'md5', true);
+    }
 
 
 	//メールアドレスが登録されていない、またはメールアドレスのstatusが１ではない場合、エラーを出す
