mirror of
https://github.com/ad-aures/castopod.git
synced 2026-04-14 20:17:46 +02:00
refactor: rewrite form pages using form helper
- add installGateway to app config - update route names and groups - remove `author_name` and `author_email` from `episodes` table - remove `author_name` and `author_email` from `podcasts` table - remove `owner_id` + add `created_by` and `updated_by` fields in `podcasts` and `episodes` tables - remove unnecessary comments in database fields - remove confirm password inputs from auth forms for better ux - rename `pub_date` field to `published_at` and add publication time field in episode form closes #14, #28
This commit is contained in:
parent
012de2072e
commit
a1a28de702
59 changed files with 1580 additions and 1158 deletions
|
|
@ -70,10 +70,32 @@ class Contributor extends BaseController
|
|||
|
||||
public function add()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
$users = (new UserModel())->findAll();
|
||||
$userOptions = array_reduce(
|
||||
$users,
|
||||
function ($result, $user) {
|
||||
$result[$user->id] = $user->username;
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$roles = (new GroupModel())->getContributorRoles();
|
||||
$roleOptions = array_reduce(
|
||||
$roles,
|
||||
function ($result, $role) {
|
||||
$result[$role->id] = lang('Contributor.roles.' . $role->name);
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$data = [
|
||||
'podcast' => $this->podcast,
|
||||
'users' => (new UserModel())->findAll(),
|
||||
'roles' => (new GroupModel())->getContributorRoles(),
|
||||
'userOptions' => $userOptions,
|
||||
'roleOptions' => $roleOptions,
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
|
|
@ -97,11 +119,23 @@ class Contributor extends BaseController
|
|||
]);
|
||||
}
|
||||
|
||||
return redirect()->route('contributor_list', [$this->podcast->id]);
|
||||
return redirect()->route('contributor-list', [$this->podcast->id]);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
$roles = (new GroupModel())->getContributorRoles();
|
||||
$roleOptions = array_reduce(
|
||||
$roles,
|
||||
function ($result, $role) {
|
||||
$result[$role->id] = lang('Contributor.roles.' . $role->name);
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$data = [
|
||||
'podcast' => $this->podcast,
|
||||
'user' => $this->user,
|
||||
|
|
@ -109,7 +143,7 @@ class Contributor extends BaseController
|
|||
$this->user->id,
|
||||
$this->podcast->id
|
||||
),
|
||||
'roles' => (new GroupModel())->getContributorRoles(),
|
||||
'roleOptions' => $roleOptions,
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([
|
||||
|
|
@ -127,7 +161,7 @@ class Contributor extends BaseController
|
|||
$this->request->getPost('role')
|
||||
);
|
||||
|
||||
return redirect()->route('contributor_list', [$this->podcast->id]);
|
||||
return redirect()->route('contributor-list', [$this->podcast->id]);
|
||||
}
|
||||
|
||||
public function remove()
|
||||
|
|
|
|||
|
|
@ -86,6 +86,9 @@ class Episode extends BaseController
|
|||
'enclosure' => 'uploaded[enclosure]|ext_in[enclosure,mp3,m4a]',
|
||||
'image' =>
|
||||
'uploaded[image]|is_image[image]|ext_in[image,jpg,png]|permit_empty',
|
||||
'publication_date' => 'valid_date[Y-m-d]|permit_empty',
|
||||
'publication_time' =>
|
||||
'regex_match[/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/]|permit_empty',
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
|
|
@ -100,17 +103,20 @@ class Episode extends BaseController
|
|||
'title' => $this->request->getPost('title'),
|
||||
'slug' => $this->request->getPost('slug'),
|
||||
'enclosure' => $this->request->getFile('enclosure'),
|
||||
'pub_date' => $this->request->getPost('pub_date'),
|
||||
'description' => $this->request->getPost('description'),
|
||||
'image' => $this->request->getFile('image'),
|
||||
'explicit' => (bool) $this->request->getPost('explicit'),
|
||||
'explicit' => $this->request->getPost('explicit') == 'yes',
|
||||
'number' => $this->request->getPost('episode_number'),
|
||||
'season_number' => $this->request->getPost('season_number'),
|
||||
'type' => $this->request->getPost('type'),
|
||||
'author_name' => $this->request->getPost('author_name'),
|
||||
'author_email' => $this->request->getPost('author_email'),
|
||||
'block' => (bool) $this->request->getPost('block'),
|
||||
'block' => $this->request->getPost('block') == 'yes',
|
||||
'created_by' => user(),
|
||||
'updated_by' => user(),
|
||||
]);
|
||||
$newEpisode->setPublishedAt(
|
||||
$this->request->getPost('publication_date'),
|
||||
$this->request->getPost('publication_time')
|
||||
);
|
||||
|
||||
$episodeModel = new EpisodeModel();
|
||||
|
||||
|
|
@ -121,7 +127,7 @@ class Episode extends BaseController
|
|||
->with('errors', $episodeModel->errors());
|
||||
}
|
||||
|
||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||
return redirect()->route('episode-list', [$this->podcast->id]);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
|
|
@ -146,6 +152,9 @@ class Episode extends BaseController
|
|||
'uploaded[enclosure]|ext_in[enclosure,mp3,m4a]|permit_empty',
|
||||
'image' =>
|
||||
'uploaded[image]|is_image[image]|ext_in[image,jpg,png]|permit_empty',
|
||||
'publication_date' => 'valid_date[Y-m-d]|permit_empty',
|
||||
'publication_time' =>
|
||||
'regex_match[/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/]|permit_empty',
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
|
|
@ -157,17 +166,19 @@ class Episode extends BaseController
|
|||
|
||||
$this->episode->title = $this->request->getPost('title');
|
||||
$this->episode->slug = $this->request->getPost('slug');
|
||||
$this->episode->pub_date = $this->request->getPost('pub_date');
|
||||
$this->episode->description = $this->request->getPost('description');
|
||||
$this->episode->explicit = (bool) $this->request->getPost('explicit');
|
||||
$this->episode->explicit = $this->request->getPost('explicit') == 'yes';
|
||||
$this->episode->number = $this->request->getPost('episode_number');
|
||||
$this->episode->season_number = $this->request->getPost('season_number')
|
||||
? $this->request->getPost('season_number')
|
||||
: null;
|
||||
$this->episode->type = $this->request->getPost('type');
|
||||
$this->episode->author_name = $this->request->getPost('author_name');
|
||||
$this->episode->author_email = $this->request->getPost('author_email');
|
||||
$this->episode->block = (bool) $this->request->getPost('block');
|
||||
$this->episode->block = $this->request->getPost('block') == 'yes';
|
||||
$this->episode->setPublishedAt(
|
||||
$this->request->getPost('publication_date'),
|
||||
$this->request->getPost('publication_time')
|
||||
);
|
||||
$this->episode->updated_by = user();
|
||||
|
||||
$enclosure = $this->request->getFile('enclosure');
|
||||
if ($enclosure->isValid()) {
|
||||
|
|
@ -187,13 +198,13 @@ class Episode extends BaseController
|
|||
->with('errors', $episodeModel->errors());
|
||||
}
|
||||
|
||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||
return redirect()->route('episode-list', [$this->podcast->id]);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
(new EpisodeModel())->delete($this->episode->id);
|
||||
|
||||
return redirect()->route('episode_list', [$this->podcast->id]);
|
||||
return redirect()->route('episode-list', [$this->podcast->id]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ class Myaccount extends BaseController
|
|||
|
||||
public function changePassword()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
return view('admin/my_account/change_password');
|
||||
}
|
||||
|
||||
|
|
@ -31,10 +33,8 @@ class Myaccount extends BaseController
|
|||
// Validate here first, since some things,
|
||||
// like the password, can only be validated properly here.
|
||||
$rules = [
|
||||
'email' => 'required|valid_email',
|
||||
'password' => 'required',
|
||||
'new_password' => 'required|strong_password',
|
||||
'new_pass_confirm' => 'required|matches[new_password]',
|
||||
'new_password' => 'required|strong_password|differs[password]',
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
|
|
@ -53,7 +53,7 @@ class Myaccount extends BaseController
|
|||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $userModel->errors());
|
||||
->with('error', lang('MyAccount.messages.wrongPasswordError'));
|
||||
}
|
||||
|
||||
user()->password = $this->request->getPost('new_password');
|
||||
|
|
@ -68,7 +68,7 @@ class Myaccount extends BaseController
|
|||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('myAccount')
|
||||
->back()
|
||||
->with('message', lang('MyAccount.messages.passwordChangeSuccess'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ class Podcast extends BaseController
|
|||
public function list()
|
||||
{
|
||||
if (!has_permission('podcasts-list')) {
|
||||
return redirect()->route('my_podcasts');
|
||||
return redirect()->route('my-podcasts');
|
||||
}
|
||||
|
||||
$data = ['podcasts' => (new PodcastModel())->findAll()];
|
||||
|
|
@ -63,11 +63,30 @@ class Podcast extends BaseController
|
|||
{
|
||||
helper(['form', 'misc']);
|
||||
|
||||
$languageModel = new LanguageModel();
|
||||
$categoryModel = new CategoryModel();
|
||||
$categories = (new CategoryModel())->findAll();
|
||||
$languages = (new LanguageModel())->findAll();
|
||||
$languageOptions = array_reduce(
|
||||
$languages,
|
||||
function ($result, $language) {
|
||||
$result[$language->code] = $language->native_name;
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
$categoryOptions = array_reduce(
|
||||
$categories,
|
||||
function ($result, $category) {
|
||||
$result[$category->code] = lang(
|
||||
'Podcast.category_options.' . $category->code
|
||||
);
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$data = [
|
||||
'languages' => $languageModel->findAll(),
|
||||
'categories' => $categoryModel->findAll(),
|
||||
'languageOptions' => $languageOptions,
|
||||
'categoryOptions' => $categoryOptions,
|
||||
'browserLang' => get_browser_language(
|
||||
$this->request->getServer('HTTP_ACCEPT_LANGUAGE')
|
||||
),
|
||||
|
|
@ -99,17 +118,17 @@ class Podcast extends BaseController
|
|||
'image' => $this->request->getFile('image'),
|
||||
'language' => $this->request->getPost('language'),
|
||||
'category' => $this->request->getPost('category'),
|
||||
'explicit' => (bool) $this->request->getPost('explicit'),
|
||||
'author_name' => $this->request->getPost('author_name'),
|
||||
'author_email' => $this->request->getPost('author_email'),
|
||||
'owner' => user(),
|
||||
'explicit' => $this->request->getPost('explicit') == 'yes',
|
||||
'author' => $this->request->getPost('author'),
|
||||
'owner_name' => $this->request->getPost('owner_name'),
|
||||
'owner_email' => $this->request->getPost('owner_email'),
|
||||
'type' => $this->request->getPost('type'),
|
||||
'copyright' => $this->request->getPost('copyright'),
|
||||
'block' => (bool) $this->request->getPost('block'),
|
||||
'complete' => (bool) $this->request->getPost('complete'),
|
||||
'block' => $this->request->getPost('block') == 'yes',
|
||||
'complete' => $this->request->getPost('complete') == 'yes',
|
||||
'custom_html_head' => $this->request->getPost('custom_html_head'),
|
||||
'created_by' => user(),
|
||||
'updated_by' => user(),
|
||||
]);
|
||||
|
||||
$podcastModel = new PodcastModel();
|
||||
|
|
@ -136,17 +155,38 @@ class Podcast extends BaseController
|
|||
|
||||
$db->transComplete();
|
||||
|
||||
return redirect()->route('podcast_list');
|
||||
return redirect()->route('podcast-list');
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
$categories = (new CategoryModel())->findAll();
|
||||
$languages = (new LanguageModel())->findAll();
|
||||
$languageOptions = array_reduce(
|
||||
$languages,
|
||||
function ($result, $language) {
|
||||
$result[$language->code] = $language->native_name;
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
$categoryOptions = array_reduce(
|
||||
$categories,
|
||||
function ($result, $category) {
|
||||
$result[$category->code] = lang(
|
||||
'Podcast.category_options.' . $category->code
|
||||
);
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$data = [
|
||||
'podcast' => $this->podcast,
|
||||
'languages' => (new LanguageModel())->findAll(),
|
||||
'categories' => (new CategoryModel())->findAll(),
|
||||
'languageOptions' => $languageOptions,
|
||||
'categoryOptions' => $categoryOptions,
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([0 => $this->podcast->title]);
|
||||
|
|
@ -180,18 +220,18 @@ class Podcast extends BaseController
|
|||
}
|
||||
$this->podcast->language = $this->request->getPost('language');
|
||||
$this->podcast->category = $this->request->getPost('category');
|
||||
$this->podcast->explicit = (bool) $this->request->getPost('explicit');
|
||||
$this->podcast->author_name = $this->request->getPost('author_name');
|
||||
$this->podcast->author_email = $this->request->getPost('author_email');
|
||||
$this->podcast->explicit = $this->request->getPost('explicit') == 'yes';
|
||||
$this->podcast->author = $this->request->getPost('author');
|
||||
$this->podcast->owner_name = $this->request->getPost('owner_name');
|
||||
$this->podcast->owner_email = $this->request->getPost('owner_email');
|
||||
$this->podcast->type = $this->request->getPost('type');
|
||||
$this->podcast->copyright = $this->request->getPost('copyright');
|
||||
$this->podcast->block = (bool) $this->request->getPost('block');
|
||||
$this->podcast->complete = (bool) $this->request->getPost('complete');
|
||||
$this->podcast->block = $this->request->getPost('block') == 'yes';
|
||||
$this->podcast->complete = $this->request->getPost('complete') == 'yes';
|
||||
$this->podcast->custom_html_head = $this->request->getPost(
|
||||
'custom_html_head'
|
||||
);
|
||||
$this->updated_by = user();
|
||||
|
||||
$podcastModel = new PodcastModel();
|
||||
|
||||
|
|
@ -202,13 +242,13 @@ class Podcast extends BaseController
|
|||
->with('errors', $podcastModel->errors());
|
||||
}
|
||||
|
||||
return redirect()->route('podcast_list');
|
||||
return redirect()->route('podcast-list');
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
(new PodcastModel())->delete($this->podcast->id);
|
||||
|
||||
return redirect()->route('podcast_list');
|
||||
return redirect()->route('podcast-list');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ class User extends BaseController
|
|||
|
||||
public function create()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
$data = [
|
||||
'roles' => (new GroupModel())->getUserRoles(),
|
||||
];
|
||||
|
|
@ -65,7 +67,6 @@ class User extends BaseController
|
|||
[
|
||||
'email' => 'required|valid_email|is_unique[users.email]',
|
||||
'password' => 'required|strong_password',
|
||||
'pass_confirm' => 'required|matches[password]',
|
||||
]
|
||||
);
|
||||
|
||||
|
|
@ -94,7 +95,7 @@ class User extends BaseController
|
|||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('user_list')
|
||||
->route('user-list')
|
||||
->with(
|
||||
'message',
|
||||
lang('User.messages.createSuccess', [
|
||||
|
|
@ -105,9 +106,21 @@ class User extends BaseController
|
|||
|
||||
public function edit()
|
||||
{
|
||||
helper('form');
|
||||
|
||||
$roles = (new GroupModel())->getUserRoles();
|
||||
$roleOptions = array_reduce(
|
||||
$roles,
|
||||
function ($result, $role) {
|
||||
$result[$role->name] = lang('User.roles.' . $role->name);
|
||||
return $result;
|
||||
},
|
||||
[]
|
||||
);
|
||||
|
||||
$data = [
|
||||
'user' => $this->user,
|
||||
'roles' => (new GroupModel())->getUserRoles(),
|
||||
'roleOptions' => $roleOptions,
|
||||
];
|
||||
|
||||
replace_breadcrumb_params([0 => $this->user->username]);
|
||||
|
|
@ -123,7 +136,7 @@ class User extends BaseController
|
|||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('user_list')
|
||||
->route('user-list')
|
||||
->with(
|
||||
'message',
|
||||
lang('User.messages.rolesEditSuccess', [
|
||||
|
|
@ -145,7 +158,7 @@ class User extends BaseController
|
|||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('user_list')
|
||||
->route('user-list')
|
||||
->with(
|
||||
'message',
|
||||
lang('User.messages.forcePassResetSuccess', [
|
||||
|
|
@ -178,7 +191,7 @@ class User extends BaseController
|
|||
}
|
||||
|
||||
return redirect()
|
||||
->route('user_list')
|
||||
->route('user-list')
|
||||
->with(
|
||||
'message',
|
||||
lang('User.messages.banSuccess', [
|
||||
|
|
@ -199,7 +212,7 @@ class User extends BaseController
|
|||
}
|
||||
|
||||
return redirect()
|
||||
->route('user_list')
|
||||
->route('user-list')
|
||||
->with(
|
||||
'message',
|
||||
lang('User.messages.unbanSuccess', [
|
||||
|
|
|
|||
167
app/Controllers/Auth.php
Normal file
167
app/Controllers/Auth.php
Normal file
|
|
@ -0,0 +1,167 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @copyright 2020 Podlibre
|
||||
* @license https://www.gnu.org/licenses/agpl-3.0.en.html AGPL3
|
||||
* @link https://castopod.org/
|
||||
*/
|
||||
|
||||
namespace App\Controllers;
|
||||
|
||||
use App\Entities\User;
|
||||
|
||||
class Auth extends \Myth\Auth\Controllers\AuthController
|
||||
{
|
||||
/**
|
||||
* Attempt to register a new user.
|
||||
*/
|
||||
public function attemptRegister()
|
||||
{
|
||||
// Check if registration is allowed
|
||||
if (!$this->config->allowRegistration) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('error', lang('Auth.registerDisabled'));
|
||||
}
|
||||
|
||||
$users = model('UserModel');
|
||||
|
||||
// Validate here first, since some things,
|
||||
// like the password, can only be validated properly here.
|
||||
$rules = [
|
||||
'username' =>
|
||||
'required|alpha_numeric_space|min_length[3]|is_unique[users.username]',
|
||||
'email' => 'required|valid_email|is_unique[users.email]',
|
||||
'password' => 'required|strong_password',
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', service('validation')->getErrors());
|
||||
}
|
||||
|
||||
// Save the user
|
||||
$allowedPostFields = array_merge(
|
||||
['password'],
|
||||
$this->config->validFields,
|
||||
$this->config->personalFields
|
||||
);
|
||||
$user = new User($this->request->getPost($allowedPostFields));
|
||||
|
||||
$this->config->requireActivation !== false
|
||||
? $user->generateActivateHash()
|
||||
: $user->activate();
|
||||
|
||||
// Ensure default group gets assigned if set
|
||||
if (!empty($this->config->defaultUserGroup)) {
|
||||
$users = $users->withGroup($this->config->defaultUserGroup);
|
||||
}
|
||||
|
||||
if (!$users->save($user)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $users->errors());
|
||||
}
|
||||
|
||||
if ($this->config->requireActivation !== false) {
|
||||
$activator = service('activator');
|
||||
$sent = $activator->send($user);
|
||||
|
||||
if (!$sent) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with(
|
||||
'error',
|
||||
$activator->error() ?? lang('Auth.unknownError')
|
||||
);
|
||||
}
|
||||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('login')
|
||||
->with('message', lang('Auth.activationSuccess'));
|
||||
}
|
||||
|
||||
// Success!
|
||||
return redirect()
|
||||
->route('login')
|
||||
->with('message', lang('Auth.registerSuccess'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies the code with the email and saves the new password,
|
||||
* if they all pass validation.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function attemptReset()
|
||||
{
|
||||
if ($this->config->activeResetter === false) {
|
||||
return redirect()
|
||||
->route('login')
|
||||
->with('error', lang('Auth.forgotDisabled'));
|
||||
}
|
||||
|
||||
$users = model('UserModel');
|
||||
|
||||
// First things first - log the reset attempt.
|
||||
$users->logResetAttempt(
|
||||
$this->request->getPost('email'),
|
||||
$this->request->getPost('token'),
|
||||
$this->request->getIPAddress(),
|
||||
(string) $this->request->getUserAgent()
|
||||
);
|
||||
|
||||
$rules = [
|
||||
'token' => 'required',
|
||||
'email' => 'required|valid_email',
|
||||
'password' => 'required|strong_password',
|
||||
];
|
||||
|
||||
if (!$this->validate($rules)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('errors', $users->errors());
|
||||
}
|
||||
|
||||
$user = $users
|
||||
->where('email', $this->request->getPost('email'))
|
||||
->where('reset_hash', $this->request->getPost('token'))
|
||||
->first();
|
||||
|
||||
if (is_null($user)) {
|
||||
return redirect()
|
||||
->back()
|
||||
->with('error', lang('Auth.forgotNoUser'));
|
||||
}
|
||||
|
||||
// Reset token still valid?
|
||||
if (
|
||||
!empty($user->reset_expires) &&
|
||||
time() > $user->reset_expires->getTimestamp()
|
||||
) {
|
||||
return redirect()
|
||||
->back()
|
||||
->withInput()
|
||||
->with('error', lang('Auth.resetTokenExpired'));
|
||||
}
|
||||
|
||||
// Success! Save the new password, and cleanup the reset hash.
|
||||
$user->password = $this->request->getPost('password');
|
||||
$user->reset_hash = null;
|
||||
$user->reset_at = date('Y-m-d H:i:s');
|
||||
$user->reset_expires = null;
|
||||
$user->force_pass_reset = false;
|
||||
$users->save($user);
|
||||
|
||||
return redirect()
|
||||
->route('login')
|
||||
->with('message', lang('Auth.resetSuccess'));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue