mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
replace check for guest by generic acl check
This commit is contained in:
parent
684f27ef87
commit
79aa6c079c
|
@ -359,7 +359,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo " <li class=\"dropdown\">\n";
|
||||
echo " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".($this->params['session']->getSu() ? getMLText("switched_to") : getMLText("signed_in_as"))." '".htmlspecialchars($this->params['user']->getFullName())."' <i class=\"icon-caret-down\"></i></a>\n";
|
||||
echo " <ul class=\"dropdown-menu\" role=\"menu\">\n";
|
||||
if (!$this->params['user']->isGuest()) {
|
||||
// if (!$this->params['user']->isGuest()) {
|
||||
$menuitems = array();
|
||||
if ($accessobject->check_view_access('MyDocuments'))
|
||||
$menuitems['my_documents'] = array('link'=>"../out/out.MyDocuments.php", 'label'=>'my_documents');
|
||||
|
@ -379,7 +379,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
}
|
||||
echo " <li class=\"divider\"></li>\n";
|
||||
}
|
||||
}
|
||||
// }
|
||||
$showdivider = false;
|
||||
if($this->params['enablelanguageselector']) {
|
||||
$showdivider = true;
|
||||
|
@ -421,16 +421,18 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo " </li>\n";
|
||||
echo " </ul>\n";
|
||||
|
||||
if($this->params['enablemenutasks'] && !$this->params['user']->isGuest()) {
|
||||
echo " <div id=\"menu-tasks\">";
|
||||
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Tasks\" data-action=\"menuTasks\"></div>";
|
||||
// echo " <ul id=\"main-menu-tasks\" class=\"nav pull-right\">\n";
|
||||
// echo " <li class=\"dropdown\">\n";
|
||||
// echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array()));
|
||||
// echo " </li>\n";
|
||||
// echo " </ul>\n";
|
||||
echo " </div>";
|
||||
//$this->addFooterJS('checkTasks();');
|
||||
if($this->params['enablemenutasks']) {
|
||||
if($accessobject->check_view_access('Tasks', array('action'=>'menuTasks'))) {
|
||||
echo " <div id=\"menu-tasks\">";
|
||||
echo " <div class=\"ajax\" data-no-spinner=\"true\" data-view=\"Tasks\" data-action=\"menuTasks\"></div>";
|
||||
// echo " <ul id=\"main-menu-tasks\" class=\"nav pull-right\">\n";
|
||||
// echo " <li class=\"dropdown\">\n";
|
||||
// echo $this->menuTasks(array('review'=>array(), 'approval'=>array(), 'receipt'=>array(), 'revision'=>array()));
|
||||
// echo " </li>\n";
|
||||
// echo " </ul>\n";
|
||||
echo " </div>";
|
||||
//$this->addFooterJS('checkTasks();');
|
||||
}
|
||||
}
|
||||
|
||||
if($this->params['dropfolderdir'] && $this->params['enabledropfolderlist']) {
|
||||
|
@ -587,7 +589,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo "<ul class=\"nav\">\n";
|
||||
$menuitems = array();
|
||||
|
||||
if ($accessMode == M_READ && !$this->params['user']->isGuest()) {
|
||||
if ($accessMode == M_READ) {
|
||||
if ($accessobject->check_view_access('FolderNotify'))
|
||||
$menuitems['edit_folder_notify'] = array('link'=>"../out/out.FolderNotify.php?folderid=".$folderID."&showtree=".showtree(), 'label'=>'edit_folder_notify');
|
||||
}
|
||||
|
@ -611,7 +613,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
}
|
||||
$menuitems['edit_existing_notify'] = array('link'=>"../out/out.FolderNotify.php?folderid=". $folderID ."&showtree=". showtree(), 'label'=>'edit_existing_notify');
|
||||
}
|
||||
if ($this->params['user']->isAdmin() && $this->params['enablefullsearch']) {
|
||||
if ($accessobject->check_view_access('Indexer') && $this->params['enablefullsearch']) {
|
||||
$menuitems['index_folder'] = array('link'=>"../out/out.Indexer.php?folderid=". $folderID."&showtree=".showtree(), 'label'=>'index_folder');
|
||||
}
|
||||
|
||||
|
@ -638,7 +640,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
if ($accessMode >= M_READWRITE) {
|
||||
if (!$document->isLocked()) {
|
||||
$menuitems['update_document'] = array('link'=>"../out/out.UpdateDocument".$docid, 'label'=>'update_document');
|
||||
$menuitems['lock_document'] = array('link'=>"../op/op.LockDocument".$docid, 'label'=>'lock_document');
|
||||
if($accessobject->check_controller_access('LockDocument'))
|
||||
$menuitems['lock_document'] = array('link'=>"../op/op.LockDocument".$docid, 'label'=>'lock_document');
|
||||
if($document->isCheckedOut())
|
||||
$menuitems['checkin_document'] = array('link'=>"../out/out.CheckInDocument".$docid, 'label'=>'checkin_document');
|
||||
else {
|
||||
|
@ -653,7 +656,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$lockingUser = $document->getLockingUser();
|
||||
if (($lockingUser->getID() == $this->params['user']->getID()) || ($document->getAccessMode($this->params['user']) == M_ALL)) {
|
||||
$menuitems['update_document'] = array('link'=>"../out/out.UpdateDocument".$docid, 'label'=>'update_document');
|
||||
$menuitems['unlock_document'] = array('link'=>"../op/op.UnlockDocument".$docid, 'label'=>'unlock_document');
|
||||
if($accessobject->check_controller_access('UnlockDocument'))
|
||||
$menuitems['unlock_document'] = array('link'=>"../op/op.UnlockDocument".$docid, 'label'=>'unlock_document');
|
||||
if($document->isCheckedOut()) {
|
||||
$menuitems['checkin_document'] = array('link'=>"../out/out.CheckInDocument".$docid, 'label'=>'checkin_document');
|
||||
} else {
|
||||
|
@ -665,20 +669,22 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
$menuitems['move_document'] = array('link'=>"../out/out.MoveDocument".$docid, 'label'=>'move_document');
|
||||
}
|
||||
}
|
||||
if($this->params['accessobject']->maySetExpires($document)) {
|
||||
$menuitems['expires'] = array('link'=>"../out/out.SetExpires".$docid, 'label'=>'expires');
|
||||
// $menuitems[''] = array('link'=>"", 'label'=>'');
|
||||
if($accessobject->maySetExpires($document)) {
|
||||
if ($accessobject->check_view_access('SetExpires'))
|
||||
$menuitems['expires'] = array('link'=>"../out/out.SetExpires".$docid, 'label'=>'expires');
|
||||
}
|
||||
}
|
||||
if ($accessMode == M_ALL) {
|
||||
$menuitems['rm_document'] = array('link'=>"../out/out.RemoveDocument".$docid, 'label'=>'rm_document');
|
||||
if ($accessobject->check_view_access('RemoveDocument'))
|
||||
$menuitems['rm_document'] = array('link'=>"../out/out.RemoveDocument".$docid, 'label'=>'rm_document');
|
||||
if ($accessobject->check_view_access('DocumentAccess'))
|
||||
$menuitems['edit_document_access'] = array('link'=>"../out/out.DocumentAccess". $docid, 'label'=>'edit_document_access');
|
||||
}
|
||||
if ($accessMode >= M_READ && !$this->params['user']->isGuest()) {
|
||||
$menuitems['edit_existing_notify'] = array('link'=>"../out/out.DocumentNotify". $docid, 'label'=>'edit_existing_notify');
|
||||
if ($accessMode >= M_READ) {
|
||||
if ($accessobject->check_view_access('DocumentNotify'))
|
||||
$menuitems['edit_existing_notify'] = array('link'=>"../out/out.DocumentNotify". $docid, 'label'=>'edit_existing_notify');
|
||||
}
|
||||
if ($this->params['user']->isAdmin()) {
|
||||
if ($accessobject->check_view_access('TransferDocument')) {
|
||||
$menuitems['transfer_document'] = array('link'=>"../out/out.TransferDocument". $docid, 'label'=>'transfer_document');
|
||||
}
|
||||
|
||||
|
@ -712,7 +718,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo "<ul class=\"nav\">\n";
|
||||
|
||||
$menuitems = array();
|
||||
if ($this->params['user']->isAdmin() || !$this->params['disableselfedit'])
|
||||
if ($accessobject->check_view_access('EditUserData') || !$this->params['disableselfedit'])
|
||||
$menuitems['edit_user_details'] = array('link'=>"../out/out.EditUserData.php", 'label'=>'edit_user_details');
|
||||
|
||||
if (!$this->params['user']->isAdmin())
|
||||
|
@ -881,7 +887,8 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo "<li><a href=\"../out/out.CalendarOld.php?mode=w".$ds."\">".getMLText("week_view")."</a></li>\n";
|
||||
echo "<li><a href=\"../out/out.CalendarOld.php?mode=m".$ds."\">".getMLText("month_view")."</a></li>\n";
|
||||
echo "<li><a href=\"../out/out.CalendarOld.php?mode=y".$ds."\">".getMLText("year_view")."</a></li>\n";
|
||||
if (!$this->params['user']->isGuest()) echo "<li><a href=\"../out/out.AddEvent.php\">".getMLText("add_event")."</a></li>\n";
|
||||
if($accessobject->check_view_access(array('AddEvent')))
|
||||
echo "<li><a href=\"../out/out.AddEvent.php\">".getMLText("add_event")."</a></li>\n";
|
||||
echo "</ul>\n";
|
||||
echo "</div>\n";
|
||||
return;
|
||||
|
@ -894,7 +901,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
|
|||
echo "<ul class=\"nav\">\n";
|
||||
|
||||
$menuitems = array();
|
||||
if (!$this->params['user']->isGuest())
|
||||
if($accessobject->check_view_access(array('AddEvent')))
|
||||
$menuitems['addevent'] = array('link'=>"../out/out.AddEvent.php", 'label'=>'add_event');
|
||||
|
||||
/* Check if hook exists because otherwise callHook() will override $menuitems */
|
||||
|
|
Loading…
Reference in New Issue
Block a user