76 if(isset(self::$instance) and self::$instance)
85 return $this->active ?
true :
false;
89 $this->active = $a_status;
93 $this->port = $a_port;
101 $this->secret = $a_secret;
105 return $this->secret;
109 $this->server_string = $a_server_string;
110 $this->servers = explode(
',',$this->server_string);
114 return implode(
',',$this->servers);
118 return $this->servers ? $this->servers : array();
122 $this->name = $a_name;
139 $auth_params[
'servers'][] = array($server,$this->
getPort(),$this->
getSecret());
141 return $auth_params ? $auth_params : array();
153 return $this->default_role;
158 $this->default_role = $a_role;
169 return $this->creation;
181 $this->creation = $a_status;
193 $this->account_migration = $a_status;
204 return $this->account_migration ?
true :
false;
215 return $this->charset ? 1 : 0;
227 $this->charset = $a_charset;
239 $this->settings->deleteLike(
'radius_server%');
241 $this->settings->set(
'radius_active',$this->
isActive() ? 1 : 0);
242 $this->settings->set(
'radius_port',$this->
getPort());
243 $this->settings->set(
'radius_shared_secret',$this->
getSecret());
244 $this->settings->set(
'radius_name',$this->
getName());
245 $this->settings->set(
'radius_creation',$this->
enabledCreation() ? 1 : 0);
247 $this->settings->set(
'radius_charset',$this->
getCharset() ? 1 : 0);
254 $this->settings->set(
'radius_server',trim($server));
258 $this->settings->set(
'radius_server'.$counter,trim($server));
262 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
287 return $ok and $role_ok;
298 return preg_match(
"/^[0-9]{0,5}$/",$this->
getPort()) == 1;
309 $servers = explode(
",",$this->server_string);
313 $server = trim($server);
332 $all_settings = $this->settings->getAll();
334 $sets = array(
"radius_active" =>
"setActive",
335 "radius_port" =>
"setPort",
336 "radius_shared_secret" =>
"setSecret",
337 "radius_name" =>
"setName",
338 "radius_creation" =>
"enableCreation",
339 "radius_migration" =>
"enableAccountMigration",
340 "radius_charset" =>
"setCharset"
342 foreach ($sets as $s => $m)
344 if (isset($all_settings[$s]))
346 $this->$m($all_settings[$s]);
350 reset($all_settings);
351 foreach($all_settings as $k => $v)
353 if (substr($k, 0, 13) ==
"radius_server")
355 $this->servers[] = $v;
359 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
361 $this->default_role = 0;
362 if (isset($roles[0]) && $roles[0])
364 $this->default_role = $roles[0];