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