DEV: Изменение Email (3 часть)
This commit is contained in:
parent
2ad4923de9
commit
766c17f3c6
|
@ -63,10 +63,11 @@ class SettingController extends Controller
|
|||
Request::getResources()->addBottomScript('/assets/js/dialog/dialog.js');
|
||||
|
||||
$new = SettingModel::getNewEmail();
|
||||
$email = $new['email'] ?? null;
|
||||
|
||||
if($code = Request::getGet('newemail')) {
|
||||
if (SettingModel::available($code)) {
|
||||
SettingModel::editEmail($new['email']);
|
||||
SettingModel::editEmail($email);
|
||||
|
||||
is_return(__('msg.change_saved'), 'success', url('setting'));
|
||||
}
|
||||
|
@ -78,7 +79,7 @@ class SettingController extends Controller
|
|||
'meta' => Meta::get(__('app.setting')),
|
||||
'data' => [
|
||||
'user' => UserModel::getUser($this->user['login'], 'slug'),
|
||||
'new_email' => $new['email'],
|
||||
'new_email' => $email,
|
||||
]
|
||||
]
|
||||
);
|
||||
|
@ -212,7 +213,6 @@ class SettingController extends Controller
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
function ignored()
|
||||
{
|
||||
return $this->render(
|
||||
|
@ -250,7 +250,6 @@ class SettingController extends Controller
|
|||
return json_encode('error');
|
||||
}
|
||||
|
||||
|
||||
if (is_array(AuthModel::checkRepetitions($email, 'email'))) {
|
||||
return json_encode('repeat');
|
||||
}
|
||||
|
@ -260,7 +259,8 @@ class SettingController extends Controller
|
|||
SettingModel::setNewEmail($email, $code);
|
||||
|
||||
SendEmail::mailText($this->user['id'], 'new.email', ['link' => '/setting?newemail=' . $code]);
|
||||
|
||||
|
||||
return json_encode('success');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ class SendEmail
|
|||
$result = $mailSMTP->send($email, $subject, $message, $from);
|
||||
|
||||
if ($result === true) {
|
||||
echo "Done";
|
||||
return true;
|
||||
} else {
|
||||
throw AutorizationException::Smtp("Error - " . $result);
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
var color = 'green';
|
||||
}
|
||||
|
||||
Notice(text, 3500, {
|
||||
Notice(text, 4500, {
|
||||
valign: 'bottom',
|
||||
align: 'center',
|
||||
styles: {
|
||||
|
@ -75,12 +75,12 @@
|
|||
}
|
||||
});
|
||||
|
||||
reload();
|
||||
reload();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function reload(){
|
||||
function reload(){
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
}, 1500)
|
||||
|
|
Loading…
Reference in a new issue