/** * Assert that the action name equals the given value. * * @param string $name Action name to check against. */ protected final function assertActionNameEquals($name) { $this->assertEquals($name, getActionName()); }
print "</div>"; ?> </div> <div id="header-logo-report" style="text-align: right"> <img height='75px' width='300px' alt="Logo" src="<?php print $_SESSION[$guid]["absoluteURL"] . "/" . $_SESSION[$guid]["organisationLogo"]; ?> "/> </div> </div> <div id="content-wrap-report" style="min-height: 500px"> <?php $_SESSION[$guid]["address"] = $_GET["q"]; $_SESSION[$guid]["module"] = getModuleName($_SESSION[$guid]["address"]); $_SESSION[$guid]["action"] = getActionName($_SESSION[$guid]["address"]); if (strstr($_SESSION[$guid]["address"], "..") != FALSE) { print "<div class='error'>"; print _("Illegal address detected: access denied."); print "</div>"; } else { if (is_file("./" . $_SESSION[$guid]["address"])) { include "./" . $_SESSION[$guid]["address"]; } else { include "./error.php"; } } ?> </div> <div id="footer-report"> <?php
function isActionAccessible($guid, $connection2, $address, $sub = "") { $output = FALSE; //Check user is logged in if (isset($_SESSION[$guid]["username"])) { //Check user has a current role set if ($_SESSION[$guid]["gibbonRoleIDCurrent"] != "") { //Check module ready $moduleID = checkModuleReady($address, $connection2); if ($moduleID != FALSE) { //Check current role has access rights to the current action. try { $data = array("actionName" => "%" . getActionName($address) . "%", "gibbonRoleID" => $_SESSION[$guid]["gibbonRoleIDCurrent"]); $sqlWhere = ""; if ($sub != "") { $data["sub"] = $sub; $sqlWhere = "AND gibbonAction.name=:sub"; } $sql = "SELECT gibbonAction.name FROM gibbonAction, gibbonPermission, gibbonRole WHERE (gibbonAction.URLList LIKE :actionName) AND (gibbonAction.gibbonActionID=gibbonPermission.gibbonActionID) AND (gibbonPermission.gibbonRoleID=gibbonRole.gibbonRoleID) AND (gibbonPermission.gibbonRoleID=:gibbonRoleID) AND (gibbonAction.gibbonModuleID={$moduleID}) {$sqlWhere}"; $result = $connection2->prepare($sql); $result->execute($data); if ($result->rowCount() > 0) { $output = TRUE; } } catch (PDOException $e) { } } } } return $output; }
/** * Gets an array of key => value pairs from a method on the controller. * * @param string $tab_name tab in which the field sits * @param string $field_name field name * @return array array of options */ protected function getSelectOptionsByMethod($tab_name, $field_name) { $form_field = $this->form_fields[$tab_name][$field_name]; $method_name = 'get' . studly_case($field_name) . 'Choices'; $action_name = getActionName(); if (!is_null($this->controller) && method_exists($this->controller, $method_name)) { return $this->controller->{$method_name}($action_name); } else { return []; } }
<td align="right"> <?php if (isLoggedIn()) { ?> <a href="EditAccount.action">Edit Account</a> . <a href="LogOut.action?referringPage=<?php echo $_SERVER['REQUEST_URI']; ?> ">Logout</a> <?php } else { ?> <a href="Login.action?referringPage=<?php echo $_SERVER['REQUEST_URI']; ?> " <?php if (getActionName() == "Login") { ?> class="on"<?php } ?> >Login</a> <?php } ?> </td> </tr> </table> </td> </tr> <tr> <td>
<?php $controller = getControllerName(class_basename(Route::currentRouteAction())); $action = getActionName(class_basename(Route::currentRouteAction())); ?> <section class="sidebar"> <ul class="sidebar-menu"> <li class="header">Thống kê</li> <li class="treeview"> <a href="/"> <i class="fa fa-dashboard"></i> <span>Kacana Dashboard</span></i> </a> </li> <li class="header">Quản lý kho</li> <li class="{{in_array($controller, array('BranchController', 'ProductController')) ? 'active' : ''}} treeview"> <a href="#"> <i class="fa fa-pie-chart"></i> <span>Quản lý sản phẩm</span> <i class="fa fa-angle-left pull-right"></i> </a> <ul class="treeview-menu"> <li class="{{($controller == 'ProductController') ? 'active':''}}"><a href="{{URL::to('/product')}}"><i class="fa fa-circle-o"></i> Sản Phẩm</a></li> </ul> </li> <li class="{{in_array($controller, array('TagController')) ? 'active' : ''}} treeview"> <a href="#"> <i class="fa fa-pie-chart"></i> <span>Hệ thống TAG</span> <i class="fa fa-angle-left pull-right"></i>