Browse Source

updated LoginAttemptModel, LoginTokenModel, UserModel & UserVariableModel (added @since)

added GroupModel & PermModel (based on CI4 Model)
v3-dev
REJack 7 years ago
parent
commit
04ef0cfe9e
No known key found for this signature in database
GPG Key ID: 4A44B48700429F46
  1. 71
      application/Models/Aauth/GroupModel.php
  2. 2
      application/Models/Aauth/LoginAttemptModel.php
  3. 2
      application/Models/Aauth/LoginTokenModel.php
  4. 71
      application/Models/Aauth/PermModel.php
  5. 2
      application/Models/Aauth/UserModel.php
  6. 2
      application/Models/Aauth/UserVariableModel.php

71
application/Models/Aauth/GroupModel.php

@ -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\Models\Aauth;
use CodeIgniter\Model;
use Config\Aauth as AauthConfig;
/**
* Group Model
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class GroupModel extends Model
{
/**
* If true, will set created_at, and updated_at
* values during insert and update routines.
*
* @var boolean
*/
protected $useTimestamps = true;
/**
* An array of field names that are allowed
* to be set by the user in inserts/updates.
*
* @var array
*/
protected $allowedFields = [
'name',
'definition',
];
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->config = new AauthConfig();
$this->table = $this->config->dbTableGroups;
$this->DBGroup = $this->config->dbProfile;
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]';
$this->validationMessages = [
'name' => [
'required' => lang('Aauth.requiredPermName'),
'is_unique' => lang('Aauth.existsAlreadyPerm'),
],
];
}
}

2
application/Models/Aauth/LoginAttemptModel.php

@ -28,6 +28,8 @@ use CodeIgniter\Database\ConnectionInterface;
* Login Attempt caseModel
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class LoginAttemptModel
{

2
application/Models/Aauth/LoginTokenModel.php

@ -27,6 +27,8 @@ use CodeIgniter\Database\ConnectionInterface;
* Login Token Model
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class LoginTokenModel
{

71
application/Models/Aauth/PermModel.php

@ -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\Models\Aauth;
use CodeIgniter\Model;
use Config\Aauth as AauthConfig;
/**
* Perm Model
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class PermModel extends Model
{
/**
* If true, will set created_at, and updated_at
* values during insert and update routines.
*
* @var boolean
*/
protected $useTimestamps = true;
/**
* An array of field names that are allowed
* to be set by the user in inserts/updates.
*
* @var array
*/
protected $allowedFields = [
'name',
'definition',
];
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->config = new AauthConfig();
$this->table = $this->config->dbTablePerms;
$this->DBGroup = $this->config->dbProfile;
$this->validationRules['name'] = 'required|is_unique[' . $this->table . '.name,id,{id}]';
$this->validationMessages = [
'name' => [
'required' => lang('Aauth.requiredPermName'),
'is_unique' => lang('Aauth.existsAlreadyPerm'),
],
];
}
}

2
application/Models/Aauth/UserModel.php

@ -24,6 +24,8 @@ use Config\Aauth as AauthConfig;
* User Model
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class UserModel extends Model
{

2
application/Models/Aauth/UserVariableModel.php

@ -27,6 +27,8 @@ use CodeIgniter\Database\ConnectionInterface;
* User Variable Model.
*
* @package CodeIgniter-Aauth
*
* @since 3.0.0
*/
class UserVariableModel
{

Loading…
Cancel
Save