リビジョン 26d1f852
app/Controller/UsersController.php | ||
---|---|---|
14 | 14 |
|
15 | 15 |
public function beforeFilter() { |
16 | 16 |
parent::beforeFilter(); |
17 |
$this->Auth->allow('register','activate','confirm','sent','login','reset_pwd','reset_pwd_confirm','reset_pwd_sent','newpwd','reset_pwd_comp_mail'); |
|
17 |
$this->Auth->allow('register','activate','confirm','sent','login','reset_pwd','reset_pwd_confirm','reset_pwd_sent','newpwd','reset_pwd_comp_mail','withdraw_comp');
|
|
18 | 18 |
} |
19 | 19 |
|
20 | 20 |
/** |
... | ... | |
189 | 189 |
* register confirm |
190 | 190 |
*/ |
191 | 191 |
public function withdraw_check() { |
192 |
if (!$this->User->exists()) { |
|
193 |
return $this->redirect(array('controller' => 'top','action' => 'index')); |
|
194 |
} |
|
192 |
// if (!$this->User->exists()) {
|
|
193 |
// return $this->redirect(array('controller' => 'top','action' => 'index'));
|
|
194 |
// }
|
|
195 | 195 |
} |
196 | 196 |
|
197 | 197 |
/** |
... | ... | |
201 | 201 |
* @param string $id |
202 | 202 |
* @return void |
203 | 203 |
*/ |
204 |
public function withdraw_comp($id = null) { |
|
205 |
$this->User->id = $id; |
|
206 |
if (!$this->User->exists()) { |
|
207 |
throw new NotFoundException(__('Invalid user')); |
|
208 |
} |
|
209 |
$this->request->allowMethod('post', 'delete'); |
|
210 |
// statusフィールドを1に更新 |
|
211 |
$this->User->saveField( 'status', 0); |
|
212 |
return $this->redirect(array('controller' => 'top','action' => 'index')); |
|
213 |
// if ($this->User->delete()) { |
|
214 |
// $this->Flash->success(__('The user has been deleted.')); |
|
215 |
// } else { |
|
216 |
// $this->Flash->error(__('The user could not be deleted. Please, try again.')); |
|
217 |
// } |
|
218 |
// return $this->redirect(array('action' => 'index')); |
|
204 |
public function withdraw_comp() { |
|
205 |
$this->User->id = $this->Auth->user('id'); |
|
206 |
$this->User->saveField( 'status', 0); |
|
207 |
$this->Session->write('Auth', $user); |
|
219 | 208 |
} |
220 | 209 |
|
221 | 210 |
/** |
... | ... | |
227 | 216 |
*/ |
228 | 217 |
public function login() { |
229 | 218 |
if($this->Auth->user()){ |
230 |
// $this->redirect($this->Auth->redirectUrl()); |
|
231 | 219 |
$this->redirect('/users/login_top'); |
232 | 220 |
} |
233 | 221 |
if ($this->request->is('post')) { |
app/View/users/login_top.ctp | ||
---|---|---|
15 | 15 |
<section class="howto"> |
16 | 16 |
<p class="howto_btn"><a href="/top/howto"><img src="/img/img_arrow_top04.png">PictCodeの使い方</a></p> |
17 | 17 |
</section> |
18 |
<section> |
|
19 |
<p class="withdraw">退会は<a href="withdraw_check">コチラ</a></p> |
|
20 |
</section> |
|
18 | 21 |
</article> |
19 | 22 |
</main> |
20 | 23 |
|
app/View/users/withdraw_check.ctp | ||
---|---|---|
8 | 8 |
<p>退会処理を行いますと、今まで作成し保存されたプログラミングのデータが全て削除されてしまいます。</p> |
9 | 9 |
<p>本当に退会してもよろしいですか?</p> |
10 | 10 |
<section class="button_area01"> |
11 |
<a href="/top/index"><p class="button btn_back01"></p></a>
|
|
12 |
<a href="/top/withdraw_comp/"><p class="button btn_withdraw01"></p></a>
|
|
11 |
<a href="javascript:history.back();"><p class="button btn_back01"></p></a>
|
|
12 |
<a href="withdraw_comp"><p class="button btn_withdraw01"></p></a>
|
|
13 | 13 |
</section> |
14 | 14 |
</article> |
15 | 15 |
</main> |
app/View/users/withdraw_comp.ctp | ||
---|---|---|
10 | 10 |
<img src="/img/img_img_withdraw.png"> |
11 | 11 |
</section> |
12 | 12 |
<section class="button_area01"> |
13 |
<a href="index.html"><p class="button btn_top02"></p></a>
|
|
13 |
<a href="/top/index"><p class="button btn_top02"></p></a>
|
|
14 | 14 |
</section> |
15 | 15 |
</article> |
16 | 16 |
</main> |
app/webroot/css/main.css | ||
---|---|---|
863 | 863 |
section p.withdraw { |
864 | 864 |
display: block; |
865 | 865 |
float: right; |
866 |
margin:-60px 0 0;
|
|
866 |
margin:-30px 0 0;
|
|
867 | 867 |
font-weight: bold; |
868 | 868 |
font-size: 14px !important; |
869 | 869 |
} |
他の形式にエクスポート: Unified diff