} else {
$this->loginRedirect = Configure::read('Routing.basePath');
}
+
if ("/".$this->loginRedirect == Router::normalize(Configure::read('Routing.loginPath'))) {
$this->loginRedirect = Router::normalize(Configure::read('Routing.basePath'));
if (Configure::read('mobileUserAgent')) {
}
}
+ if (isset($this->user['User']['pcmail']) && !empty($this->user['User']['pcmail'])) {
+ $this->user['User']['pcmail'] = $this->Crypt->decrypt($this->user['User']['pcmail']);
+ }
+ $this->set('user', $this->user);
+
$this->pageTitle .= " - ". __('Regist Mail', true);
}
function edit_mail($code = null) {
if (empty($code)) {
- $this->Session->setFlash(__('Invalid URL.', true));
+ $this->Session->setFlash(__('Invalid URL.', true));
$this->redirect(array('controller' => 'users', 'action'=>'login'));
}
+
$registData = $this->{$this->modelClass}->getRegistData4code($code);
+
// $codeに該当するデータなし、user_idが異なる
if (empty($registData) || empty($registData['RegistMail']['user_id']) || $registData['RegistMail']['user_id'] != $this->user_id) {
$this->Session->setFlash(__('Invalid URL.', true));
$this->{$this->modelClass}->deleteRegistData4mail($registData['RegistMail']['mail']);
}
-
$this->redirect(array('controller' => 'users', 'action'=>'index'));
}
}
$fields = array('pcmail');
}
- // バリデーション
+ // validate
$data['User']['id'] = $this->user_id;
if ($this->User->save($data, array('fieldList' => $fields, 'validate' => false))) {
$this->{$this->modelClass}->deleteRegistData4mail($registData['RegistMail']['mail']);
msgstr "メールアドレス登録"
#: /views/regist_mails/add.ctp:
-msgid "Input your mail address."
-msgstr "メールアドレスを入力してください。"
+msgid "Change Mail"
+msgstr "メールアドレス変更"
+
+#: /views/regist_mails/add.ctp:
+msgid "Your Address"
+msgstr "現在のアドレス"
+
+#: /views/regist_mails/add.ctp:
+msgid "New address"
+msgstr "登録するアドレス"
#: /controllers/regist_mails_controller.php:
msgid "This Address has been registed."
return $this->RegistMail->deleteAll($conditions);
}
+ function deleteRegistData4user_id($user_id)
+ {
+ if (!$user_id) {
+ return null;
+ }
+
+ $this->RegistMail = CorePlus::set_model('RegistMail');
+ $conditions = array(
+ 'RegistMail.user_id' => $user_id,
+ );
+
+ return $this->RegistMail->deleteAll($conditions);
+ }
+
function isUniquePcMail($data)
{
// usersチェック
+<?php if ($this->action != 'regist_end'): ?>
<?php if (isset($site_configs['Site.outerHome']['value']) && $site_configs['Site.outerHome']['value']): ?>
<li><?php echo $html->link($site_configs['Site.outerHomeLinkname']['value'], $site_configs['Site.outerHome']['value']); ?>
<?php endif; ?>
<?php echo $html->link(__('Login', true), array('controller' => 'users', 'action' => 'login')); ?>
<?php endif; ?>
</li>
+<?php endif; ?>
\ No newline at end of file
<div class="registMails form">
<?php echo $form->create('RegistMail');?>
<fieldset>
-<legend><?php __('Regist Mail');?></legend>
-<?php
- echo $html->div('attention', __('Input your mail address.', true));
- echo $form->input('mail', array(
- 'label' => false,
- ));
- echo $token->create();
+<?php
+if (isset($user['User']['pcmail']) && !empty($user['User']['pcmail'])) {
+ echo $html->tag('legend', __('Change Mail', true));
+} else {
+ echo $html->tag('legend', __('Regist Mail', true));
+}
+
+if (isset($user['User']['pcmail']) && !empty($user['User']['pcmail'])) {
+ echo $html->div('input',
+ $html->tag('label',
+ __('Your Address', true),
+ array(
+ )
+ ).
+ $html->div('',
+ $user['User']['pcmail']
+ )
+ );
+}
+
+echo $form->input('mail', array(
+ 'label' => __('New address', true),
+));
+
+echo $token->create();
?>
</fieldset>
<?php echo $form->end(array('label' => __('Submit', true)));?>