本文整理汇总了PHP中Administration::saveConfig方法的典型用法代码示例。如果您正苦于以下问题:PHP Administration::saveConfig方法的具体用法?PHP Administration::saveConfig怎么用?PHP Administration::saveConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Administration
的用法示例。
在下文中一共展示了Administration::saveConfig方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testsaveConfig
public function testsaveConfig()
{
$admin = new Administration();
$_POST['proxy_test'] = 'test value';
//execute the method and verify that it sets the correct config key
$admin->saveConfig();
$actual = $admin->settings['proxy_test'];
$this->assertEquals($actual, 'test value');
}
示例2: Configurator
function action_saveconfig()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$configurator = new Configurator();
if ($configurator->saveConfig() === false) {
$this->errors = ['company_logo' => $configurator->getError()];
$this->view = 'edit';
return;
}
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($cachedfile = sugar_cached('modules/Contacts/EditView.tpl'))) {
unlink($cachedfile);
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}
示例3: display
/**
* @see SugarView::display()
*/
public function display()
{
global $mod_strings, $app_strings, $app_list_strings;
require_once "modules/Configurator/metadata/SugarpdfSettingsdefs.php";
if (file_exists('custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php')) {
require_once 'custom/modules/Configurator/metadata/SugarpdfSettingsdefs.php';
}
if (!empty($_POST['save'])) {
// Save the logos
$error = $this->checkUploadImage();
if (empty($error)) {
$focus = new Administration();
foreach ($SugarpdfSettings as $k => $v) {
if ($v['type'] == 'password') {
if (isset($_POST[$k])) {
$_POST[$k] = blowfishEncode(blowfishGetKey($k), $_POST[$k]);
}
}
}
if (!empty($_POST["sugarpdf_pdf_class"]) && $_POST["sugarpdf_pdf_class"] != PDF_CLASS) {
// clear the cache for quotes detailview in order to switch the pdf class.
if (is_file($cachedfile = sugar_cached('modules/Quotes/DetailView.tpl'))) {
unlink($cachedfile);
}
}
$focus->saveConfig();
header('Location: index.php?module=Administration&action=index');
}
}
if (!empty($_POST['restore'])) {
$focus = new Administration();
foreach ($_POST as $key => $val) {
$prefix = $focus->get_config_prefix($key);
if (in_array($prefix[0], $focus->config_categories)) {
$result = $focus->db->query("SELECT count(*) AS the_count FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
$row = $focus->db->fetchByAssoc($result);
if ($row['the_count'] != 0) {
$focus->db->query("DELETE FROM config WHERE category = '{$prefix[0]}' AND name = '{$prefix[1]}'");
}
}
}
header('Location: index.php?module=Configurator&action=SugarpdfSettings');
}
echo getClassicModuleTitle("Administration", array("<a href='index.php?module=Administration&action=index'>" . translate('LBL_MODULE_NAME', 'Administration') . "</a>", $mod_strings['LBL_PDFMODULE_NAME']), false);
$pdf_class = array("TCPDF" => "TCPDF", "EZPDF" => "EZPDF");
$this->ss->assign('APP_LIST', $app_list_strings);
$this->ss->assign("JAVASCRIPT", get_set_focus_js());
$this->ss->assign("SugarpdfSettings", $SugarpdfSettings);
$this->ss->assign("pdf_enable_ezpdf", PDF_ENABLE_EZPDF);
if (PDF_ENABLE_EZPDF == "0" && PDF_CLASS == "EZPDF") {
$error = "ERR_EZPDF_DISABLE";
$this->ss->assign("selected_pdf_class", "TCPDF");
} else {
$this->ss->assign("selected_pdf_class", PDF_CLASS);
}
$this->ss->assign("pdf_class", $pdf_class);
if (!empty($error)) {
$this->ss->assign("error", $mod_strings[$error]);
}
if (!function_exists('imagecreatefrompng')) {
$this->ss->assign("GD_WARNING", 1);
} else {
$this->ss->assign("GD_WARNING", 0);
}
$this->ss->display('modules/Configurator/tpls/SugarpdfSettings.tpl');
require_once "include/javascript/javascript.php";
$javascript = new javascript();
$javascript->setFormName("ConfigureSugarpdfSettings");
foreach ($SugarpdfSettings as $k => $v) {
if (isset($v["required"]) && $v["required"] == true) {
$javascript->addFieldGeneric($k, "varchar", $v['label'], TRUE, "");
}
}
echo $javascript->getScript();
}
示例4: unset
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']);
}
}
//if the check box is empty, then set it to 0
if (!isset($_POST['mail_smtpauth_req'])) {
$_POST['mail_smtpauth_req'] = 0;
}
//default ssl use to false
if (!isset($_POST['mail_smtpssl'])) {
$_POST['mail_smtpssl'] = 0;
}
//reuse existing saveconfig functionality
$focus->saveConfig();
/**************************** Add New Monitored Box *****************************/
//perform this if the option to create new mail box has been checked
if (isset($_REQUEST['wiz_new_mbox']) && $_REQUEST['wiz_new_mbox'] == '1') {
//Populate the Request variables that inboundemail expects
$_REQUEST['mark_read'] = 1;
$_REQUEST['only_since'] = 1;
$_REQUEST['mailbox_type'] = 'bounce';
$_REQUEST['from_name'] = $_REQUEST['name'];
$_REQUEST['group_id'] = 'new';
// $_REQUEST['from_addr'] = $_REQUEST['wiz_step1_notify_fromaddress'];
//reuse save functionality for inbound email
require_once 'modules/InboundEmail/Save.php';
}
if (!empty($_REQUEST['error'])) {
//an error was found during inbound save. This means the save was allowed but the inbound box had problems, return user to wizard
示例5: 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;
if (!is_admin($current_user) && !is_admin_for_module($GLOBALS['current_user'], 'Emails') && !is_admin_for_module($GLOBALS['current_user'], 'Campaigns')) {
sugar_die("Unauthorized access to administration.");
}
//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 = new 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.
}
}
if (!empty($_POST['notify_allow_default_outbound'])) {
$oe = new OutboundEmail();
if (!$oe->isAllowUserAccessToSystemDefaultOutbound()) {
$oe->removeUserOverrideAccounts();
}
}
$focus->saveConfig();
// 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();
}
示例6: Configurator
function action_saveconfig()
{
global $current_user;
if (!is_admin($current_user)) {
sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
}
$configurator = new Configurator();
$configurator->saveConfig();
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl')) {
unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl');
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}
示例7: die
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$admin = new Administration();
$admin->saveConfig();
header("Location: index.php?action={$_REQUEST['return_action']}&module={$_REQUEST['return_module']}&record={$_REQUEST['return_id']}");
示例8: Configurator
function action_saveconfig()
{
$configurator = new Configurator();
$configurator->saveConfig();
$focus = new Administration();
$focus->saveConfig();
// Clear the Contacts file b/c portal flag affects rendering
if (file_exists($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl')) {
unlink($GLOBALS['sugar_config']['cache_dir'] . 'modules/Contacts/EditView.tpl');
}
SugarApplication::redirect('index.php?module=Administration&action=index');
}