PostfixAdmin - web based virtual user administration interface for Postfix mail servers https://postfixadmin.github.io/postfixadmin/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

65 lines
1.8 KiB

  1. <?php
  2. /**
  3. * Postfix Admin
  4. *
  5. * LICENSE
  6. * This source file is subject to the GPL license that is bundled with
  7. * this package in the file LICENSE.TXT.
  8. *
  9. * Further details on the project are available at :
  10. * http://www.postfixadmin.com or http://postfixadmin.sf.net
  11. *
  12. * @version $Id$
  13. * @license GNU GPL v2 or later.
  14. *
  15. * File: common.php
  16. * All pages should include this file - which itself sets up the necessary
  17. * environment and ensures other functions are loaded.
  18. */
  19. if(!defined('POSTFIXADMIN')) { # already defined if called from setup.php
  20. session_start();
  21. define('POSTFIXADMIN', 1); # checked in included files
  22. }
  23. $incpath = dirname(__FILE__);
  24. (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_runtime', '0') : '1');
  25. (ini_get('magic_quotes_gpc') ? ini_set('magic_quotes_sybase', '0') : '1');
  26. if(ini_get('register_globals') == 'on') {
  27. die("Please turn off register_globals; edit your php.ini");
  28. }
  29. require_once("$incpath/variables.inc.php");
  30. if(!is_file("$incpath/config.inc.php")) {
  31. die("config.inc.php is missing!");
  32. }
  33. require_once("$incpath/config.inc.php");
  34. if(isset($CONF['configured'])) {
  35. if($CONF['configured'] == FALSE) {
  36. die("Please edit config.inc.php - change \$CONF['configured'] to true after setting your database settings");
  37. }
  38. }
  39. require_once("$incpath/languages/language.php");
  40. require_once("$incpath/functions.inc.php");
  41. require_once("$incpath/languages/" . check_language () . ".lang");
  42. /**
  43. * @param string $class
  44. * __autoload implementation, for use with spl_autoload_register().
  45. */
  46. function postfixadmin_autoload($class) {
  47. $PATH = dirname(__FILE__) . '/model/' . $class . '.php';
  48. if(is_file($PATH)) {
  49. require_once($PATH);
  50. return true;
  51. }
  52. return false;
  53. }
  54. spl_autoload_register('postfixadmin_autoload');
  55. /* vim: set expandtab softtabstop=4 tabstop=4 shiftwidth=4: */