Subversion-Projekte lars-tiefland.openvz_admin

Revision

Revision 109 | Revision 165 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 109 Revision 162
Zeile 1... Zeile 1...
1
<?
1
<?
2
	//$Id: common.php 109 2008-05-09 22:19:52Z lars $
2
    //$Id: common.php 162 2010-03-12 23:25:46Z lars $
3
	/**
3
    /**
4
	 * 	@package	openvz_admin
4
     * 	@package	openvz_admin
5
	 * 	@author		Lars Tiefland <ltiefland@gmail.com> 
5
     * 	@author		Lars Tiefland <ltiefland@gmail.com> 
6
	 **/
6
     **/
7
	if(!file_exists("include/config.xml"))
7
    if ( ! file_exists( "include/config.xml" ) )
8
	{
8
    {
9
		header("Location: install.php");
9
        header( "Location: install.php" );
10
	}
10
    }
11
	//PEAR Packages
11
    //PEAR Packages
12
	require_once("Text/Password.php");
12
    require_once ( "Text/Password.php" );
13
	require_once("I18Nv2.php");
13
    require_once ( "I18Nv2.php" );
14
	require_once("Auth.php");
14
    require_once ( "Auth.php" );
15
	require_once("Mail.php");
15
    require_once ( "Mail.php" );
16
	require_once("Translation2.php");
16
    require_once ( "Translation2.php" );
17
	require_once("Log.php");
17
    require_once ( "Log.php" );
18
 
18
 
19
	//Smarty
19
    //Smarty
20
	require_once("libs/Smarty.class.php");
20
    require_once ( "libs/Smarty.class.php" );
21
	$smarty=new Smarty;
21
    $smarty = new Smarty;
22
	$smarty->assign("display_result",false);
22
    $smarty->assign( "display_result", false );
23
	$smarty->assign("title","openVZ-Administration");
23
    $smarty->assign( "title", "openVZ-Administration" );
24
	$smarty->assign("error",false);
24
    $smarty->assign( "error", false );
25
	$smarty->assign("save",false);
25
    $smarty->assign( "save", false );
26
	$smarty->assign("upd",false);
26
    $smarty->assign( "upd", false );
27
	$smarty->assign("meld","");
27
    $smarty->assign( "meld", "" );
28
	$smarty->assign("h1","");
28
    $smarty->assign( "h1", "" );
29
	$smarty->assign("mode","");
29
    $smarty->assign( "mode", "" );
30
	$smarty->assign("db_meld","");
30
    $smarty->assign( "db_meld", "" );
31
	$smarty->assign("u_type",0);
31
    $smarty->assign( "u_type", 0 );
32
	$smarty->assign("id",0);
32
    $smarty->assign( "id", 0 );
33
	$smarty->assign("u_name","");
33
    $smarty->assign( "u_name", "" );
34
	$smarty->assign("disabled2","");
34
    $smarty->assign( "disabled2", "" );
35
	
35
 
36
	//DB Connection
36
    //DB Connection
37
	require_once("connect.php");
37
    require_once ( "connect.php" );
38
 
38
 
39
	$params_tr["strings_default_table"]="i18n_%s";
39
    $params_tr["strings_default_table"] = "i18n_%s";
40
	$params_tr["string_text_col"]="string";
40
    $params_tr["string_text_col"] = "string";
41
	$tr=& Translation2::factory("mdb2",$db,$params_tr);
41
    $tr = &Translation2::factory( "mdb2", $db, $params_tr );
42
	
42
 
43
	$mail=	& Mail::factory("mail",array());
43
    $mail = &Mail::factory( "mail", array() );
44
 
44
 
45
	//
45
    //
46
	require_once("user.class.php");
46
    require_once ( "user.class.php" );
47
	require_once("config.php");
47
    require_once ( "config.php" );
48
	$config=new Conf();
48
    $config = new Conf();
49
	$year=$config->year;
49
    $year = $config->year;
50
	$loc=&I18Nv2::createLocale("en_US");
50
    $loc = &I18Nv2::createLocale( "en_US" );
51
	require_once("functions.php");
51
    require_once ( "functions.php" );
52
	require_once("dist.class.php");
52
    require_once ( "dist.class.php" );
53
	require_once("ip.class.php");
53
    require_once ( "ip.class.php" );
54
	require_once("hn.class.php");
54
    require_once ( "hn.class.php" );
55
	require_once("vServer.class.php");
55
    require_once ( "vServer.class.php" );
56
	//
56
    //
57
 
57
 
58
	$smarty->assign("version", $config->version);
58
    $smarty->assign( "version", $config->version );
59
	$max_anz=$config->max_anz;
59
    $max_anz = $config->max_anz;
60
	$u=new User("","");
60
    $u = new User( "", "" );
61
	$tr =& $tr->getDecorator('Lang'); 
61
    $tr = &$tr->getDecorator( 'Lang' );
62
	$tr->setOption('fallbackLang', 'en');
62
    $tr->setOption( 'fallbackLang', 'en' );
63
	$tr->setPageID("common");
63
    $tr->setPageID( "common" );
64
	$tr->setLang($u->u_lang);
64
    $tr->setLang( $u->u_lang );
65
	$common=$tr->getPage();
65
    $common = $tr->getPage();
66
	foreach ($common as $key => $value)
66
    foreach ( $common as $key => $value )
67
	{
67
    {
68
		$smarty->assign(strtoupper("L_$key"),$value);
68
        $smarty->assign( strtoupper( "L_$key" ), $value );
69
	}
69
    }
70
	if (!defined("IN_ADMIN"))
70
    if ( ! defined( "IN_ADMIN" ) )
71
	{
71
    {
72
		$show=false;
72
        $show = false;
73
	}
73
    }
74
	else
74
    else
75
	{
75
    {
76
		$show=true;
76
        $show = true;
77
	}
77
    }
78
	$a=user_login($show);
78
    $a = user_login( $show );
79
	if($a->getUserName())
79
    if ( $a->getUserName() )
80
	{
80
    {
81
		$u=$u->UserData($a->getUserName());
81
        $u = $u->UserData( $a->getUserName() );
82
	}
82
    }
83
	$u_loc=($u->u_lang=="de")?"de_DE":"en_US";
83
    $u_loc = ( $u->u_lang == "de" ) ? "de_DE" : "en_US";
84
	$tr->setPageID("common");
84
    $tr->setPageID( "common" );
85
	$tr->setLang($u->u_lang);
85
    $tr->setLang( $u->u_lang );
86
	$common=$tr->getPage();
86
    $common = $tr->getPage();
87
	foreach ($common as $key => $value)
87
    foreach ( $common as $key => $value )
88
	{
88
    {
89
		$smarty->assign(strtoupper("L_$key"),$value);
89
        $smarty->assign( strtoupper( "L_$key" ), $value );
90
	}
90
    }
91
	$loc=&I18Nv2::createLocale("$u_loc");
91
    $loc = &I18Nv2::createLocale( "$u_loc" );
92
	$date=$loc->formatDateTime(time());
92
    $date = $loc->formatDateTime( time() );
93
	$logger=create_logger();
93
    $logger = create_logger();
94
	$smarty->assign("m_ve",$config->management_ve);
94
    $smarty->assign( "m_ve", $config->management_ve );
95
?>
95
?>