14 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
15 ilUnitUtil::performInitialisation();
24 include_once(
"./Services/User/classes/class.ilObjUser.php");
37 "login" =>
"aatestuser",
39 "passwd" =>
"password",
42 "lastname" =>
"Mutzke",
43 "email" =>
"de@de.de",
44 "client_ip" =>
"1.2.3.4",
45 "ext_account" =>
"ext_mutzke" 47 $user->assignData(
$d);
50 $user->setLanguage(
"no");
53 $value.= $user->getFirstname() .
"-";
56 $user->setFirstname(
"Maxi");
58 $value.= $user->getFirstname() .
"-";
61 $user->refreshLogin();
68 $value.=
$n[
"lastname"] .
"-";
81 $user->writePref(
"testpref",
"pref1");
83 $user->deletePref(
"testpref");
85 $value.=
"pref2" .
"-";
89 $user->setActive(
false);
93 $user->setActive(
true);
106 "Max-Maxi-de@de.de-m-1.2.3.4-Mutzke-aatestuser-ext_mutzke-$id-no-le-" .
107 "pref1-pref2-act1-act2-act3-",
119 include_once(
"./Services/User/classes/class.ilObjUser.php");
126 "login" =>
"aatestuser2",
128 "passwd" =>
"password",
130 "firstname" =>
"Heidi",
131 "lastname" =>
"Kabel",
132 "email" =>
"qwe@ty.de",
133 "ext_account" =>
"ext_" 135 $user->assignData(
$d);
136 $user->setActive(
true);
139 $user->setLanguage(
"de");
141 $id = $user->getId();
147 if (is_array($ids) && count($ids) == 1 && $ids[0] ==
"aatestuser2") {
156 foreach ($acc as $k => $v) {
157 if ($k ==
$id && $v ==
"ext_kabel") {
186 "email1-email2-auth1-auth2-auth3-auth4-",
197 include_once(
"./Services/User/classes/class.ilObjUser.php");
204 "login" =>
"aatestuser3",
206 "passwd" =>
"password",
208 "firstname" =>
"Heidi",
209 "lastname" =>
"Kabel",
210 "email" =>
"de@de.de" 212 $user->assignData(
$d);
213 $user->setActive(
true);
216 $user->setLanguage(
"de");
218 $id = $user->getId();
220 $user->addDesktopItem(ROOT_FOLDER_ID,
"root");
221 if ($user->isDesktopItem(ROOT_FOLDER_ID,
"root")) {
224 $user->setDesktopItemParameters(ROOT_FOLDER_ID,
"root",
"par1");
225 $di = $user->getDesktopItems();
226 if ($item = current($di)) {
227 if ($item[
"type"] ==
"root" && $item[
"ref_id"] == ROOT_FOLDER_ID) {
232 $user->dropDesktopItem(ROOT_FOLDER_ID,
"root");
233 if (!$user->isDesktopItem(ROOT_FOLDER_ID,
"root")) {
236 $user->_removeItemFromDesktops(ROOT_FOLDER_ID);
242 "desk1-desk2-desk3-",
253 include_once(
"./Services/User/classes/class.ilObjUser.php");
293 "login" =>
"aatestuser3",
295 "passwd" =>
"password",
297 "firstname" =>
"Heidi",
298 "lastname" =>
"Kabel",
299 "email" =>
"de@de.de" 301 $user->assignData(
$d);
302 $user->setActive(
true);
305 $user->setLanguage(
"de");
307 $id = $user->getId();
309 $user->addObjectToClipboard(
$id,
"user",
"aatestuser");
310 $user->addObjectToClipboard(56,
"mump",
"mumpitz");
311 if ($user->clipboardHasObjectsOfType(
"user")) {
315 $user->clipboardDeleteObjectsOfType(
"user");
316 if ($user->clipboardHasObjectsOfType(
"mump") &&
317 !$user->clipboardHasObjectsOfType(
"user")) {
321 $objs = $user->getClipboardObjects(
"mump");
322 if (is_array($objs) && count($objs) == 1 && $objs[0][
"id"] == 56) {
326 $objs = $user->getClipboardChilds(56,
"2008-10-10");
330 if (is_array($us) && count($us) == 1 && $us[0] ==
$id) {
337 "clip1-clip2-clip3-clip4-",
350 include_once(
"./Services/User/classes/class.ilObjUser.php");
static _lookupLogin($a_user_id)
lookup login
static _lookupName($a_user_id)
lookup user name
static _lookupExternalAccount($a_user_id)
lookup external account for login and authmethod
static _getNumberOfUsersForStyle($a_skin, $a_style)
skins and styles
Class ilObjUserTest needsInstalledILIAS.
testAuthAndEmailMethods()
Auth and email related methods IL_Init.
testClipboard()
Clipboard IL_Init.
static _getUsersForClipboadObject($a_type, $a_id)
get all users, that have a certain object within their clipboard
testSearch()
Search methods IL_Init.
static _incrementLoginAttempts($a_usr_id)
if(!array_key_exists('StateId', $_REQUEST)) $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.
static _lookupClientIP($a_user_id)
Lookup client ip.
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.
static _readUsersProfileData($a_user_ids)
STATIC METHOD get user data of selected users.
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...
static _getAllUserData($a_fields=null, $active=-1)
STATIC METHOD get all user data.
static _getLocalAccountsForEmail($a_email)
check whether external account and authentication method matches with a user
static _getNumberOfUsersPerAuthMode()
get number of users per auth mode
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.
Create styles array
The data for the language used.
static _checkExternalAuthAccount($a_auth, $a_account, $tryFallback=true)
check whether external account and authentication method matches with a user
testMiscellaneous()
Miscellaneous IL_Init.
static _lookupAuthMode($a_usr_id)
lookup auth mode
static _setUserInactive($a_usr_id)
static _lookupLanguage($a_usr_id)
testPersonalDesktopItems()
Personal Desktop Items IL_Init.
static _lookupEmail($a_user_id)
Lookup email.
static _lookupPref($a_usr_id, $a_keyword)
testCreateSetLookupDelete()
Creates a user, sets preferences, lookups data, delete user IL_Init.
static _getUserIdsByEmail($a_email)
STATIC METHOD get all user_ids of an email address.
static _moveUsersToStyle($a_from_skin, $a_from_style, $a_to_skin, $a_to_style)
skins and styles
getStoredActive($a_id)
get user active state
static _lookupFields($a_user_id)
lookup fields (deprecated; use more specific methods instead)
static _writeAuthMode($a_usr_id, $a_auth_mode)
static _writeExternalAccount($a_usr_id, $a_ext_id)
static _getAllUserAssignedStyles()
skins and styles
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _lookupLastLogin($a_user_id)
lookup last login