Subversion-Projekte lars-tiefland.inventar

Revision

Revision 12 | Blame | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

<?php
        //$Id: common.php 29 2008-07-19 14:15:42Z lars $
        
        /**
         * @package     Inventar Datenbank
         * @author Lars Tiefland <ltiefland@gmail.com>
         * @copyright 2008
         **/
         
        if(!file_exists("include/config.xml"))
        {
                header("Location: install.php");
        }
        //PEAR Packages
        require_once("Text/Password.php");
        require_once("I18Nv2.php");
        require_once("Auth.php");
        require_once("Mail.php");
        require_once("Translation2.php");
        require_once("Log.php");

        //Smarty
        require_once("libs/Smarty.class.php");
        $smarty=new Smarty;
        $smarty->assign("display_result",false);
        $smarty->assign("title","Inventar Datenbank");
        $smarty->assign("error",false);
        $smarty->assign("save",false);
        $smarty->assign("upd",false);
        $smarty->assign("meld","");
        $smarty->assign("h1","");
        $smarty->assign("mode","");
        $smarty->assign("db_meld","");
        $smarty->assign("u_type",0);
        $smarty->assign("id",0);
        $smarty->assign("u_name","");
        $smarty->assign("disabled2","");
        
        //DB Connection
        require_once("connect.php");

        require_once("functions.php");

        $params_tr["strings_default_table"]="i18n_%s";
        $params_tr["string_text_col"]="string";
        $tr=& Translation2::factory("mdb2",$db,$params_tr);
        
        $mail=  & Mail::factory("mail",array());

        //
/*      require_once("user.class.php");
        require_once("config.php");
        $config=new Conf();
        $year=$config->year;*/
        $loc=&I18Nv2::createLocale("en_US");
        require_once("os.class.php");
        require_once("comp.class.php");
        require_once("ip.class.php");
        require_once("hardware.class.php");
        require_once("hardware_type.class.php");
        require_once("comp_hw.class.php");
        //

        $smarty->assign("version", $config->version);
        $max_anz=$config->max_anz;
//      $u=new User("","");
//      $tr =& $tr->getDecorator('Lang'); 
//      $tr->setOption('fallbackLang', 'en');
//      $tr->setPageID("common");
//      $tr->setLang($u->u_lang);
//      $common=$tr->getPage();
//      foreach ($common as $key => $value)
//      {
//              $smarty->assign(strtoupper("L_$key"),$value);
//      }
//      if (!defined("IN_ADMIN"))
//      {
//              $show=false;
//      }
//      else
//      {
//              $show=true;
//      }
//      $a=user_login($show);
//      if($a->getUserName())
//      {
//              $u=$u->UserData($a->getUserName());
//      }
//      $u_loc=($u->u_lang=="de")?"de_DE":"en_US";
//      $tr->setPageID("common");
//      $tr->setLang($u->u_lang);
//      $common=$tr->getPage();
//      foreach ($common as $key => $value)
//      {
//              $smarty->assign(strtoupper("L_$key"),$value);
//      }
//      $loc=&I18Nv2::createLocale("$u_loc");
        $date=$loc->formatDateTime(time());
        $logger=create_logger();
//
?>