Exemplo n.º 1
0
 /**
  * Overwrite this method, if link target is not build by ctrl class
  * (e.g. "lm_presentation.php", "forum.php"). This is the case
  * for all links now, but bringing everything to ilCtrl should
  * be realised in the future.
  *
  * @param	string		$a_cmd			command
  *
  */
 function getCommandLink($a_cmd)
 {
     global $ilCtrl;
     switch ($a_cmd) {
         // BEGIN WebDAV: Mount Webfolder.
         case 'mount_webfolder':
             require_once 'Services/WebDAV/classes/class.ilDAVActivationChecker.php';
             if (ilDAVActivationChecker::_isActive()) {
                 require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
                 $davServer = ilDAVServer::getInstance();
                 // XXX: The following is a very dirty, ugly trick.
                 //        To mount URI needs to be put into two attributes:
                 //        href and folder. This hack returns both attributes
                 //        like this:  http://...mount_uri..." folder="http://...folder_uri...
                 $cmd_link = $davServer->getMountURI($this->ref_id) . '" folder="' . $davServer->getFolderURI($this->ref_id);
                 break;
             }
             // fall through if plugin is not active
             // END Mount Webfolder.
         // fall through if plugin is not active
         // END Mount Webfolder.
         case "edit":
         default:
             $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->ref_id);
             $cmd_link = $ilCtrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
             $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
             break;
     }
     return $cmd_link;
 }
 /**
  * Gets the defaultWebfolderInstructions property.
  * This is a read only property. The text is retrieved from $lng.
  * 
  * @return	String	value
  */
 public function getDefaultWebfolderInstructions()
 {
     return ilDAVServer::_getDefaultWebfolderInstructions();
 }
Exemplo n.º 3
0
 /**
  * prepare output
  */
 protected function prepareOutput()
 {
     global $ilLocator, $tpl, $ilUser;
     $this->tpl->getStandardTemplate();
     // administration prepare output
     if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
         $this->addAdminLocatorItems();
         $tpl->setLocator();
         //			ilUtil::sendInfo();
         ilUtil::infoPanel();
         $this->setTitleAndDescription();
         if ($this->getCreationMode() != true) {
             $this->setAdminTabs();
         }
         return false;
     }
     // set locator
     $this->setLocator();
     // catch feedback message
     //		ilUtil::sendInfo();
     ilUtil::infoPanel();
     // in creation mode (parent) object and gui object
     // do not fit
     if ($this->getCreationMode() == true) {
         // repository vs. workspace
         if ($this->call_by_reference) {
             // get gui class of parent and call their title and description method
             $obj_type = ilObject::_lookupType($_GET["ref_id"], true);
             $class_name = $this->objDefinition->getClassName($obj_type);
             $class = strtolower("ilObj" . $class_name . "GUI");
             $class_path = $this->ctrl->lookupClassPath($class);
             include_once $class_path;
             $class_name = $this->ctrl->getClassForClasspath($class_path);
             //echo "<br>instantiating parent for title and description";
             $this->parent_gui_obj = new $class_name("", $_GET["ref_id"], true, false);
             // the next line prevents the header action menu being shown
             $this->parent_gui_obj->setCreationMode(true);
             $this->parent_gui_obj->setTitleAndDescription();
         }
     } else {
         // set title and description and title icon
         $this->setTitleAndDescription();
         // set tabs
         $this->setTabs();
         // BEGIN WebDAV: Display Mount Webfolder icon.
         require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
         if (ilDAVServer::_isActive() && $ilUser->getId() != ANONYMOUS_USER_ID) {
             $this->showMountWebfolderIcon();
         }
         // END WebDAV: Display Mount Webfolder icon.
         // fileupload support
         require_once './Services/FileUpload/classes/class.ilFileUploadUtil.php';
         if (ilFileUploadUtil::isUploadAllowed($this->ref_id, $this->object->getType())) {
             $this->enableDragDropFileUpload();
         }
     }
     return true;
 }
Exemplo n.º 4
0
 /**
  * add standard object section
  */
 function addObjectSections()
 {
     global $lng, $ilCtrl, $ilUser, $ilAccess, $tree, $ilSetting, $ilObjDataCache;
     $this->addSection($lng->txt("additional_info"));
     $a_obj = $this->gui_object->object;
     // links to the object
     if (is_object($a_obj)) {
         // permanent link
         $type = $a_obj->getType();
         $ref_id = $a_obj->getRefId();
         if ($ref_id) {
             include_once './Services/Link/classes/class.ilLink.php';
             $href = ilLink::_getStaticLink($ref_id, $type, true);
             include_once 'Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
             if (ilECSServerSettings::getInstance()->activeServerExists()) {
                 $this->addProperty($lng->txt("object_id"), $a_obj->getId());
             }
             include_once 'Services/PermanentLink/classes/class.ilPermanentLinkGUI.php';
             $pm = new ilPermanentLinkGUI($type, $ref_id);
             $pm->setIncludePermanentLinkText(false);
             $pm->setAlignCenter(false);
             $this->addProperty($lng->txt("perma_link"), $pm->getHTML(), "");
             // bookmarks
             $title = $ilObjDataCache->lookupTitle($a_obj->getId());
             $bms = ilPermanentLinkGUI::_getBookmarksSelectionList($title, $href);
             // links to resource
             if ($ilAccess->checkAccess("write", "", $ref_id) || $ilAccess->checkAccess("edit_permissions", "", $ref_id)) {
                 $obj_id = $a_obj->getId();
                 $rs = ilObject::_getAllReferences($obj_id);
                 $refs = array();
                 foreach ($rs as $r) {
                     if ($tree->isInTree($r)) {
                         $refs[] = $r;
                     }
                 }
                 if (count($refs) > 1) {
                     $links = $sep = "";
                     foreach ($refs as $r) {
                         $cont_loc = new ilLocatorGUI();
                         $cont_loc->addContextItems($r, true);
                         $links .= $sep . $cont_loc->getHTML();
                         $sep = "<br />";
                     }
                     $this->addProperty($lng->txt("res_links"), '<div class="small">' . $links . '</div>');
                 }
             }
         }
     }
     // creation date
     $this->addProperty($lng->txt("create_date"), ilDatePresentation::formatDate(new ilDateTime($a_obj->getCreateDate(), IL_CAL_DATETIME)));
     // owner
     if ($ilUser->getId() != ANONYMOUS_USER_ID and $a_obj->getOwner()) {
         include_once './Services/Object/classes/class.ilObjectFactory.php';
         include_once './Services/User/classes/class.ilObjUser.php';
         if (ilObjUser::userExists(array($a_obj->getOwner()))) {
             $ownerObj = ilObjectFactory::getInstanceByObjId($a_obj->getOwner(), false);
         } else {
             $ownerObj = ilObjectFactory::getInstanceByObjId(6, false);
         }
         if (!is_object($ownerObj) || $ownerObj->getType() != "usr") {
             $this->addProperty($lng->txt("owner"), $lng->txt("no_owner"));
         } else {
             if ($ownerObj->hasPublicProfile()) {
                 $ilCtrl->setParameterByClass("ilpublicuserprofilegui", "user_id", $ownerObj->getId());
                 $this->addProperty($lng->txt("owner"), $ownerObj->getPublicName(), $ilCtrl->getLinkTargetByClass("ilpublicuserprofilegui", "getHTML"));
             } else {
                 $this->addProperty($lng->txt("owner"), $ownerObj->getPublicName());
             }
         }
     }
     // disk usage
     require_once 'Services/WebDAV/classes/class.ilDiskQuotaActivationChecker.php';
     if ($ilUser->getId() != ANONYMOUS_USER_ID && ilDiskQuotaActivationChecker::_isActive()) {
         $size = $a_obj->getDiskUsage();
         if ($size !== null) {
             $this->addProperty($lng->txt("disk_usage"), ilFormat::formatSize($size, 'long'));
         }
     }
     // change event
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     if (ilChangeEvent::_isActive()) {
         if ($ilUser->getId() != ANONYMOUS_USER_ID) {
             $readEvents = ilChangeEvent::_lookupReadEvents($a_obj->getId());
             $count_users = 0;
             $count_members = 0;
             $count_user_reads = 0;
             $count_anonymous_reads = 0;
             foreach ($readEvents as $evt) {
                 if ($evt['usr_id'] == ANONYMOUS_USER_ID) {
                     $count_anonymous_reads += $evt['read_count'];
                 } else {
                     $count_user_reads += $evt['read_count'];
                     $count_users++;
                     /* to do: if ($evt['user_id'] is member of $this->getRefId())
                     			{
                     				$count_members++;
                     			}*/
                 }
             }
             if ($count_anonymous_reads > 0) {
                 $this->addProperty($this->lng->txt("readcount_anonymous_users"), $count_anonymous_reads);
             }
             if ($count_user_reads > 0) {
                 $this->addProperty($this->lng->txt("readcount_users"), $count_user_reads);
             }
             if ($count_users > 0) {
                 $this->addProperty($this->lng->txt("accesscount_registered_users"), $count_users);
             }
         }
     }
     // END ChangeEvent: Display change event info
     // BEGIN WebDAV: Display locking information
     require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
     if (ilDAVServer::_isActive()) {
         global $ilias, $ilUser;
         if ($ilUser->getId() != ANONYMOUS_USER_ID) {
             $davLocks = new ilDAVLocks();
             // Show lock info
             if ($ilias->account->getId() != ANONYMOUS_USER_ID) {
                 $locks =& $davLocks->getLocksOnObjectObj($a_obj->getId());
                 if (count($locks) > 0) {
                     $lockUser = new ilObjUser($locks[0]['ilias_owner']);
                     $this->addProperty($this->lng->txt("in_use_by"), $lockUser->getPublicName(), "./ilias.php?user=" . $locks[0]['ilias_owner'] . '&cmd=showUserProfile&cmdClass=ilpersonaldesktopgui&cmdNode=1&baseClass=ilPersonalDesktopGUI');
                 }
             }
         }
     }
     // END WebDAV: Display locking information
 }
 /**
  * Edit settings.
  */
 public function editWebDAVSettings()
 {
     global $rbacsystem, $ilErr, $ilTabs;
     global $tpl, $ilCtrl, $lng, $tree, $settings;
     $this->tabs_gui->setTabActive('webdav');
     if (!$rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
         $ilErr->raiseError($lng->txt("no_permission"), $ilErr->WARNING);
     }
     require_once "./Services/Form/classes/class.ilPropertyFormGUI.php";
     require_once "./Services/Form/classes/class.ilCheckboxInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioGroupInputGUI.php";
     require_once "./Services/Form/classes/class.ilRadioOption.php";
     require_once "./Services/Form/classes/class.ilTextAreaInputGUI.php";
     require_once "./Services/WebDAV/classes/class.ilDAVServer.php";
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($lng->txt("settings"));
     // Enable webdav
     $ilDAVServer = ilDAVServer::getInstance();
     $isPearAuthHTTPInstalled = @(include_once "Auth/HTTP.php");
     $cb_prop = new ilCheckboxInputGUI($lng->txt("enable_webdav"), "enable_webdav");
     $cb_prop->setValue('1');
     $cb_prop->setChecked($this->object->isWebdavEnabled() && $isPearAuthHTTPInstalled);
     $cb_prop->setDisabled(!$isPearAuthHTTPInstalled);
     $cb_prop->setInfo($isPearAuthHTTPInstalled ? sprintf($lng->txt('enable_webdav_info'), $ilDAVServer->getMountURI($tree->getRootId(), 0, null, null, true)) : $lng->txt('webdav_pear_auth_http_needed'));
     $form->addItem($cb_prop);
     // Webdav help text
     if ($isPearAuthHTTPInstalled) {
         $rgi_prop = new ilRadioGroupInputGUI($lng->txt('webfolder_instructions'), 'custom_webfolder_instructions_choice');
         $rgi_prop->addOption(new ilRadioOption($lng->txt('use_default_instructions'), 'default'));
         $rgi_prop->addOption(new ilRadioOption($lng->txt('use_customized_instructions'), 'custom'));
         $rgi_prop->setValue($this->object->isCustomWebfolderInstructionsEnabled() ? 'custom' : 'default');
         $rgi_prop->setDisabled(!$isPearAuthHTTPInstalled);
         $form->addItem($rgi_prop);
         $tai_prop = new ilTextAreaInputGUI('', 'custom_webfolder_instructions');
         $tai_prop->setValue($this->object->getCustomWebfolderInstructions());
         $tai_prop->setInfo($lng->txt("webfolder_instructions_info"));
         $tai_prop->setCols(80);
         $tai_prop->setRows(20);
         $tai_prop->setDisabled(!$isPearAuthHTTPInstalled);
         $form->addItem($tai_prop);
     }
     // command buttons
     $form->addCommandButton('saveWebDAVSettings', $lng->txt('save'));
     $form->addCommandButton('view', $lng->txt('cancel'));
     $tpl->setContent($form->getHTML());
 }
Exemplo n.º 6
0
 /**
  * Gets Webfolder mount instructions for the specified webfolder.
  *
  *
  * The following placeholders are currently supported:
  *
  * [WEBFOLDER_TITLE] - the title of the webfolder
  * [WEBFOLDER_URI] - the URL for mounting the webfolder with standard
  *                   compliant WebDAV clients
  * [WEBFOLDER_URI_IE] - the URL for mounting the webfolder with Internet Explorer
  * [WEBFOLDER_URI_KONQUEROR] - the URL for mounting the webfolder with Konqueror
  * [WEBFOLDER_URI_NAUTILUS] - the URL for mounting the webfolder with Nautilus
  * [IF_WINDOWS]...[/IF_WINDOWS] - conditional contents, with instructions for Windows
  * [IF_MAC]...[/IF_MAC] - conditional contents, with instructions for Mac OS X
  * [IF_LINUX]...[/IF_LINUX] - conditional contents, with instructions for Linux
  * [ADMIN_MAIL] - the mailbox address of the system administrator
  * @param String Title of the webfolder
  * @param String Mount URI of the webfolder for standards compliant WebDAV clients
  * @param String Mount URI of the webfolder for IE
  * @param String Mount URI of the webfolder for Konqueror
  * @param String Mount URI of the webfolder for Nautilus
  * @param String Operating system: 'windows', 'unix' or 'unknown'.
  * @param String Operating system flavor: 'xp', 'vista', 'osx', 'linux' or 'unknown'.
  * @return String HTML text.
  */
 public static function _getWebfolderInstructionsFor($webfolderTitle, $webfolderURI, $webfolderURI_IE, $webfolderURI_Konqueror, $webfolderURI_Nautilus, $os = 'unknown', $osFlavor = 'unknown')
 {
     global $ilSetting;
     $settings = new ilSetting('file_access');
     $str = $settings->get('custom_webfolder_instructions', '');
     if (strlen($str) == 0 || !$settings->get('custom_webfolder_instructions_enabled')) {
         $str = ilDAVServer::_getDefaultWebfolderInstructions();
     }
     if (is_file('Customizing/clients/' . CLIENT_ID . '/webdavtemplate.htm')) {
         $str = fread(fopen('Customizing/clients/' . CLIENT_ID . '/webdavtemplate.htm', "rb"), filesize('Customizing/clients/' . CLIENT_ID . '/webdavtemplate.htm'));
     }
     $str = utf8_encode($str);
     preg_match_all('/(\\d+)/', $webfolderURI, $matches);
     $refID = $matches[0][0];
     $str = str_replace("[WEBFOLDER_ID]", $refID, $str);
     $str = str_replace("[WEBFOLDER_TITLE]", $webfolderTitle, $str);
     $str = str_replace("[WEBFOLDER_URI]", $webfolderURI, $str);
     $str = str_replace("[WEBFOLDER_URI_IE]", $webfolderURI_IE, $str);
     $str = str_replace("[WEBFOLDER_URI_KONQUEROR]", $webfolderURI_Konqueror, $str);
     $str = str_replace("[WEBFOLDER_URI_NAUTILUS]", $webfolderURI_Nautilus, $str);
     $str = str_replace("[ADMIN_MAIL]", $ilSetting->get("admin_email"), $str);
     if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false) {
         $str = preg_replace('/\\[IF_IEXPLORE\\]((?:.|\\n)*)\\[\\/IF_IEXPLORE\\]/', '\\1', $str);
     } else {
         $str = preg_replace('/\\[IF_NOTIEXPLORE\\]((?:.|\\n)*)\\[\\/IF_NOTIEXPLORE\\]/', '\\1', $str);
     }
     switch ($os) {
         case 'windows':
             $operatingSystem = 'WINDOWS';
             break;
         case 'unix':
             switch ($osFlavor) {
                 case 'osx':
                     $operatingSystem = 'MAC';
                     break;
                 case 'linux':
                     $operatingSystem = 'LINUX';
                     break;
                 default:
                     $operatingSystem = 'LINUX';
                     break;
             }
             break;
         default:
             $operatingSystem = 'UNKNOWN';
             break;
     }
     if ($operatingSystem != 'UNKNOWN') {
         $str = preg_replace('/\\[IF_' . $operatingSystem . '\\]((?:.|\\n)*)\\[\\/IF_' . $operatingSystem . '\\]/', '\\1', $str);
         $str = preg_replace('/\\[IF_([A-Z_]+)\\](?:(?:.|\\n)*)\\[\\/IF_\\1\\]/', '', $str);
     } else {
         $str = preg_replace('/\\[IF_([A-Z_]+)\\]((?:.|\\n)*)\\[\\/IF_\\1\\]/', '\\2', $str);
     }
     return $str;
 }
Exemplo n.º 7
0
 /**
  * prepares ilias to get output rendered by sub gui class
  *
  * @global ilLocator $ilLocator
  * @global ilTemplate $tpl
  * @global ilObjUser $ilUser
  * @return boolean
  */
 private function prepareSubGuiOutput()
 {
     global $ilUser;
     $this->tpl->getStandardTemplate();
     // set locator
     $this->setLocator();
     // catch feedback message
     ilUtil::infoPanel();
     // set title and description and title icon
     $this->setTitleAndDescription();
     // BEGIN WebDAV: Display Mount Webfolder icon.
     require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
     if (ilDAVServer::_isActive() && $ilUser->getId() != ANONYMOUS_USER_ID) {
         $this->showMountWebfolderIcon();
     }
     // END WebDAV: Display Mount Webfolder icon.
 }
Exemplo n.º 8
0
 /**
  * Fill side icons (upper icon, tree icon, webfolder icon)
  */
 function fillSideIcons()
 {
     global $lng, $ilSetting;
     if ($this->upper_icon == "" && $this->tree_flat_link == "" && $this->mount_webfolder == "") {
         return;
     }
     // upper icon
     // deprecated
     if ($this->upper_icon != "") {
         /*if ($this->upper_icon_frame != "")
         			{
         				$this->setCurrentBlock("target_top");
         				$this->setVariable("TARGET_TOP", $this->upper_icon_frame);
         				$this->parseCurrentBlock();
         			}
         	
         			$this->setCurrentBlock("alt_top");
         			$this->setVariable("ALT_TOP", $lng->txt("up"));
         			$this->parseCurrentBlock();
         	
         			$this->setCurrentBlock("top");
         			$this->setVariable("LINK_TOP", $this->upper_icon);
         			$this->parseCurrentBlock();*/
     }
     // tree/flat icon
     if ($this->tree_flat_link != "") {
         if ($this->left_nav_content != "") {
             $this->touchBlock("tree_lns");
         }
         $this->setCurrentBlock("tree_mode");
         $this->setVariable("LINK_MODE", $this->tree_flat_link);
         if ($ilSetting->get("tree_frame") == "right") {
             if ($this->tree_flat_mode == "tree") {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
                 $this->setVariable("RIGHT", "Right");
             } else {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
                 $this->setVariable("RIGHT", "Right");
             }
         } else {
             if ($this->tree_flat_mode == "tree") {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
             } else {
                 $this->setVariable("IMG_TREE", ilUtil::getImagePath("icon_sidebar_on.svg"));
             }
         }
         $this->setVariable("ALT_TREE", $lng->txt($this->tree_flat_mode . "view"));
         $this->setVariable("TARGET_TREE", ilFrameTargetInfo::_getFrame("MainContent"));
         include_once "./Services/Accessibility/classes/class.ilAccessKeyGUI.php";
         $this->setVariable("TREE_ACC_KEY", ilAccessKeyGUI::getAttribute($this->tree_flat_mode == "tree" ? ilAccessKey::TREE_ON : ilAccessKey::TREE_OFF));
         $this->parseCurrentBlock();
     }
     // mount webfolder
     if ($this->mount_webfolder != "") {
         require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
         $davServer = new ilDAVServer();
         $a_ref_id = $this->mount_webfolder;
         $a_link = $davServer->getMountURI($a_ref_id);
         $a_folder = $davServer->getFolderURI($a_ref_id);
         $this->setCurrentBlock("mount_webfolder");
         $this->setVariable("LINK_MOUNT_WEBFOLDER", $a_link);
         $this->setVariable("FOLDER_MOUNT_WEBFOLDER", $a_folder);
         $this->setVariable("IMG_MOUNT_WEBFOLDER", ilUtil::getImagePath("ic_mount_webfolder.png"));
         $this->setVariable("ALT_MOUNT_WEBFOLDER", $lng->txt("mount_webfolder"));
         $this->setVariable("TARGET_MOUNT_WEBFOLDER", '_blank');
         $this->parseCurrentBlock();
     }
     $this->setCurrentBlock("tree_icons");
     $this->parseCurrentBlock();
 }
 /**
  * Init password form.
  *
  * @param        int        $a_mode        Edit Mode
  */
 public function initPasswordForm()
 {
     global $lng, $ilUser, $ilSetting;
     include_once "Services/Form/classes/class.ilPropertyFormGUI.php";
     $this->form = new ilPropertyFormGUI();
     // Check whether password change is allowed
     if ($this->allowPasswordChange()) {
         // The current password needs to be checked for verification
         // unless the user uses Shibboleth authentication with additional
         // local authentication for WebDAV.
         //if (
         //	($ilUser->getAuthMode(true) != AUTH_SHIBBOLETH || !$ilSetting->get("shib_auth_allow_local"))
         //)
         if ($ilUser->getAuthMode(true) == AUTH_LOCAL) {
             // current password
             $cpass = new ilPasswordInputGUI($lng->txt("current_password"), "current_password");
             $cpass->setRetype(false);
             $cpass->setSkipSyntaxCheck(true);
             // only if a password exists.
             if ($ilUser->getPasswd()) {
                 $cpass->setRequired(true);
             }
             $this->form->addItem($cpass);
         }
         // new password
         $ipass = new ilPasswordInputGUI($lng->txt("desired_password"), "new_password");
         $ipass->setRequired(true);
         $ipass->setInfo(ilUtil::getPasswordRequirementsInfo());
         if ($ilSetting->get("passwd_auto_generate") == 1) {
             $ipass->setPreSelection(true);
             $this->form->addItem($ipass);
             $this->form->addCommandButton("savePassword", $lng->txt("save"));
             $this->form->addCommandButton("showPassword", $lng->txt("new_list_password"));
         } else {
             $this->form->addItem($ipass);
             $this->form->addCommandButton("savePassword", $lng->txt("save"));
         }
         switch ($ilUser->getAuthMode(true)) {
             case AUTH_LOCAL:
                 $this->form->setTitle($lng->txt("chg_password"));
                 break;
             case AUTH_SHIBBOLETH:
             case AUTH_CAS:
                 require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
                 if (ilDAVServer::_isActive()) {
                     $this->form->setTitle($lng->txt("chg_ilias_and_webfolder_password"));
                 } else {
                     $this->form->setTitle($lng->txt("chg_ilias_password"));
                 }
                 break;
             default:
                 $this->form->setTitle($lng->txt("chg_ilias_password"));
                 break;
         }
         $this->form->setFormAction($this->ctrl->getFormAction($this));
     }
 }
Exemplo n.º 10
0
 /**
  * Show webdav password instruction
  * @return 
  */
 protected function showPasswordInstructionObject($a_init = true)
 {
     global $tpl, $ilToolbar;
     if ($a_init) {
         ilUtil::sendInfo($this->lng->txt('webdav_pwd_instruction'));
         $this->initFormPasswordInstruction();
     }
     include_once 'Services/WebDAV/classes/class.ilDAVServer.php';
     $davServer = ilDAVServer::getInstance();
     $ilToolbar->addButton($this->lng->txt('mount_webfolder'), $davServer->getMountURI($this->object->getRefId()), '_blank', '', $davServer->getFolderURI($this->object->getRefId()));
     $tpl->setContent($this->form->getHTML());
 }
Exemplo n.º 11
0
 /**
  * Get command link url.
  *
  * Overwrite this method, if link target is not build by ctrl class
  * (e.g. "forum.php"). This is the case
  * for all links now, but bringing everything to ilCtrl should
  * be realised in the future.
  *
  * @param	string		$a_cmd			command
  *
  * @return	string		command link url
  */
 function getCommandLink($a_cmd)
 {
     if ($this->context == self::CONTEXT_REPOSITORY || $this->context == self::CONTEXT_SHOP) {
         // BEGIN WebDAV Get mount webfolder link.
         require_once 'Services/WebDAV/classes/class.ilDAVActivationChecker.php';
         if ($a_cmd == 'mount_webfolder' && ilDAVActivationChecker::_isActive()) {
             require_once 'Services/WebDAV/classes/class.ilDAVServer.php';
             $davServer = ilDAVServer::getInstance();
             // XXX: The following is a very dirty, ugly trick.
             //        To mount URI needs to be put into two attributes:
             //        href and folder. This hack returns both attributes
             //        like this:  http://...mount_uri..." folder="http://...folder_uri...
             return $davServer->getMountURI($this->ref_id) . '" folder="' . $davServer->getFolderURI($this->ref_id);
         }
         // END WebDAV Get mount webfolder link.
         $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getCommandId());
         $cmd_link = $this->ctrl->getLinkTargetByClass("ilrepositorygui", $a_cmd);
         $this->ctrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
         return $cmd_link;
         /* separate method for this line
         			$cmd_link = $this->ctrl->getLinkTargetByClass($this->gui_class_name,
         				$a_cmd);
         			return $cmd_link;
         			*/
     } else {
         $this->ctrl->setParameterByClass($this->gui_class_name, "ref_id", "");
         $this->ctrl->setParameterByClass($this->gui_class_name, "wsp_id", $this->ref_id);
         return $this->ctrl->getLinkTargetByClass($this->gui_class_name, $a_cmd);
     }
 }
Exemplo n.º 12
0
*/
// Initialize
// -----------------------------------------------------
// Retrieve the client id from PATH_INFO
// Component 1 contains the ILIAS client_id.
$path_info_components = explode('/', $_SERVER['PATH_INFO']);
$client_id = $path_info_components[1];
// For all requests, except for GET-Requests for files, we enforce HTTP
// authentication for the WebDAV protocol.
#if ($_SERVER['REQUEST_METHOD'] != 'GET' ||
#	count($path_info_components) < 3 ||
#	substr($path_info_components[2],0,5) != 'file_') {
#	define ('WebDAV_Authentication', 'HTTP');
#}
define('WebDAV_Authentication', 'HTTP');
// Set context for authentication
include_once 'Services/Authentication/classes/class.ilAuthFactory.php';
ilAuthFactory::setContext(ilAuthFactory::CONTEXT_HTTP);
// Launch ILIAS using the client id we have determined
// -----------------------------------------------------
$_COOKIE["ilClientId"] = $client_id;
include_once "Services/Context/classes/class.ilContext.php";
ilContext::init(ilContext::CONTEXT_WEBDAV);
require_once "Services/Init/classes/class.ilInitialisation.php";
ilInitialisation::initILIAS();
// Launch the WebDAV Server
// -----------------------------------------------------
include_once "Services/WebDAV/classes/class.ilDAVServer.php";
$server = new ilDAVServer();
$server->ServeRequest();
// END WebDAV