From db77016fc8245d01a5dbe63ccc308258c794e7f2 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 7 Apr 2013 19:27:34 +0400 Subject: move service-dependent auth plugins to contrib repo --- plugins/auth_radius/init.php | 76 -------------------------------------------- 1 file changed, 76 deletions(-) delete mode 100644 plugins/auth_radius/init.php (limited to 'plugins/auth_radius/init.php') diff --git a/plugins/auth_radius/init.php b/plugins/auth_radius/init.php deleted file mode 100644 index b08654549..000000000 --- a/plugins/auth_radius/init.php +++ /dev/null @@ -1,76 +0,0 @@ -link = $host->get_link(); - $this->host = $host; - $this->base = new Auth_Base($this->link); - $this->debug = FALSE; - - $host->add_hook($host::HOOK_AUTH_USER, $this); - } - - private function _log($msg) { - if ($this->debug) trigger_error($msg, E_USER_WARNING); - } - - function authenticate($login, $password) { - if (!require_once('php-radius/radius.php')) { - $this->_log('Cannot require radius class files!'); - return FALSE; - } - - if ($login && $password) { - if ( (!defined('RADIUS_AUTH_SERVER')) OR (!defined('RADIUS_AUTH_SECRET')) ) { - $this->_log('Could not parse RADIUS_AUTH_ options from config.php!'); - return FALSE; - } elseif (!defined('RADIUS_AUTH_PORT')) - define('RADIUS_AUTH_PORT', 1812); - - $radius = new Radius(RADIUS_AUTH_SERVER, RADIUS_AUTH_SECRET, '', 5, RADIUS_AUTH_PORT); - $radius->SetNasIpAddress('1.2.3.4'); - $auth = $radius->AccessRequest($login, $password); - - if ($auth) - return $this->base->auto_create_user($login); - else { - $this->_log('Radius authentication rejected!'); - return FALSE; - } - } - - return FALSE; - } - -} - -?> -- cgit v1.2.3