Public Member Functions

ilRADIUSAuthentication Class Reference

Inheritance diagram for ilRADIUSAuthentication:
Collaboration diagram for ilRADIUSAuthentication:

Public Member Functions

 ilRADIUSAuthentication ()
 _validateServers ($a_servers)
 _getServers ($a_db_handler= '')
 _saveServers ($a_servers)

Detailed Description

Definition at line 37 of file class.ilRADIUSAuthentication.php.


Member Function Documentation

ilRADIUSAuthentication::_getServers ( a_db_handler = ''  ) 

Definition at line 64 of file class.ilRADIUSAuthentication.php.

References $q, and $row.

Referenced by ilRegistrationGUI::__validateRole(), ilAuthUtils::_initAuth(), _saveServers(), and ilObjAuthSettingsGUI::editRADIUSObject().

        {
                global $ilDB;
                
                $db =& $ilDB;
                
                if ($a_db_handler != '')
                {
                        $db =& $a_db_handler;
                }
                
                $q = "SELECT value FROM settings WHERE keyword LIKE 'radius_server%' ORDER BY keyword ASC";
                $r = $db->query($q);
                
                $servers = array();
                
                while ($row = $r->fetchRow())
                {
                        $servers[] = $row[0];
                }
                
                return $servers;
        }

Here is the caller graph for this function:

ilRADIUSAuthentication::_saveServers ( a_servers  ) 

Definition at line 88 of file class.ilRADIUSAuthentication.php.

References $ilias, $server, and _getServers().

Referenced by ilObjAuthSettingsGUI::saveRADIUSObject().

        {
                global $ilias;
                
                $old_servers = ilRADIUSAuthentication::_getServers();
                $count = count($old_servers);
                
                $servers = explode(",",$a_servers);
                
                $new_count = count($servers);
                
                $i = 1;
                
                foreach ($servers as $server)
                {
                        if ($i == 1)
                        {
                                $ilias->setSetting('radius_server',$server);
                        }
                        else
                        {
                                $ilias->setSetting('radius_server'.$i,$server);
                        }
                        
                        $i++;
                }
                
                // delete surplus old servers
                for ($n = $new_count + 1; $n <= $count; $n++)
                {
                        $ilias->deleteSetting('radius_server'.$n);
                }
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilRADIUSAuthentication::_validateServers ( a_servers  ) 

Definition at line 45 of file class.ilRADIUSAuthentication.php.

References $ilias, $server, ilUtil::isDN(), and ilUtil::isIPv4().

Referenced by ilObjAuthSettingsGUI::saveRADIUSObject().

        {
                global $ilias;
                
                $servers = explode(",",$a_servers);
                
                foreach ($servers as $server)
                {
                        $server = trim($server);

                        if (!ilUtil::isIPv4($server) and !ilUtil::isDN($server))
                        {
                                return false;
                        }
                }
                
                return true;
        }

Here is the call graph for this function:

Here is the caller graph for this function:

ilRADIUSAuthentication::ilRADIUSAuthentication (  ) 

Definition at line 39 of file class.ilRADIUSAuthentication.php.

References ilBaseAuthentication::__setMessageCode(), and ilBaseAuthentication::ilBaseAuthentication().

Here is the call graph for this function:


The documentation for this class was generated from the following file: