Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

Commit

Permalink
*7003* Remove web-based config editor
Browse files Browse the repository at this point in the history
  • Loading branch information
asmecher committed Jan 3, 2012
1 parent f4ed447 commit 645041b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 79 deletions.
4 changes: 0 additions & 4 deletions locale/en_US/locale.xml
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,6 @@ You may optionally provide the user with a reason for disabling their account.</
<message key="admin.server.apacheVersion">Apache version</message>
<message key="admin.server.dbDriver">Database driver</message>
<message key="admin.server.dbVersion">Database server version</message>
<message key="admin.editSystemConfigInstructions"><![CDATA[Use this form to modify your system configuration (the <tt>config.inc.php</tt> file). Click Save to save your new configuration, or "Display" to simply display the updated configuration file and not modify your existing configuration.
<br /><br />
<span class="formError">Warning: Modifying these settings can potentially leave your site in an inaccessible state (requiring your configuration file to be manually fixed). It is strongly recommended that you do not make any changes unless you know exactly what you are doing.</span>]]></message>
<message key="admin.saveSystemConfig">Save Configuration</message>
<message key="admin.displayNewSystemConfig">Display New Configuration</message>
<message key="admin.systemConfigFileReadError"><![CDATA[The configuration file <tt>config.inc.php</tt> does not exist, is not readable, or is invalid.]]></message>
<message key="admin.overwriteConfigFileInstructions"><![CDATA[<h4>NOTE!</div>
Expand Down
72 changes: 0 additions & 72 deletions pages/admin/AdminFunctionsHandler.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,78 +60,6 @@ function systemInfo() {
$templateMgr->display('admin/systemInfo.tpl');
}

/**
* Edit the system configuration settings.
*/
function editSystemConfig() {
$this->validate();
$this->setupTemplate(true);

$templateMgr =& TemplateManager::getManager();
$templateMgr->append('pageHierarchy', array('admin/systemInfo', 'admin.systemInformation'));

$configData =& Config::getData();

$templateMgr =& TemplateManager::getManager();
$templateMgr->assign_by_ref('configData', $configData);
$templateMgr->display('admin/systemConfig.tpl');
}

/**
* Save modified system configuration settings.
*/
function saveSystemConfig() {
$this->validate();
$this->setupTemplate(true);

$configData =& Config::getData();

// Update configuration based on user-supplied data
foreach ($configData as $sectionName => $sectionData) {
$newData = Request::getUserVar($sectionName);
foreach ($sectionData as $settingName => $settingValue) {
if (isset($newData[$settingName])) {
$newValue = $newData[$settingName];
if (strtolower($newValue) == "true" || strtolower($newValue) == "on") {
$newValue = "On";
} else if (strtolower($newValue) == "false" || strtolower($newValue) == "off") {
$newValue = "Off";
}
$configData[$sectionName][$settingName] = $newValue;
}
}
}

$templateMgr =& TemplateManager::getManager();

// Update contents of configuration file
$configParser = new ConfigParser();
if (!$configParser->updateConfig(Config::getConfigFileName(), $configData)) {
// Error reading config file (this should never happen)
$templateMgr->assign('errorMsg', 'admin.systemConfigFileReadError');
$templateMgr->assign('backLink', Request::getPageUrl() . '/systemInfo');
$templateMgr->assign('backLinkLabel', 'admin.systemInformation');
$templateMgr->display('common/error.tpl');

} else {
$writeConfigFailed = false;
$displayConfigContents = Request::getUserVar('display') == null ? false : true;
$configFileContents = $configParser->getFileContents();

if (!$displayConfigContents) {
if (!$configParser->writeConfig(Config::getConfigFileName())) {
$writeConfigFailed = true;
}
}

// Display confirmation
$templateMgr->assign('writeConfigFailed', $writeConfigFailed);
$templateMgr->assign('displayConfigContents', $displayConfigContents);
$templateMgr->assign('configFileContents', $configFileContents);
$templateMgr->display('admin/systemConfigUpdated.tpl');
}
}

/**
* Show full PHP configuration information.
*/
Expand Down
2 changes: 0 additions & 2 deletions pages/admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@
// Administrative functions
//
case 'systemInfo':
case 'editSystemConfig':
case 'saveSystemConfig':
case 'phpinfo':
case 'expireSessions':
case 'clearTemplateCache':
Expand Down
1 change: 0 additions & 1 deletion templates/admin/systemInfo.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<br />
<div id="systemConfiguration">
<h3>{translate key="admin.systemConfiguration"}</h3>
<a class="action" href="{url op="editSystemConfig"}">{translate key="common.edit"}</a>
<p>{translate key="admin.systemConfigurationDescription"}</p>

{foreach from=$configData key=sectionName item=sectionData}
Expand Down

0 comments on commit 645041b

Please sign in to comment.