commit 04e657a75b821f893c6ddacb39f018ca408978f1
Author: root <root@localhost.localdomain>
Date:   Tue Mar 1 07:56:06 2016 -0500

    ユーザー登録機能実装

diff --git a/app/Model/User.php b/app/Model/User.php
index 69ffbdf..1ec00e2 100755
--- a/app/Model/User.php
+++ b/app/Model/User.php
@@ -28,16 +28,26 @@ class User extends AppModel {
 				//'on' => 'create', // Limit validation to 'create' or 'update' operations
 			),
 		),
-		'password' => array(
-			'notBlank' => array(
-				'rule' => array('notBlank'),
-				//'message' => 'Your custom message here',
-				//'allowEmpty' => false,
-				//'required' => false,
-				//'last' => false, // Stop validation after this rule
-				//'on' => 'create', // Limit validation to 'create' or 'update' operations
-			),
-		),
+        'email' => array(
+            // メールアドレスであること。
+            'validEmail' => array( 'rule' => array( 'email', true), 'message' => 'アドレスを入力して下さい'),
+            // 一意性チェック
+            // 'emailExists' => array( 'rule' => 'isUnique', 'message' => '既に登録されています'),
+        ),
+        'password' => array(
+             // パスワード・確認用パスワードの一致
+             'match' => array( 'rule' => array( 'confirmPassword', 'password_confirm'), 'message' => '一致しません'),
+        ),
+		// 'password' => array(
+		// 	'notBlank' => array(
+		// 		'rule' => array('notBlank'),
+		// 		//'message' => 'Your custom message here',
+		// 		//'allowEmpty' => false,
+		// 		//'required' => false,
+		// 		//'last' => false, // Stop validation after this rule
+		// 		//'on' => 'create', // Limit validation to 'create' or 'update' operations
+		// 	),
+		// ),
 		'status' => array(
 			'numeric' => array(
 				'rule' => array('numeric'),
@@ -51,6 +61,25 @@ class User extends AppModel {
 	);
 
 
+
+    public function confirmPassword( $field, $password_confirm) {
+        if ($field['password'] === $this->data[$this->name][$password_confirm]) {
+            // パスワードハッシュ化
+            $this->data[$this->name]['password'] = Security::hash( $plain, 'sha512', true);
+            return true;
+        }
+    }
+
+	public function getActivationHash() {
+	    // ユーザIDの有無確認
+	    if (!isset($this->id)) {
+	        return false;
+	    }
+	    // 更新日時をハッシュ化
+	    return Security::hash( $this->field('updated'), 'md5', true);
+	}
+
+
 	public function beforeSave($options = array()) {
 	    if (isset($this->data[$this->alias]['password'])) {
 	        $passwordHasher = new BlowfishPasswordHasher();
