71 if(isset(self::$instance) and self::$instance)
80 return $this->active ?
true :
false;
84 $this->active = $a_status;
88 $this->port = $a_port;
96 $this->secret = $a_secret;
100 return $this->secret;
104 $this->server_string = $a_server_string;
105 $this->servers = explode(
',',$this->server_string);
109 return implode(
',',$this->servers);
113 return $this->servers ? $this->servers : array();
117 $this->name = $a_name;
134 $auth_params[
'servers'][] = array($server,$this->
getPort(),$this->
getSecret());
136 return $auth_params ? $auth_params : array();
148 return $this->default_role;
153 $this->default_role = $a_role;
164 return $this->creation;
176 $this->creation = $a_status;
188 $this->account_migration = $a_status;
199 return $this->account_migration ?
true :
false;
210 return $this->charset ? 1 : 0;
222 $this->charset = $a_charset;
234 $query =
"DELETE FROM settings WHERE keyword LIKE('radius_server%')";
235 $this->db->query($query);
237 $this->settings->set(
'radius_active',$this->
isActive() ? 1 : 0);
238 $this->settings->set(
'radius_port',$this->
getPort());
239 $this->settings->set(
'radius_shared_secret',$this->
getSecret());
240 $this->settings->set(
'radius_name',$this->
getName());
241 $this->settings->set(
'radius_creation',$this->
enabledCreation() ? 1 : 0);
243 $this->settings->set(
'radius_charset',$this->
getCharset() ? 1 : 0);
250 $this->settings->set(
'radius_server',trim($server));
254 $this->settings->set(
'radius_server'.$counter,trim($server));
258 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
283 return $ok and $role_ok;
294 return preg_match(
"/^[0-9]{0,5}$/",$this->
getPort()) == 1;
305 $servers = explode(
",",$this->server_string);
309 $server = trim($server);
328 $all_settings = $this->settings->getAll();
330 $this->
setActive($all_settings[
'radius_active']);
331 $this->
setPort($all_settings[
'radius_port']);
332 $this->
setSecret($all_settings[
'radius_shared_secret']);
333 $this->
setName($all_settings[
'radius_name']);
336 $this->
setCharset($all_settings[
'radius_charset']);
338 $query =
"SELECT value FROM settings WHERE keyword LIKE 'radius_server%' ORDER BY keyword ASC";
339 $res = $this->db->query($query);
341 while ($row =
$res->fetchRow())
343 $this->servers[] = $row[0];
346 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
348 $this->default_role = $roles[0] ? $roles[0] : 0;