1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- <?php
- global $_PAM_HANDLERS;
- $_PAM_HANDLERS = array();
- function register_pam_handler($handler, $importance = "sufficient", $policy = "user") {
- global $_PAM_HANDLERS;
-
- if (!isset($_PAM_HANDLERS[$policy])) {
- $_PAM_HANDLERS[$policy] = array();
- }
-
- if (is_string($handler) && is_callable($handler, true)) {
- $_PAM_HANDLERS[$policy][$handler] = new \stdClass;
- $_PAM_HANDLERS[$policy][$handler]->handler = $handler;
- $_PAM_HANDLERS[$policy][$handler]->importance = strtolower($importance);
- return true;
- }
- return false;
- }
- function unregister_pam_handler($handler, $policy = "user") {
- global $_PAM_HANDLERS;
- unset($_PAM_HANDLERS[$policy][$handler]);
- }
|