Source for file admin.config.php

Documentation is available at admin.config.php

  1. <?php
  2. /**
  3. @package Mambo
  4. @subpackage Config
  5. @copyright  Refer to copyright.php
  6. @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
  7. @author Mambo Foundation Inc see README.php
  8. */
  9.  
  10. /** ensure this file is being included by a parent file */
  11. defined'_VALID_MOS' or die'Direct Access to this location is not allowed.' );
  12.  
  13. if (!$acl->acl_check'administration''config''users'$my->usertype )) {
  14.     mosRedirect'index2.php'T_('You are not authorized to view this resource.') );
  15. }
  16.  
  17. class mosConfig extends mosDBTable {
  18.     /** @var int */
  19.     var $config_offline=null;
  20.     /** @var string */
  21.     var $config_host=null;
  22.     /** @var string */
  23.     var $config_user=null;
  24.     /** @var string */
  25.     var $config_password=null;
  26.     /** @var string */
  27.     var $config_db=null;
  28.     /** @var string */
  29.     var $config_dbprefix=null;
  30.     /** @var string */
  31.     var $config_path=null;
  32.     /** @var string */
  33.     var $config_live_site=null;
  34.     /** @var string */
  35.     var $config_sitename=null;
  36.     /** @var int */
  37.     var $config_auth=null;
  38.     /** @var int */
  39.     var $config_lifetime=null;
  40.     /** @var string */
  41.     var $config_offline_message=null;
  42.     /** @var string */
  43.     var $config_error_message=null;
  44.     /** @var int */
  45.     var $config_useractivation=null;
  46.     /** @var string */
  47.     var $config_use_captcha=0;
  48.     /** @var int */
  49.     var $config_uniquemail=null;
  50.     /** @var string */
  51.     var $config_metadesc=null;
  52.     /** @var string */
  53.     var $config_metakeys=null;
  54.     /** @var int */
  55.     var $config_metaauthor=null;
  56.     /** @var int */
  57.     var $config_metatitle=null;
  58.     /** @var int */
  59.     var $config_debug=0;
  60.     /** @var string */
  61.     var $config_lang=null;
  62.     /** @var string */
  63.     var $config_locale_debug=0;
  64.     /** @var string */
  65.     /** @var string */
  66.     var $config_locale=null;
  67.     /** @var int */
  68.     var $config_offset=null;
  69.     /** @var int */
  70.     var $config_hideauthor=null;
  71.     /** @var int */
  72.     var $config_hidecreate=null;
  73.     /** @var int */
  74.     var $config_hidemodify=null;
  75.     /** @var int */
  76.     var $config_hidepdf=null;
  77.     /** @var int */
  78.     var $config_hideprint=null;
  79.     /** @var int */
  80.     var $config_hideemail=null;
  81.     /** @var int */
  82.     var $config_enable_log_items=null;
  83.     /** @var int */
  84.     var $config_enable_log_searches=null;
  85.     /** @var int */
  86.     var $config_enable_stats=null;
  87.     /** @var int */
  88.     var $config_sef=0;
  89.     /** @var int */
  90.     var $config_vote=0;
  91.     /** @var int */
  92.     var $config_gzip=0;
  93.     /** @var int */
  94.     var $config_multipage_toc=0;
  95.     /** @var int */
  96.     /** @var int */
  97.     var $config_error_reporting=0;
  98.     /** @var int */
  99.     var $config_register_globals=0;
  100.     /** @var int */
  101.     var $config_link_titles=0;
  102.     /** @var int */
  103.     var $config_list_limit=0;
  104.     /** @var int */
  105.     var $config_caching=0;
  106.     /** @var string */
  107.     var $config_cachepath=null;
  108.     /** @var string */
  109.     var $config_cachetime=null;
  110.     /** @var string */
  111.     var $config_mailer=null;
  112.     /** @var string */
  113.     var $config_mailfrom=null;
  114.     /** @var string */
  115.     var $config_fromname=null;
  116.     /** @var string */
  117.     var $config_sendmail='/usr/sbin/sendmail';
  118.     /** @var string */
  119.     var $config_smtpauth=0;
  120.     /** @var string */
  121.     var $config_smtpuser=null;
  122.     /** @var string */
  123.     var $config_smtppass=null;
  124.     /** @var string */
  125.     var $config_smtphost=null;
  126.     /** @var string */
  127.     var $_alias=null;
  128.     /** @var int */
  129.     var $config_back_button=0;
  130.     /** @var int */
  131.     var $config_item_navigation=0;
  132.     /** @var int */
  133.     var $config_ml_support=0;
  134.     /** @var string */
  135.     var $config_secret=null;
  136.     /** @var int */
  137.     var $config_pagetitles=1;
  138.     /** @var int */
  139.     var $config_readmore=1;
  140.     /** @var int */
  141.     var $config_hits=1;
  142.     /** @var int */
  143.     var $config_icons=1;
  144.     /** @var string */
  145.     var $config_favicon=null;
  146.     /** @var string */
  147.     var $config_fileperms='0644';
  148.     /** @var string */
  149.     var $config_dirperms='0755';
  150.     /** @var string */
  151.     var $config_helpurl='';
  152.  
  153.     function mosConfig({
  154.         $this->_alias = array(
  155.         'config_offline'                =>'mosConfig_offline',
  156.         'config_host'                    =>'mosConfig_host',
  157.         'config_user'                    =>'mosConfig_user',
  158.         'config_password'                =>'mosConfig_password',
  159.         'config_db'                        =>'mosConfig_db',
  160.         'config_dbprefix'                =>'mosConfig_dbprefix',
  161.         'config_path'                    =>'mosConfig_absolute_path',
  162.         'config_live_site'                =>'mosConfig_live_site',
  163.         'config_sitename'                =>'mosConfig_sitename',
  164.         'config_auth'                    =>'mosConfig_shownoauth',
  165.         'config_useractivation'            =>'mosConfig_useractivation',
  166.         'config_uniquemail'                =>'mosConfig_uniquemail',
  167.         'config_use_captcha'            =>'mosConfig_usecaptcha',
  168.         'config_offline_message'        =>'mosConfig_offline_message',
  169.         'config_error_message'            =>'mosConfig_error_message',
  170.         'config_debug'                     =>'mosConfig_debug',
  171.         'config_lifetime'                =>'mosConfig_lifetime',
  172.         'config_metadesc'                =>'mosConfig_MetaDesc',
  173.         'config_metakeys'                =>'mosConfig_MetaKeys',
  174.         'config_metaauthor'                =>'mosConfig_MetaAuthor',
  175.         'config_metatitle'                =>'mosConfig_MetaTitle',
  176.         'config_lang'                    =>'mosConfig_lang',
  177.         'config_locale'                    =>'mosConfig_locale',
  178.         'config_locale_debug'            =>'mosConfig_locale_debug',
  179.         'config_locale_use_gettext'        =>'mosConfig_locale_use_gettext',
  180.         'config_offset'                    =>'mosConfig_offset',
  181.         'config_hideauthor'                =>'mosConfig_hideAuthor',
  182.         'config_hidecreate'                =>'mosConfig_hideCreateDate',
  183.         'config_hidemodify'                =>'mosConfig_hideModifyDate',
  184.         'config_hidepdf'                =>'mosConfig_hidePdf',
  185.         'config_hideprint'                =>'mosConfig_hidePrint',
  186.         'config_hideemail'                =>'mosConfig_hideEmail',
  187.         'config_enable_log_items'        =>'mosConfig_enable_log_items',
  188.         'config_enable_log_searches'    =>'mosConfig_enable_log_searches',
  189.         'config_enable_stats'             =>'mosConfig_enable_stats',
  190.         'config_sef'                    =>'mosConfig_sef',
  191.         'config_vote'                    =>'mosConfig_vote',
  192.         'config_gzip'                    =>'mosConfig_gzip',
  193.         'config_multipage_toc'            =>'mosConfig_multipage_toc',
  194.         'config_allowUserRegistration'    =>'mosConfig_allowUserRegistration',
  195.         'config_link_titles'            =>'mosConfig_link_titles',
  196.         'config_error_reporting'        =>'mosConfig_error_reporting',
  197.         'config_register_globals'        =>'mosConfig_register_globals',
  198.         'config_list_limit'                =>'mosConfig_list_limit',
  199.         'config_caching'                =>'mosConfig_caching',
  200.         'config_cachepath'                =>'mosConfig_cachepath',
  201.         'config_cachetime'                =>'mosConfig_cachetime',
  202.         'config_mailer'                 =>'mosConfig_mailer',
  203.         'config_mailfrom'                 =>'mosConfig_mailfrom',
  204.         'config_fromname'                 =>'mosConfig_fromname',
  205.         'config_sendmail'                 =>'mosConfig_sendmail',
  206.         'config_smtpauth'                 =>'mosConfig_smtpauth',
  207.         'config_smtpuser'                 =>'mosConfig_smtpuser',
  208.         'config_smtppass'                 =>'mosConfig_smtppass',
  209.         'config_smtphost'                 =>'mosConfig_smtphost',
  210.         'config_back_button'             =>'mosConfig_back_button',
  211.         'config_item_navigation'         =>'mosConfig_item_navigation',
  212.         'config_secret'                 =>'mosConfig_secret',
  213.         'config_pagetitles'             =>'mosConfig_pagetitles',
  214.         'config_readmore'                 =>'mosConfig_readmore',
  215.         'config_hits'                     =>'mosConfig_hits',
  216.         'config_icons'                     =>'mosConfig_icons',
  217.         'config_favicon'                 =>'mosConfig_favicon',
  218.         'config_fileperms'                 =>'mosConfig_fileperms',
  219.         'config_dirperms'                 =>'mosConfig_dirperms',
  220.         'config_ml_support'                =>'mosConfig_mbf_content',
  221.         'config_helpurl'                 =>'mosConfig_helpurl'
  222.         );
  223.     }
  224.  
  225.     function getVarText({
  226.         $txt '';
  227.         foreach ($this->_alias as $k=>$v{
  228.             $txt .= "\$$v = '".addslashes$this->$k )."';\n";
  229.         }
  230.         return $txt;
  231.     }
  232.  
  233.     function bindGlobals({
  234.         foreach ($this->_alias as $k=>$v{
  235.             if(isset($GLOBALS[$v]))
  236.                 $this->$k $GLOBALS[$v];
  237.         }
  238.     }
  239. }
  240.  
  241. require_oncestr_replace('\\','/',dirname(__FILE__)) '/admin.config.html.php' );
  242. $confightml new HTML_config();
  243.  
  244.  
  245. switch $task {
  246.     case 'apply':
  247.     case 'save':
  248.         saveconfig$task );
  249.         break;
  250.  
  251.     case 'cancel':
  252.         mosRedirect'index2.php' );
  253.         break;
  254.  
  255.     default:
  256.         showconfig($confightml$database$option);
  257.         break;
  258. }
  259.  
  260.  
  261. function showconfig($confightml&$database$option{
  262.     global $database$mosConfig_absolute_path$mosConfig_locale;
  263.     $row new mosConfig();
  264.     $row->bindGlobals();
  265.  
  266.     // compile list of the languages
  267.     $langs array();
  268.     // menuitems appears never to be used - so commented out by Martin Brampton 15 Dec 2005
  269. //    $menuitems = array();
  270.     $language =new mamboLanguage($mosConfig_locale);
  271.     $files $language->getLanguages();
  272.     foreach ($files as $file){
  273.         $langs[mosHTML::makeOption$file->name );
  274.     }
  275.     // sort list of languages
  276.     sort($langs);
  277.     reset($langs);
  278.  
  279.     // compile list of the editors
  280.     $query "SELECT id AS value, name AS text"
  281.     . "\n FROM #__mambots"
  282.     . "\n WHERE folder='editors' AND published >= 0"
  283.     . "\n ORDER BY ordering, name"
  284.     ;
  285.     $database->setQuery$query );
  286.     $edits $database->loadObjectList();
  287.  
  288.     $query "SELECT id"
  289.     . "\n FROM #__mambots"
  290.     . "\n WHERE folder='editors' AND published = 1"
  291.     . "\n LIMIT 1"
  292.     ;
  293.     $database->setQuery$query );
  294.     $editor $database->loadResult();
  295.  
  296.     $lists array();
  297.     // build the html select list
  298.     $lists['editor'mosHTML::selectList$edits'editor''class="inputbox" size="1"''value''text'$editor );
  299.  
  300.     // build the html select list
  301.     $lists['lang'mosHTML::selectList$langs'config_locale''class="inputbox" size="1"''value''text'$row->config_locale );
  302.     // make a generic -24 - 24 list
  303.     for ($i=-12;$i<=12;$i++{
  304.         $timeoffset[mosHTML::makeOption$i$i );
  305.     }
  306.  
  307.     // menuitems appears not to be used anywhere - so commented out Martin Brampton 15 Dec 2005
  308.     // get list of menuitems
  309. //    $query = "SELECT id AS value, name AS text FROM #__menu"
  310. //    . "\n WHERE (type='content_section' OR type='components' OR type='content_typed')"
  311. //    . "\n AND published=1"
  312. //    . "\n AND access=0"
  313. //    . "\n ORDER BY name"
  314. //    ;
  315. //    $database->setQuery( $query );
  316. //    $menuitems = array_merge( $menuitems, $database->loadObjectList() );
  317.  
  318.     $show_hide array(
  319.         mosHTML::makeOption1T_('Hide') ),
  320.         mosHTML::makeOption0T_('Show') ),
  321.     );
  322.  
  323.     $show_hide_r array(
  324.         mosHTML::makeOption0T_('Hide') ),
  325.         mosHTML::makeOption1T_('Show') ),
  326.     );
  327.  
  328.     $list_length array(
  329.         mosHTML::makeOption5),
  330.         mosHTML::makeOption1010 ),
  331.         mosHTML::makeOption1515 ),
  332.         mosHTML::makeOption2020 ),
  333.         mosHTML::makeOption2525 ),
  334.         mosHTML::makeOption3030 ),
  335.         mosHTML::makeOption5050 ),
  336.     );
  337.  
  338.     $errors array(
  339.         mosHTML::makeOption-1T_('System Default') ),
  340.         mosHTML::makeOption0T_('None') ),
  341.         mosHTML::makeOptionE_ERROR|E_WARNING|E_PARSET_('Simple') ),
  342.         mosHTML::makeOptionE_ALL T_('Maximum') )
  343.     );
  344.  
  345.     $register_globals array(
  346.         mosHTML::makeOption1T_('On') ),
  347.         mosHTML::makeOption0T_('Off') ),
  348.     );
  349.     $locale_debug array(
  350.         mosHTML::makeOption1T_('On') ),
  351.         mosHTML::makeOption0T_('Off') ),
  352.     );
  353.     $locale_use_gettext array(
  354.         mosHTML::makeOption1T_('Yes') ),
  355.         mosHTML::makeOption0T_('No') ),
  356.     );
  357.  
  358.     $mailer array(
  359.         mosHTML::makeOption'mail'T_('PHP mail function')true ),
  360.         mosHTML::makeOption'sendmail'T_('Sendmail')true ),
  361.         mosHTML::makeOption'smtp'T_('SMTP Server')true )
  362.     );
  363.  
  364.     // build the html select lists
  365.     $lists['offline']                 mosHTML::yesnoRadioList'config_offline''class="inputbox"'$row->config_offline );
  366.  
  367.     $lists['auth']                     mosHTML::yesnoRadioList'config_auth''class="inputbox"'$row->config_auth );
  368.  
  369.     $lists['metaauthor']            mosHTML::yesnoRadioList'config_metaauthor''class="inputbox"'$row->config_metaauthor );
  370.  
  371.     $lists['metatitle']             mosHTML::yesnoRadioList'config_metatitle''class="inputbox"'$row->config_metatitle );
  372.  
  373.     $lists['useractivation']         mosHTML::yesnoRadioList'config_useractivation''class="inputbox"',    $row->config_useractivation );
  374.  
  375.     $lists['uniquemail']             mosHTML::yesnoRadioList'config_uniquemail''class="inputbox"',    $row->config_uniquemail );
  376.  
  377.     $lists['usecaptcha']             mosHTML::yesnoRadioList'config_use_captcha''class="inputbox"',    $row->config_use_captcha );
  378.  
  379.     $lists['allowuserregistration'mosHTML::yesnoRadioList'config_allowUserRegistration''class="inputbox"',    $row->config_allowUserRegistration );
  380.  
  381.     $lists['debug']                 mosHTML::yesnoRadioList'config_debug''class="inputbox"'$row->config_debug );
  382.  
  383.     $lists['offset']                 mosHTML::selectList$timeoffset'config_offset''class="inputbox" size="1"',    'value''text'$row->config_offset );
  384.  
  385.     $lists['hideauthor']             mosHTML::RadioList$show_hide'config_hideauthor''class="inputbox"'$row->config_hideauthor'value''text' );
  386.  
  387.     $lists['hidecreate']             mosHTML::RadioList$show_hide'config_hidecreate''class="inputbox"'$row->config_hidecreate'value''text' );
  388.  
  389.     $lists['hidemodify']             mosHTML::RadioList$show_hide'config_hidemodify''class="inputbox"'$row->config_hidemodify'value''text' );
  390.  
  391.     if (is_writable"$mosConfig_absolute_path/media/)) {
  392.         $lists['hidepdf']             mosHTML::RadioList$show_hide'config_hidepdf''class="inputbox"'$row->config_hidepdf'value''text' );
  393.     else {
  394.         $lists['hidepdf']             '<input type="hidden" name="config_hidepdf" value="1" /><strong>'.T_('Yes').'</strong>';
  395.     }
  396.  
  397.     $lists['hideprint']             mosHTML::RadioList$show_hide'config_hideprint''class="inputbox"'$row->config_hideprint'value''text' );
  398.  
  399.     $lists['hideemail']             mosHTML::RadioList$show_hide'config_hideemail''class="inputbox"'$row->config_hideemail'value''text' );
  400.  
  401.     $lists['log_items']                 mosHTML::yesnoRadioList'config_enable_log_items''class="inputbox"'$row->config_enable_log_items );
  402.  
  403.     $lists['log_searches']             mosHTML::yesnoRadioList'config_enable_log_searches''class="inputbox"'$row->config_enable_log_searches );
  404.  
  405.     $lists['enable_stats']             mosHTML::yesnoRadioList'config_enable_stats''class="inputbox"'$row->config_enable_stats );
  406.  
  407.     $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 );
  408.  
  409.     $lists['vote']                     mosHTML::RadioList$show_hide_r'config_vote''class="inputbox"'$row->config_vote'value''text' );
  410.  
  411.     $lists['gzip']                     mosHTML::yesnoRadioList'config_gzip''class="inputbox"'$row->config_gzip );
  412.  
  413.     $lists['multipage_toc']         mosHTML::RadioList$show_hide_r'config_multipage_toc''class="inputbox"'$row->config_multipage_toc'value''text' );
  414.  
  415.     $lists['pagetitles']             mosHTML::yesnoRadioList'config_pagetitles''class="inputbox"'$row->config_pagetitles );
  416.  
  417.     $lists['error_reporting']         mosHTML::selectList$errors'config_error_reporting''class="inputbox" size="1"''value''text'$row->config_error_reporting );
  418.  
  419.     $lists['register_globals']         mosHTML::RadioList$register_globals'config_register_globals''class="inputbox" size="1"'$row->config_register_globals'value''text' );
  420.  
  421.     $lists['locale_debug']             mosHTML::RadioList$locale_debug'config_locale_debug''class="inputbox" size="1"'$row->config_locale_debug'value''text' );
  422.  
  423.     $disabled (extension_loaded('gettext')) '' 'disabled="disabled" ';
  424.     $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' );
  425.  
  426.     $lists['link_titles']             mosHTML::yesnoRadioList'config_link_titles''class="inputbox"'$row->config_link_titles );
  427.  
  428.     $lists['caching']                 mosHTML::yesnoRadioList'config_caching''class="inputbox"'$row->config_caching );
  429.  
  430.     $lists['mailer']                 mosHTML::selectList$mailer'config_mailer''class="inputbox" size="1"''value''text'$row->config_mailer );
  431.  
  432.     $lists['smtpauth']                 mosHTML::yesnoRadioList'config_smtpauth''class="inputbox"'$row->config_smtpauth );
  433.  
  434.     $lists['list_length']             mosHTML::selectList$list_length'config_list_limit''class="inputbox" size="1"''value''text'$row->config_list_limit $row->config_list_limit 50 ) );
  435.  
  436.     $lists['back_button']             mosHTML::RadioList$show_hide_r'config_back_button''class="inputbox"'$row->config_back_button'value''text' );
  437.  
  438.     $lists['item_navigation']         mosHTML::RadioList$show_hide_r'config_item_navigation''class="inputbox"'$row->config_item_navigation'value''text' );
  439.  
  440.     $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 );
  441.  
  442.     $lists['readmore']                 mosHTML::RadioList$show_hide_r'config_readmore''class="inputbox"'$row->config_readmore'value''text' );
  443.  
  444.     $lists['hits']                     mosHTML::RadioList$show_hide_r'config_hits''class="inputbox"'$row->config_hits'value''text' );
  445.  
  446.     $lists['icons']                 mosHTML::RadioList$show_hide_r'config_icons''class="inputbox"'$row->config_icons'value''text' );
  447.  
  448. //    $lists['favicon']                 = mosHTML::RadioList( $show_hide_r, 'config_icons', 'class="inputbox"', $row->config_icons, 'value', 'text' );
  449.  
  450.     $confightml->showconfig$row$lists$option );
  451. }
  452.  
  453. function saveconfig$task {
  454.     global $database$mosConfig_absolute_path;
  455.  
  456.     $row new mosConfig();
  457.     if (!$row->bind$_POST )) {
  458.         mosRedirect"index2.php"$row->getError() );
  459.     }
  460.  
  461.     $editor intvalmosGetParam$_POST'editor') );
  462.     if ($editor 0{
  463.         $query "UPDATE #__mambots"
  464.         . "\n SET published = 0"
  465.         . "\n WHERE published >= 0 AND folder='editors'"
  466.         ;
  467.         $database->setQuery$query );
  468.         $database->query(or die$database->getErrorMsg() );
  469.  
  470.         $query "UPDATE #__mambots"
  471.         . "\n SET published = 1"
  472.         . "\n WHERE id = $editor"
  473.         ;
  474.         $database->setQuery$query );
  475.         $database->query(or die$database->getErrorMsg() );
  476.     }
  477.     
  478.     $language =new mamboLanguage($row->config_locale);
  479.     $row->config_lang in_array($language->get('lang')array('persian','fa_IR','fa','farsi')) 'fa_IR' $language->get('lang');
  480.     
  481.     $config "<?php \n";
  482.     $config .= $row->getVarText();
  483.     //$config .= "setlocale (LC_TIME, \$mosConfig_locale);\n";
  484.     $config .= '?>';
  485.  
  486.     $fname '../configuration.php';
  487.     $enable_write mosGetParam($_POST,'enable_write',0);
  488.     $oldperms fileperms($fname);
  489.     if ($enable_write@chmod($fname$oldperms 0222);
  490.     if $fp fopen($fname'w') ) {
  491.         fputs($fp$configstrlen($config));
  492.         fclose($fp);
  493.         if ($enable_write{
  494.             @chmod($fname$oldperms);
  495.         else {
  496.             if (mosGetParam($_POST,'disable_write',0))
  497.                 @chmod($fname$oldperms 0777555);
  498.         // if
  499.  
  500.         $msg T_('The Configuration Details have been updated');
  501.  
  502.         // apply file and directory permissions if requested by user
  503.         $applyFilePerms mosGetParam($_POST,'applyFilePerms',0&& $row->config_fileperms!='';
  504.         $applyDirPerms mosGetParam($_POST,'applyDirPerms',0&& $row->config_dirperms!='';
  505.         if ($applyFilePerms || $applyDirPerms{
  506.             $mosrootfiles array(
  507.                 'administrator',
  508.                 'cache',
  509.                 'components',
  510.                 'editor',
  511.                 'help',
  512.                 'images',
  513.                 'includes',
  514.                 'parameters',
  515.                 'installation',
  516.                 'language',
  517.                 'mambots',
  518.                 'media',
  519.                 'modules',
  520.                 'templates',
  521.                 'CHANGELOG',
  522.                 'configuration.php',
  523.                 'htaccess.txt',
  524.                 'index.php',
  525.                 'index2.php',
  526.                 'index3.php',
  527.                 'INSTALL',
  528.                 'LICENSE',
  529.                 'mainbody.php',
  530.                 'offline.php',
  531.                 'page404.php',
  532.                 'pathway.php',
  533.                 'README',
  534.                 'robots.txt'
  535.             );
  536.             $filemode NULL;
  537.             if ($applyFilePerms$filemode octdec($row->config_fileperms);
  538.             $dirmode NULL;
  539.             if ($applyDirPerms$dirmode octdec($row->config_dirperms);
  540.             foreach ($mosrootfiles as $file)
  541.                 mosChmodRecursive($mosConfig_absolute_path.'/'.$file$filemode$dirmode);
  542.         // if
  543.  
  544.         switch $task {
  545.             case 'apply':
  546.                 mosRedirect'index2.php?option=com_config&hidemainmenu=1'$msg );
  547.                 break;
  548.  
  549.             case 'save':
  550.             default:
  551.                 mosRedirect'index2.php'$msg );
  552.                 break;
  553.         }
  554.     else {
  555.         if ($enable_write@chmod($fname$oldperms);
  556.         mosRedirect'index2.php'T_('An Error Has Occurred! Unable to open config file to write!') );
  557.     }
  558. }
  559. ?>

Documentation generated on Mon, 05 May 2008 16:13:24 +0400 by phpDocumentor 1.4.0