Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
simple_edit_user.inc
1 <?php
18 require_once SQ_CORE_PACKAGE_PATH.'/users/user/user.inc';
19 
20 
32 class Simple_Edit_User extends User
33 {
34 
35 
42  function Simple_Edit_User($assetid=0)
43  {
44  $this->User($assetid);
45 
46  }//end constructor
47 
48 
58  function canAccessBackend()
59  {
60  // Simple_Edit_User must not access the backend interface however it can access limbo
61  // This function is called before limbo access is granted because traditionally, backend access is
62  // required for limbo
63  // Permit 'backend' access only if this user is requesting a limbo page
64  // Allow simple edit user to have backend interface access when in cron
65  // we also have to consider the EES/JS API. Here the State wouldnt be in SQ_IN_LIMBO
66  // but never the less we are in simple edit.
67  // Lets be a bit chicky here and check the referer to decide if we are indeed in LIMBO
68  // We also have to make sure that the user we are currently deling with isnt the user
69  // who initiated the workflow. or else he deserves to be known
70  $in_limbo = $workflow_starter = FALSE;
71  if(isset($_SERVER['HTTP_REFERER']) && !empty($_SERVER['HTTP_REFERER'])) {
72  $in_limbo = (strpos($_SERVER['HTTP_REFERER'],SQ_CONF_LIMBO_SUFFIX) !== FALSE) ? TRUE : FALSE;
73  }
74 
75  // we are not in limbo or EES see if the user was a workflow starter and if the workflow has been canceled
76  // see workflow_manager::cancelWorkflow()
77  if(!$in_limbo && (isset($this->_tmp['starter_of_workflow']) && $this->_tmp['starter_of_workflow'])) $workflow_starter = TRUE;
78 
79  return (SQ_IN_LIMBO || SQ_IN_CRON || $in_limbo || $workflow_starter);
80 
81  }//end canAccessBackend()
82 
83 
84 }//end class
85 ?>