mirror of
https://github.com/delight-im/PHP-Auth.git
synced 2025-08-06 16:16:29 +02:00
Add component for administrative tasks as class 'Administration'
This commit is contained in:
27
src/Administration.php
Normal file
27
src/Administration.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* PHP-Auth (https://github.com/delight-im/PHP-Auth)
|
||||
* Copyright (c) delight.im (https://www.delight.im/)
|
||||
* Licensed under the MIT License (https://opensource.org/licenses/MIT)
|
||||
*/
|
||||
|
||||
namespace Delight\Auth;
|
||||
|
||||
use Delight\Db\PdoDatabase;
|
||||
|
||||
require_once __DIR__ . '/Exceptions.php';
|
||||
|
||||
/** Component that can be used for administrative tasks by privileged and authorized users */
|
||||
final class Administration extends UserManager {
|
||||
|
||||
/**
|
||||
* @param PdoDatabase $databaseConnection the database connection to operate on
|
||||
*/
|
||||
public function __construct(PdoDatabase $databaseConnection) {
|
||||
parent::__construct($databaseConnection);
|
||||
}
|
||||
|
||||
protected function throttle($actionType, $customSelector = null) {}
|
||||
|
||||
}
|
11
src/Auth.php
11
src/Auth.php
@@ -1198,6 +1198,17 @@ final class Auth extends UserManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the component that can be used for administrative tasks
|
||||
*
|
||||
* You must offer access to this interface to authorized users only (restricted via your own access control)
|
||||
*
|
||||
* @return Administration
|
||||
*/
|
||||
public function admin() {
|
||||
return new Administration($this->db);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the cookie settings that will be used to create and update cookies on the client
|
||||
*
|
||||
|
Reference in New Issue
Block a user