commit 26d1f8520bc3fbcda60041a5d50998258600863a
Author: hasse <hasegawa@i-hearts.jp>
Date:   Fri Mar 11 06:28:02 2016 -0500

    退会機能完了

diff --git a/app/Controller/UsersController.php b/app/Controller/UsersController.php
index 13ed82d..2ebbf4c 100755
--- a/app/Controller/UsersController.php
+++ b/app/Controller/UsersController.php
@@ -14,7 +14,7 @@ class UsersController extends AppController {
 
     public function beforeFilter() {
         parent::beforeFilter();
-        $this->Auth->allow('register','activate','confirm','sent','login','reset_pwd','reset_pwd_confirm','reset_pwd_sent','newpwd','reset_pwd_comp_mail');
+        $this->Auth->allow('register','activate','confirm','sent','login','reset_pwd','reset_pwd_confirm','reset_pwd_sent','newpwd','reset_pwd_comp_mail','withdraw_comp');
     }
 
 /**
@@ -189,9 +189,9 @@ class UsersController extends AppController {
  * register confirm
  */
 	public function withdraw_check() {
-		if (!$this->User->exists()) {
-			return $this->redirect(array('controller' => 'top','action' => 'index'));
-		}
+		// if (!$this->User->exists()) {
+		// 	return $this->redirect(array('controller' => 'top','action' => 'index'));
+		// }
 	}
 
 /**
@@ -201,21 +201,10 @@ class UsersController extends AppController {
  * @param string $id
  * @return void
  */
-	public function withdraw_comp($id = null) {
-		$this->User->id = $id;
-		if (!$this->User->exists()) {
-			throw new NotFoundException(__('Invalid user'));
-		}
-		$this->request->allowMethod('post', 'delete');
-			// statusフィールドを1に更新
-	        $this->User->saveField( 'status', 0);
-			return $this->redirect(array('controller' => 'top','action' => 'index'));
-		// if ($this->User->delete()) {
-		// 	$this->Flash->success(__('The user has been deleted.'));
-		// } else {
-		// 	$this->Flash->error(__('The user could not be deleted. Please, try again.'));
-		// }
-		// return $this->redirect(array('action' => 'index'));
+	public function withdraw_comp() {
+	    $this->User->id = $this->Auth->user('id');
+	    $this->User->saveField( 'status', 0);
+	    $this->Session->write('Auth', $user);
 	}
 
 /**
@@ -227,7 +216,6 @@ class UsersController extends AppController {
  */
 	public function login() {
 		if($this->Auth->user()){
-			// $this->redirect($this->Auth->redirectUrl());                          
 					$this->redirect('/users/login_top');                          
 		}
 		if ($this->request->is('post')) {
diff --git a/app/View/users/login_top.ctp b/app/View/users/login_top.ctp
index 2bb9ae2..2f36ae0 100755
--- a/app/View/users/login_top.ctp
+++ b/app/View/users/login_top.ctp
@@ -15,6 +15,9 @@
 			<section class="howto">
 				<p class="howto_btn"><a href="/top/howto"><img src="/img/img_arrow_top04.png">PictCodeの使い方</a></p>
 			</section>
+			<section>
+			<p class="withdraw">退会は<a href="withdraw_check">コチラ</a></p>
+			</section>
 		</article>
 	</main>
 
diff --git a/app/View/users/withdraw_check.ctp b/app/View/users/withdraw_check.ctp
index 46b1e95..8786573 100755
--- a/app/View/users/withdraw_check.ctp
+++ b/app/View/users/withdraw_check.ctp
@@ -8,8 +8,8 @@
 				<p>退会処理を行いますと、今まで作成し保存されたプログラミングのデータが全て削除されてしまいます。</p>
 				<p>本当に退会してもよろしいですか？</p>
 			<section class="button_area01">
-				<a href="/top/index"><p class="button btn_back01"></p></a>
-				<a href="/top/withdraw_comp/"><p class="button btn_withdraw01"></p></a>
+				<a href="javascript:history.back();"><p class="button btn_back01"></p></a>
+				<a href="withdraw_comp"><p class="button btn_withdraw01"></p></a>
 			</section>
 		</article>
 	</main>
\ No newline at end of file
diff --git a/app/View/users/withdraw_comp.ctp b/app/View/users/withdraw_comp.ctp
index 7fc5542..e2b3845 100755
--- a/app/View/users/withdraw_comp.ctp
+++ b/app/View/users/withdraw_comp.ctp
@@ -10,7 +10,7 @@
 				<img src="/img/img_img_withdraw.png">
 			</section>
 			<section class="button_area01">
-				<a href="index.html"><p class="button btn_top02"></p></a>
+				<a href="/top/index"><p class="button btn_top02"></p></a>
 			</section>
 		</article>
 	</main>
\ No newline at end of file
diff --git a/app/webroot/css/main.css b/app/webroot/css/main.css
index bc7e684..2023278 100755
--- a/app/webroot/css/main.css
+++ b/app/webroot/css/main.css
@@ -863,7 +863,7 @@ section.howto p.howto_btn:hover{
 section p.withdraw {
 	display: block;
 	float: right;
-	margin:-60px 0 0;
+	margin:-30px 0 0;
 	font-weight: bold;
 	font-size: 14px !important;
 }
