Browse Source
- updated Home & Account/Logout Controller - added Account/Home & Admin/Home Controller - updated Libraries/Aauth - updated Home, Templates/Footer, Templates/Header & Templates/HeaderBlank Views - added Templates/FooterAdmin & Templates/HeaderAdmin Views - added aauth_helperv3-dev
12 changed files with 275 additions and 27 deletions
@ -0,0 +1,62 @@ |
|||||||
|
<?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\UserModel; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Accont/Home Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Home extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Constructor |
||||||
|
*/ |
||||||
|
public function __construct() |
||||||
|
{ |
||||||
|
$this->config = new AauthConfig(); |
||||||
|
$this->user = new UserModel(); |
||||||
|
$this->aauth = new Aauth(); |
||||||
|
|
||||||
|
if (! $this->aauth->isLoggedIn()) |
||||||
|
{ |
||||||
|
redirect()->to('/'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
// print_r($this->aauth->session); |
||||||
|
// print_r($this->aauth->login("[email protected]", "password123456")); |
||||||
|
// print_r($this->aauth->deleteUser(4)); |
||||||
|
// print_r($this->aauth->updateUser(1, "[email protected]", "password", 'Admines')); |
||||||
|
// print_r($this->aauth->createUser("[email protected]", 'asdasasdasdsd')); |
||||||
|
|
||||||
|
echo $this->aauth->printErrors('<br />', true); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,42 @@ |
|||||||
|
<?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\Admin; |
||||||
|
|
||||||
|
use CodeIgniter\Controller; |
||||||
|
use Config\Aauth as AauthConfig; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Admin/Home Controller |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
class Home extends Controller |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Index |
||||||
|
* |
||||||
|
* @return void |
||||||
|
*/ |
||||||
|
public function index() |
||||||
|
{ |
||||||
|
helper('aauth'); |
||||||
|
echo view('Templates/HeaderAdmin'); |
||||||
|
echo view('Admin/Home'); |
||||||
|
echo view('Templates/FooterAdmin'); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,37 @@ |
|||||||
|
<?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 |
||||||
|
*/ |
||||||
|
|
||||||
|
use App\Libraries\Aauth; |
||||||
|
|
||||||
|
/** |
||||||
|
* Aauth Helper |
||||||
|
* |
||||||
|
* @package CodeIgniter-Aauth |
||||||
|
*/ |
||||||
|
if (! function_exists('is_loggedin')) |
||||||
|
{ |
||||||
|
/** |
||||||
|
* Is logged in |
||||||
|
* |
||||||
|
* @return boolean |
||||||
|
*/ |
||||||
|
function is_loggedin() |
||||||
|
{ |
||||||
|
$aauth = new Aauth(); |
||||||
|
return $aauth->isLoggedIn(); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,27 @@ |
|||||||
|
</div> |
||||||
|
|
||||||
|
<footer class="sticky-footer"> |
||||||
|
<div class="container my-auto"> |
||||||
|
<div class="copyright text-center my-auto"> |
||||||
|
<span>Copyright © Aauth 2018</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</footer> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
|
||||||
|
<a class="scroll-to-top rounded" href="#page-top"> |
||||||
|
<i class="fas fa-angle-up"></i> |
||||||
|
</a> |
||||||
|
|
||||||
|
<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,52 @@ |
|||||||
|
<!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"> |
||||||
|
<nav class="navbar navbar-expand navbar-dark bg-dark static-top"> |
||||||
|
<a class="navbar-brand mr-1" href="index.html">Aauth</a> |
||||||
|
<button class="btn btn-link btn-sm text-white order-1 order-sm-0" id="sidebarToggle" href="#"> |
||||||
|
<i class="fas fa-bars"></i> |
||||||
|
</button> |
||||||
|
<ul class="navbar-nav ml-auto"> |
||||||
|
<? if (is_loggedin()): ?> |
||||||
|
<li class="nav-item dropdown no-arrow"> |
||||||
|
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||||
|
<i class="fas fa-user-circle fa-fw"></i> |
||||||
|
</a> |
||||||
|
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="userDropdown"> |
||||||
|
<!-- <a class="dropdown-item" href="#">Settings</a> --> |
||||||
|
<!-- <div class="dropdown-divider"></div> --> |
||||||
|
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#logoutModal">Logout</a> |
||||||
|
</div> |
||||||
|
</li> |
||||||
|
<?php endif; ?> |
||||||
|
</ul> |
||||||
|
</nav> |
||||||
|
|
||||||
|
<div id="wrapper"> |
||||||
|
<ul class="sidebar navbar-nav"> |
||||||
|
<li class="nav-item"> |
||||||
|
<a class="nav-link" href="index.html"> |
||||||
|
<i class="fas fa-fw fa-tachometer-alt"></i> |
||||||
|
<span>Dashboard</span> |
||||||
|
</a> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
|
||||||
|
<div id="content-wrapper"> |
||||||
|
<div class="container-fluid"> |
Loading…
Reference in new issue