72 if(isset(self::$instance) and self::$instance)
81 return $this->active ?
true :
false;
85 $this->active = $a_status;
89 $this->port = $a_port;
97 $this->secret = $a_secret;
101 return $this->secret;
105 $this->server_string = $a_server_string;
106 $this->servers = explode(
',',$this->server_string);
110 return implode(
',',$this->servers);
114 return $this->servers ? $this->servers : array();
118 $this->name = $a_name;
135 $auth_params[
'servers'][] = array($server,$this->
getPort(),$this->
getSecret());
137 return $auth_params ? $auth_params : array();
149 return $this->default_role;
154 $this->default_role = $a_role;
165 return $this->creation;
177 $this->creation = $a_status;
189 $this->account_migration = $a_status;
200 return $this->account_migration ?
true :
false;
211 return $this->charset ? 1 : 0;
223 $this->charset = $a_charset;
235 $this->settings->deleteLike(
'radius_server%');
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 $sets = array(
"radius_active" =>
"setActive",
331 "radius_port" =>
"setPort",
332 "radius_shared_secret" =>
"setSecret",
333 "radius_name" =>
"setName",
334 "radius_creation" =>
"enableCreation",
335 "radius_migration" =>
"enableAccountMigration",
336 "radius_charset" =>
"setCharset"
338 foreach ($sets as $s => $m)
340 if (isset($all_settings[$s]))
342 $this->$m($all_settings[$s]);
346 reset($all_settings);
347 foreach($all_settings as $k => $v)
349 if (substr($k, 0, 13) ==
"radius_server")
351 $this->servers[] = $v;
355 include_once(
'./Services/AccessControl/classes/class.ilObjRole.php');
357 $this->default_role = 0;
358 if (isset($roles[0]) && $roles[0])
360 $this->default_role = $roles[0];