1
0
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:
Marco
2017-02-21 09:43:30 +01:00
parent d99979f270
commit da4bb583bf
2 changed files with 38 additions and 0 deletions

27
src/Administration.php Normal file
View 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) {}
}

View File

@@ -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
*