示例#1
0
 public function isAccessible()
 {
     $listingTypeID = SJB_Array::get($this->params, 'listing_type_id');
     if ($listingTypeID) {
         $permissionLabel = 'view_' . strtolower($listingTypeID) . '_search_results';
         $this->setPermissionLabel($permissionLabel);
     }
     return parent::isAccessible() && SJB_System::isUserAccessThisPage();
 }
示例#2
0
 /**
  * @return bool
  */
 public function isAccessible()
 {
     $listingTypeID = SJB_Array::get($this->params, 'listing_type_id');
     if ($listingTypeID) {
         $permissionLabel = 'open_' . strtolower($listingTypeID) . '_search_form';
         $this->setPermissionLabel($permissionLabel);
         $form_template = SJB_Array::get($this->params, 'form_template');
         if ($listingTypeID === 'Job') {
             if (!parent::isAccessible() && !isset($form_template) && !SJB_System::isUserAccessThisPage()) {
                 return false;
             } elseif ($form_template == 'quick_search.tpl') {
                 return true;
             }
         }
     }
     return parent::isAccessible() && SJB_System::isUserAccessThisPage();
 }
示例#3
0
 public function isAccessible()
 {
     $listingTypeID = SJB_Array::get($this->params, 'listing_type_id');
     if ($listingTypeID) {
         $permissionLabel = 'view_' . strtolower($listingTypeID) . '_details';
         $this->setPermissionLabel($permissionLabel);
         $allow = parent::isAccessible() && SJB_System::isUserAccessThisPage();
         $listingID = SJB_Request::getVar('listing_id', false);
         $passedParametersViaUri = SJB_Request::getVar('passed_parameters_via_uri', false);
         if (!$listingID && $passedParametersViaUri) {
             $passedParametersViaUri = SJB_UrlParamProvider::getParams();
             if (isset($passedParametersViaUri[0])) {
                 $listingID = $passedParametersViaUri[0];
             }
         }
         if (SJB_UserManager::isUserLoggedIn()) {
             $currentUser = SJB_UserManager::getCurrentUser();
             if (!$allow && $listingID) {
                 $pageID = SJB_PageManager::getPageParentURI(SJB_Navigator::getURI(), SJB_System::getSystemSettings('SYSTEM_ACCESS_TYPE'), false);
                 $pageHasBeenVisited = SJB_ContractManager::isPageViewed($currentUser->getSID(), $pageID, $listingID);
                 if ($pageHasBeenVisited || strpos($pageID, 'print') !== false) {
                     $allow = true;
                 }
             }
             if (!$allow && 'Resume' == $listingTypeID && $listingID) {
                 // if view resume not allowed by ACL, check applications table
                 // for current resume ID, applied for one of current user jobs
                 // if present in applications - allow current user to view resume
                 // check for all jobs of current user
                 $cuJobs = SJB_ListingManager::getListingsByUserSID($currentUser->getSID());
                 $listingSids = array();
                 foreach ($cuJobs as $job) {
                     $listingSids[] = $job->getSID();
                 }
                 if (!empty($listingSids)) {
                     $result = SJB_DB::query('SELECT * FROM `applications` WHERE `resume` = ?n AND `listing_id` IN (?l) LIMIT 1', $listingID, $listingSids);
                     if (!empty($result)) {
                         $allow = true;
                     }
                 }
             }
         }
         return $allow;
     }
     return parent::isAccessible() && SJB_System::isUserAccessThisPage();
 }