コード例 #1
0
 /**
  * Get singleton instance
  * @return ilFMSettings
  */
 public static function getInstance()
 {
     if (self::$instance) {
         return self::$instance;
     }
     return self::$instance = new ilFMSettings();
 }
コード例 #2
0
 /**
  * get commands
  * 
  * this method returns an array of all possible commands/permission combinations
  * 
  * example:	
  * $commands = array
  *	(
  *		array("permission" => "read", "cmd" => "view", "lang_var" => "show"),
  *		array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"),
  *	);
  */
 function _getCommands()
 {
     $commands = array();
     $commands[] = array("permission" => "read", "cmd" => "view", "lang_var" => "show", "default" => true);
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     if (ilFMSettings::getInstance()->isEnabled()) {
         $commands[] = array('permission' => 'read', 'cmd' => 'fileManagerLaunch', 'lang_var' => 'fm_start', 'enable_anonymous' => false);
     }
     // why here, why read permission? it just needs info_screen_enabled = true in ilObjCategoryListGUI (alex, 30.7.2008)
     // this is not consistent, with all other objects...
     //$commands[] = array("permission" => "read", "cmd" => "showSummary", "lang_var" => "info_short", "enable_anonymous" => "false");
     if (ilObjFolderAccess::hasDownloadAction($_GET["ref_id"])) {
         $commands[] = array("permission" => "read", "cmd" => "downloadFolder", "lang_var" => "download", "enable_anonymous" => "false");
     }
     // BEGIN WebDAV: Mount Webfolder.
     include_once 'Services/WebDAV/classes/class.ilDAVActivationChecker.php';
     if (ilDAVActivationChecker::_isActive()) {
         include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
         if (ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired()) {
             $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
         } else {
             $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
         }
     }
     $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
     $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
     return $commands;
 }
コード例 #3
0
 /**
  * get commands
  * 
  * this method returns an array of all possible commands/permission combinations
  * 
  * example:	
  * $commands = array
  *	(
  *		array("permission" => "read", "cmd" => "view", "lang_var" => "show"),
  *		array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"),
  *	);
  */
 function _getCommands()
 {
     $commands = array();
     $commands[] = array("permission" => "read", "cmd" => "render", "lang_var" => "show", "default" => true);
     // begin-patch fm
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     if (ilFMSettings::getInstance()->isEnabled()) {
         $commands[] = array('permission' => 'read', 'cmd' => 'fileManagerLaunch', 'lang_var' => 'fm_start', 'enable_anonymous' => false);
     }
     // end-patch fm
     // BEGIN WebDAV
     require_once 'Services/WebDAV/classes/class.ilDAVActivationChecker.php';
     if (ilDAVActivationChecker::_isActive()) {
         include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
         if (ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired()) {
             $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
         } else {
             $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
         }
     }
     // END WebDAV
     $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
     $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
     return $commands;
 }
コード例 #4
0
 /**
  * get commands
  * 
  * this method returns an array of all possible commands/permission combinations
  * 
  * example:	
  * $commands = array
  *	(
  *		array("permission" => "read", "cmd" => "view", "lang_var" => "show"),
  *		array("permission" => "write", "cmd" => "edit", "lang_var" => "edit"),
  *	);
  */
 function _getCommands()
 {
     $commands = array();
     $commands[] = array("permission" => "crs_linked", "cmd" => "", "lang_var" => "view", "default" => true);
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     if (ilFMSettings::getInstance()->isEnabled()) {
         $commands[] = array('permission' => 'read', 'cmd' => 'fileManagerLaunch', 'lang_var' => 'fm_start', 'enable_anonymous' => false);
     }
     $commands[] = array("permission" => "join", "cmd" => "join", "lang_var" => "join");
     // on waiting list
     $commands[] = array('permission' => "join", "cmd" => "leave", "lang_var" => "leave_waiting_list");
     // regualar users
     $commands[] = array('permission' => "leave", "cmd" => "leave", "lang_var" => "crs_unsubscribe");
     include_once 'Services/WebDAV/classes/class.ilDAVActivationChecker.php';
     if (ilDAVActivationChecker::_isActive()) {
         include_once './Services/WebDAV/classes/class.ilDAVUtils.php';
         if (ilDAVUtils::getInstance()->isLocalPasswordInstructionRequired()) {
             $commands[] = array('permission' => 'read', 'cmd' => 'showPasswordInstruction', 'lang_var' => 'mount_webfolder', 'enable_anonymous' => 'false');
         } else {
             $commands[] = array("permission" => "read", "cmd" => "mount_webfolder", "lang_var" => "mount_webfolder", "enable_anonymous" => "false");
         }
     }
     $commands[] = array("permission" => "write", "cmd" => "enableAdministrationPanel", "lang_var" => "edit_content");
     $commands[] = array("permission" => "write", "cmd" => "edit", "lang_var" => "settings");
     return $commands;
 }
コード例 #5
0
 function getTreeChilds($sid, $ref_id, $types, $user_id)
 {
     $this->initAuth($sid);
     $this->initIlias();
     if (!$this->__checkSession($sid)) {
         return $this->__raiseError($this->__getMessage(), $this->__getMessageCode());
     }
     $all = false;
     global $tree;
     if (!($target_obj =& ilObjectFactory::getInstanceByRefId($ref_id, false))) {
         return $this->__raiseError('No valid reference id given.', 'Client');
     }
     if (intval($ref_id) == SYSTEM_FOLDER_ID) {
         return $this->__raiseError('No valid reference id given.', 'Client');
     }
     if (!$types) {
         $all = true;
     }
     $objs = array();
     // begin-patch filemanager
     include_once './Services/WebServices/FileManager/classes/class.ilFMSettings.php';
     if (in_array('parent', (array) $types)) {
         $objs[] = $target_obj;
     }
     // end-patch filemanager
     foreach ($tree->getChilds($ref_id, 'title') as $child) {
         if ($all or in_array($child['type'], $types)) {
             if ($tmp = ilObjectFactory::getInstanceByRefId($child['ref_id'], false)) {
                 $objs[] = $tmp;
             }
         }
     }
     include_once './webservice/soap/classes/class.ilObjectXMLWriter.php';
     $xml_writer = new ilObjectXMLWriter();
     // begin-patch filemanager
     if (ilFMSettings::getInstance()->isEnabled()) {
         $xml_writer->enableReferences(false);
     }
     // end-patch filemanager
     $xml_writer->enablePermissionCheck(true);
     $xml_writer->setObjects($objs);
     $xml_writer->enableOperations(true);
     if ($user_id) {
         $xml_writer->setUserId($user_id);
     }
     if ($xml_writer->start()) {
         #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->getXML());
         return $xml_writer->getXML();
     }
     return $this->__raiseError('Cannot create object xml !', 'Server');
 }
コード例 #6
0
 /**
  * Launch jnlp
  */
 protected function fileManagerLaunchObject()
 {
     global $ilUser;
     $tpl = new ilTemplate('tpl.fm_launch_ws.html', false, false, 'Services/WebServices/FileManager');
     $tpl->setVariable('JNLP_URL', ILIAS_HTTP_PATH . '/Services/WebServices/FileManager/lib/dist/FileManager.jnlp');
     $tpl->setVariable('SESSION_ID', $_COOKIE['PHPSESSID'] . '::' . CLIENT_ID);
     $tpl->setVariable('UID', $ilUser->getId());
     $tpl->setVariable('REF_ID', $this->object->getRefId());
     $tpl->setVariable('WSDL_URI', ILIAS_HTTP_PATH . '/webservice/soap/server.php?wsdl');
     $tpl->setVariable('LOCAL_FRAME', ilFMSettings::getInstance()->isLocalFSEnabled() ? 1 : 0);
     $tpl->setVariable('REST_URI', ILIAS_HTTP_PATH . '/Services/WebServices/Rest/server.php');
     $tpl->setVariable('FILE_LOCKS', 0);
     $tpl->setVariable('UPLOAD_FILESIZE', ilFMSettings::getInstance()->getMaxFileSize());
     include_once "./Modules/SystemFolder/classes/class.ilObjSystemFolder.php";
     $header_top_title = ilObjSystemFolder::_getHeaderTitle();
     $tpl->setVariable('HEADER_TITLE', $header_top_title ? $header_top_title : '');
     echo $tpl->get();
     exit;
 }
コード例 #7
0
 /**
  * Init settings form
  */
 protected function initSettingsForm()
 {
     global $ilCtrl;
     include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($ilCtrl->getFormAction($this));
     $form->setTitle($GLOBALS['lng']->txt('settings'));
     $form->addCommandButton('update', $GLOBALS['lng']->txt('save'));
     $form->addCommandButton('settings', $GLOBALS['lng']->txt('cancel'));
     // activation
     $active = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_active'), 'active');
     $active->setInfo($GLOBALS['lng']->txt('fm_settings_active_info'));
     $active->setValue(1);
     $active->setChecked(ilFMSettings::getInstance()->isEnabled());
     $form->addItem($active);
     // one frame
     $local = new ilCheckboxInputGUI($GLOBALS['lng']->txt('fm_settings_local'), 'local');
     $local->setInfo($GLOBALS['lng']->txt('fm_settings_local_info'));
     $local->setValue(1);
     $local->setChecked(ilFMSettings::getInstance()->IsLocalFSEnabled());
     $form->addItem($local);
     $fs = new ilNumberInputGUI($GLOBALS['lng']->txt('fm_settings_filesize'), 'filesize');
     $fs->setSuffix('MiB');
     $fs->setSize(3);
     $fs->setMaxLength(3);
     $fs->setMinValue(1);
     $fs->setMaxValue(999);
     $fs->setInfo($GLOBALS['lng']->txt('fm_settings_filesize_info'));
     $fs->setValue(ilFMSettings::getInstance()->getMaxFileSize());
     $form->addItem($fs);
     return $form;
 }