ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilBlogWebAccessChecker.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once "Services/FileSystem/classes/class.ilFileSystemStorageWebAccessChecker.php";
5 
15 {
16  protected $wsp_id; // [int]
17 
18  public function isValidPath(array $a_path)
19  {
20  if(parent::isValidPath($a_path))
21  {
22  // personal workspace blog?
23  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceTree.php";
24  $this->tree = new ilWorkspaceTree(0);
25  $node_id = $this->tree->lookupNodeId($this->object_id);
26 
27  if($node_id)
28  {
29  $this->wsp_id = $node_id;
30  $this->object_id = null; // force custom check
31  }
32 
33  return true;
34  }
35  }
36 
37  public function checkAccess(array $a_users)
38  {
39  if($this->wsp_id)
40  {
41  include_once "Services/PersonalWorkspace/classes/class.ilWorkspaceAccessHandler.php";
42  foreach ($a_users as $user_id)
43  {
44  $access_handler = new ilWorkspaceAccessHandler($this->tree);
45  if ($access_handler->checkAccessOfUser($this->tree, $user_id, "read", "view", $this->wsp_id, "blog"))
46  {
47  return true;
48  }
49  }
50  }
51  }
52 }
53