Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
authent.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 
7 include_once ('WHAT/autoload.php');
8 include_once ('WHAT/Class.ActionRouter.php');
9 
11  include_once ('TOOLBOX/stop.php');
12  exit(0);
13 }
14 
16 if ($auth === false) {
17  throw new \Dcp\Exception("Could not get authenticator.");
18 }
19 
20 if (isset($_REQUEST['logout'])) {
22 } else {
23  if (!method_exists($auth, 'logon')) {
24  throw new \Dcp\Exception(sprintf("Authenticator '%s' does not provide a logon() method.", get_class($auth)));
25  }
26  // default application is AUTHENT
27  if (!isset($_GET["app"])) $_GET["app"] = "AUTHENT";
28  /*
29  * @var htmlAuthenticator $auth
30  */
31  $auth->logon();
32 }
33 /**
34  * @param string $authtype
35  * @return Authenticator
36  */
37 function getAuthenticator($authtype = '')
38 {
39  if ($authtype == '') {
41  }
42  if (!preg_match('/^[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*$/', $authtype)) {
43  return false;
44  }
45  $authClass = strtolower($authtype) . "Authenticator";
46  $authFile = DEFAULT_PUBDIR . DIRECTORY_SEPARATOR . 'WHAT' . DIRECTORY_SEPARATOR . 'Class.' . $authClass . '.php';
47  if (!file_exists($authFile)) {
48  return false;
49  }
50  include_once ($authFile);
51  return new $authClass($authtype, Authenticator::nullProvider);
52 }
if(ActionRouter::inMaintenance()) $auth
Definition: authent.php:15
static inMaintenance()
const DEFAULT_PUBDIR
Definition: Lib.Prefix.php:28
getAuthenticator($authtype= '')
Definition: authent.php:37
global $_GET
Definition: wsh.php:37
switch($command) exit
Definition: checkVault.php:46
← centre documentaire © anakeen