46 $this->ilias =& $ilias;
48 $this->user =& $a_user_obj;
50 $this->
__init($a_from_ilinc);
58 SELECT ilinc_id, ilinc_login, ilinc_passwd FROM usr_data
59 WHERE usr_data.usr_id = %s',
61 array($this->user->getId()));
63 if ($ilDB->numRows($r) > 0)
65 $data = $ilDB->fetchAssoc($r);
67 $this->
id =
$data[
'ilinc_id'];
68 $this->login =
$data[
'ilinc_login'];
69 $this->passwd =
$data[
'ilinc_passwd'];
73 $ilErr->raiseError(
"<b>Error: There is no dataset with id ".
74 $this->
id.
"!</b><br />class: ".get_class($this).
"<br />Script: ".__FILE__.
75 "<br />Line: ".__LINE__, $ilErr->FATAL);
87 $statement = $ilDB->manipulateF(
'
94 array(
'timestamp',
'integer',
'text',
'text',
'integer'),
95 array(date(
'Y-m-d H:i:s', time()), $this->
id, $this->login, $this->passwd, $this->user->getId()));
112 $err_msg = $this->error_msg;
113 $this->error_msg =
"";
132 $chars = preg_split(
'//', substr($a_user_login,0,3), -1, PREG_SPLIT_NO_EMPTY);
137 $result = preg_replace(
'@[^a-zA-Z0-9_]@',
'_',$chars);
139 $data[
"login"] =
$result.
"_".$a_user_id.
"_".$a_inst_id.
"_".time();
140 $data[
"passwd"] = md5(microtime().$a_user_login.rand(10000, 32000));
143 $this->login =
$data[
'login'];
144 $this->passwd =
$data[
'passwd'];
152 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
157 $login_data = $this->
__createLoginData($this->user->getId(),$this->user->getLogin(),$this->ilias->getSetting($inst_id));
160 $this->ilincAPI->addUser($this);
161 $response = $this->ilincAPI->sendRequest();
163 if ($response->isError())
165 if (!$response->getErrorMsg())
167 $this->error_msg =
"err_add_user";
171 $this->error_msg = $response->getErrorMsg();
177 $this->
id = $response->getFirstID();
178 $this->login = $login_data[
"login"];
179 $this->passwd = $login_data[
"passwd"];
189 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
194 $this->ilincAPI->editUser($this);
195 $response = $this->ilincAPI->sendRequest();
197 if ($response->isError())
199 if (!$response->getErrorMsg())
201 $this->error_msg =
"err_edit_user";
205 $this->error_msg = $response->getErrorMsg();
227 function find($a_id =
'',$a_login =
'', $a_fullname =
'')
229 include_once (
'./Modules/ILinc/classes/class.ilnetucateXMLAPI.php');
233 $this->ilincAPI->findUser($a_id,$a_login,$a_fullname);
234 $response = $this->ilincAPI->sendRequest();
236 if ($response->isError())
238 if (!$response->getErrorMsg())
240 $this->error_msg =
"err_find_user";
244 $this->error_msg = $response->getErrorMsg();
250 return $response->data;
255 $this->$a_varname = $a_value;