46 $this->ilias =& $ilias;
48 $this->user =& $a_user_obj;
50 $this->
__init($a_from_ilinc);
57 $q =
"SELECT ilinc_id,ilinc_login,ilinc_passwd FROM usr_data ".
58 "WHERE usr_data.usr_id = ".$ilDB->quote($this->user->getId());
59 $r = $ilDB->query($q);
61 if ($r->numRows() > 0)
65 $this->
id =
$data[
'ilinc_id'];
66 $this->login =
$data[
'ilinc_login'];
67 $this->passwd =
$data[
'ilinc_passwd'];
71 $ilErr->raiseError(
"<b>Error: There is no dataset with id ".
72 $this->
id.
"!</b><br />class: ".get_class($this).
"<br />Script: ".__FILE__.
73 "<br />Line: ".__LINE__, $ilErr->FATAL);
85 $q =
"UPDATE usr_data SET ".
86 "last_update=now(), ".
90 "WHERE usr_id = ".$ilDB->quote($this->user->getId());
92 $this->ilias->db->query($q);
109 $err_msg = $this->error_msg;
110 $this->error_msg =
"";
129 $chars = preg_split(
'//', substr($a_user_login,0,3), -1, PREG_SPLIT_NO_EMPTY);
134 $result = preg_replace(
'@[^a-zA-Z0-9_]@',
'_',$chars);
136 $data[
"login"] =
$result.
"_".$a_user_id.
"_".$a_inst_id.
"_".time();
137 $data[
"passwd"] = md5(microtime().$a_user_login.rand(10000, 32000));
140 $this->login =
$data[
'login'];
141 $this->passwd =
$data[
'passwd'];
149 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
154 $login_data = $this->
__createLoginData($this->user->getId(),$this->user->getLogin(),$this->ilias->getSetting($inst_id));
157 $this->ilincAPI->addUser($this);
158 $response = $this->ilincAPI->sendRequest();
160 if ($response->isError())
162 if (!$response->getErrorMsg())
164 $this->error_msg =
"err_add_user";
168 $this->error_msg = $response->getErrorMsg();
174 $this->
id = $response->getFirstID();
175 $this->login = $login_data[
"login"];
176 $this->passwd = $login_data[
"passwd"];
186 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
191 $this->ilincAPI->editUser($this);
192 $response = $this->ilincAPI->sendRequest();
194 if ($response->isError())
196 if (!$response->getErrorMsg())
198 $this->error_msg =
"err_edit_user";
202 $this->error_msg = $response->getErrorMsg();
224 function find($a_id =
'',$a_login =
'', $a_fullname =
'')
226 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
230 $this->ilincAPI->findUser($a_id,$a_login,$a_fullname);
231 $response = $this->ilincAPI->sendRequest();
233 if ($response->isError())
235 if (!$response->getErrorMsg())
237 $this->error_msg =
"err_find_user";
241 $this->error_msg = $response->getErrorMsg();
247 return $response->data;
252 $this->$a_varname = $a_value;