function process() { $GLOBALS['log']->info(get_class($this) . ":"); global $current_user; $access = get_admin_modules_for_user($current_user); if (is_admin($current_user) || is_admin_for_any_module($current_user) && !isset($_REQUEST['view_module']) && (isset($_REQUEST['action']) && $_REQUEST['action'] != 'package') || isset($_REQUEST['view_module']) && (in_array($_REQUEST['view_module'], $access) || empty($_REQUEST['view_module'])) || isset($_REQUEST['type']) && ($_REQUEST['type'] == 'dropdowns' && is_admin_for_any_module($current_user) || $_REQUEST['type'] == 'studio' && displayStudioForCurrentUser() == true)) { $this->hasAccess = true; } else { $this->hasAccess = false; } parent::process(); }
/** * @see SugarView::display() */ public function display() { require_once 'include/connectors/utils/ConnectorUtils.php'; $source = $_REQUEST['source_id']; $sources = ConnectorUtils::getConnectors(); $modules_sources = ConnectorUtils::getDisplayConfig(); //$json = getJSONobj(); $enabled_modules = array(); $disabled_modules = array(); //Find all modules this source has been enabled for foreach ($modules_sources as $module => $mapping) { foreach ($modules_sources[$module] as $entry) { if ($entry == $source) { $enabled_modules[$module] = $module; } } } global $moduleList, $beanList; //Do filtering here? $count = 0; global $current_user; $access = get_admin_modules_for_user($current_user); $d = dir('modules'); while ($e = $d->read()) { if (substr($e, 0, 1) == '.' || !is_dir('modules/' . $e)) { continue; } if (empty($enabled_modules[$e]) && file_exists('modules/' . $e . '/metadata/studio.php') && file_exists('modules/' . $e . '/metadata/detailviewdefs.php') && isset($GLOBALS['beanList'][$e]) && (in_array($e, $access) || is_admin($current_user))) { $disabled_modules[$e] = $e; } } asort($enabled_modules); asort($disabled_modules); //$enabled = $json->encode($enabled_modules); //$disabled = $json->encode($disabled_modules); //$script = "addTable('{$module}', '{$enabled}', '{$disabled}', '{$source}', '{$GLOBALS['theme']}');\n"; //$this->ss->assign('new_modules_sources', $modules_sources); //$this->ss->assign('dynamic_script', $script); $this->ss->assign('enabled_modules', $enabled_modules); $this->ss->assign('disabled_modules', $disabled_modules); $this->ss->assign('source_id', $source); $this->ss->assign('mod', $GLOBALS['mod_strings']); $this->ss->assign('APP', $GLOBALS['app_strings']); $this->ss->assign('theme', $GLOBALS['theme']); $this->ss->assign('external', !empty($sources[$source]['eapm'])); $this->ss->assign('externalOnly', !empty($sources[$source]['eapm']['only'])); // We don't want to tell the user to set the properties of the connector if there aren't any $s = SourceFactory::getSource($source); $fields = $s->getRequiredConfigFields(); $this->ss->assign('externalHasProperties', !empty($fields)); $this->ss->assign('externalChecked', !empty($sources[$source]['eapm']['enabled']) ? " checked" : ""); echo $this->ss->fetch('modules/Connectors/tpls/display_properties.tpl'); }
function process() { $GLOBALS['log']->info(get_class($this) . ":"); global $current_user; $access = get_admin_modules_for_user($current_user); //Non admins can still execute functions if (!empty($_REQUEST['action']) && in_array($_REQUEST['action'], $this->non_admin_actions) || $this->isModuleAdmin($access)) { $this->hasAccess = true; } else { $this->hasAccess = false; } parent::process(); }
function loadModules() { global $current_user; $access = get_admin_modules_for_user($current_user); $d = dir('modules'); while ($e = $d->read()) { if (substr($e, 0, 1) == '.' || !is_dir('modules/' . $e)) { continue; } if (file_exists('modules/' . $e . '/metadata/studio.php') && isset($GLOBALS['beanList'][$e]) && (in_array($e, $access) || is_admin($current_user))) { $this->modules[$e] = new StudioModule($e); } } }
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc. * All Rights Reserved. * Contributor(s): ______________________________________.. ********************************************************************************/ global $app_strings; global $app_list_strings; global $mod_strings; global $currentModule; global $current_language; global $current_user; global $sugar_flavor; if (!is_admin($current_user) && !is_admin_for_any_module($current_user)) { sugar_die("Unauthorized access to administration."); } echo get_module_title($mod_strings['LBL_MODULE_NAME'], $mod_strings['LBL_MODULE_TITLE'], true); $access = get_admin_modules_for_user($current_user); //Sugar Network $admin_option_defs = array(); $license_key = 'no_key'; $admin_option_defs['Administration']['support'] = array('Support', 'LBL_SUPPORT_TITLE', 'LBL_SUPPORT', './index.php?module=Administration&action=SupportPortal&view=support_portal'); //$admin_option_defs['documentation']= array('OnlineDocumentation','LBL_DOCUMENTATION_TITLE','LBL_DOCUMENTATION','./index.php?module=Administration&action=SupportPortal&view=documentation&help_module=Administration&edition='.$sugar_flavor.'&key='.$server_unique_key.'&language='.$current_language); $admin_option_defs['Administration']['documentation'] = array('OnlineDocumentation', 'LBL_DOCUMENTATION_TITLE', 'LBL_DOCUMENTATION', 'javascript:void window.open("index.php?module=Administration&action=SupportPortal&view=documentation&help_module=Administration&edition=' . $sugar_flavor . '&key=' . $server_unique_key . '&language=' . $current_language . '", "helpwin","width=600,height=600,status=0,resizable=1,scrollbars=1,toolbar=0,location=0")'); $admin_option_defs['Administration']['update'] = array('sugarupdate', 'LBL_SUGAR_UPDATE_TITLE', 'LBL_SUGAR_UPDATE', './index.php?module=Administration&action=Updater'); if (!empty($license->settings['license_latest_versions'])) { $encodedVersions = $license->settings['license_latest_versions']; $versions = unserialize(base64_decode($encodedVersions)); include 'sugar_version.php'; if (!empty($versions)) { foreach ($versions as $version) { if ($version['version'] > $sugar_version) { $admin_option_defs['Administration']['update'][] = 'red';