Elgg  Version 3.0
pam.php
Go to the documentation of this file.
1 <?php
39 function register_pam_handler($handler, $importance = "sufficient", $policy = "user") {
40  // setup array for this type of pam if not already set
41  if (!isset(\ElggPAM::$_handlers[$policy])) {
42  \ElggPAM::$_handlers[$policy] = [];
43  }
44 
45  // @todo remove requirement that $handle be a global function
46  if (is_string($handler) && is_callable($handler, true)) {
47  \ElggPAM::$_handlers[$policy][$handler] = new \stdClass;
48 
49  \ElggPAM::$_handlers[$policy][$handler]->handler = $handler;
50  \ElggPAM::$_handlers[$policy][$handler]->importance = strtolower($importance);
51 
52  return true;
53  }
54 
55  return false;
56 }
57 
67 function unregister_pam_handler($handler, $policy = "user") {
68  unset(\ElggPAM::$_handlers[$policy][$handler]);
69 }
static $_handlers
Definition: ElggPAM.php:13
register_pam_handler($handler, $importance="sufficient", $policy="user")
Register a PAM handler.
Definition: pam.php:39
unregister_pam_handler($handler, $policy="user")
Unregisters a PAM handler.
Definition: pam.php:67
$handler
Definition: add.php:7