Source for file admin.config.php
Documentation is available at admin.config.php
* @copyright Refer to copyright.php
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @author Mambo Foundation Inc see README.php
/** ensure this file is being included by a parent file */
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
if (!$acl->acl_check( 'administration', 'config', 'users', $my->usertype )) {
mosRedirect( 'index2.php', T_('You are not authorized to view this resource.') );
'config_offline' =>
'mosConfig_offline',
'config_host' =>
'mosConfig_host',
'config_user' =>
'mosConfig_user',
'config_password' =>
'mosConfig_password',
'config_db' =>
'mosConfig_db',
'config_dbprefix' =>
'mosConfig_dbprefix',
'config_path' =>
'mosConfig_absolute_path',
'config_live_site' =>
'mosConfig_live_site',
'config_sitename' =>
'mosConfig_sitename',
'config_auth' =>
'mosConfig_shownoauth',
'config_useractivation' =>
'mosConfig_useractivation',
'config_uniquemail' =>
'mosConfig_uniquemail',
'config_use_captcha' =>
'mosConfig_usecaptcha',
'config_offline_message' =>
'mosConfig_offline_message',
'config_error_message' =>
'mosConfig_error_message',
'config_debug' =>
'mosConfig_debug',
'config_lifetime' =>
'mosConfig_lifetime',
'config_metadesc' =>
'mosConfig_MetaDesc',
'config_metakeys' =>
'mosConfig_MetaKeys',
'config_metaauthor' =>
'mosConfig_MetaAuthor',
'config_metatitle' =>
'mosConfig_MetaTitle',
'config_lang' =>
'mosConfig_lang',
'config_locale' =>
'mosConfig_locale',
'config_locale_debug' =>
'mosConfig_locale_debug',
'config_locale_use_gettext' =>
'mosConfig_locale_use_gettext',
'config_offset' =>
'mosConfig_offset',
'config_hideauthor' =>
'mosConfig_hideAuthor',
'config_hidecreate' =>
'mosConfig_hideCreateDate',
'config_hidemodify' =>
'mosConfig_hideModifyDate',
'config_hidepdf' =>
'mosConfig_hidePdf',
'config_hideprint' =>
'mosConfig_hidePrint',
'config_hideemail' =>
'mosConfig_hideEmail',
'config_enable_log_items' =>
'mosConfig_enable_log_items',
'config_enable_log_searches' =>
'mosConfig_enable_log_searches',
'config_enable_stats' =>
'mosConfig_enable_stats',
'config_sef' =>
'mosConfig_sef',
'config_vote' =>
'mosConfig_vote',
'config_gzip' =>
'mosConfig_gzip',
'config_multipage_toc' =>
'mosConfig_multipage_toc',
'config_allowUserRegistration' =>
'mosConfig_allowUserRegistration',
'config_link_titles' =>
'mosConfig_link_titles',
'config_error_reporting' =>
'mosConfig_error_reporting',
'config_register_globals' =>
'mosConfig_register_globals',
'config_list_limit' =>
'mosConfig_list_limit',
'config_caching' =>
'mosConfig_caching',
'config_cachepath' =>
'mosConfig_cachepath',
'config_cachetime' =>
'mosConfig_cachetime',
'config_mailer' =>
'mosConfig_mailer',
'config_mailfrom' =>
'mosConfig_mailfrom',
'config_fromname' =>
'mosConfig_fromname',
'config_sendmail' =>
'mosConfig_sendmail',
'config_smtpauth' =>
'mosConfig_smtpauth',
'config_smtpuser' =>
'mosConfig_smtpuser',
'config_smtppass' =>
'mosConfig_smtppass',
'config_smtphost' =>
'mosConfig_smtphost',
'config_back_button' =>
'mosConfig_back_button',
'config_item_navigation' =>
'mosConfig_item_navigation',
'config_secret' =>
'mosConfig_secret',
'config_pagetitles' =>
'mosConfig_pagetitles',
'config_readmore' =>
'mosConfig_readmore',
'config_hits' =>
'mosConfig_hits',
'config_icons' =>
'mosConfig_icons',
'config_favicon' =>
'mosConfig_favicon',
'config_fileperms' =>
'mosConfig_fileperms',
'config_dirperms' =>
'mosConfig_dirperms',
'config_ml_support' =>
'mosConfig_mbf_content',
'config_helpurl' =>
'mosConfig_helpurl'
foreach ($this->_alias as $k=>
$v) {
$txt .=
"\$$v = '".
addslashes( $this->$k ).
"';\n";
foreach ($this->_alias as $k=>
$v) {
$this->$k =
$GLOBALS[$v];
require_once( str_replace('\\','/',dirname(__FILE__
)) .
'/admin.config.html.php' );
function showconfig($confightml, &$database, $option) {
global $database, $mosConfig_absolute_path, $mosConfig_locale;
// compile list of the languages
// menuitems appears never to be used - so commented out by Martin Brampton 15 Dec 2005
foreach ($files as $file){
// sort list of languages
// compile list of the editors
$query =
"SELECT id AS value, name AS text"
.
"\n WHERE folder='editors' AND published >= 0"
.
"\n ORDER BY ordering, name"
$database->setQuery( $query );
$edits =
$database->loadObjectList();
.
"\n WHERE folder='editors' AND published = 1"
$database->setQuery( $query );
$editor =
$database->loadResult();
// build the html select list
$lists['editor'] =
mosHTML::selectList( $edits, 'editor', 'class="inputbox" size="1"', 'value', 'text', $editor );
// build the html select list
// make a generic -24 - 24 list
for ($i=-
12;$i<=
12;$i++
) {
// menuitems appears not to be used anywhere - so commented out Martin Brampton 15 Dec 2005
// $query = "SELECT id AS value, name AS text FROM #__menu"
// . "\n WHERE (type='content_section' OR type='components' OR type='content_typed')"
// . "\n AND published=1"
// $database->setQuery( $query );
// $menuitems = array_merge( $menuitems, $database->loadObjectList() );
$register_globals =
array(
$locale_use_gettext =
array(
// build the html select lists
$lists['hideauthor'] =
mosHTML::RadioList( $show_hide, 'config_hideauthor', 'class="inputbox"', $row->config_hideauthor, 'value', 'text' );
$lists['hidecreate'] =
mosHTML::RadioList( $show_hide, 'config_hidecreate', 'class="inputbox"', $row->config_hidecreate, 'value', 'text' );
$lists['hidemodify'] =
mosHTML::RadioList( $show_hide, 'config_hidemodify', 'class="inputbox"', $row->config_hidemodify, 'value', 'text' );
if (is_writable( "$mosConfig_absolute_path/media/" )) {
$lists['hidepdf'] =
mosHTML::RadioList( $show_hide, 'config_hidepdf', 'class="inputbox"', $row->config_hidepdf, 'value', 'text' );
$lists['hidepdf'] =
'<input type="hidden" name="config_hidepdf" value="1" /><strong>'.
T_('Yes').
'</strong>';
$lists['hideprint'] =
mosHTML::RadioList( $show_hide, 'config_hideprint', 'class="inputbox"', $row->config_hideprint, 'value', 'text' );
$lists['hideemail'] =
mosHTML::RadioList( $show_hide, 'config_hideemail', 'class="inputbox"', $row->config_hideemail, 'value', 'text' );
$lists['sef'] =
mosHTML::yesnoRadioList( 'config_sef', 'class="inputbox" onclick="javascript: if (document.adminForm.config_sef[1].checked) { alert(\''.
T_('Remember to rename htaccess.txt to .htaccess').
'\') }"', $row->config_sef );
$lists['vote'] =
mosHTML::RadioList( $show_hide_r, 'config_vote', 'class="inputbox"', $row->config_vote, 'value', 'text' );
$lists['multipage_toc'] =
mosHTML::RadioList( $show_hide_r, 'config_multipage_toc', 'class="inputbox"', $row->config_multipage_toc, 'value', 'text' );
$lists['register_globals'] =
mosHTML::RadioList( $register_globals, 'config_register_globals', 'class="inputbox" size="1"', $row->config_register_globals, 'value', 'text' );
$lists['locale_debug'] =
mosHTML::RadioList( $locale_debug, 'config_locale_debug', 'class="inputbox" size="1"', $row->config_locale_debug, 'value', 'text' );
$lists['locale_use_gettext'] =
mosHTML::RadioList( $locale_use_gettext, 'config_locale_use_gettext', $disabled.
'class="inputbox" size="1"', $row->config_locale_use_gettext, 'value', 'text' );
$lists['back_button'] =
mosHTML::RadioList( $show_hide_r, 'config_back_button', 'class="inputbox"', $row->config_back_button, 'value', 'text' );
$lists['item_navigation'] =
mosHTML::RadioList( $show_hide_r, 'config_item_navigation', 'class="inputbox"', $row->config_item_navigation, 'value', 'text' );
$lists['ml_support'] =
mosHTML::yesnoRadioList( 'config_ml_support', 'class="inputbox" onclick="javascript: if (document.adminForm.config_ml_support[1].checked) { alert(\''.
T_('Remember to install the MambelFish component.').
'\') }"', $row->config_ml_support );
$lists['readmore'] =
mosHTML::RadioList( $show_hide_r, 'config_readmore', 'class="inputbox"', $row->config_readmore, 'value', 'text' );
$lists['hits'] =
mosHTML::RadioList( $show_hide_r, 'config_hits', 'class="inputbox"', $row->config_hits, 'value', 'text' );
$lists['icons'] =
mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' );
// $lists['favicon'] = mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' );
global $database, $mosConfig_absolute_path;
if (!$row->bind( $_POST )) {
$query =
"UPDATE #__mambots"
.
"\n WHERE published >= 0 AND folder='editors'"
$database->setQuery( $query );
$database->query() or die( $database->getErrorMsg() );
$query =
"UPDATE #__mambots"
.
"\n WHERE id = $editor"
$database->setQuery( $query );
$database->query() or die( $database->getErrorMsg() );
$row->config_lang =
in_array($language->get('lang'), array('persian','fa_IR','fa','farsi')) ?
'fa_IR' :
$language->get('lang');
//$config .= "setlocale (LC_TIME, \$mosConfig_locale);\n";
$fname =
'../configuration.php';
if ($enable_write) @chmod($fname, $oldperms |
0222);
if ( $fp =
fopen($fname, 'w') ) {
@chmod($fname, $oldperms);
@chmod($fname, $oldperms & 0777555);
$msg =
T_('The Configuration Details have been updated');
// apply file and directory permissions if requested by user
if ($applyFilePerms ||
$applyDirPerms) {
foreach ($mosrootfiles as $file)
mosRedirect( 'index2.php?option=com_config&hidemainmenu=1', $msg );
if ($enable_write) @chmod($fname, $oldperms);
mosRedirect( 'index2.php', T_('An Error Has Occurred! Unable to open config file to write!') );
Documentation generated on Mon, 05 May 2008 16:13:24 +0400 by phpDocumentor 1.4.0