/**
  * show send mail
  *
  * @access public
  * @param
  * @return
  */
 public function sendMailToSelectedUsers()
 {
     if (isset($_GET['member_id'])) {
         $_POST['participants'] = array($_GET['member_id']);
     } else {
         $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'], (array) $_POST['tutors'], (array) $_POST['members'], (array) $_POST['roles'], (array) $_POST['waiting'], (array) $_POST['subscribers']));
     }
     if (!count($_POST['participants'])) {
         ilUtil::sendFailure($GLOBALS['lng']->txt("no_checkbox"), TRUE);
         $this->ctrl->returnToParent($this);
         return false;
     }
     foreach ($_POST['participants'] as $usr_id) {
         $rcps[] = ilObjUser::_lookupLogin($usr_id);
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     ilUtil::redirect(ilMailFormCall::getRedirectTarget($this->getCurrentObject(), 'members', array(), array('type' => 'new', 'rcp_to' => implode(',', $rcps), 'sig' => $this->createMailSignature())));
     return true;
 }
 /**
  * set feedback status for member and redirect to mail screen
  */
 function redirectFeedbackMail()
 {
     if ($_GET["member_id"] != "") {
         ilEphAssignment::updateStatusFeedbackForUser((int) $_GET["ass_id"], (int) $_GET["member_id"], 1);
         $login = ilObjUser::_lookupLogin((int) $_GET["member_id"]);
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'showSubmissions', array(), array('type' => 'new', 'rcp_to' => urlencode($login))));
     } else {
         if (count($_POST["member"]) > 0) {
             include_once './Services/User/classes/class.ilObjUser.php';
             $logins = array();
             foreach ($_POST["member"] as $member => $val) {
                 $logins[] = ilObjUser::_lookupLogin($member);
                 ilEphAssignment::updateStatusFeedbackForUser((int) $_GET["ass_id"], $member, 1);
             }
             $logins = implode($logins, ",");
             require_once 'Services/Mail/classes/class.ilMailFormCall.php';
             ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'showSubmissions', array(), array('type' => 'new', 'rcp_to' => $logins)));
         }
     }
     ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
     $this->ctrl->redirect($this, "showSubmissions");
 }
 /**
  * get public profile html code
  * 
  * Used in Personal Profile (as preview) and Portfolio (as page block)
  */
 function getEmbeddable($a_add_goto = false)
 {
     global $ilSetting, $lng, $ilCtrl, $lng, $ilSetting, $ilUser;
     // get user object
     if (!ilObject::_exists($this->getUserId())) {
         return "";
     }
     $user = new ilObjUser($this->getUserId());
     $tpl = new ilTemplate("tpl.usr_public_profile.html", true, true, "Services/User");
     $tpl->setVariable("ROWCOL1", "tblrow1");
     $tpl->setVariable("ROWCOL2", "tblrow2");
     if (!$this->offline && $ilUser->getId() != ANONYMOUS_USER_ID) {
         $ref_url = str_replace("&", "&", $this->getBackUrl());
         if (!$ref_url) {
             $ref_url = basename($_SERVER['REQUEST_URI']);
         }
         $tpl->setCurrentBlock("mail");
         $tpl->setVariable("TXT_MAIL", $lng->txt("send_mail"));
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         $tpl->setVariable('HREF_MAIL', ilMailFormCall::getLinkTarget($ref_url, '', array(), array('type' => 'new', 'rcp_to' => urlencode($user->getLogin()))));
         $tpl->parseCurrentBlock();
     }
     $first_name = "";
     if ($this->getPublicPref($user, "public_title") == "y") {
         $first_name .= $user->getUTitle() . " ";
     }
     $first_name .= $user->getFirstName();
     $tpl->setVariable("TXT_NAME", $lng->txt("name"));
     $tpl->setVariable("FIRSTNAME", $first_name);
     $tpl->setVariable("LASTNAME", $user->getLastName());
     if (!$this->offline) {
         // vcard
         $tpl->setCurrentBlock("vcard");
         $tpl->setVariable("TXT_VCARD", $lng->txt("vcard"));
         $tpl->setVariable("TXT_DOWNLOAD_VCARD", $lng->txt("vcard_download"));
         $ilCtrl->setParameter($this, "user", $this->getUserId());
         $tpl->setVariable("HREF_VCARD", $ilCtrl->getLinkTarget($this, "deliverVCard"));
         //$tpl->setVariable("IMG_VCARD", ilUtil::getImagePath("vcard.png"));
     }
     $webspace_dir = ilUtil::getWebspaceDir("user");
     $check_dir = ilUtil::getWebspaceDir();
     $imagefile = $webspace_dir . "/usr_images/" . $user->getPref("profile_image") . "?dummy=" . rand(1, 999999);
     $check_file = $check_dir . "/usr_images/" . $user->getPref("profile_image");
     if (!@is_file($check_file)) {
         $imagefile = $check_file = ilObjUser::_getPersonalPicturePath($user->getId(), "small", false, true);
     }
     if ($this->getPublicPref($user, "public_upload") == "y" && $imagefile != "") {
         //Getting the flexible path of image form ini file
         //$webspace_dir = ilUtil::getWebspaceDir("output");
         $tpl->setCurrentBlock("image");
         $tpl->setVariable("TXT_IMAGE", $lng->txt("image"));
         $tpl->setVariable("IMAGE_PATH", $imagefile);
         $tpl->setVariable("IMAGE_ALT", $lng->txt("personal_picture"));
         $tpl->parseCurrentBlock();
     }
     // address
     if ($this->getPublicPref($user, "public_street") == "y" || $this->getPublicPref($user, "public_zipcode") == "y" || $this->getPublicPref($user, "public_city") == "y" || $this->getPublicPref($user, "public_country") == "y") {
         $address = array();
         $val_arr = array("getStreet" => "street", "getZipcode" => "zipcode", "getCity" => "city", "getCountry" => "country", "getSelectedCountry" => "sel_country");
         foreach ($val_arr as $key => $value) {
             // if value "y" show information
             if ($this->getPublicPref($user, "public_" . $value) == "y") {
                 $address_value = $user->{$key}();
                 // only if set
                 if (trim($address_value) != "") {
                     switch ($value) {
                         case "street":
                             $address[0] = $address_value;
                             break;
                         case "zipcode":
                         case "city":
                             $address[1] .= " " . $address_value;
                             break;
                         case "sel_country":
                             $lng->loadLanguageModule("meta");
                             $address[2] = $lng->txt("meta_c_" . $address_value);
                             break;
                         case "country":
                             $address[2] = $address_value;
                             break;
                     }
                 }
             }
         }
         if (sizeof($address)) {
             $tpl->setCurrentBlock("address_line");
             foreach ($address as $line) {
                 if (trim($line)) {
                     $tpl->setVariable("TXT_ADDRESS_LINE", trim($line));
                     $tpl->parseCurrentBlock();
                 }
             }
             $tpl->setCurrentBlock("address");
             $tpl->setVariable("TXT_ADDRESS", $lng->txt("address"));
             $tpl->parseCurrentBlock();
         }
     }
     // institution / department
     if ($this->getPublicPref($user, "public_institution") == "y" || $this->getPublicPref($user, "public_department") == "y") {
         $tpl->setCurrentBlock("inst_dep");
         $sep = "";
         if ($this->getPublicPref($user, "public_institution") == "y") {
             $h = $lng->txt("institution");
             $v = $user->getInstitution();
             $sep = " / ";
         }
         if ($this->getPublicPref($user, "public_department") == "y") {
             $h .= $sep . $lng->txt("department");
             $v .= $sep . $user->getDepartment();
         }
         $tpl->setVariable("TXT_INST_DEP", $h);
         $tpl->setVariable("INST_DEP", $v);
         $tpl->parseCurrentBlock();
     }
     // contact
     $val_arr = array("getPhoneOffice" => "phone_office", "getPhoneHome" => "phone_home", "getPhoneMobile" => "phone_mobile", "getFax" => "fax", "getEmail" => "email");
     $v = $sep = "";
     foreach ($val_arr as $key => $value) {
         // if value "y" show information
         if ($this->getPublicPref($user, "public_" . $value) == "y") {
             $v .= $sep . $lng->txt($value) . ": " . $user->{$key}();
             $sep = "<br />";
         }
     }
     if ($ilSetting->get("usr_settings_hide_instant_messengers") != 1) {
         $im_arr = array("icq", "yahoo", "msn", "aim", "skype", "jabber", "voip");
         foreach ($im_arr as $im_name) {
             if ($im_id = $user->getInstantMessengerId($im_name)) {
                 if ($this->getPublicPref($user, "public_im_" . $im_name) != "n") {
                     $v .= $sep . $lng->txt('im_' . $im_name) . ": " . $im_id;
                     $sep = "<br />";
                 }
             }
         }
     }
     if ($v != "") {
         $tpl->parseCurrentBlock("contact");
         $tpl->setVariable("TXT_CONTACT", $lng->txt("contact"));
         $tpl->setVariable("CONTACT", $v);
         $tpl->parseCurrentBlock();
     }
     $val_arr = array("getHobby" => "hobby", "getMatriculation" => "matriculation", "getClientIP" => "client_ip");
     foreach ($val_arr as $key => $value) {
         // if value "y" show information
         if ($this->getPublicPref($user, "public_" . $value) == "y") {
             $tpl->setCurrentBlock("profile_data");
             $tpl->setVariable("TXT_DATA", $lng->txt($value));
             $tpl->setVariable("DATA", $user->{$key}());
             $tpl->parseCurrentBlock();
         }
     }
     // delicious row
     //$d_set = new ilSetting("delicious");
     if ($this->getPublicPref($user, "public_delicious") == "y") {
         $tpl->setCurrentBlock("delicious_row");
         $tpl->setVariable("TXT_DELICIOUS", $lng->txt("delicious"));
         $tpl->setVariable("TXT_DEL_ICON", $lng->txt("delicious"));
         $tpl->setVariable("SRC_DEL_ICON", ilUtil::getImagePath("icon_delicious.png"));
         $tpl->setVariable("DEL_ACCOUNT", $user->getDelicious());
         $tpl->parseCurrentBlock();
     }
     // map
     include_once "./Services/GoogleMaps/classes/class.ilGoogleMapUtil.php";
     if (ilGoogleMapUtil::isActivated() && $this->getPublicPref($user, "public_location") == "y" && $user->getLatitude() != "") {
         $tpl->setVariable("TXT_LOCATION", $lng->txt("location"));
         include_once "./Services/GoogleMaps/classes/class.ilGoogleMapGUI.php";
         $map_gui = new ilGoogleMapGUI();
         $map_gui->setMapId("user_map");
         $map_gui->setWidth("350px");
         $map_gui->setHeight("230px");
         $map_gui->setLatitude($user->getLatitude());
         $map_gui->setLongitude($user->getLongitude());
         $map_gui->setZoom($user->getLocationZoom());
         $map_gui->setEnableNavigationControl(true);
         $map_gui->addUserMarker($user->getId());
         $tpl->setVariable("MAP_CONTENT", $map_gui->getHTML());
     }
     // additional defined user data fields
     include_once './Services/User/classes/class.ilUserDefinedFields.php';
     $this->user_defined_fields =& ilUserDefinedFields::_getInstance();
     $user_defined_data = $user->getUserDefinedData();
     foreach ($this->user_defined_fields->getVisibleDefinitions() as $field_id => $definition) {
         // public setting
         if ($this->getPublicPref($user, "public_udf_" . $definition["field_id"]) == "y") {
             if ($user_defined_data["f_" . $definition["field_id"]] != "") {
                 $tpl->setCurrentBlock("udf_data");
                 $tpl->setVariable("TXT_UDF_DATA", $definition["field_name"]);
                 $tpl->setVariable("UDF_DATA", $user_defined_data["f_" . $definition["field_id"]]);
                 $tpl->parseCurrentBlock();
             }
         }
     }
     // additional information
     $additional = $this->getAdditional();
     if (is_array($additional)) {
         foreach ($additional as $key => $val) {
             $tpl->setCurrentBlock("profile_data");
             $tpl->setVariable("TXT_DATA", $key);
             $tpl->setVariable("DATA", $val);
             $tpl->parseCurrentBlock();
         }
     }
     $goto = "";
     if ($a_add_goto) {
         include_once 'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
         $goto = new ilPermanentLinkGUI("usr", $user->getId());
         $goto = $goto->getHTML();
     }
     return $tpl->get() . $goto;
 }
 public function cancelMail()
 {
     if (ilMailFormCall::isRefererStored()) {
         ilUtil::redirect(ilMailFormCall::getRefererRedirectUrl());
     } else {
         return $this->showForm();
     }
 }
 protected function sendMailToSelectedUsers()
 {
     $_POST['participants'] = array_unique(array_merge((array) $_POST['admins'], (array) $_POST['members']));
     if (!count($_POST['participants'])) {
         ilUtil::sendFailure($this->lng->txt("no_checkbox"));
         $this->participants();
         return false;
     }
     foreach ($_POST['participants'] as $usr_id) {
         $rcps[] = ilObjUser::_lookupLogin($usr_id);
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'participants', array(), array('type' => 'new', 'rcp_to' => implode(',', $rcps))));
     return true;
 }
 function mailToRoleObject()
 {
     global $rbacreview;
     $obj_ids = ilObject::_getIdsForTitle($this->object->getTitle(), $this->object->getType());
     if (count($obj_ids) > 1) {
         $_SESSION['mail_roles'][] = '#il_role_' . $this->object->getId();
     } else {
         $_SESSION['mail_roles'][] = $rbacreview->getRoleMailboxAddress($this->object->getId());
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $script = ilMailFormCall::getRedirectTarget($this, 'userassignment', array(), array('type' => 'role'));
     ilUtil::redirect($script);
 }
 public function showTrustees($a_show_delete = false)
 {
     global $ilToolbar;
     $_SESSION['paya_delete_trustee'] = $_SESSION['paya_delete_trustee'] ? $_SESSION['paya_delete_trustee'] : array();
     $actions = array(0 => $this->lng->txt("paya_disabled"), 1 => $this->lng->txt("paya_enabled"));
     include_once "./Services/Form/classes/class.ilTextInputGUI.php";
     $ul = new ilTextInputGUI($this->lng->txt("user"), "search_str");
     $ul->setDataSource($this->ctrl->getLinkTarget($this, "performSearch", "", true));
     $ul->setSize(20);
     $ilToolbar->addInputItem($ul, true);
     $ilToolbar->addFormButton($this->lng->txt("add"), "performSearch");
     $ilToolbar->setFormAction($this->ctrl->getFormAction($this));
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     if ($a_show_delete) {
         $oConfirmationGUI = new ilConfirmationGUI();
         // set confirm/cancel commands
         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDeleteTrustee"));
         $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_selected_trustees"));
         $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "cancelDelete");
         $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteTrustee");
         foreach ($this->trustee_obj->getTrustees() as $trustee) {
             $delete_row = '';
             if (in_array($trustee['trustee_id'], $_POST['trustee'])) {
                 if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
                     $delete_row = $tmp_obj->getLogin() . ' -> ' . $tmp_obj->getFirstname() . ' ' . $tmp_obj->getLastname();
                 }
             }
             $oConfirmationGUI->addItem('', $delete_row, $delete_row);
         }
         $this->tpl->setVariable("CONFIRMATION", $oConfirmationGUI->getHTML());
     }
     if (!count($this->trustee_obj->getTrustees())) {
         ilUtil::sendInfo($this->lng->txt('paya_no_trustees'));
         return true;
     }
     $counter = 0;
     $f_result = array();
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     foreach ($this->trustee_obj->getTrustees() as $trustee) {
         // GET USER OBJ
         if ($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'], false)) {
             $f_result[$counter]['trustee_id'] = ilUtil::formCheckbox(in_array($trustee['trustee_id'], $_SESSION['paya_delete_trustee']) ? 1 : 0, "trustee[]", $trustee['trustee_id']);
             $f_result[$counter]['login'] = $tmp_obj->getLogin();
             $f_result[$counter]['firstname'] = $tmp_obj->getFirstname();
             $f_result[$counter]['lastname'] = $tmp_obj->getLastname();
             $f_result[$counter]['perm_stat'] = ilUtil::formSelect((int) $trustee['perm_stat'], 'perm_stat[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_obj'] = ilUtil::formSelect((int) $trustee['perm_obj'], 'perm_obj[' . $trustee['trustee_id'] . ']', $actions, false, true);
             $f_result[$counter]['perm_coupons'] = ilUtil::formSelect((int) $trustee['perm_coupons'], 'perm_coupons[' . $trustee['trustee_id'] . ']', $actions, false, true);
             #				$link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
             #					$tmp_obj->getLogin()."\"".$img_mail."</a>";
             $url_mail = ilMailFormCall::getLinkTarget($this, '', array(), array('type' => 'new', 'rcp_to' => $tmp_obj->getLogin()));
             $link_mail = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"" . $url_mail . "\">" . $this->lng->txt("mail") . "</a></div>";
             $f_result[$counter]['options'] = $link_mail;
             unset($tmp_obj);
             ++$counter;
         }
     }
     return $this->__showTrusteesTable($f_result);
 }
 public function executeCommand()
 {
     global $ilUser;
     // Check for incomplete profile
     if ($ilUser->getProfileIncomplete()) {
         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
     }
     // check whether password of user have to be changed
     // due to first login or password of user is expired
     if ($ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired()) {
         ilUtil::redirect('ilias.php?baseClass=ilPersonalDesktopGUI');
     }
     if ($_GET["type"] == "search_res") {
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "attach") {
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "new") {
         $_SESSION['rcp_to'] = $_GET['rcp_to'];
         $_SESSION['rcp_cc'] = $_GET['rcp_cc'];
         $_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "reply") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "read") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "deliverFile") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $_SESSION['filename'] = $_POST["filename"] ? $_POST["filename"] : $_GET["filename"];
         $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "message_sent") {
         ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "role") {
         if (is_array($_POST['roles'])) {
             $_SESSION['mail_roles'] = $_POST['roles'];
         } else {
             if ($_GET["role"]) {
                 $_SESSION['mail_roles'] = array($_GET["role"]);
             }
         }
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["view"] == "my_courses") {
         $_SESSION['search_crs'] = $_GET['search_crs'];
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if (isset($_GET["viewmode"])) {
         ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
         $this->ctrl->setCmd("setViewMode");
     }
     $this->forwardClass = $this->ctrl->getNextClass($this);
     if ($this->ctrl->getCmd() != "showMenu" && $this->ctrl->getCmd() != "refresh") {
         $this->showHeader();
     }
     include_once "Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     switch ($this->forwardClass) {
         case 'ilmailformgui':
             include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
             $this->ctrl->forwardCommand(new ilMailFormGUI());
             break;
         case 'ilmailaddressbookgui':
             include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php';
             $this->ctrl->forwardCommand(new ilMailAddressbookGUI());
             break;
         case 'ilmailoptionsgui':
             include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
             $this->ctrl->forwardCommand(new ilMailOptionsGUI());
             break;
         case 'ilmailfoldergui':
             include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
             $this->ctrl->forwardCommand(new ilMailFolderGUI());
             break;
         default:
             if (!($cmd = $this->ctrl->getCmd())) {
                 $cmd = "setViewMode";
             }
             $this->{$cmd}();
             break;
     }
     return true;
 }
 public function executeCommand()
 {
     if ($_GET["type"] == "search_res") {
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchResults");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "attach") {
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailAttachment");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "new") {
         $_SESSION['rcp_to'] = $_GET['rcp_to'];
         $_SESSION['rcp_cc'] = $_GET['rcp_cc'];
         $_SESSION['rcp_bcc'] = $_GET['rcp_bcc'];
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailUser");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "reply") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "replyMail");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["type"] == "read") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "showMail");
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "deliverFile") {
         $_SESSION['mail_id'] = $_GET['mail_id'];
         $_SESSION['filename'] = $_POST["filename"] ? $_POST["filename"] : $_GET["filename"];
         $this->ctrl->setParameterByClass("ilmailfoldergui", "cmd", "deliverFile");
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "message_sent") {
         ilUtil::sendInfo($this->lng->txt('mail_message_send'), true);
         $this->ctrl->redirectByClass("ilmailfoldergui");
     }
     if ($_GET["type"] == "role") {
         if (is_array($_POST['roles'])) {
             $_SESSION['mail_roles'] = $_POST['roles'];
         } else {
             if ($_GET["role"]) {
                 $_SESSION['mail_roles'] = array($_GET["role"]);
             }
         }
         ilMailFormCall::storeReferer($_GET);
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "mailRole");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if ($_GET["view"] == "my_courses") {
         $_SESSION['search_crs'] = $_GET['search_crs'];
         $this->ctrl->setParameterByClass("ilmailformgui", "cmd", "searchCoursesTo");
         $this->ctrl->redirectByClass("ilmailformgui");
     }
     if (isset($_GET["viewmode"])) {
         ilSession::set(self::VIEWMODE_SESSION_KEY, $_GET["viewmode"]);
         $this->ctrl->setCmd("setViewMode");
     }
     $this->forwardClass = $this->ctrl->getNextClass($this);
     $this->showHeader();
     if ('tree' == ilSession::get(self::VIEWMODE_SESSION_KEY) && $this->ctrl->getCmd() != "showExplorer") {
         $this->showExplorer();
     }
     include_once "Services/jQuery/classes/class.iljQueryUtil.php";
     iljQueryUtil::initjQuery();
     switch ($this->forwardClass) {
         case 'ilmailformgui':
             include_once 'Services/Mail/classes/class.ilMailFormGUI.php';
             $this->ctrl->forwardCommand(new ilMailFormGUI());
             break;
         case 'ilmailaddressbookgui':
             include_once 'Services/Contact/classes/class.ilMailAddressbookGUI.php';
             $this->ctrl->forwardCommand(new ilMailAddressbookGUI());
             break;
         case 'ilmailoptionsgui':
             include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
             $this->ctrl->forwardCommand(new ilMailOptionsGUI());
             break;
         case 'ilmailfoldergui':
             include_once 'Services/Mail/classes/class.ilMailFolderGUI.php';
             $this->ctrl->forwardCommand(new ilMailFolderGUI());
             break;
         default:
             if (!($cmd = $this->ctrl->getCmd())) {
                 $cmd = "setViewMode";
             }
             $this->{$cmd}();
             break;
     }
     return true;
 }
 /**
  * get flat bookmark list for personal desktop
  */
 function fillRow($a_set)
 {
     global $ilUser, $ilCtrl, $lng, $ilSetting, $rbacsetting, $rbacsystem;
     // mail link
     $a_set["mail_to"] = "";
     if ($this->mail_allowed && $rbacsystem->checkAccessOfUser($a_set['id'], 'internal_mail', ilMailGlobalServices::getMailObjectRefId())) {
         $a_set['mail_url'] = ilMailFormCall::getLinkTarget($this->topGuiObj, '', array(), array('type' => 'new', 'rcp_to' => urlencode($a_set['login'])));
     }
     // check for profile
     $a_set["profile"] = in_array(ilObjUser::_lookupPref($a_set["id"], "public_profile"), array("y", "g"));
     // user image
     if ($this->getCurrentDetailLevel() > 2) {
         if ($a_set["mail_url"] != "") {
             $this->tpl->setCurrentBlock("mailto_link");
             $this->tpl->setVariable("TXT_MAIL", $lng->txt("mail"));
             $this->tpl->setVariable("MAIL_URL", $a_set["mail_url"]);
             $this->tpl->parseCurrentBlock();
         }
         $chatSettings = new ilSetting('chatroom');
         if ($chatSettings->get('chat_enabled')) {
             if (!$this->__showActiveChatsOfUser($a_set["id"])) {
                 // Show invite to chat
                 $this->__showChatInvitation($a_set["id"]);
             }
             global $rbacsystem;
             include_once './Modules/Chatroom/classes/class.ilObjChatroom.php';
             if ($a_set["id"] == $ilUser->getId() && $rbacsystem->checkAccess('read', ilObjChatroom::_getPublicRefId())) {
                 $this->tpl->setCurrentBlock('chat_link');
                 $this->tpl->setVariable('TXT_CHAT_INVITE', $lng->txt('chat_enter_public_room'));
                 $this->tpl->setVariable('TXT_CHAT_INVITE_TOOLTIP', $lng->txt('chat_enter_public_room_tooltip'));
                 //					$this->tpl->setVariable('CHAT_LINK','./ilias.php?baseClass=ilChatPresentationGUI&ref_id='.ilObjChat::_getPublicChatRefId());
                 $this->tpl->setVariable('CHAT_LINK', './ilias.php?baseClass=ilRepositoryGUI&cmd=view&ref_id=' . ilObjChatroom::_getPublicRefId());
                 $this->tpl->parseCurrentBlock();
             }
         }
         // user image
         $this->tpl->setCurrentBlock("usr_image");
         $this->tpl->setVariable("USR_IMAGE", ilObjUser::_getPersonalPicturePath($a_set["id"], "xxsmall"));
         $this->tpl->setVariable("USR_ALT", $lng->txt("personal_picture"));
         $this->tpl->parseCurrentBlock();
         $this->tpl->touchBlock("usr_image_space");
         $pd_set = new ilSetting("pd");
         $osi_server = $pd_set->get("osi_host");
         //			if (trim($osi_server) != "")
         //			{
         // instant messengers
         // 1 indicates to use online status check
         $im_arr = array("icq" => 0, "yahoo" => 1, "msn" => 0, "aim" => 0, "skype" => 1, "jabber" => 0, "voip" => 0);
         // use onlinestatus.org
         // when enabled all instant messengers are checked online and ignores settings above
         if (trim($osi_server) != "") {
             $osi_enable = true;
         }
         // removed calls to external servers due to
         // bug 10583, alex 8 Mar 2013
         foreach ($im_arr as $im_name => $im_check) {
             if ($im_id = ilObjUser::_lookupIm($a_set["id"], $im_name)) {
                 $im_url = "";
                 switch ($im_name) {
                     case "icq":
                         $im_url = "http://http://www.icq.com/people/" . $im_id;
                         break;
                     case "yahoo":
                         $im_url = "http://edit.yahoo.com/config/send_webmesg?target=" . $im_id . "&src=pg";
                         break;
                     case "msn":
                         $im_url = "http://messenger.live.com";
                         break;
                     case "aim":
                         //$im_url = "aim:GoIM?screenname=".$im_id;
                         $im_url = "http://aimexpress.aim.com";
                         break;
                     case "skype":
                         $im_url = "skype:" . $im_id . "?call";
                         break;
                 }
                 $im_img = ilUtil::getImagePath($im_name . 'online.png');
                 if ($im_url != "") {
                     $this->tpl->setCurrentBlock("im_link_start");
                     $this->tpl->setVariable("URL_IM", $im_url);
                     $this->tpl->parseCurrentBlock();
                     $this->tpl->touchBlock("im_link_end");
                 }
                 $this->tpl->setCurrentBlock("instant_messengers");
                 $this->tpl->setVariable("IMG_IM_ICON", $im_img);
                 $this->tpl->setVariable("TXT_IM_ICON", $lng->txt("im_" . $im_name));
                 $icon_id = "im_" . $im_name . "_usr_" . $a_set["id"];
                 $this->tpl->setVariable("ICON_ID", $icon_id);
                 include_once "./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php";
                 ilTooltipGUI::addTooltip($icon_id, $lng->txt("im_" . $im_name) . ": " . $im_id, "", "top center", "bottom center");
                 $this->tpl->parseCurrentBlock();
             }
         }
         //			}
     }
     // username
     if (!$a_set["profile"]) {
         $this->tpl->setVariable("USR_LOGIN", $a_set["login"]);
     } else {
         if ($this->getCurrentDetailLevel() > 2) {
             $this->tpl->setVariable("USR_LOGIN", "<br />" . $a_set["login"]);
         } else {
             $this->tpl->setVariable("USR_LOGIN", " [" . $a_set["login"] . "]");
         }
     }
     // profile link
     if ($a_set["profile"]) {
         include_once "Services/User/classes/class.ilUserUtil.php";
         $user_name = ilUserUtil::getNamePresentation($a_set["id"], false, false, "", false, true, false);
         $this->tpl->setCurrentBlock("profile_link");
         $this->tpl->setVariable("TXT_VIEW", $lng->txt("profile"));
         // see ilPersonalProfileGUI::getProfilePortfolio()
         $has_prtf = false;
         if ($ilSetting->get('user_portfolios')) {
             include_once "Modules/Portfolio/classes/class.ilObjPortfolio.php";
             $has_prtf = ilObjPortfolio::getDefaultPortfolio($a_set["id"]);
         }
         if (!$has_prtf) {
             // (simple) profile: center column
             $ilCtrl->setParameter($this, "user", $a_set["id"]);
             $this->tpl->setVariable("LINK_PROFILE", $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
         } else {
             // portfolio: fullscreen
             include_once "Services/Link/classes/class.ilLink.php";
             $this->tpl->setVariable("LINK_PROFILE", ilLink::_getLink($a_set["id"], "usr"));
             $this->tpl->setVariable("LINK_TARGET", "_blank");
         }
         $this->tpl->setVariable("USR_ID", $a_set["id"]);
         $this->tpl->setVariable("LINK_FULLNAME", $user_name);
         $this->tpl->parseCurrentBlock();
     } else {
         $this->tpl->setVariable("USR_FULLNAME", "");
     }
 }
 /**
  * Form for mail to group members
  */
 function mailMembersObject()
 {
     global $rbacreview, $ilObjDataCache, $ilias;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $this->lng->loadLanguageModule('mail');
     if (!isset($_GET['returned_from_mail'])) {
         ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
     }
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'mailMembers', array(), array('type' => 'role', 'sig' => $this->createMailSignature())));
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.png'));
     $this->tpl->setVariable("TXT_MARKED_ENTRIES", $this->lng->txt('marked_entries'));
     $this->tpl->setVariable("OK", $this->lng->txt('next'));
     // Get role mailbox addresses
     $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
     $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
     $role_addrs = array();
     // Sort by relevance
     $sorted_role_ids = array();
     $counter = 2;
     foreach ($role_ids as $role_id) {
         switch (substr(ilObject::_lookupTitle($role_id), 0, 8)) {
             case 'il_grp_a':
                 $sorted_role_ids[1] = $role_id;
                 break;
             case 'il_grp_m':
                 $sorted_role_ids[0] = $role_id;
                 break;
             default:
                 $sorted_role_ids[$counter++] = $role_id;
                 break;
         }
     }
     ksort($sorted_role_ids, SORT_NUMERIC);
     foreach ((array) $sorted_role_ids as $role_id) {
         $this->tpl->setCurrentBlock("mailbox_row");
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         // check if role title is unique. if not force use pear mail for roles
         $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
         if (count($ids_for_role_title) >= 2) {
             $ilias->setSetting('pear_mail_enable', 1);
         }
         $this->tpl->setVariable("CHECK_MAILBOX", ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail()) {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable("MAILBOX", $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable("MAILBOX", ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (" . $role_addr . ")");
         }
         $this->tpl->parseCurrentBlock();
     }
 }
 /**
  * send  bookmarks as attachment
  */
 function sendmail()
 {
     global $ilUser;
     include_once './Services/Mail/classes/class.ilFileDataMail.php';
     require_once "Services/Mail/classes/class.ilFormatMail.php";
     $mfile = new ilFileDataMail($ilUser->getId());
     $umail = new ilFormatMail($ilUser->getId());
     $html_content = $this->export(false);
     $tempfile = ilUtil::ilTempnam();
     $fp = fopen($tempfile, 'w');
     fwrite($fp, $html_content);
     fclose($fp);
     $filename = 'bookmarks.html';
     $mfile->copyAttachmentFile($tempfile, $filename);
     $umail->savePostData($ilUser->getId(), array($filename), '', '', '', '', '', '', '', 0);
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, '', array(), array('type' => 'attach')));
 }
 /**
  * Send Mail to blocked users
  */
 function sendMailToBlockedUsers()
 {
     global $ilCtrl;
     if (!is_array($_POST["userquest_id"])) {
         ilUtil::sendFailure($this->lng->txt("no_checkbox"), 1);
         $ilCtrl->redirect($this, "listBlockedUsers");
     }
     $rcps = array();
     foreach ($_POST["userquest_id"] as $uqid) {
         $uqid = explode(":", $uqid);
         $login = ilObjUser::_lookupLogin($uqid[1]);
         if (!in_array($login, $rcps)) {
             $rcps[] = $login;
         }
     }
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'listBlockedUsers', array(), array('type' => 'new', 'rcp_to' => implode(',', $rcps), 'sig' => $this->getBlockedUsersMailSignature())));
 }
 public function mailMembersObject()
 {
     global $rbacreview, $ilObjDataCache;
     include_once 'Services/AccessControl/classes/class.ilObjRole.php';
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     $this->__setSubTabs('members');
     include_once "./Services/Link/classes/class.ilLink.php";
     $link_to_seminar = ilLink::_getLink($this->object->getRefId());
     include_once 'Services/Mail/classes/class.ilMail.php';
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'mailMembers', array(), array('type' => 'role')));
     $this->tpl->setVariable('ADDITIONAL_MESSAGE_TEXT', $link_to_seminar);
     $this->tpl->setVariable('IMG_ARROW', ilUtil::getImagePath('arrow_downright.png'));
     $this->tpl->setVariable('OK', $this->lng->txt('ok'));
     $role_folder = $rbacreview->getRoleFolderOfObject($this->object->getRefId());
     $role_ids = $rbacreview->getRolesOfRoleFolder($role_folder['ref_id'], false);
     foreach ($role_ids as $role_id) {
         $this->tpl->setCurrentBlock('mailbox_row');
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         $this->tpl->setVariable('CHECK_MAILBOX', ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail()) {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable('MAILBOX', $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable('MAILBOX', ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . ' (' . $role_addr . ')');
         }
         $this->tpl->parseCurrentBlock();
     }
 }
Beispiel #15
0
 function mailMembersObject()
 {
     global $rbacreview, $ilErr, $ilAccess, $ilObjDataCache, $ilias;
     include_once './Services/AccessControl/classes/class.ilObjRole.php';
     $this->lng->loadLanguageModule('mail');
     if (!isset($_GET['returned_from_mail'])) {
         ilUtil::sendInfo($this->lng->txt('mail_select_recipients'));
     }
     $is_admin = (bool) $ilAccess->checkAccess("write", "", $this->object->getRefId());
     if (!$is_admin && $this->object->getMailToMembersType() != ilCourseConstants::MAIL_ALLOWED_ALL) {
         $ilErr->raiseError($this->lng->txt("msg_no_perm_read"), $ilErr->MESSAGE);
     }
     $this->setSubTabs('members');
     $this->tabs_gui->setTabActive('members');
     $this->tabs_gui->setSubTabActive('mail_members');
     $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail_members.html', 'Services/Contact');
     require_once 'Services/Mail/classes/class.ilMailFormCall.php';
     $this->tpl->setVariable("MAILACTION", ilMailFormCall::getLinkTarget($this, 'membersGallery', array(), array('type' => 'role', 'sig' => $this->createMailSignature())));
     $this->tpl->setVariable("SELECT_ACTION", 'ilias.php?baseClass=ilmailgui&view=my_courses&search_crs=' . $this->object->getId());
     $this->tpl->setVariable("MAIL_SELECTED", $this->lng->txt('send_mail_selected'));
     $this->tpl->setVariable("MAIL_MEMBERS", $this->lng->txt('send_mail_members'));
     $this->tpl->setVariable("MAIL_TUTOR", $this->lng->txt('send_mail_tutors'));
     $this->tpl->setVariable("MAIL_ADMIN", $this->lng->txt('send_mail_admins'));
     $this->tpl->setVariable("IMG_ARROW", ilUtil::getImagePath('arrow_downright.svg'));
     $this->tpl->setVariable("OK", $this->lng->txt('next'));
     // Display roles with user friendly mailbox addresses
     $role_ids = $rbacreview->getRolesOfRoleFolder($this->object->getRefId(), false);
     // Sort by relevance
     $sorted_role_ids = array();
     $counter = 3;
     foreach ($role_ids as $role_id) {
         switch (substr(ilObject::_lookupTitle($role_id), 0, 8)) {
             case 'il_crs_a':
                 $sorted_role_ids[2] = $role_id;
                 break;
             case 'il_crs_t':
                 $sorted_role_ids[1] = $role_id;
                 break;
             case 'il_crs_m':
                 $sorted_role_ids[0] = $role_id;
                 break;
             default:
                 $sorted_role_ids[$counter++] = $role_id;
                 break;
         }
     }
     ksort($sorted_role_ids, SORT_NUMERIC);
     foreach ((array) $sorted_role_ids as $role_id) {
         $this->tpl->setCurrentBlock("mailbox_row");
         $role_addr = $rbacreview->getRoleMailboxAddress($role_id);
         // check if role title is unique. if not force use pear mail for roles
         $ids_for_role_title = ilObject::_getIdsForTitle(ilObject::_lookupTitle($role_id), 'role');
         if (count($ids_for_role_title) >= 2) {
             $ilias->setSetting('pear_mail_enable', 1);
         }
         $this->tpl->setVariable("CHECK_MAILBOX", ilUtil::formCheckbox(1, 'roles[]', htmlspecialchars($role_addr)));
         if (ilMail::_usePearMail() && substr($role_addr, 0, 4) != '#il_') {
             // if pear mail is enabled, mailbox addresses are already localized in the language of the user
             $this->tpl->setVariable("MAILBOX", $role_addr);
         } else {
             // if pear mail is not enabled, we need to localize mailbox addresses in the language of the user
             $this->tpl->setVariable("MAILBOX", ilObjRole::_getTranslation($ilObjDataCache->lookupTitle($role_id)) . " (" . $role_addr . ")");
         }
         $this->tpl->parseCurrentBlock();
     }
 }
 /**
  * set feedback status for member and redirect to mail screen
  */
 function redirectFeedbackMailObject()
 {
     $this->checkPermission("write");
     $members = array();
     if ($_GET["member_id"] != "") {
         if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
             $members = ilExAssignment::getTeamMembersByAssignmentId($this->ass->getId(), $_GET["member_id"]);
         } else {
             $members = array($_GET["member_id"]);
         }
     } else {
         if (count($_POST["member"]) > 0) {
             if ($this->ass->getType() == ilExAssignment::TYPE_UPLOAD_TEAM) {
                 foreach (array_keys($_POST["member"]) as $user_id) {
                     $members = array_merge($members, ilExAssignment::getTeamMembersByAssignmentId($this->ass->getId(), $user_id));
                 }
                 $members = array_unique($members);
             } else {
                 $members = array_keys($_POST["member"]);
             }
         }
     }
     if ($members) {
         $logins = array();
         foreach ($members as $user_id) {
             ilExAssignment::updateStatusFeedbackForUser($this->ass->getId(), $user_id, 1);
             $logins[] = ilObjUser::_lookupLogin($user_id);
         }
         $logins = implode($logins, ",");
         require_once 'Services/Mail/classes/class.ilMailFormCall.php';
         ilUtil::redirect(ilMailFormCall::getRedirectTarget($this, 'members', array(), array('type' => 'new', 'rcp_to' => $logins)));
     }
     ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
     $this->ctrl->redirect($this, "members");
 }
 /**
  * Fill table row
  */
 protected function fillRow($user)
 {
     global $ilCtrl, $lng;
     $this->tpl->setVariable("VAL_FIRSTNAME", $user["firstname"]);
     $this->tpl->setVariable("VAL_LASTNAME", $user["lastname"]);
     if ($user['usr_id'] != SYSTEM_USER_ID and ($user['usr_id'] != ANONYMOUS_USER_ID or $this->getRoleId() != ANONYMOUS_ROLE_ID) and $this->isRoleAssignmentEditable()) {
         $this->tpl->setVariable("ID", $user["usr_id"]);
     }
     include_once "./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php";
     $actions = new ilAdvancedSelectionListGUI();
     $actions->setSelectionHeaderClass("small");
     $actions->setItemLinkClass("small");
     $actions->setListTitle($lng->txt('actions'));
     $actions->setId($user['usr_id']);
     $link_contact = ilMailFormCall::getLinkTarget($this->getParentObject(), $this->getParentCmd(), array('fr' => rawurlencode(base64_encode($ilCtrl->getLinkTarget($this->getParentObject(), 'userassignment', '', false, false)))), array('type' => 'new', 'rcp_to' => urlencode($user['login'])));
     $actions->addItem($lng->txt('message'), '', $link_contact);
     if (strtolower($_GET["baseClass"]) == 'iladministrationgui' && $_GET["admin_mode"] == "settings") {
         $ilCtrl->setParameterByClass("ilobjusergui", "ref_id", 7);
         $ilCtrl->setParameterByClass("ilobjusergui", "obj_id", $user["usr_id"]);
         $link_change = $ilCtrl->getLinkTargetByClass(array("iladministrationgui", "ilobjusergui"), "view");
         $this->tpl->setVariable('VAL_LOGIN', $user['login']);
         $this->tpl->setVariable('HREF_LOGIN', $link_change);
         $actions->addItem($this->lng->txt("edit"), '', $link_change);
     } else {
         $this->tpl->setVariable('VAL_PLAIN_LOGIN', $user['login']);
     }
     if (($this->getRoleId() != SYSTEM_ROLE_ID or $user['usr_id'] != SYSTEM_USER_ID) and ($this->getRoleId() != ANONYMOUS_ROLE_ID or $user['usr_id'] != ANONYMOUS_USER_ID) and $this->isRoleAssignmentEditable()) {
         $ilCtrl->setParameter($this->getParentObject(), "user_id", $user["usr_id"]);
         $link_leave = $ilCtrl->getLinkTarget($this->getParentObject(), "deassignUser");
         $actions->addItem($this->lng->txt('remove'), '', $link_leave);
     }
     $this->tpl->setVariable('VAL_ACTIONS', $actions->getHTML());
 }