10 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
11 ilUnitUtil::performInitialisation();
21 include_once(
"./Services/User/classes/class.ilObjUser.php");
35 "login" =>
"aatestuser",
37 "passwd" =>
"password",
40 "lastname" =>
"Mutzke",
41 "email" =>
"de@de.de",
42 "client_ip" =>
"1.2.3.4",
43 "ext_account" =>
"ext_mutzke" 45 $user->assignData(
$d);
48 $user->setLanguage(
"no");
51 $value.= $user->getFirstname().
"-";
54 $user->setFirstname(
"Maxi");
56 $value.= $user->getFirstname().
"-";
59 $user->refreshLogin();
66 $value.=
$n[
"lastname"].
"-";
84 $user->replacePassword(md5(
"password2"));
89 $user->updatePassword(
"password2",
"password3",
"password3");
94 $user->resetPassword(
"password4",
"password4");
101 $user->writePref(
"testpref",
"pref1");
103 $user->deletePref(
"testpref");
106 $value.=
"pref2".
"-";
110 $user->setActive(
false);
115 $user->setActive(
true);
129 $this->assertEquals(
"Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-$id-no-le-".
130 "pw1-pw2-pw3-pw4-pref1-pref2-act1-act2-act3-",
141 include_once(
"./Services/User/classes/class.ilObjUser.php");
148 "login" =>
"aatestuser2",
150 "passwd" =>
"password",
152 "firstname" =>
"Heidi",
153 "lastname" =>
"Kabel",
154 "email" =>
"qwe@ty.de",
155 "ext_account" =>
"ext_" 157 $user->assignData(
$d);
158 $user->setActive(
true);
161 $user->setLanguage(
"de");
163 $id = $user->getId();
169 if (is_array($ids) && count($ids) == 1 && $ids[0] ==
"aatestuser2")
180 foreach ($acc as $k => $v)
181 if ($k == $id && $v ==
"ext_kabel")
212 $this->assertEquals(
"email1-email2-auth1-auth2-auth3-auth4-",
222 include_once(
"./Services/User/classes/class.ilObjUser.php");
229 "login" =>
"aatestuser3",
231 "passwd" =>
"password",
233 "firstname" =>
"Heidi",
234 "lastname" =>
"Kabel",
235 "email" =>
"de@de.de" 237 $user->assignData(
$d);
238 $user->setActive(
true);
241 $user->setLanguage(
"de");
243 $id = $user->getId();
245 $user->addDesktopItem(ROOT_FOLDER_ID,
"root");
246 if ($user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
250 $user->setDesktopItemParameters(ROOT_FOLDER_ID,
"root",
"par1");
251 $di = $user->getDesktopItems();
252 if ($item = current($di))
254 if ($item[
"type"] ==
"root" && $item[
"ref_id"] == ROOT_FOLDER_ID)
260 $user->dropDesktopItem(ROOT_FOLDER_ID,
"root");
261 if (!$user->isDesktopItem(ROOT_FOLDER_ID,
"root"))
265 $user->_removeItemFromDesktops(ROOT_FOLDER_ID);
270 $this->assertEquals(
"desk1-desk2-desk3-",
280 include_once(
"./Services/User/classes/class.ilObjUser.php");
303 $this->assertEquals(
"",
318 "login" =>
"aatestuser3",
320 "passwd" =>
"password",
322 "firstname" =>
"Heidi",
323 "lastname" =>
"Kabel",
324 "email" =>
"de@de.de" 326 $user->assignData(
$d);
327 $user->setActive(
true);
330 $user->setLanguage(
"de");
332 $id = $user->getId();
334 $user->addObjectToClipboard($id,
"user",
"aatestuser");
335 $user->addObjectToClipboard(56,
"mump",
"mumpitz");
336 if ($user->clipboardHasObjectsOfType(
"user"))
341 $user->clipboardDeleteObjectsOfType(
"user");
342 if ($user->clipboardHasObjectsOfType(
"mump") &&
343 !$user->clipboardHasObjectsOfType(
"user"))
348 $objs = $user->getClipboardObjects(
"mump");
349 if (is_array($objs) && count($objs) == 1 && $objs[0][
"id"] == 56)
354 $objs = $user->getClipboardChilds(56,
"2008-10-10");
358 if (is_array($us) && count($us) == 1 && $us[0] == $id)
365 $this->assertEquals(
"clip1-clip2-clip3-clip4-",
377 include_once(
"./Services/User/classes/class.ilObjUser.php");
382 $this->assertEquals(
"",
static _lookupName($a_user_id)
lookup user name
_lookupLastLogin($a_user_id)
lookup last login
_getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
testAuthAndEmailMethods()
Auth and email related methods IL_Init.
_lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
testClipboard()
Clipboard IL_Init.
_moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
testSearch()
Search methods IL_Init.
_lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
static _incrementLoginAttempts($a_usr_id)
static _getExternalAccountsByAuthMode($a_auth_mode, $a_read_auth_default=false)
Get list of external account by authentication method Note: If login == ext_account for two user with...
static _lookupId($a_user_str)
lookup id by login
_lookupPref($a_usr_id, $a_keyword)
static _lookupGender($a_user_id)
Lookup gender.
static _resetLoginAttempts($a_usr_id)
static _getLoginAttempts($a_usr_id)
static _toggleActiveStatusOfUsers($a_usr_ids, $a_status)
Toggle active status of users.
_getNumberOfUsersPerAuthMode()
get number of users per auth mode
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
_getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
static _externalAccountExists($a_external_account, $a_auth_mode)
Check if an external account name already exists.
getUserIdByEmail($a_email)
STATIC METHOD get the user_id of an email address.
static _loginExists($a_login, $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
_checkPassword($a_usr_id, $a_pw)
static searchUsers($a_search_str, $active=1, $a_return_ids_only=false, $filter_settings=FALSE)
STATIC METHOD get the user_ids which correspond a search string.
_lookupLogin($a_user_id)
lookup login
_lookupEmail($a_user_id)
Lookup email.
_getAllUserData($a_fields=NULL, $active=-1)
STATIC METHOD get all user data.
testMiscellaneous()
Miscellaneous IL_Init.
_writeExternalAccount($a_usr_id, $a_ext_id)
static _lookupAuthMode($a_usr_id)
lookup auth mode
static _setUserInactive($a_usr_id)
static _lookupLanguage($a_usr_id)
testPersonalDesktopItems()
Personal Desktop Items IL_Init.
_writeAuthMode($a_usr_id, $a_auth_mode)
static _checkExternalAuthAccount($a_auth, $a_account)
check whether external account and authentication method matches with a user
testCreateSetLookupDelete()
Creates a user, sets preferences, lookups data, changes password, delete user IL_Init.
getStoredActive($a_id)
get user active state
_getAllUserAssignedStyles()
skins and styles
_getUsersForClipboadObject($a_type, $a_id)
get all users, that have a certain object within their clipboard
_lookupClientIP($a_user_id)
Lookup client ip.
_getUserIdsByEmail($a_email)
STATIC METHOD get all user_ids of an email address.