SAAS-1135 - fix help button url for logged out users

This commit is contained in:
Duncan Sommerville 2015-11-19 11:08:35 -05:00
parent e4027c1e1f
commit c328515f4b
7 changed files with 27 additions and 20 deletions

View File

@ -7,6 +7,15 @@ class ErrorController extends Zend_Controller_Action {
//We cannot show that. //We cannot show that.
$this->view->layout()->disableLayout(); $this->view->layout()->disableLayout();
$this->setupCSS(); $this->setupCSS();
// TODO: set Help button URL based on whether or not user is logged in
try {
$service_user = new Application_Service_UserService();
$service_user->getCurrentUser();
$this->view->helpUrl = Application_Common_OsPath::getBaseDir() . 'dashboard/help';
} catch (Exception $e) {
$this->view->helpUrl = HELP_URL;
}
} }
public function errorAction() { public function errorAction() {

View File

@ -211,8 +211,10 @@ class Zend_Controller_Plugin_Acl extends Zend_Controller_Plugin_Abstract
$resourceName .= $controller; $resourceName .= $controller;
/** Check if the controller/action can be accessed by the current user */ /** Check if the controller/action can be accessed by the current user */
if (!$this->getAcl()->has($resourceName) if (!$this->getAcl()->has($resourceName)) {
|| !$this->getAcl()->isAllowed($this->_roleName, $this->setErrorPage('error404');
$this->denyAccess();
} else if (!$this->getAcl()->isAllowed($this->_roleName,
$resourceName, $resourceName,
$request->getActionName())) { $request->getActionName())) {
/** Redirect to access denied page */ /** Redirect to access denied page */

View File

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -11,7 +10,7 @@
<h2><?php echo _("Bad Request!")?></h2> <h2><?php echo _("Bad Request!")?></h2>
<p><?php echo _("The requested action is not supported!")?></p> <p><?php echo _("The requested action is not supported!")?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -11,7 +10,7 @@
<h2><?php echo _("Access Denied!")?></h2> <h2><?php echo _("Access Denied!")?></h2>
<p><?php echo _("You do not have permission to access this page!")?></p> <p><?php echo _("You do not have permission to access this page!")?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -11,7 +10,7 @@
<h2><?php echo _("Page not found!")?></h2> <h2><?php echo _("Page not found!")?></h2>
<p><?php echo _("We couldn't find the page you were looking for.")?></p> <p><?php echo _("We couldn't find the page you were looking for.")?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>

View File

@ -1,5 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"; <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd>
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
@ -11,7 +10,7 @@
<h2><?php echo _("Oops!")?></h2> <h2><?php echo _("Oops!")?></h2>
<p><?php echo _("Something went wrong!")?></p> <p><?php echo _("Something went wrong!")?></p>
<div class="button-bar"> <div class="button-bar">
<a class="toggle-button" href="<?php echo $this->baseUrl('dashboard/help'); ?>"><?php echo _("Help") ?></a> <a class="toggle-button" href="<?php echo $this->helpUrl; ?>"><?php echo _("Help") ?></a>
</div> </div>
</div> </div>
</body> </body>

View File

@ -2858,12 +2858,12 @@ dt.block-display.info-block {
/*---//////////////////// ERROR PAGE ////////////////////---*/ /*---//////////////////// ERROR PAGE ////////////////////---*/
.error-content { .error-content {
background:url(images/maintenance.png) no-repeat 0 0; position: relative;
width:360px; background: url(images/maintenance.png) no-repeat 0 0;
height:350px; width: 360px;
margin:auto; height: 350px;
margin-top:25px; margin: auto;
padding:auto; top: 25px;
} }
.error-content h2 { .error-content h2 {
margin:0; margin:0;