Exemplo n.º 1
0
 public function GetProfilesPermissions()
 {
     if (count($this->profilesPermissions) == 0) {
         $profiles = getAllProfileInfo();
         $sql = "SELECT * FROM its4you_calendar4you_profilespermissions";
         $res = $this->db->query($sql);
         $permissions = array();
         while ($row = $this->db->fetchByAssoc($res)) {
             //      in case that profile has been deleted we need to set permission only for active profiles
             if (isset($profiles[$row["profileid"]])) {
                 $permissions[$row["profileid"]][$row["operation"]] = $row["permissions"];
             }
         }
         foreach ($profiles as $profileid => $profilename) {
             foreach ($this->profilesActions as $actionName) {
                 $actionId = getActionid($actionName);
                 if (!isset($permissions[$profileid][$actionId])) {
                     $permissions[$profileid][$actionId] = "0";
                 }
             }
         }
         ksort($permissions);
         $this->profilesPermissions = $permissions;
     }
     return $this->profilesPermissions;
 }
Exemplo n.º 2
0
/*+********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 ********************************************************************************/
require_once 'include/utils/utils.php';
global $adb;
global $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$profDetails = getAllProfileInfo();
$smarty->assign("MOD", return_module_language($current_language, 'Settings'));
$smarty->assign("APP", $app_strings);
if (isset($_REQUEST['roleid']) && $_REQUEST['roleid'] != '') {
    $roleid = vtlib_purify($_REQUEST['roleid']);
    $mode = vtlib_purify($_REQUEST['mode']);
    $roleInfo = getRoleInformation($roleid);
    $thisRoleDet = $roleInfo[$roleid];
    $rolename = $thisRoleDet[0];
    $parent = $thisRoleDet[3];
    //retreiving the vtiger_profileid
    $roleRelatedProfiles = getRoleRelatedProfiles($roleid);
} elseif (isset($_REQUEST['parent']) && $_REQUEST['parent'] != '') {
    $mode = 'create';
    $parent = vtlib_purify($_REQUEST['parent']);
}