Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 25 additions & 16 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,24 +280,31 @@
/* Job Types mapping
*/
/* Uncomment bellow if you want custom mapping */
/*const JOB_TYPES_LIST = array(
'PT' => 'Part-Time',
'FT' => 'Full-Time',
'ST' => 'Student',
'FL' => 'Freelance'
);*/


/*
require_once('.\constants.php');
// defining user roles
const USER_ROLES = array(
/*
class JOB_TYPES {
public static $LIST = array(
'PT' => 'Part-Time',
'FT' => 'Full-Time',
'ST' => 'Student',
'FL' => 'Freelance'
);
};
*/


/*
require_once('./constants.php');

class ACL_SETUP {

// defining user roles
public static $USER_ROLES = array(
'candidate' => array('Candidate', 'candidate', 'This is a candidate.', ACCESS_LEVEL_SA, ACCESS_LEVEL_READ),
'demo' => array('Demo', 'demo', 'This is a demo user.', ACCESS_LEVEL_SA, ACCESS_LEVEL_READ)
);
// defining access levels different from the default access level
const ACCESS_LEVEL_MAP = array(

// defining access levels different from the default access level
public static $ACCESS_LEVEL_MAP = array(
'candidate' => array(
),
'demo' => array(
Expand All @@ -308,7 +315,9 @@
'joborders.show' => ACCESS_LEVEL_DEMO,
'joborders.email' => ACCESS_LEVEL_DISABLED,
)
);*/
);
};
*/

/* All possible secure object names
'candidates.history'
Expand Down
42 changes: 23 additions & 19 deletions lib/ACL.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,27 @@ class ACL
* Example:
const CATEGORY_DISABLED = '#';

const ACCESS_LEVEL_MAP = array(
'recruiter' => array(
'calendar' => ACCESS_LEVEL_DELETE,
'candidates'=> ACCESS_LEVEL_DELETE,
'candidates.add'=> ACCESS_LEVEL_DISABLED
),
'candidate' => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_DISABLED,
'news' => ACCESS_LEVEL_READ,
),
ACL::CATEGORY_EMPTY => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_READ
),
ACL::CATEGORY_DISABLED => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_DISABLED
)

class ACL_SETUP {
public static $USER_ROLES = array(
'demo' => array('Demo', 'demo', 'This is a demo user.', ACCESS_LEVEL_SA, ACCESS_LEVEL_READ)
);
public static $ACCESS_LEVEL_MAP = array(
'recruiter' => array(
'calendar' => ACCESS_LEVEL_DELETE,
'candidates'=> ACCESS_LEVEL_DELETE,
'candidates.add'=> ACCESS_LEVEL_DISABLED
),
'candidate' => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_DISABLED,
'news' => ACCESS_LEVEL_READ,
),
ACL::CATEGORY_EMPTY => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_READ
),
ACL::CATEGORY_DISABLED => array(
ACL::SECOBJ_ROOT => ACCESS_LEVEL_DISABLED
)
};
);
*/

Expand All @@ -47,12 +51,12 @@ class ACL
*/
public static function getAccessLevel($securedObjectName, $userCategories, $defaultAccessLevel)
{
if( !defined('ACCESS_LEVEL_MAP') || empty(ACCESS_LEVEL_MAP))
if( !class_exists('ACL_SETUP') || empty(ACL_SETUP::$ACCESS_LEVEL_MAP))
{
return $defaultAccessLevel;
}

$aclmap = ACCESS_LEVEL_MAP;
$aclmap = ACL_SETUP::$ACCESS_LEVEL_MAP;
$userCategory = ACL::CATEGORY_EMPTY;
if( isset($userCategories) && count($userCategories) > 0 && isset($userCategories[0]) )
{
Expand Down
4 changes: 2 additions & 2 deletions lib/JobOrderTypes.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ public function __construct() {
*/
public function getAll()
{
if(defined('JOB_TYPES_LIST'))
if( class_exists('JOB_TYPES') && !empty(JOB_TYPES::$LIST) )
{
return JOB_TYPES_LIST;
return JOB_TYPES::$LIST;
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions modules/settings/SettingsUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ public function __construct()
$this->_moduleTabText = 'Settings';

/* Only CATS professional on site gets to make career portal customizer users. */
if(defined('USER_ROLES'))
if( class_exists('ACL_SETUP') && !empty(ACL_SETUP::$USER_ROLES) )
{
$this->_settingsUserCategories = USER_ROLES;
$this->_settingsUserCategories = ACL_SETUP::$USER_ROLES;
}

$mp = array(
Expand Down
14 changes: 8 additions & 6 deletions test/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -265,11 +265,13 @@
define ('LDAP_BIND_PASSWORD', 'password');
define ('LDAP_PROTOCOL_VERSION', 3);

const JOB_TYPES_LIST = array(
'H' => 'Hire',
'C' => 'Contract',
'C2H' => 'Contract To Hire',
'FL' => 'Freelance'
);
class JOB_TYPES {
public static $LIST = array(
'H' => 'Hire',
'C' => 'Contract',
'C2H' => 'Contract To Hire',
'FL' => 'Freelance'
);
};

?>