Browse Source
- updated .gitignore - added assets - updated Home Controller - added Controller Account/Login & Account/Register - added Home View - added Account/Login & Account Register View - added Templates (Footer, FooterBlank, Header & HeaderBlank)v3-dev
16 changed files with 393 additions and 3 deletions
@ -0,0 +1,73 @@ |
|||||||
|
<?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 Config\Services; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Accont/Login Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Login extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->config = new AauthConfig(); |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
$this->request = Services::request(); |
||||||
|
helper('form'); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return redirect |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
if ($input = $this->request->getVar()) |
||||||
|
{ |
||||||
|
$identifier = ($this->config->loginUseUsername ? $input['username'] : $input['email']); |
||||||
|
|
||||||
|
if (! $this->aauth->login($identifier, $input['password'], (isset($input['remember']) ? true : false))) |
||||||
|
{ |
||||||
|
$data['errors'] = $this->aauth->printErrors('<br />', true); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
return redirect()->to('/account'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['useUsername'] = $this->config->loginUseUsername; |
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/login.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderBlank', $data); |
||||||
|
echo view('Account/Login', $data); |
||||||
|
echo view('Templates/FooterBlank', $data); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,72 @@ |
|||||||
|
<?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/Register Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Register 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->getVar()) |
||||||
|
{ |
||||||
|
if (! $this->aauth->createUser($input['email'], $input['password'], $input['username'])) |
||||||
|
{ |
||||||
|
$data['errors'] = $this->aauth->printErrors('<br />', true); |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
$data['info'] = $this->aauth->printInfos('<br />', true); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
$data['useUsername'] = $this->config->loginUseUsername; |
||||||
|
$data['cssFiles'] = [ |
||||||
|
'/assets/css/login.css' |
||||||
|
]; |
||||||
|
|
||||||
|
echo view('Templates/HeaderBlank', $data); |
||||||
|
echo view('Account/Register', $data); |
||||||
|
echo view('Templates/FooterBlank', $data); |
||||||
|
} |
||||||
|
} |
@ -1,13 +1,41 @@ |
|||||||
<?php |
<?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; |
namespace App\Controllers; |
||||||
|
|
||||||
use CodeIgniter\Controller; |
use CodeIgniter\Controller; |
||||||
use Config\Aauth as AauthConfig; |
use Config\Aauth as AauthConfig; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Home Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
class Home extends Controller |
class Home extends Controller |
||||||
{ |
{ |
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
public function index() |
public function index() |
||||||
{ |
{ |
||||||
|
echo view('Templates/Header'); |
||||||
|
echo view('Home'); |
||||||
|
echo view('Templates/Footer'); |
||||||
} |
} |
||||||
} |
} |
||||||
|
@ -0,0 +1,42 @@ |
|||||||
|
<div class="container"> |
||||||
|
<div class="card card-login mx-auto mt-5"> |
||||||
|
<div class="card-header"><?=lang('Account.loginText')?></div>
|
||||||
|
<div class="card-body"> |
||||||
|
<form method="POST"> |
||||||
|
<?if (isset($errors)):?> |
||||||
|
<div class="alert alert-danger"><?=$errors?></div>
|
||||||
|
<?endif;?> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<?if ($useUsername):?> |
||||||
|
<input type="text" name="username" id="inputUsername" class="form-control" placeholder="<?=lang('Account.loginLabelUsername')?>" required autofocus>
|
||||||
|
<label for="inputUsername"><?=lang('Account.loginLabelUsername')?></label>
|
||||||
|
<?else:?> |
||||||
|
<input type="email" name="email" id="inputEmail" class="form-control" placeholder="<?=lang('Account.loginLabelEmail')?>" required autofocus>
|
||||||
|
<label for="inputEmail"><?=lang('Account.loginLabelEmail')?></label>
|
||||||
|
<?endif;?> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="<?=lang('Account.loginLabelPassword')?>" required>
|
||||||
|
<label for="inputPassword"><?=lang('Account.loginLabelPassword')?></label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="checkbox"> |
||||||
|
<label> |
||||||
|
<input type="checkbox" name="remember" value="true"> |
||||||
|
<?=lang('Account.loginLabelRemember')?> |
||||||
|
</label> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<button class="btn btn-primary btn-block" type="submit"><?=lang('Account.loginLabelSubmit')?></button>
|
||||||
|
</form> |
||||||
|
<div class="text-center"> |
||||||
|
<a class="d-block small mt-3" href="<?=site_url('account/register')?>"><?=lang('Account.loginLinkRegister')?></a>
|
||||||
|
<a class="d-block small" href="<?=site_url('account/forgot_password')?>"><?=lang('Account.loginLinkForgotPassword')?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,41 @@ |
|||||||
|
<div class="container"> |
||||||
|
<div class="card card-register mx-auto mt-5"> |
||||||
|
<div class="card-header"><?=lang('Account.registerText')?></div>
|
||||||
|
<div class="card-body"> |
||||||
|
<form method="POST"> |
||||||
|
<?if (isset($errors)):?> |
||||||
|
<div class="alert alert-danger"><?=$errors?></div>
|
||||||
|
<?endif;?> |
||||||
|
<?if (isset($infos)):?> |
||||||
|
<div class="alert alert-success"><?=$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.registerLabelEmail')?>" required autofocus>
|
||||||
|
<label for="inputEmail"><?=lang('Account.registerLabelEmail')?>*</label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<input type="text" name="username" id="inputUsername" class="form-control" placeholder="<?=lang('Account.registerLabelUsername')?>" <?=($useUsername ? 'required' : '')?>>
|
||||||
|
<label for="inputUsername"><?=lang('Account.registerLabelUsername')?><?=($useUsername ? '*' : '')?></label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<div class="form-label-group"> |
||||||
|
<input type="password" name="password" id="inputPassword" class="form-control" placeholder="<?=lang('Account.registerLabelPassword')?>" required>
|
||||||
|
<label for="inputPassword"><?=lang('Account.registerLabelPassword')?>*</label>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
<div class="form-group"> |
||||||
|
<p>* <?=lang('Account.registerRequired')?></p>
|
||||||
|
</div> |
||||||
|
<button class="btn btn-primary btn-block" type="submit"><?=lang('Account.registerLabelSubmit')?></button>
|
||||||
|
</form> |
||||||
|
<div class="text-center"> |
||||||
|
<a class="d-block small mt-3" href="<?=site_url('account/login')?>"><?=lang('Account.registerLinkLogin')?></a>
|
||||||
|
<a class="d-block small" href="<?=site_url('account/forgot_password')?>"><?=lang('Account.registerLinkForgotPassword')?></a>
|
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -0,0 +1,6 @@ |
|||||||
|
<div class="pt-5 px-5 mt-5 mx-auto w-50"> |
||||||
|
<h1 class="mb-5">Welcome To CodeIgniter-Aauth v3 for CodeIgniter 4.x</h1> |
||||||
|
<p class="lead">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..</p> |
||||||
|
<p>You can Login now and test it.</p> |
||||||
|
<a href="<?= site_url('account/login') ?>" class="btn btn-primary px-5">Login</a>
|
||||||
|
</div> |
@ -0,0 +1,12 @@ |
|||||||
|
|
||||||
|
<script src="/assets/vendor/jquery/jquery.min.js"></script> |
||||||
|
<script src="/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script> |
||||||
|
<script src="/assets/vendor/jquery-easing/jquery.easing.min.js"></script> |
||||||
|
<script src="/assets/js/sb-admin.min.js"></script> |
||||||
|
<? if (isset($jsFiles)): ?> |
||||||
|
<? foreach ($jsFiles as $jsFiles): ?> |
||||||
|
<script type="text/javascript" src="<?= $jsFile; ?>"></script>
|
||||||
|
<? endforeach; ?> |
||||||
|
<? endif; ?> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,12 @@ |
|||||||
|
|
||||||
|
<script src="/assets/vendor/jquery/jquery.min.js"></script> |
||||||
|
<script src="/assets/vendor/bootstrap/js/bootstrap.bundle.min.js"></script> |
||||||
|
<script src="/assets/vendor/jquery-easing/jquery.easing.min.js"></script> |
||||||
|
<script src="/assets/js/sb-admin.min.js"></script> |
||||||
|
<? if (isset($jsFiles)): ?> |
||||||
|
<? foreach ($jsFiles as $jsFiles): ?> |
||||||
|
<script type="text/javascript" src="<?= $jsFile; ?>"></script>
|
||||||
|
<? endforeach; ?> |
||||||
|
<? endif; ?> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,19 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||||
|
<meta name="description" content=""> |
||||||
|
<meta name="author" content=""> |
||||||
|
<title><? (isset($title) ? $title : '') ?></title>
|
||||||
|
<link href="/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/vendor/fontawesome-free/css/all.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/sb-admin.min.css" rel="stylesheet"> |
||||||
|
<? if (isset($cssFiles)): ?> |
||||||
|
<? foreach ($cssFiles as $cssFile): ?> |
||||||
|
<link href="<?= $cssFile; ?>" rel="stylesheet">
|
||||||
|
<? endforeach; ?> |
||||||
|
<? endif; ?> |
||||||
|
</head> |
||||||
|
<body id="page-top"> |
@ -0,0 +1,19 @@ |
|||||||
|
<!DOCTYPE html> |
||||||
|
<html lang="en"> |
||||||
|
<head> |
||||||
|
<meta charset="utf-8"> |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||||
|
<meta name="description" content=""> |
||||||
|
<meta name="author" content=""> |
||||||
|
<title><? (isset($title) ? $title : '') ?></title>
|
||||||
|
<link href="/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/vendor/fontawesome-free/css/all.min.css" rel="stylesheet"> |
||||||
|
<link href="/assets/css/sb-admin.min.css" rel="stylesheet"> |
||||||
|
<? if (isset($cssFiles)): ?> |
||||||
|
<? foreach ($cssFiles as $cssFile): ?> |
||||||
|
<link href="<?= $cssFile; ?>" rel="stylesheet">
|
||||||
|
<? endforeach; ?> |
||||||
|
<? endif; ?> |
||||||
|
</head> |
||||||
|
<body id="page-top"> |
File diff suppressed because one or more lines are too long
@ -0,0 +1,44 @@ |
|||||||
|
html, |
||||||
|
body { |
||||||
|
height: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
body { |
||||||
|
display: -ms-flexbox; |
||||||
|
display: flex; |
||||||
|
-ms-flex-align: center; |
||||||
|
align-items: center; |
||||||
|
padding-top: 40px; |
||||||
|
padding-bottom: 40px; |
||||||
|
background-color: #f5f5f5; |
||||||
|
} |
||||||
|
|
||||||
|
.form-signin { |
||||||
|
width: 100%; |
||||||
|
max-width: 330px; |
||||||
|
padding: 15px; |
||||||
|
margin: auto; |
||||||
|
} |
||||||
|
.form-signin .checkbox { |
||||||
|
font-weight: 400; |
||||||
|
} |
||||||
|
.form-signin .form-control { |
||||||
|
position: relative; |
||||||
|
box-sizing: border-box; |
||||||
|
height: auto; |
||||||
|
padding: 10px; |
||||||
|
font-size: 16px; |
||||||
|
} |
||||||
|
.form-signin .form-control:focus { |
||||||
|
z-index: 2; |
||||||
|
} |
||||||
|
.form-signin input[type="email"] { |
||||||
|
margin-bottom: -1px; |
||||||
|
border-bottom-right-radius: 0; |
||||||
|
border-bottom-left-radius: 0; |
||||||
|
} |
||||||
|
.form-signin input[type="password"] { |
||||||
|
margin-bottom: 10px; |
||||||
|
border-top-left-radius: 0; |
||||||
|
border-top-right-radius: 0; |
||||||
|
} |
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 253 KiB |
@ -0,0 +1,7 @@ |
|||||||
|
/*! |
||||||
|
* Start Bootstrap - SB Admin v5.0.2 (https://startbootstrap.com/template-overviews/sb-admin)
|
||||||
|
* Copyright 2013-2018 Start Bootstrap |
||||||
|
* Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-sb-admin/blob/master/LICENSE)
|
||||||
|
*/ |
||||||
|
|
||||||
|
!function(t){"use strict";t("#sidebarToggle").click(function(e){e.preventDefault(),t("body").toggleClass("sidebar-toggled"),t(".sidebar").toggleClass("toggled")}),t("body.fixed-nav .sidebar").on("mousewheel DOMMouseScroll wheel",function(e){if(768<$window.width()){var o=e.originalEvent,t=o.wheelDelta||-o.detail;this.scrollTop+=30*(t<0?1:-1),e.preventDefault()}}),t(document).scroll(function(){100<t(this).scrollTop()?t(".scroll-to-top").fadeIn():t(".scroll-to-top").fadeOut()}),t(document).on("click","a.scroll-to-top",function(e){var o=t(this);t("html, body").stop().animate({scrollTop:t(o.attr("href")).offset().top},1e3,"easeInOutExpo"),e.preventDefault()})}(jQuery); |
Loading…
Reference in new issue