phpUserTrack
[ class tree: phpUserTrack ] [ index: phpUserTrack ] [ all elements ]

Source for file settings.php

Documentation is available at settings.php

  1. <?php
  2.  
  3. if (isset($_POST['submit'])) {
  4.     $settings_array = array('mysqlHost', 'mysqlDbName', 'mysqlUsername', 'mysqlPassword' ,'mysqlPort', 'allowanonymous', 
  5.         'dbDriver', 'installpath', 'siteTable', 'dataTable', 'ipTable', 'timezone');
  6.     $content = "<?php \n";
  7.     foreach($settings_array as $setting) {
  8.         $content .= '$conf[\'' . $setting . '\'] = \'' . $_POST[$setting] . "';\n";
  9.     }
  10.     $content .= '$conf[\'' . 'activePlugins' . '\'] = ' . 'array(\'ipFilter\')' . ";\n";
  11.     $content .= "?> \n";
  12.     $handle = fopen(dirname(__FILE__) . '/conf/conf.php', "w");
  13.     fwrite($handle, $content);
  14. }
  15.  
  16. require_once './include/version.php';
  17. require_once './lib/core.php';
  18. require_once './conf/conf.php';
  19.     
  20. require_once 'smarty/libs/Smarty.class.php';    
  21.  
  22. $smarty = new Smarty();
  23.  
  24. $smarty->plugins_dir[] = 'include';
  25. require_once $smarty->_get_plugin_filepath('function', 'html_doctype');
  26.  
  27. try {
  28.     $login = new login(true);
  29.     $smarty->assign('login', $login);
  30. } catch (LoginException $e) {
  31.     header( 'Location: login.php' ) ;
  32. } 
  33.  
  34. $smarty->assign('notifMsg', $notify);
  35.  
  36. $smarty->assign('conf', $conf);
  37.  
  38. $smarty->display('header.tpl');
  39. $smarty->display('settings.tpl');
  40. $smarty->display('footer.tpl');
  41.  
  42. ?>

Documentation generated on Tue, 06 Nov 2007 09:22:11 -0800 by phpDocumentor 1.4.0a2