Browse Source
- updated languages (added infoRemindSuccess & infoResetSuccess) - added en/Account language - added Account/Remind_password & Account/Reset_password Controllers & Views - updated Account/Login & Account/Register Controllers & Views - renamed views Aauth/Reset & Aauth/ResetSuccess to Aauth/RemindPassword & Aauth/ResetPassword - updated LoginTokenModel - updated Libraries/Aauth - updated Config/Aauthv3-dev
24 changed files with 619 additions and 297 deletions
@ -0,0 +1,71 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make |
||||||
|
* easy some essential jobs such as login, permissions and access operations. |
||||||
|
* Despite ease of use, it has also very advanced features like groupping, |
||||||
|
* access management, public access etc.. |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* @author Magefly Team |
||||||
|
* @copyright 2014-2017 Emre Akay |
||||||
|
* @copyright 2018 Magefly |
||||||
|
* @license https://opensource.org/licenses/MIT MIT License |
||||||
|
* @link https://github.com/magefly/CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace App\Controllers\Account; |
||||||
|
|
||||||
|
use CodeIgniter\Controller; |
||||||
|
use Config\Aauth as AauthConfig; |
||||||
|
use App\Libraries\Aauth; |
||||||
|
use App\Models\Aauth\UserVariableModel as UserVariableModel; |
||||||
|
use Config\Services; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Accont/Remind_password Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Remind_password extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->config = new AauthConfig(); |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
$this->request = Services::request(); |
||||||
|
helper('form'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
if ($input = $this->request->getPost()) |
||||||
|
{ |
||||||
|
if (! $this->aauth->remindPassword($input['email'])) |
||||||
|
{ |
||||||
|
$data['errors'] = $this->aauth->printErrors('<br />', true); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$data['infos'] = $this->aauth->printInfos('<br />', true); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/login.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderBlank', $data); |
||||||
|
echo view('Account/RemindPassword', $data); |
||||||
|
echo view('Templates/FooterBlank', $data); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,74 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make |
||||||
|
* easy some essential jobs such as login, permissions and access operations. |
||||||
|
* Despite ease of use, it has also very advanced features like groupping, |
||||||
|
* access management, public access etc.. |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* @author Magefly Team |
||||||
|
* @copyright 2014-2017 Emre Akay |
||||||
|
* @copyright 2018 Magefly |
||||||
|
* @license https://opensource.org/licenses/MIT MIT License |
||||||
|
* @link https://github.com/magefly/CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
|
||||||
|
namespace App\Controllers\Account; |
||||||
|
|
||||||
|
use CodeIgniter\Controller; |
||||||
|
use Config\Aauth as AauthConfig; |
||||||
|
use App\Libraries\Aauth; |
||||||
|
use App\Models\Aauth\UserVariableModel as UserVariableModel; |
||||||
|
use Config\Services; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Accont/Reset_password Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Reset_password extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->config = new AauthConfig(); |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
$this->request = Services::request(); |
||||||
|
helper('form'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @param string $verificationCode Verification Code |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index(string $verificationCode = '') |
||||||
|
{ |
||||||
|
if ($input = $this->request->getPost()) |
||||||
|
{ |
||||||
|
if (! $this->aauth->resetPassword($input['verification_code'])) |
||||||
|
{ |
||||||
|
$data['errors'] = $this->aauth->printErrors('<br />', true); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$data['infos'] = $this->aauth->printInfos('<br />', true); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['verificationCode'] = $verificationCode; |
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/login.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderBlank', $data); |
||||||
|
echo view('Account/ResetPassword', $data); |
||||||
|
echo view('Templates/FooterBlank', $data); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,57 @@ |
|||||||
|
<?php |
||||||
|
/** |
||||||
|
* CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* Aauth is a User Authorization Library for CodeIgniter 4.x, which aims to make |
||||||
|
* easy some essential jobs such as login, permissions and access operations. |
||||||
|
* Despite ease of use, it has also very advanced features like groupping, |
||||||
|
* access management, public access etc.. |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* @author Magefly Team |
||||||
|
* @copyright 2014-2017 Emre Akay |
||||||
|
* @copyright 2018 Magefly |
||||||
|
* @license https://opensource.org/licenses/MIT MIT License |
||||||
|
* @link https://github.com/magefly/CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
|
||||||
|
/** |
||||||
|
* Account language strings. |
||||||
|
* |
||||||
|
* Language English |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
* |
||||||
|
* @codeCoverageIgnore |
||||||
|
*/ |
||||||
|
return [ |
||||||
|
'linkBackToLogin' => 'Back to Login', |
||||||
|
'linkLogin' => 'Login', |
||||||
|
'linkRegister' => 'Register new Account', |
||||||
|
'linkRemindPassword' => 'Forgot Password?', |
||||||
|
|
||||||
|
'loginHeader' => 'Login', |
||||||
|
'loginLabelUsername' => 'Username', |
||||||
|
'loginLabelEmail' => 'Email address', |
||||||
|
'loginLabelPassword' => 'Password', |
||||||
|
'loginLabelRemember' => 'Remember me', |
||||||
|
'loginLabelSubmit' => 'Login', |
||||||
|
|
||||||
|
'registerHeader' => 'Create new Account', |
||||||
|
'registerLabelUsername' => 'Username', |
||||||
|
'registerLabelEmail' => 'Email address', |
||||||
|
'registerLabelPassword' => 'Password', |
||||||
|
'registerLabelRemember' => 'Remember me', |
||||||
|
'registerLabelSubmit' => 'Create Account', |
||||||
|
'registerRequired' => 'Required', |
||||||
|
|
||||||
|
'remindPasswordHeader' => 'Remind Password', |
||||||
|
'remindPasswordText' => 'Forgot your password? <br />You can reset your password here.', |
||||||
|
'remindPasswordLabelEmail' => 'Email address', |
||||||
|
'remindPasswordLabelSubmit' => 'Send reset instructions', |
||||||
|
|
||||||
|
'resetPasswordHeader' => 'Reset Password', |
||||||
|
'resetPasswordText' => 'You are only one step away from your new password.', |
||||||
|
'resetPasswordLabelVerificationCode' => 'Verification Code', |
||||||
|
'resetPasswordLabelSubmit' => 'Send new password', |
||||||
|
]; |
@ -0,0 +1,33 @@ |
|||||||
|
<div class="container"> |
||||||
|
<div class="card card-login mx-auto mt-5"> |
||||||
|
<div class="card-header"><?=lang('Account.remindPasswordHeader')?></div>
|
||||||
|
<div class="card-body"> |
||||||
|
<form method="POST"> |
||||||
|
<p><?=lang('Account.remindPasswordText')?></p>
|
||||||
|
<?if (isset($errors)):?> |
||||||
|
<div class="alert alert-danger"><?=$errors?></div>
|
||||||
|
<?endif;?> |
||||||
|
<?if (isset($infos)):?> |
||||||
|
<div class="alert alert-info"><?=$infos?></div>
|
||||||
|
<?endif;?> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="<?=lang('Account.remindPasswordLabelEmail')?>" required autofocus>
|
||||||
|
<label for="inputEmail"><?=lang('Account.remindPasswordLabelEmail')?></label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<button class="btn btn-primary btn-block" type="submit"><?=lang('Account.remindPasswordLabelSubmit')?></button>
|
||||||
|
</form> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-6"> |
||||||
|
<a class="d-block small" href="<?=site_url('account/login')?>"><?=lang('Account.linkBackToLogin')?></a>
|
||||||
|
</div> |
||||||
|
<div class="col-6 text-right"> |
||||||
|
<a class="d-block small" href="<?=site_url('account/register')?>"><?=lang('Account.linkRegister')?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,33 @@ |
|||||||
|
<div class="container"> |
||||||
|
<div class="card card-login mx-auto mt-5"> |
||||||
|
<div class="card-header"><?=lang('Account.resetPasswordHeader')?></div>
|
||||||
|
<div class="card-body"> |
||||||
|
<form method="POST"> |
||||||
|
<p><?=lang('Account.resetPasswordText')?></p>
|
||||||
|
<?if (isset($errors)):?> |
||||||
|
<div class="alert alert-danger"><?=$errors?></div>
|
||||||
|
<?endif;?> |
||||||
|
<?if (isset($infos)):?> |
||||||
|
<div class="alert alert-info"><?=$infos?></div>
|
||||||
|
<?endif;?> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<input type="test" name="verification_code" id="inputVerificationCode" class="form-control" placeholder="<?=lang('Account.resetPasswordLabelVerificationCode')?>" value="<?=$verificationCode?>" required autofocus>
|
||||||
|
<label for="inputVerificationCode"><?=lang('Account.resetPasswordLabelVerificationCode')?></label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<button class="btn btn-primary btn-block" type="submit"><?=lang('Account.resetPasswordLabelSubmit')?></button>
|
||||||
|
</form> |
||||||
|
</div> |
||||||
|
<div class="card-footer"> |
||||||
|
<div class="row"> |
||||||
|
<div class="col-6"> |
||||||
|
<a class="d-block small" href="<?=site_url('account/login')?>"><?=lang('Account.linkBackToLogin')?></a>
|
||||||
|
</div> |
||||||
|
<div class="col-6 text-right"> |
||||||
|
<a class="d-block small" href="<?=site_url('account/register')?>"><?=lang('Account.linkRegister')?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
Loading…
Reference in new issue