26 $ilCtrl->saveParameter($this,
"wsp_id");
27 $ilCtrl->saveParameter($this,
"prt_id");
28 $this->node_id =
$_GET[
"wsp_id"];
29 $this->portfolio_id =
$_GET[
"prt_id"];
36 $next_class = $ilCtrl->getNextClass($this);
37 $cmd = $ilCtrl->getCmd();
39 $tpl->getStandardTemplate();
42 $ilMainMenu->setActive(
"desktop");
47 include_once
"Modules/Blog/classes/class.ilObjBlogGUI.php";
49 $ilCtrl->forwardCommand($bgui);
53 include_once
"Modules/File/classes/class.ilObjFileGUI.php";
55 $ilCtrl->forwardCommand($fgui);
58 case "ilobjtestverificationgui":
59 include_once
"Modules/Test/classes/class.ilObjTestVerificationGUI.php";
61 $ilCtrl->forwardCommand($tgui);
64 case "ilobjexerciseverificationgui":
65 include_once
"Modules/Exercise/classes/class.ilObjExerciseVerificationGUI.php";
67 $ilCtrl->forwardCommand($egui);
70 case "ilobjlinkresourcegui":
71 include_once
"Modules/WebResource/classes/class.ilObjLinkResourceGUI.php";
73 $ilCtrl->forwardCommand($lgui);
76 case "ilobjportfoliogui":
77 include_once
"Services/Portfolio/classes/class.ilObjPortfolioGUI.php";
79 $ilCtrl->forwardCommand($pgui);
97 if(!$this->node_id && !$this->portfolio_id)
105 if(!self::hasAccess($this->node_id))
107 exit(
"no permission");
113 if(!self::hasAccess($this->portfolio_id,
true))
115 exit(
"no permission");
121 public static function hasAccess($a_node_id, $a_is_portfolio =
false)
126 if($ilUser->getId() != ANONYMOUS_USER_ID)
130 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
131 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
137 include_once
"Services/Portfolio/classes/class.ilPortfolioAccessHandler.php";
147 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessGUI.php";
151 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
156 include_once
"Services/Portfolio/classes/class.ilPortfolioAccessHandler.php";
172 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&wsp_id=".$a_node_id);
176 ilUtil::redirect(
"ilias.php?baseClass=ilSharedResourceGUI&cmd=passwordForm&prt_id=".$a_node_id);
185 global
$ilCtrl, $objDefinition, $ilUser;
190 if(!$object_data[
"obj_id"])
192 exit(
"invalid object");
199 exit(
"invalid object");
201 $object_data[
"obj_id"] = $a_node_id;
202 $object_data[
"type"] =
"prtf";
205 $class = $objDefinition->getClassName($object_data[
"type"]);
206 $gui =
"ilobj".$class.
"gui";
208 switch($object_data[
"type"])
211 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
212 $ilCtrl->setParameterByClass($gui,
"gtp",
$_GET[
"gtp"]);
213 $ilCtrl->redirectByClass($gui,
"preview");
217 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
218 $ilCtrl->redirectByClass($gui,
"deliver");
222 $ilCtrl->setParameterByClass($gui,
"wsp_id", $a_node_id);
223 $ilCtrl->redirectByClass($gui);
226 $ilCtrl->setParameterByClass($gui,
"prt_id", $a_node_id);
227 $ilCtrl->redirectByClass($gui,
"preview");
230 exit(
"invalid object type");
238 $set = $ilDB->query(
"SELECT obj.obj_id, obj.type, obj.title".
239 " FROM object_reference_ws ref".
240 " JOIN tree_workspace tree ON (tree.child = ref.wsp_id)".
241 " JOIN object_data obj ON (ref.obj_id = obj.obj_id)".
242 " WHERE ref.wsp_id = ".$ilDB->quote($a_node_id,
"integer"));
243 return $ilDB->fetchAssoc($set);
250 $lng->loadLanguageModule(
"wsp");
252 $tpl->setTitle($lng->txt(
"wsp_password_protected_resource"));
253 $tpl->setDescription($lng->txt(
"wsp_password_protected_resource_info"));
260 $tpl->setContent($form->getHTML());
276 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
278 $form->setFormAction($ilCtrl->getFormAction($this,
"checkPassword"));
279 $form->setTitle($lng->txt(
"wsp_password_for").
": ".$object_data[
"title"]);
283 $password->setRequired(
true);
284 $form->addItem($password);
286 $form->addCommandButton(
"checkPassword", $lng->txt(
"submit"));
288 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
290 $ilTabs->setBackTarget($lng->txt(
"back"), $ilCtrl->getLinkTarget($this,
"cancelPassword"));
291 $form->addCommandButton(
"cancelPassword", $lng->txt(
"cancel"));
301 if($ilUser->getId() && $ilUser->getId() != ANONYMOUS_USER_ID)
305 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
306 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
309 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToWorkspace&dsh=".$owner);
313 include_once
"Services/Portfolio/classes/class.ilObjPortfolio.php";
315 $owner = $prtf->getOwner();
316 ilUtil::redirect(
"ilias.php?baseClass=ilPersonalDesktopGUI&cmd=jumpToPortfolio&dsh=".$owner);
325 $lng->loadLanguageModule(
"wsp");
328 if($form->checkInput())
330 $input = md5($form->getInput(
"password"));
333 include_once
"Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
338 include_once
"Services/Portfolio/classes/class.ilPortfolioAccessHandler.php";
341 if($input == $password)
356 $item = $form->getItemByPostVar(
"password");
357 $item->setAlert($lng->txt(
"wsp_invalid_password"));
362 $form->setValuesByPost();