本文整理汇总了PHP中Configurator::handleOverride方法的典型用法代码示例。如果您正苦于以下问题:PHP Configurator::handleOverride方法的具体用法?PHP Configurator::handleOverride怎么用?PHP Configurator::handleOverride使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configurator
的用法示例。
在下文中一共展示了Configurator::handleOverride方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if default_theme is valid
if (isset($_REQUEST['default_theme']) && !in_array($_REQUEST['default_theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("Default theme is invalid.");
}
if (isset($_REQUEST['disabled_themes'])) {
$toDecode = html_entity_decode($_REQUEST['disabled_themes'], ENT_QUOTES);
$disabledThemes = json_decode($toDecode, true);
if (($key = array_search(SugarThemeRegistry::current()->__toString(), $disabledThemes)) !== FALSE) {
unset($disabledThemes[$key]);
}
$_REQUEST['disabled_themes'] = implode(',', $disabledThemes);
$configurator = new Configurator();
$configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
$configurator->config['default_theme'] = $_REQUEST['default_theme'];
$configurator->handleOverride();
echo "true";
} else {
parent::process();
}
}
示例2: action_savelanguages
public function action_savelanguages()
{
global $sugar_config;
$toDecode = html_entity_decode($_REQUEST['disabled_langs'], ENT_QUOTES);
$disabled_langs = json_decode($toDecode);
$toDecode = html_entity_decode($_REQUEST['enabled_langs'], ENT_QUOTES);
$enabled_langs = json_decode($toDecode);
if (count($sugar_config['languages']) === count($disabled_langs)) {
sugar_die(translate('LBL_CAN_NOT_DISABLE_ALL_LANG'));
} else {
$cfg = new Configurator();
if (in_array($sugar_config['default_language'], $disabled_langs)) {
reset($enabled_langs);
$cfg->config['default_language'] = current($enabled_langs);
}
if (in_array($GLOBALS['current_user']->preferred_language, $disabled_langs)) {
$GLOBALS['current_user']->preferred_language = current($enabled_langs);
$GLOBALS['current_user']->save();
}
$cfg->config['disabled_languages'] = join(',', $disabled_langs);
// TODO: find way to enforce order
$cfg->handleOverride();
// Clear the metadata cache so changes to languages are picked up right away
MetaDataManager::refreshLanguagesCache($enabled_langs);
require_once 'modules/Administration/QuickRepairAndRebuild.php';
$repair = new RepairAndClear();
$repair->clearLanguageCache();
}
//Call Ping API to refresh the language list.
die("\n <script>\n var app = window.parent.SUGAR.App;\n app.api.call('read', app.api.buildURL('ping'));\n app.router.navigate('#bwc/index.php?module=Administration&action=Languages', {trigger:true, replace:true});\n </script>");
}
示例3: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if the theme is valid
if (!isset($_REQUEST['theme']) || !in_array($_REQUEST['theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("theme is invalid.");
}
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'save') {
$theme_config = SugarThemeRegistry::getThemeConfig($_REQUEST['theme']);
$configurator = new Configurator();
foreach ($theme_config as $name => $def) {
if (isset($_REQUEST[$name])) {
if ($_REQUEST[$name] == 'true') {
$_REQUEST[$name] = true;
} else {
if ($_REQUEST[$name] == 'false') {
$_REQUEST[$name] = false;
}
}
$configurator->config['theme_settings'][$_REQUEST['theme']][$name] = $_REQUEST[$name];
}
}
$configurator->handleOverride();
SugarApplication::redirect('index.php?module=Administration&action=ThemeSettings');
exit;
}
parent::process();
}
示例4: setAppSettings
function setAppSettings($appId, $appSecret)
{
if (ctype_alnum($appId) && strlen($appId) == 20 && ctype_alnum($appSecret) && strlen($appSecret) == 40) {
$configurator = new Configurator();
$configurator->config['authenticationClass'] = "LatchAuthenticate";
$configurator->config['appId'] = $appId;
$configurator->config['appSecret'] = $appSecret;
$configurator->handleOverride();
}
}
示例5: action_savelanguages
public function action_savelanguages()
{
global $sugar_config;
$toDecode = html_entity_decode($_REQUEST['disabled_langs'], ENT_QUOTES);
$disabled_langs = json_decode($toDecode);
$toDecode = html_entity_decode($_REQUEST['enabled_langs'], ENT_QUOTES);
$enabled_langs = json_decode($toDecode);
$cfg = new Configurator();
$cfg->config['disabled_languages'] = join(',', $disabled_langs);
// TODO: find way to enforce order
$cfg->handleOverride();
header("Location: index.php?module=Administration&action=Languages");
}
示例6: clearFTSFlags
/**
* After the notification is displayed, clear the fts flags
* @return null
*/
protected function clearFTSFlags()
{
if (is_admin($GLOBALS['current_user'])) {
$admin = Administration::getSettings();
if (!empty($settings->settings['info_fts_index_done'])) {
$admin->saveSetting('info', 'fts_index_done', 0);
}
// remove notification disabled notification
$cfg = new Configurator();
$cfg->config['fts_disable_notification'] = false;
$cfg->handleOverride();
}
}
示例7: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (is_admin($current_user) && isset($_REQUEST['disabled_themes'])) {
$_REQUEST['disabled_themes'] = explode(',', $_REQUEST['disabled_themes']);
if (($key = array_search(SugarThemeRegistry::current()->__toString(), $_REQUEST['disabled_themes'])) !== FALSE) {
unset($_REQUEST['disabled_themes'][$key]);
}
$_REQUEST['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
$configurator = new Configurator();
$configurator->config['disabled_themes'] = $_REQUEST['disabled_themes'];
$configurator->handleOverride();
}
parent::process();
}
示例8: process
/**
* @see SugarView::process()
*/
public function process()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die("Unauthorized access to administration.");
}
// Check if default_theme is valid
if (isset($_REQUEST['default_theme']) && !in_array($_REQUEST['default_theme'], array_keys(SugarThemeRegistry::allThemes()))) {
sugar_die("Default theme is invalid.");
}
if (isset($_REQUEST['disabled_themes'])) {
$configurator = new Configurator();
$configurator->config['disabled_themes'] = implode(',', $_REQUEST['disabled_themes']);
$configurator->config['default_theme'] = $_REQUEST['default_theme'];
$configurator->handleOverride();
}
parent::process();
}
示例9: disableFTS
/**
* Disable FTS and write to config.
*
*/
protected function disableFTS()
{
$this->logger->fatal('Full Text Search has been disabled because the system is not able to connect to the search engine.');
self::markSearchEngineStatus(true);
// notification
if (empty($GLOBALS['sugar_config']['fts_disable_notification'])) {
$cfg = new Configurator();
$cfg->config['fts_disable_notification'] = true;
$cfg->handleOverride();
}
}
示例10: unset
//no need to write to config.php
unset($sugar_config['disable_team_access_check']);
}
logThis('Running merge_passwordsetting', $path);
if (!merge_passwordsetting($sugar_config, $sugar_version)) {
logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path);
$errors[] = 'Could not write config.php!';
}
logThis('Done merge_passwordsetting', $path);
}
if (version_compare($sugar_version, '6.7.0', '<') && isset($sugar_config['default_theme']) && $sugar_config['default_theme'] == 'Sugar5') {
logThis('Set default_theme to RacerX', $path);
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
$configurator->config['default_theme'] = 'RacerX';
$configurator->handleOverride();
}
if (!write_array_to_file("sugar_config", $sugar_config, "config.php")) {
logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path);
$errors[] = 'Could not write config.php!';
}
logThis('Set default_max_tabs to 7', $path);
$sugar_config['default_max_tabs'] = '7';
logThis('Upgrade the sugar_version', $path);
$sugar_config['sugar_version'] = $sugar_version;
ksort($sugar_config);
if (!write_array_to_file("sugar_config", $sugar_config, "config.php")) {
logThis('*** ERROR: could not write config.php! - upgrade will fail!', $path);
$errors[] = 'Could not write config.php!';
}
logThis('post_install() done.', $path);
示例11: putSettingsEngine
public function putSettingsEngine($api, $args)
{
$this->checkACL($api, $args);
if (!empty($args['data'])) {
$cfg = new Configurator();
$cfg->config['pmse_settings_default'] = $args['data'];
$cfg->handleOverride();
}
return array('success' => true, 'data' => $args['data']);
}
示例12: Administration
function action_saveadminwizard()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$focus = new Administration();
$focus->retrieveSettings();
$focus->saveConfig();
$configurator = new Configurator();
$configurator->populateFromPost();
$configurator->handleOverride();
$configurator->parseLoggerSettings();
$configurator->saveConfig();
// Bug 37310 - Delete any existing currency that matches the one we've just set the default to during the admin wizard
$currency = new Currency();
$currency->retrieve($currency->retrieve_id_by_name($_REQUEST['default_currency_name']));
if (!empty($currency->id) && $currency->symbol == $_REQUEST['default_currency_symbol'] && $currency->iso4217 == $_REQUEST['default_currency_iso4217']) {
$currency->deleted = 1;
$currency->save();
}
SugarApplication::redirect('index.php?module=Users&action=Wizard&skipwelcome=1');
}
示例13: Configurator
function action_Save()
{
require_once 'include/OutboundEmail/OutboundEmail.php';
require_once 'modules/Configurator/Configurator.php';
$configurator = new Configurator();
global $sugar_config;
global $current_user, $mod_strings;
if (!is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'], 'Emails') && !is_admin_for_module($GLOBALS['current_user'], 'Campaigns')) {
sugar_die($mod_strings['LBL_UNAUTH_ACCESS']);
}
//Do not allow users to spoof for sendmail if the config flag is not set.
if (!isset($sugar_config['allow_sendmail_outbound']) || !$sugar_config['allow_sendmail_outbound']) {
$_REQUEST['mail_sendtype'] = "SMTP";
}
// save Outbound settings #Bug 20033 Ensure data for Outbound email exists before trying to update the system mailer.
if (isset($_REQUEST['mail_sendtype']) && empty($_REQUEST['campaignConfig'])) {
$oe = new OutboundEmail();
$oe->populateFromPost();
$oe->saveSystem();
}
$focus = BeanFactory::getBean('Administration');
if (isset($_POST['tracking_entities_location_type'])) {
if ($_POST['tracking_entities_location_type'] != '2') {
unset($_POST['tracking_entities_location']);
unset($_POST['tracking_entities_location_type']);
}
}
// cn: handle mail_smtpauth_req checkbox on/off (removing double reference in the form itself
if (!isset($_POST['mail_smtpauth_req'])) {
$_POST['mail_smtpauth_req'] = 0;
if (empty($_POST['campaignConfig'])) {
$_POST['notify_allow_default_outbound'] = 0;
// If smtp auth is disabled ensure outbound is disabled.
}
}
$focus->saveConfig();
// mark user metadata changed so the user preferences get refreshed
// (user preferences contain email client preference)
$mm = MetadataManager::getManager();
$mm->setUserMetadataHasChanged($current_user);
// save User defaults for emails
$configurator->config['email_default_delete_attachments'] = isset($_REQUEST['email_default_delete_attachments']) ? true : false;
///////////////////////////////////////////////////////////////////////////////
//// SECURITY
$security = array();
if (isset($_REQUEST['applet'])) {
$security['applet'] = 'applet';
}
if (isset($_REQUEST['base'])) {
$security['base'] = 'base';
}
if (isset($_REQUEST['embed'])) {
$security['embed'] = 'embed';
}
if (isset($_REQUEST['form'])) {
$security['form'] = 'form';
}
if (isset($_REQUEST['frame'])) {
$security['frame'] = 'frame';
}
if (isset($_REQUEST['frameset'])) {
$security['frameset'] = 'frameset';
}
if (isset($_REQUEST['iframe'])) {
$security['iframe'] = 'iframe';
}
if (isset($_REQUEST['import'])) {
$security['import'] = '\\?import';
}
if (isset($_REQUEST['layer'])) {
$security['layer'] = 'layer';
}
if (isset($_REQUEST['link'])) {
$security['link'] = 'link';
}
if (isset($_REQUEST['object'])) {
$security['object'] = 'object';
}
if (isset($_REQUEST['style'])) {
$security['style'] = 'style';
}
if (isset($_REQUEST['xmp'])) {
$security['xmp'] = 'xmp';
}
$security['script'] = 'script';
$configurator->config['email_xss'] = base64_encode(serialize($security));
//// SECURITY
///////////////////////////////////////////////////////////////////////////////
ksort($sugar_config);
$configurator->handleOverride();
}
示例14: action_UpdateAjaxUI
public function action_UpdateAjaxUI()
{
require_once 'modules/Configurator/Configurator.php';
$cfg = new Configurator();
$disabled = json_decode(html_entity_decode($_REQUEST['disabled_modules'], ENT_QUOTES));
$cfg->config['addAjaxBannedModules'] = empty($disabled) ? FALSE : $disabled;
$cfg->handleOverride();
$this->view = "configureajaxui";
}
示例15: Administration
function action_saveadminwizard()
{
$focus = new Administration();
$focus->retrieveSettings();
$focus->saveConfig();
$configurator = new Configurator();
$configurator->populateFromPost();
$configurator->handleOverride();
$configurator->parseLoggerSettings();
$configurator->saveConfig();
SugarApplication::redirect('index.php?module=Users&action=Wizard&skipwelcome=1');
}