Пример #1
0
 /**
  * Read role properties and write them to form
  * @return 
  * @param object $role
  */
 protected function readRoleProperties(ilObjRole $role)
 {
     global $rbacreview;
     include_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
     $data['title'] = $role->getTitle();
     $data['desc'] = $role->getDescription();
     $data['reg'] = $role->getAllowRegister();
     $data['la'] = $role->getAssignUsersStatus();
     if (ilDiskQuotaActivationChecker::_isActive()) {
         $data['disk_quota'] = $role->getDiskQuota() / pow(ilFormat::_getSizeMagnitude(), 2);
     }
     if (ilDiskQuotaActivationChecker::_isPersonalWorkspaceActive()) {
         $data['wsp_disk_quota'] = $role->getPersonalWorkspaceDiskQuota() / pow(ilFormat::_getSizeMagnitude(), 2);
     }
     $data['pro'] = $rbacreview->isProtected($this->rolf_ref_id, $role->getId());
     $this->form->setValuesByArray($data);
 }
Пример #2
0
 /**
  * Get values from user object and put them into form
  */
 function getValues()
 {
     global $ilUser, $ilSetting;
     $data = array();
     // login data
     $data["auth_mode"] = $this->object->getAuthMode();
     $data["login"] = $this->object->getLogin();
     //$data["passwd"] = "********";
     //$data["passwd2"] = "********";
     $data["ext_account"] = $this->object->getExternalAccount();
     // system information
     require_once './Services/Utilities/classes/class.ilFormat.php';
     $data["create_date"] = ilFormat::formatDate($this->object->getCreateDate(), 'datetime', true);
     $data["owner"] = ilObjUser::_lookupLogin($this->object->getOwner());
     $data["approve_date"] = $this->object->getApproveDate() != "" ? ilFormat::formatDate($this->object->getApproveDate(), 'datetime', true) : null;
     $data["agree_date"] = $this->object->getAgreeDate() != "" ? ilFormat::formatDate($this->object->getAgreeDate(), 'datetime', true) : null;
     $data["last_login"] = $this->object->getLastLogin() != "" ? ilFormat::formatDate($this->object->getLastLogin(), 'datetime', true) : null;
     $data["active"] = $this->object->getActive();
     $data["time_limit_unlimited"] = $this->object->getTimeLimitUnlimited();
     $from = new ilDateTime($this->object->getTimeLimitFrom() ? $this->object->getTimeLimitFrom() : time(), IL_CAL_UNIX);
     $data["time_limit_from"]["date"] = $from->get(IL_CAL_FKT_DATE, 'Y-m-d', $ilUser->getTimeZone());
     $data["time_limit_from"]["time"] = $from->get(IL_CAL_FKT_DATE, 'H:i:s', $ilUser->getTimeZone());
     $until = new ilDateTime($this->object->getTimeLimitUntil() ? $this->object->getTimeLimitUntil() : time(), IL_CAL_UNIX);
     $data['time_limit_until']['date'] = $until->get(IL_CAL_FKT_DATE, 'Y-m-d', $ilUser->getTimeZone());
     $data['time_limit_until']['time'] = $until->get(IL_CAL_FKT_DATE, 'H:i:s', $ilUser->getTimeZone());
     // BEGIN DiskQuota, Show disk space used
     require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
     if (ilDiskQuotaActivationChecker::_isActive()) {
         $data["disk_quota"] = $this->object->getDiskQuota() / ilFormat::_getSizeMagnitude() / ilFormat::_getSizeMagnitude();
     }
     if (ilDiskQuotaActivationChecker::_isPersonalWorkspaceActive()) {
         $data["wsp_disk_quota"] = $this->object->getPersonalWorkspaceDiskQuota() / ilFormat::_getSizeMagnitude() / ilFormat::_getSizeMagnitude();
     }
     // W. Randelshofer 2008-09-09: Deactivated display of disk space usage,
     // because determining the disk space usage may take several minutes.
     /*
     require_once "Modules/File/classes/class.ilObjFileAccess.php";
     require_once "Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php";
     require_once "Modules/ScormAicc/classes/class.ilObjSAHSLearningModuleAccess.php";
     require_once "Services/Mail/classes/class.ilObjMailAccess.php";
     require_once "Modules/Forum/classes/class.ilObjForumAccess.php";
     require_once "Modules/MediaCast/classes/class.ilObjMediaCastAccess.php";
     $data["disk_space_used"] =
     	ilObjFileAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>'.
     	ilObjFileBasedLMAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>'.
     	ilObjSAHSLearningModuleAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>'.
     	ilObjMailAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>'.
     	ilObjForumAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>'.
     	ilObjMediaCastAccess::_getDiskSpaceUsedBy($this->object->getId(), true).'<br>';
     */
     // END DiskQuota, Show disk space used
     // personal data
     $data["gender"] = $this->object->getGender();
     $data["firstname"] = $this->object->getFirstname();
     $data["lastname"] = $this->object->getLastname();
     $data["title"] = $this->object->getUTitle();
     $data['birthday'] = $this->object->getBirthday();
     $data["institution"] = $this->object->getInstitution();
     $data["department"] = $this->object->getDepartment();
     $data["street"] = $this->object->getStreet();
     $data["city"] = $this->object->getCity();
     $data["zipcode"] = $this->object->getZipcode();
     $data["country"] = $this->object->getCountry();
     $data["sel_country"] = $this->object->getSelectedCountry();
     $data["phone_office"] = $this->object->getPhoneOffice();
     $data["phone_home"] = $this->object->getPhoneHome();
     $data["phone_mobile"] = $this->object->getPhoneMobile();
     $data["fax"] = $this->object->getFax();
     $data["email"] = $this->object->getEmail();
     $data["hobby"] = $this->object->getHobby();
     $data["referral_comment"] = $this->object->getComment();
     // interests
     $data["interests_general"] = $this->object->getGeneralInterests();
     $data["interests_help_offered"] = $this->object->getOfferingHelp();
     $data["interests_help_looking"] = $this->object->getLookingForHelp();
     // instant messengers
     $data["im_icq"] = $this->object->getInstantMessengerId('icq');
     $data["im_yahoo"] = $this->object->getInstantMessengerId('yahoo');
     $data["im_msn"] = $this->object->getInstantMessengerId('msn');
     $data["im_aim"] = $this->object->getInstantMessengerId('aim');
     $data["im_skype"] = $this->object->getInstantMessengerId('skype');
     $data["im_jabber"] = $this->object->getInstantMessengerId('jabber');
     $data["im_voip"] = $this->object->getInstantMessengerId('voip');
     // other data
     $data["matriculation"] = $this->object->getMatriculation();
     $data["delicious"] = $this->object->getDelicious();
     $data["client_ip"] = $this->object->getClientIP();
     // user defined fields
     include_once './Services/User/classes/class.ilUserDefinedFields.php';
     $this->user_defined_fields = ilUserDefinedFields::_getInstance();
     $user_defined_data = $this->object->getUserDefinedData();
     foreach ($this->user_defined_fields->getDefinitions() as $field_id => $definition) {
         $data["udf_" . $field_id] = $user_defined_data["f_" . $field_id];
     }
     // settings
     $data["language"] = $this->object->getLanguage();
     $data["skin_style"] = $this->object->skin . ":" . $this->object->prefs["style"];
     $data["hits_per_page"] = $this->object->prefs["hits_per_page"];
     $data["show_users_online"] = $this->object->prefs["show_users_online"];
     $data["hide_own_online_status"] = $this->object->prefs["hide_own_online_status"] == 'y';
     $data["session_reminder_enabled"] = (int) $this->object->prefs["session_reminder_enabled"];
     $this->form_gui->setValuesByArray($data);
 }