"Fossies" - the Fresh Open Source Software Archive

Member "openmailadmin-1.0.1/inc/_script.php" (1 Jun 2008, 1543 Bytes) of package /linux/privat/old/openmailadmin-1.0.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "_script.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 /**
    3  * \brief   Include this as small-footsize initialization for/in your
    4  *      applications or command-line tools.
    5  *
    6  * Please feel free to ask for help on the mailing lists.
    7  */
    8 
    9 ini_set('log_errors', '0');
   10 ini_set('display_errors', '1');
   11 error_reporting(E_ALL);
   12 $_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'shell';
   13 
   14 include('./inc/config.inc.php');
   15 @(include('./inc/config.local.inc.php'))
   16     or die('You have to create an configuration file, first. Try <a href="setup.php">setup.php</a>.');
   17 include('./inc/translation.inc.php');
   18 include('adodb/adodb.inc.php');
   19 include('./inc/functions.inc.php');
   20 
   21 if(!isset($cfg['Servers']['IMAP'][$server_no]['TYPE'])) {
   22     die('You have forgotten to set TYPEs in the configuration files!');
   23 }
   24 
   25 // table names with prefixes
   26 $cfg['tablenames'] = array();
   27 foreach(array('user', 'domains', 'virtual', 'virtual_regexp', 'imap_demo') as $table) {
   28     $cfg['tablenames'][$table] = $cfg['Servers']['DB'][$server_no]['PREFIX'].$table;
   29 }
   30 
   31 // Objects' initialization
   32 $db         = ADONewConnection($cfg['Servers']['DB'][$server_no]['DSN'])
   33                 or die('Cannot connect to database server.');
   34 User::$db       = $db;
   35 User::$tablenames   = $cfg['tablenames'];
   36 
   37 // IMAP
   38 $imap = IMAP_get_instance($cfg['Servers']['IMAP'][$server_no],
   39             $cfg['Servers']['IMAP'][$server_no]['TYPE']);
   40 
   41 // include the backend
   42 $oma    = new openmailadmin($db, $cfg['tablenames'], $cfg, $imap);
   43 $oma->authenticated_user    = User::authenticate($creator_mbox, $creator_passwd);
   44 $oma->current_user      = $oma->authenticated_user;
   45 $ErrorHandler   = ErrorHandler::getInstance();
   46 
   47 ?>