<?php //trace("======"); /* * CandidATS * Sites Management * * Copyright (C) 2014 - 2015 Auieo Software Private Limited, Parent Company of Unicomtech. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ ob_start(); if ($this->isPopup) { TemplateUtility::printHeader('Candidate - '.$this->data['first_name'].' '.$this->data['last_name'], array( 'js/activity.js', 'js/sorttable.js', 'js/match.js', 'js/lib.js', 'js/pipeline.js', 'js/attachment.js')); } else { TemplateUtility::printHeader('Candidate - '.$this->data['first_name'].' '.$this->data['last_name'], array( 'js/activity.js', 'js/sorttable.js', 'js/match.js', 'js/lib.js', 'js/pipeline.js', 'js/attachment.js')); } $AUIEO_HEADER= ob_get_clean(); $AUIEO_CONTENT=""; ob_start(); if ($this->data['is_admin_hidden'] == 1) { ?> <p class="warning">This Candidate is hidden. Only CATS Administrators can view it or search for it. To make it visible by the site users, click <a href="<?php echo(CATSUtility::getIndexName()); ?>?m=candidates&a=administrativeHideShow&candidateID=<?php echo($this->candidateID); ?>&state=0" style="font-weight:bold;">Here.</a></p> <?php
public function isModuleActionPermitted($module = false, $action = false) { if ($module === false && isset($_REQUEST["m"])) { $module = $_REQUEST["m"]; } if ($action === false && isset($_REQUEST["a"])) { $action = $_REQUEST["a"]; } /** * if module not set, it is home module. It is allowed */ if ($module === false) { return true; } $data_item_type = 0; $actionMapping = array(); switch ($module) { case 'candidates': $data_item_type = 100; $actionMapping = Candidates::actionMapping(); break; case 'companies': $data_item_type = 200; $actionMapping = Companies::actionMapping(); break; case 'contacts': $data_item_type = 300; $actionMapping = Contacts::actionMapping(); break; case 'joborders': $data_item_type = 400; $actionMapping = JobOrders::actionMapping(); break; } /** * if $data_item_type is 0, it indicates other modules. so it is allowed */ if ($data_item_type <= 0) { return true; } $modulePermission = isset($this->permission[$data_item_type]) ? $this->permission[$data_item_type] : array(); /** * checks whether any one operation is allowed */ $isModulePermited = false; if ($modulePermission) { foreach ($modulePermission as $operation => $permission) { if ($permission > 0) { $isModulePermited = true; break; } } } /** * since all the operation is not allowed, don't allow */ if ($isModulePermited === false) { return false; } /** * if $action is false, check whether default action exist in action mapping */ if ($action === false) { if (isset($actionMapping["default"])) { $action = $actionMapping["default"]; } } if (!isset($actionMapping[$action])) { return true; } $operation = $actionMapping[$action]; /** * if the action allowed */ if (isset($modulePermission[$operation]) && $modulePermission[$operation] > 0) { return true; } return false; }