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("admin@example.com", "password123456")); |
||||||
|
// print_r($this->aauth->deleteUser(4)); |
||||||
|
// print_r($this->aauth->updateUser(1, "admin@example.com", "password", 'Admines')); |
||||||
|
// print_r($this->aauth->createUser("admin@example.coma", '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(); |
||||||
|
} |
||||||
|
} |
@ -1,6 +1,4 @@ |
|||||||
<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> |
||||||
<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 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> |
||||||
<p>You can Login now and test it.</p> |
<a href="<?= site_url('account/login') ?>" class="btn btn-primary px-5">Login</a>
|
||||||
<a href="<?= site_url('account/login') ?>" class="btn btn-primary px-5">Login</a>
|
|
||||||
</div> |
|
||||||
|
@ -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> |
@ -1,19 +1,42 @@ |
|||||||
<!DOCTYPE html> |
<!DOCTYPE html> |
||||||
<html lang="en"> |
<html lang="en"> |
||||||
<head> |
<head> |
||||||
<meta charset="utf-8"> |
<meta charset="utf-8"> |
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
<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="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> |
||||||
<meta name="description" content=""> |
<meta name="description" content=""> |
||||||
<meta name="author" content=""> |
<meta name="author" content=""> |
||||||
<title><? (isset($title) ? $title : '') ?></title>
|
<title><? (isset($title) ? $title : '') ?></title>
|
||||||
<link href="/assets/vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet"> |
<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/vendor/fontawesome-free/css/all.min.css" rel="stylesheet"> |
||||||
<link href="/assets/css/sb-admin.min.css" rel="stylesheet"> |
<link href="/assets/css/sb-admin.min.css" rel="stylesheet"> |
||||||
<? if (isset($cssFiles)): ?> |
<? if (isset($cssFiles)): ?> |
||||||
<? foreach ($cssFiles as $cssFile): ?> |
<? foreach ($cssFiles as $cssFile): ?> |
||||||
<link href="<?= $cssFile; ?>" rel="stylesheet">
|
<link href="<?= $cssFile; ?>" rel="stylesheet">
|
||||||
<? endforeach; ?> |
<? endforeach; ?> |
||||||
<? endif; ?> |
<? endif; ?> |
||||||
</head> |
</head> |
||||||
<body id="page-top"> |
<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> |
||||||
|
<ul class="navbar-nav ml-4"> |
||||||
|
<li class="nav-item"> |
||||||
|
<a href="<?= site_url() ?>">Home</a>
|
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
<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="<?= site_url('account/logout') ?>">Logout</a>
|
||||||
|
</div> |
||||||
|
</li> |
||||||
|
<?php endif; ?> |
||||||
|
</ul> |
||||||
|
</nav> |
||||||
|
<div class="m-5"> |
||||||
|
@ -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