Changeset 325

Show
Ignore:
Timestamp:
02/11/07 14:12:13 (2 years ago)
Author:
rats
Message:

- GUI:
* changed Errordocs (untested)
* fixed bug #71

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/CHANGELOG

    r322 r325  
    1414 
    15152007-02-10 Benedikt Heintel 
    16         - LANGUAGES: 
    17                 changed and deleted unused / wrong strings 
     16        - GUI: 
     17                * changed Errordocs (untested) 
     18                * fixed bug #71 
     19 
     202007-02-10 Benedikt Heintel 
     21        - LANGUAGES: 
     22                * changed and deleted unused / wrong strings 
    1823 
    19242007-02-09 Laurent DECLERCQ 
    2025        - CONFIGS: 
    21                 Edit "php.ini" files for master user: 
     26                * Edit "php.ini" files for master user: 
    2227                        - open_basedir: added "bind/df" and "/bind/mount" path for GUI System Info 
    2328                        - open_basedir: added "/var/log/rkhunter.log" path for Gui Rootkit 
     
    26312007-02-08 Benedikt Heintel 
    2732        - LANGUAGES: 
    28                 Spanish: added missing language strings 
    29         - GUI: 
    30                 changed behavior of string translation and added optional javascript variable 
     33                * Spanish: added missing language strings 
     34        - GUI: 
     35                * changed behavior of string translation and added optional javascript variable 
    3136        - SETUP: 
    32                 modified Makefiles 
     37                * modified Makefiles 
    3338 
    34392007-02-08 Laurent DECLERCQ 
    3540        - ENGINE: 
    36                 Fixed bug #48 : 
     41                * Fixed bug #48 : 
    3742                        => Edit "vhcs2-dmn-mngr 
    3843                                - Instructions disabled for Master user 
    3944 
    4045        - SETUP: 
    41                 Fixed bug #48 : 
     46                * Fixed bug #48 : 
    4247                        => Edit vhcs-setup 
    4348                                - added new Subroutine --> create "php4" and "php5" directory for Master User 
     
    45502007-02-07 Laurent DECLERCQ 
    4651        - CONFIGS: 
    47                 Fixed bug #48 : 
     52                * Fixed bug #48 : 
    4853                        => Edit "fastcgi.conf" (NO FINISH) 
    4954                                - Rename fastcgi.conf in fastcgi.conf.bak 
     
    6671 
    6772        - SETUP: 
    68                 Fixed bug #48 : 
     73                * Fixed bug #48 : 
    6974                        => Edit makefile : 
    7075                                - Added "phptmp" directory 
     
    7883                                - Added chmod "0755" for the GUI "phptmp" directory 
    7984        - GUI: 
    80                 Fixed bug #48 : 
     85                * Fixed bug #48 : 
    8186                        => Create new directory for the tmp_dir and the upload_dir --> "phptmp" for the master user 
    8287 
     
    88932007-02-06 Benedikt Heintel 
    8994        - ENGINE: 
    90                 changed MySQL Backup 
    91         - LANGUAGES: 
    92                 added Ukrainian 
    93                 added missings strings to Dutch and French 
     95                * changed MySQL Backup 
     96        - LANGUAGES: 
     97                * added Ukrainian 
     98                * added missings strings to Dutch and French 
    9499        - SETUP: 
    95                 added setup reset script 
     100                * added setup reset script 
    96101 
    971022007-02-05 Benedikt Heintel 
    98103        - GUI: 
    99                 multilingual support changed (tables have less columns, languages are stored UTF-8) 
    100                 lostpassword improvements 
    101         - LANGUAGES: 
    102                 added message string 
    103                 all languages in UTF-8 
     104                * multilingual support changed (tables have less columns, languages are stored UTF-8) 
     105                * lostpassword improvements 
     106        - LANGUAGES: 
     107                * added message string 
     108                * all languages in UTF-8 
    104109                => Chinese, Thai and Russian have to be re-translated! 
    105110        - SETUP: 
     
    1091142007-02-05 Benedikt Heintel 
    110115        - GUI: 
    111                 multilingual support changed (tables have less columns, languages are stored UTF-8) 
    112                 lostpassword improvements 
    113         - LANGUAGES: 
    114                 added message string 
    115                 all languages in UTF-8 
     116                * multilingual support changed (tables have less columns, languages are stored UTF-8) 
     117                * lostpassword improvements 
     118        - LANGUAGES: 
     119                * added message string 
     120                * all languages in UTF-8 
    116121                => Chinese, Thai and Russian have to be re-translated! 
    117122        - SETUP: 
    118                 added "a2enmod rewrite" for nativ mod_rewrite support 
     123                * added "a2enmod rewrite" for nativ mod_rewrite support 
    119124 
    1201252007-02-05 Laurent DECLERCQ 
    121126        - CONFIGS: 
    122                 Changed <IfModule mod_php.c> 
     127                * Changed <IfModule mod_php.c> 
    123128                        Report wget-hack prevention 
    124129        - DOCS: 
    125                 Fixed name "fedora" 
     130                * Fixed name "fedora" 
    126131 
    1271322007-02-04 Benedikt Heintel 
  • trunk/gui/errordocs/index.php

    r324 r325  
    22 <head> 
    33  <title>VHCS ERROR</title> 
    4   <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> 
    5   <link href="/vhcs2/themes/omega_original/css/vhcs.css" rel="stylesheet" type="text/css"> 
    6   <script type="text/javascript" src="/vhcs2/themes/omega_original/css/vhcs.js"></script> 
     4  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 
     5<?php 
     6        require_once('/vhcs2/include/vhcs-lib.php'); 
     7        $theme = $cfg['USER_INITIAL_THEME']; 
     8?> 
     9  <link href="/vhcs2/themes/<?=$theme;?>/css/vhcs.css" rel="stylesheet" type="text/css"> 
     10  <script type="text/javascript" src="/vhcs2/themes/<?=$theme;?>/css/vhcs.js"></script> 
    711 </head> 
    812 <body style="color:#000000;"> 
  • trunk/gui/include/admin-functions.php

    r321 r325  
    11<?php 
    2 //   ------------------------------------------------------------------------------- 
    3 //  |             VHCS(tm) - Virtual Hosting Control System                         | 
    4 //  |              Copyright (c) 2001-2006 by moleSoftware                                      | 
    5 //  |                   http://vhcs.net | http://www.molesoftware.com                                   | 
    6 //  |                                                                               | 
    7 //  | This program is free software; you can redistribute it and/or                 | 
    8 //  | modify it under the terms of the MPL General Public License                   | 
    9 //  | as published by the Free Software Foundation; either version 1.1              | 
    10 //  | of the License, or (at your option) any later version.                        | 
    11 //  |                                                                               | 
    12 //  | You should have received a copy of the MPL Mozilla Public License             | 
    13 //  | along with this program; if not, write to the Open Source Initiative (OSI)    | 
    14 //  | http://opensource.org | osi@opensource.org                                                                    | 
    15 //  |                                                                               | 
    16 //   ------------------------------------------------------------------------------- 
    17  
     2/** 
     3 *  VHCS ω (OMEGA) - Virtual Hosting Control System | Omega Version 
     4 * 
     5 *  @copyright  2001-2006 by moleSoftware GmbH 
     6 *  @copyright  2006-2007 by ispCP | http://isp-control.net 
     7 *  @link               http://isp-control.net 
     8 *  @author             VHCS Team, Benedikt Heintel (2007) 
     9 * 
     10 *  @license 
     11 *  This program is free software; you can redistribute it and/or modify it under 
     12 *  the terms of the MPL General Public License as published by the Free Software 
     13 *  Foundation; either version 1.1 of the License, or (at your option) any later 
     14 *  version. 
     15 *  You should have received a copy of the MPL Mozilla Public License along with 
     16 *  this program; if not, write to the Open Source Initiative (OSI) 
     17 *  http://opensource.org | osi@opensource.org 
     18 * 
     19 **/ 
    1820 
    1921function gen_admin_mainmenu(&$tpl, $menu_file) { 
     
    2325                $tpl -> define_dynamic('custom_buttons', 'menu'); 
    2426                $tpl -> assign( 
    25             array( 
    26                 'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
    27                 'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
    28                 'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
    29                 'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
    30                 'TR_MENU_STATISTICS' => tr('Statistics'), 
    31                 'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
    32                 'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
    33                 'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
    34                 'TR_MENU_SETTINGS' => tr('Settings'), 
    35                 'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
    36                 'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
    37                 'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
    38                 'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
    39                 'TR_MENU_STATISTICS' => tr('Statistics'), 
    40                 'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
    41                 'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
    42                 'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
    43                 'TR_MENU_SETTINGS' => tr('Settings'), 
    44                 'TR_MENU_CHANGE_PASSWORD' => tr('Change password'), 
    45                 'TR_MENU_CHANGE_PERSONAL_DATA' => tr('Change pers. data'), 
    46                 'TR_MENU_ADD_ADMIN'  => tr('Add admin'), 
    47                 'TR_MENU_ADD_RESELLER'  => tr('Add reseller'), 
    48                 'TR_MENU_RESELLER_ASIGNMENT'  => tr('Reseller assignment'), 
    49                 'TR_MENU_USER_ASIGNMENT'  => tr('User assignment'), 
    50                 'TR_MENU_EMAIL_SETUP'  => tr('Email setup'), 
    51                 'TR_MENU_CIRCULAR'  => tr('Email marketing'), 
    52                 'TR_MENU_ADD_HOSTING' => tr('Add hosting plan'), 
    53                 'TR_MENU_RESELLER_STATISTICS' => tr('Reseller statistics'), 
    54                 'TR_MENU_SERVER_STATISTICS' => tr('Server statistics'), 
    55                 'TR_MENU_ADMIN_LOG' => tr('Admin log'), 
    56                 'TR_MENU_MANAGE_IPS' => tr('Manage IPs'),                 
    57                 'TR_MENU_SYSTEM_INFO' => tr('System info'), 
    58                 'TR_MENU_I18N' => tr('Multilanguage'), 
    59                 'TR_MENU_LAYOUT_TEMPLATES' => tr('Layout'), 
    60                 'TR_MENU_LOGOUT' => tr('Logout'), 
    61                 'TR_MENU_QUESTIONS_AND_COMMENTS' => tr('Support system'),               
    62                 'TR_MENU_SERVER_TRAFFIC_SETTINGS'=> tr('Server traffic settings'), 
    63                 'TR_MENU_SERVER_STATUS'=> tr('Server status'), 
    64                 'TR_MENU_VHCS_UPDATE'=> tr('VHCS updates'), 
    65                 'TR_MENU_VHCS_DEBUGGER'=> tr('VHCS debugger'), 
    66                 'TR_CUSTOM_MENUS' => tr('Custom menus'), 
    67                 'TR_MENU_OVERVIEW' => tr('Overview'), 
    68                 'TR_MENU_MANAGE_SESSIONS' => tr('User sessions'), 
    69                 'TR_MENU_LOSTPW_EMAIL' => tr('Lostpw email setup'), 
    70                 'TR_SERVICEMODE' => tr('Servicemode'),                           
    71                 'TR_GENERAL_SETTINGS' => tr('General settings'), 
    72                 'TR_SERVERPORTS' => tr('Serverports')) 
    73                 )); 
     27                                        array( 
     28                                                'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
     29                                                'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
     30                                                'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
     31                                                'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
     32                                                'TR_MENU_STATISTICS' => tr('Statistics'), 
     33                                                'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
     34                                                'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
     35                                                'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
     36                                                'TR_MENU_SETTINGS' => tr('Settings'), 
     37                                                'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
     38                                                'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
     39                                                'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
     40                                                'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
     41                                                'TR_MENU_STATISTICS' => tr('Statistics'), 
     42                                                'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
     43                                                'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
     44                                                'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
     45                                                'TR_MENU_SETTINGS' => tr('Settings'), 
     46                                                'TR_MENU_CHANGE_PASSWORD' => tr('Change password'), 
     47                                                'TR_MENU_CHANGE_PERSONAL_DATA' => tr('Change pers. data'), 
     48                                                'TR_MENU_ADD_ADMIN'  => tr('Add admin'), 
     49                                                'TR_MENU_ADD_RESELLER'  => tr('Add reseller'), 
     50                                                'TR_MENU_RESELLER_ASIGNMENT'  => tr('Reseller assignment'), 
     51                                                'TR_MENU_USER_ASIGNMENT'  => tr('User assignment'), 
     52                                                'TR_MENU_EMAIL_SETUP'  => tr('Email setup'), 
     53                                                'TR_MENU_CIRCULAR'  => tr('Email marketing'), 
     54                                                'TR_MENU_ADD_HOSTING' => tr('Add hosting plan'), 
     55                                                'TR_MENU_RESELLER_STATISTICS' => tr('Reseller statistics'), 
     56                                                'TR_MENU_SERVER_STATISTICS' => tr('Server statistics'), 
     57                                                'TR_MENU_ADMIN_LOG' => tr('Admin log'), 
     58                                                'TR_MENU_MANAGE_IPS' => tr('Manage IPs'), 
     59                                                'TR_MENU_SYSTEM_INFO' => tr('System info'), 
     60                                                'TR_MENU_I18N' => tr('Multilanguage'), 
     61                                                'TR_MENU_LAYOUT_TEMPLATES' => tr('Layout'), 
     62                                                'TR_MENU_LOGOUT' => tr('Logout'), 
     63                                                'TR_MENU_QUESTIONS_AND_COMMENTS' => tr('Support system'), 
     64                                                'TR_MENU_SERVER_TRAFFIC_SETTINGS'=> tr('Server traffic settings'), 
     65                                                'TR_MENU_SERVER_STATUS'=> tr('Server status'), 
     66                                                'TR_MENU_VHCS_UPDATE'=> tr('VHCS updates'), 
     67                                                'TR_MENU_VHCS_DEBUGGER'=> tr('VHCS debugger'), 
     68                                                'TR_CUSTOM_MENUS' => tr('Custom menus'), 
     69                                                'TR_MENU_OVERVIEW' => tr('Overview'), 
     70                                                'TR_MENU_MANAGE_SESSIONS' => tr('User sessions'), 
     71                                                'TR_MENU_LOSTPW_EMAIL' => tr('Lostpw email setup'), 
     72                                                'TR_SERVICEMODE' => tr('Servicemode'), 
     73                                                'TR_GENERAL_SETTINGS' => tr('General settings'), 
     74                                                'TR_SERVERPORTS' => tr('Serverports') 
     75                                        ) 
     76                                ); 
     77 
    7478        $query = <<<SQL_QUERY 
    75         select 
    76            
    77         from 
    78             custom_menus 
    79         where 
    80             menu_level = 'admin' 
    81 SQL_QUERY; 
    82  
    83     $rs = exec_query($sql, $query, array()); 
     79               select 
     80                       
     81               from 
     82                       custom_menus 
     83               where 
     84                       menu_level = 'admin' 
     85SQL_QUERY; 
     86 
     87       $rs = exec_query($sql, $query, array()); 
    8488         if ($rs -> RecordCount() == 0) { 
    8589 
    86         $tpl -> assign('CUSTOM_BUTTONS', ''); 
    87  
    88     } else { 
     90                $tpl -> assign('CUSTOM_BUTTONS', ''); 
     91 
     92        } 
     93        else { 
     94 
     95                global $i; 
     96                $i = 100; 
     97 
     98                while (!$rs -> EOF) { 
     99 
     100                $menu_name = $rs -> fields['menu_name']; 
     101                $menu_link = get_menu_vars($rs -> fields['menu_link']); 
     102                $menu_target = $rs -> fields['menu_target']; 
     103 
     104                if ($menu_target === '') { 
     105                        $menu_target = ""; 
     106                } 
     107                else { 
     108                        $menu_target = "target=\"".$menu_target."\""; 
     109                } 
     110 
     111                $tpl -> assign( 
     112                                  array( 
     113                                                'BUTTON_LINK' => $menu_link, 
     114                                                'BUTTON_NAME' => $menu_name, 
     115                                                'BUTTON_TARGET' => $menu_target, 
     116                                                'BUTTON_ID' => $i, 
     117                                                ) 
     118                                  ); 
     119 
     120        $tpl -> parse('CUSTOM_BUTTONS', '.custom_buttons'); 
     121        $rs -> MoveNext(); $i++; 
     122 
     123                } // end while 
     124        } // end else 
     125 
     126        if ($cfg['VHCS_SUPPORT_SYSTEM'] != 1) { 
     127 
     128                $tpl -> assign('SUPPORT_SYSTEM', ''); 
     129 
     130        } 
     131 
     132        if ($cfg['HOSTING_PLANS_LEVEL'] != strtolower('admin')) { 
     133 
     134                $tpl -> assign('HOSTING_PLANS', ''); 
     135 
     136        } 
     137 
     138        $tpl -> parse('MAIN_MENU', 'menu'); 
     139 
     140
     141 
     142function gen_admin_menu(&$tpl, $menu_file) { 
     143 
     144global $sql, $cfg; 
     145 
     146$tpl -> define_dynamic('menu', $menu_file); 
     147 
     148$tpl -> define_dynamic('custom_buttons', 'menu'); 
     149 
     150$tpl -> assign( 
     151                        array( 
     152                                'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
     153                                'TR_MENU_CHANGE_PASSWORD' => tr('Change password'), 
     154                                'TR_MENU_CHANGE_PERSONAL_DATA' => tr('Change pers. data'), 
     155                                'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
     156                                'TR_MENU_ADD_ADMIN'  => tr('Add admin'), 
     157                                'TR_MENU_ADD_RESELLER'  => tr('Add reseller'), 
     158                                'TR_MENU_RESELLER_ASIGNMENT'  => tr('Reseller assignment'), 
     159                                'TR_MENU_USER_ASIGNMENT'  => tr('User assignment'), 
     160                                'TR_MENU_EMAIL_SETUP'  => tr('Email setup'), 
     161                                'TR_MENU_CIRCULAR'  => tr('Email marketing'), 
     162                                'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
     163                                'TR_MENU_ADD_HOSTING' => tr('Add hosting plan'), 
     164                                'TR_MENU_ROOTKIT_LOG' => tr('Rootkit Log'), 
     165                                'TR_MENU_RESELLER_STATISTICS' => tr('Reseller statistics'), 
     166                                'TR_MENU_SERVER_STATISTICS' => tr('Server statistics'), 
     167                                'TR_MENU_ADMIN_LOG' => tr('Admin log'), 
     168                                'TR_MENU_MANAGE_IPS' => tr('Manage IPs'), 
     169                                'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
     170                                'TR_MENU_SYSTEM_INFO' => tr('System info'), 
     171                                'TR_MENU_I18N' => tr('Multilanguage'), 
     172                                'TR_MENU_LAYOUT_TEMPLATES' => tr('Layout'), 
     173                                'TR_MENU_LOGOUT' => tr('Logout'), 
     174                                'TR_MENU_QUESTIONS_AND_COMMENTS' => tr('Support system'), 
     175                                'TR_MENU_STATISTICS' => tr('Statistics'), 
     176                                'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
     177                                'TR_MENU_SERVER_TRAFFIC_SETTINGS'=> tr('Server traffic settings'), 
     178                                'TR_MENU_SERVER_STATUS'=> tr('Server status'), 
     179                                'TR_MENU_VHCS_UPDATE'=> tr('VHCS updates'), 
     180                                'TR_MENU_VHCS_DEBUGGER'=> tr('VHCS debugger'), 
     181                                'TR_CUSTOM_MENUS' => tr('Custom menus'), 
     182                                'TR_MENU_OVERVIEW' => tr('Overview'), 
     183                                'TR_MENU_MANAGE_SESSIONS' => tr('User sessions'), 
     184                                'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
     185                                'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
     186                                'TR_MENU_LOSTPW_EMAIL' => tr('Lostpw email setup'), 
     187                                'TR_SERVICEMODE' => tr('Servicemode'), 
     188                                'TR_MENU_SETTINGS' => tr('Settings'), 
     189                                'TR_GENERAL_SETTINGS' => tr('General settings'), 
     190                                'TR_SERVERPORTS' => tr('Serverports') 
     191                        ) 
     192        ); 
     193$query = <<<SQL_QUERY 
     194                select 
     195                        * 
     196                from 
     197                        custom_menus 
     198                where 
     199                        menu_level = 'admin1' 
     200SQL_QUERY; 
     201 
     202        $rs = exec_query($sql, $query, array()); 
     203         if ($rs -> RecordCount() == 0) { 
     204 
     205                $tpl -> assign('CUSTOM_BUTTONS', ''); 
     206 
     207        } else { 
    89208 
    90209                global $i; 
     
    104223 
    105224                $tpl -> assign( 
    106                   array( 
    107                         'BUTTON_LINK' => $menu_link, 
    108                         'BUTTON_NAME' => $menu_name, 
    109                         'BUTTON_TARGET' => $menu_target, 
    110                         'BUTTON_ID' => $i, 
    111                        
    112                   ); 
    113  
    114     $tpl -> parse('CUSTOM_BUTTONS', '.custom_buttons'); 
    115     $rs -> MoveNext(); $i++; 
     225                                 array( 
     226                                               'BUTTON_LINK' => $menu_link, 
     227                                               'BUTTON_NAME' => $menu_name, 
     228                                               'BUTTON_TARGET' => $menu_target, 
     229                                               'BUTTON_ID' => $i, 
     230                                               
     231                                 ); 
     232 
     233       $tpl -> parse('CUSTOM_BUTTONS', '.custom_buttons'); 
     234       $rs -> MoveNext(); $i++; 
    116235 
    117236                } // end while 
     
    130249        } 
    131250 
    132         $tpl -> parse('MAIN_MENU', 'menu'); 
    133  
    134 } 
    135  
    136 function gen_admin_menu(&$tpl, $menu_file) { 
    137  
    138 global $sql, $cfg; 
    139  
    140 $tpl -> define_dynamic('menu', $menu_file); 
    141  
    142 $tpl -> define_dynamic('custom_buttons', 'menu'); 
    143  
    144 $tpl -> assign( 
    145             array( 
    146                 'TR_MENU_GENERAL_INFORMATION' => tr('General information'), 
    147                 'TR_MENU_CHANGE_PASSWORD' => tr('Change password'), 
    148                 'TR_MENU_CHANGE_PERSONAL_DATA' => tr('Change pers. data'), 
    149                 'TR_MENU_MANAGE_USERS' => tr('Manage users'), 
    150                 'TR_MENU_ADD_ADMIN'  => tr('Add admin'), 
    151                 'TR_MENU_ADD_RESELLER'  => tr('Add reseller'), 
    152                 'TR_MENU_RESELLER_ASIGNMENT'  => tr('Reseller assignment'), 
    153                 'TR_MENU_USER_ASIGNMENT'  => tr('User assignment'), 
    154                 'TR_MENU_EMAIL_SETUP'  => tr('Email setup'), 
    155                 'TR_MENU_CIRCULAR'  => tr('Email marketing'), 
    156                 'TR_MENU_HOSTING_PLANS' => tr('Manage hosting plans'), 
    157                 'TR_MENU_ADD_HOSTING' => tr('Add hosting plan'), 
    158                 'TR_MENU_ROOTKIT_LOG' => tr('Rootkit Log'), 
    159                 'TR_MENU_RESELLER_STATISTICS' => tr('Reseller statistics'), 
    160                 'TR_MENU_SERVER_STATISTICS' => tr('Server statistics'), 
    161                 'TR_MENU_ADMIN_LOG' => tr('Admin log'), 
    162                 'TR_MENU_MANAGE_IPS' => tr('Manage IPs'), 
    163                 'TR_MENU_SUPPORT_SYSTEM' => tr('Support system'), 
    164                 'TR_MENU_SYSTEM_INFO' => tr('System info'), 
    165                 'TR_MENU_I18N' => tr('Multilanguage'), 
    166                 'TR_MENU_LAYOUT_TEMPLATES' => tr('Layout'), 
    167                 'TR_MENU_LOGOUT' => tr('Logout'), 
    168                 'TR_MENU_QUESTIONS_AND_COMMENTS' => tr('Support system'), 
    169                 'TR_MENU_STATISTICS' => tr('Statistics'), 
    170                 'TR_MENU_SYSTEM_TOOLS' => tr('System tools'), 
    171                 'TR_MENU_SERVER_TRAFFIC_SETTINGS'=> tr('Server traffic settings'), 
    172                 'TR_MENU_SERVER_STATUS'=> tr('Server status'), 
    173                 'TR_MENU_VHCS_UPDATE'=> tr('VHCS updates'), 
    174                 'TR_MENU_VHCS_DEBUGGER'=> tr('VHCS debugger'), 
    175                 'TR_CUSTOM_MENUS' => tr('Custom menus'), 
    176                 'TR_MENU_OVERVIEW' => tr('Overview'), 
    177                 'TR_MENU_MANAGE_SESSIONS' => tr('User sessions'), 
    178                 'SUPPORT_SYSTEM_PATH' => $cfg['VHCS_SUPPORT_SYSTEM_PATH'], 
    179                 'SUPPORT_SYSTEM_TARGET' => $cfg['VHCS_SUPPORT_SYSTEM_TARGET'], 
    180                 'TR_MENU_LOSTPW_EMAIL' => tr('Lostpw email setup'), 
    181                 'TR_SERVICEMODE' => tr('Servicemode'), 
    182                 'TR_MENU_SETTINGS' => tr('Settings'), 
    183                 'TR_GENERAL_SETTINGS' => tr('General settings'), 
    184                 'TR_SERVERPORTS' => tr('Serverports') 
    185             ) 
    186     ); 
    187 $query = <<<SQL_QUERY 
    188         select 
    189             * 
    190         from 
    191             custom_menus 
    192         where 
    193             menu_level = 'admin1'  
    194 SQL_QUERY; 
    195  
    196     $rs = exec_query($sql, $query, array()); 
    197          if ($rs -> RecordCount() == 0) { 
    198  
    199         $tpl -> assign('CUSTOM_BUTTONS', ''); 
    200  
    201     } else { 
    202  
    203                 global $i; 
    204                 $i = 100; 
    205  
    206                 while (!$rs -> EOF) { 
    207  
    208                 $menu_name = $rs -> fields['menu_name']; 
    209                 $menu_link = get_menu_vars($rs -> fields['menu_link']); 
    210                 $menu_target = $rs -> fields['menu_target']; 
    211  
    212                 if ($menu_target === ''){ 
    213                         $menu_target = ""; 
    214                 } else { 
    215                         $menu_target = "target=\"".$menu_target."\""; 
    216                 } 
    217  
    218                 $tpl -> assign( 
    219                   array( 
    220                         'BUTTON_LINK' => $menu_link, 
    221                         'BUTTON_NAME' => $menu_name, 
    222                         'BUTTON_TARGET' => $menu_target, 
    223                         'BUTTON_ID' => $i, 
    224                         ) 
    225                   ); 
    226  
    227     $tpl -> parse('CUSTOM_BUTTONS', '.custom_buttons'); 
    228     $rs -> MoveNext(); $i++; 
    229  
    230                 } // end while 
    231         } // end else 
    232  
    233         if ($cfg['VHCS_SUPPORT_SYSTEM'] != 1) { 
    234  
    235                 $tpl -> assign('SUPPORT_SYSTEM', ''); 
    236  
    237         } 
    238  
    239         if ($cfg['HOSTING_PLANS_LEVEL'] != strtolower('admin')) { 
    240  
    241                 $tpl -> assign('HOSTING_PLANS', ''); 
    242  
    243         } 
    244  
    245251        $tpl -> parse('MENU', 'menu'); 
    246252 
     
    249255function get_cnt_of_user(&$sql, $user_type) { 
    250256 
    251     $query = <<<SQL_QUERY 
    252         SELECT 
    253             count(admin_id) as cnt 
    254         FROM 
    255             admin 
    256         WHERE 
    257             admin_type=? 
    258 SQL_QUERY; 
    259  
    260     $rs = exec_query($sql, $query, array($user_type)); 
    261  
    262     $admin_cnt = $rs -> fields['cnt']; 
    263  
    264     return $admin_cnt; 
     257       $query = <<<SQL_QUERY 
     258               SELECT 
     259                       count(admin_id) as cnt 
     260               FROM 
     261                       admin 
     262               WHERE 
     263                       admin_type=? 
     264SQL_QUERY; 
     265 
     266       $rs = exec_query($sql, $query, array($user_type)); 
     267 
     268       $admin_cnt = $rs -> fields['cnt']; 
     269 
     270       return $admin_cnt; 
    265271 
    266272} 
     
    270276{ 
    271277  if ($where != '') { 
    272     $query = <<<SQL_QUERY 
    273             SELECT 
    274                 count(?) as  cnt 
    275             FROM 
    276                 $table 
    277             WHERE 
    278                 $where = ? 
    279 SQL_QUERY; 
    280     $rs = exec_query($sql, $query, array($field, $value)); 
     278       $query = <<<SQL_QUERY 
     279                       SELECT 
     280                               count(?) as  cnt 
     281                       FROM 
     282                               $table 
     283                       WHERE 
     284                               $where = ? 
     285SQL_QUERY; 
     286       $rs = exec_query($sql, $query, array($field, $value)); 
    281287 
    282288  } else { 
    283289 
    284     $query = <<<SQL_QUERY 
    285             SELECT 
    286                 count(?) as  cnt 
    287             FROM 
    288                 $table 
    289 SQL_QUERY; 
    290     $rs = exec_query($sql, $query, array($field)); 
     290       $query = <<<SQL_QUERY 
     291                       SELECT 
     292                               count(?) as  cnt 
     293                       FROM 
     294                               $table 
     295SQL_QUERY; 
     296       $rs = exec_query($sql, $query, array($field)); 
    291297  } 
    292298 
     
    311317{ 
    312318 
    313     $tpl -> assign( 
    314         array( 
    315             'TR_GENERAL_INFORMATION' => tr('General information'), 
    316             'TR_ACCOUNT_NAME' => tr('Account name'), 
    317             'TR_ADMIN_USERS' => tr('Admin users'), 
    318             'TR_RESELLER_USERS' => tr('Reseller users'), 
    319             'TR_NORMAL_USERS' => tr('Normal users'), 
    320             'TR_DOMAINS' => tr('Domains'), 
    321             'TR_SUBDOMAINS' => tr('Subdomains'), 
    322             'TR_DOMAINS_ALIASES' => tr('Domain aliases'), 
    323             'TR_MAIL_ACCOUNTS' => tr('Mail accounts'), 
    324             'TR_FTP_ACCOUNTS' => tr('FTP accounts'), 
    325             'TR_SQL_DATABASES' => tr('SQL databases'), 
    326             'TR_SQL_USERS' => tr('SQL users'), 
    327  
    328             'TR_SYSTEM_MESSAGES' => tr('System messages'), 
    329             'TR_NO_NEW_MESSAGES' => tr('No new messages'), 
    330             'TR_SERVER_TRAFFIC' => tr('Server traffic'), 
    331             ) 
    332         ); 
    333  
    334     $tpl -> assign( 
    335         array( 
    336             'ACCOUNT_NAME' => $_SESSION['user_logged'], 
    337             'ADMIN_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'admin'), 
    338             'RESELLER_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'reseller'), 
    339             'NORMAL_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'user'), 
    340             'DOMAINS' => get_cnt($sql, 'domain', 'domain_id','', ''), 
    341             'SUBDOMAINS' => get_cnt($sql, 'subdomain', 'subdomain_id','', ''), 
    342             'DOMAINS_ALIASES' => get_cnt($sql, 'domain_aliasses', 'alias_id', '', ''), 
    343             'MAIL_ACCOUNTS'  => get_cnt($sql, 'mail_users','mail_id', '', ''), 
    344             'FTP_ACCOUNTS'  => get_cnt($sql, 'ftp_users', 'userid', '', ''), 
    345             'SQL_DATABASES'  => get_cnt($sql, 'sql_database', 'sqld_id','', ''), 
    346             'SQL_USERS'  => get_sql_user_count($sql) 
    347             ) 
    348         ); 
     319        $tpl -> assign( 
     320                array( 
     321                        'TR_GENERAL_INFORMATION' => tr('General information'), 
     322                        'TR_ACCOUNT_NAME' => tr('Account name'), 
     323                        'TR_ADMIN_USERS' => tr('Admin users'), 
     324                        'TR_RESELLER_USERS' => tr('Reseller users'), 
     325                        'TR_NORMAL_USERS' => tr('Normal users'), 
     326                        'TR_DOMAINS' => tr('Domains'), 
     327                        'TR_SUBDOMAINS' => tr('Subdomains'), 
     328                        'TR_DOMAINS_ALIASES' => tr('Domain aliases'), 
     329                        'TR_MAIL_ACCOUNTS' => tr('Mail accounts'), 
     330                        'TR_FTP_ACCOUNTS' => tr('FTP accounts'), 
     331                        'TR_SQL_DATABASES' => tr('SQL databases'), 
     332                        'TR_SQL_USERS' => tr('SQL users'), 
     333                        'TR_SYSTEM_MESSAGES' => tr('System messages'), 
     334                        'TR_NO_NEW_MESSAGES' => tr('No new messages'), 
     335                        'TR_SERVER_TRAFFIC' => tr('Server traffic') 
     336                        ) 
     337                ); 
     338 
     339        $tpl -> assign( 
     340                array( 
     341                        'ACCOUNT_NAME' => $_SESSION['user_logged'], 
     342                        'ADMIN_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'admin'), 
     343                        'RESELLER_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'reseller'), 
     344                        'NORMAL_USERS' => get_cnt($sql, 'admin', 'admin_id', 'admin_type', 'user'), 
     345                        'DOMAINS' => get_cnt($sql, 'domain', 'domain_id','', ''), 
     346                        'SUBDOMAINS' => get_cnt($sql, 'subdomain', 'subdomain_id','', ''), 
     347                        'DOMAINS_ALIASES' => get_cnt($sql, 'domain_aliasses', 'alias_id', '', ''), 
     348                        'MAIL_ACCOUNTS'  => get_cnt($sql, 'mail_users','mail_id', '', ''), 
     349                        'FTP_ACCOUNTS'  => get_cnt($sql, 'ftp_users', 'userid', '', ''), 
     350                        'SQL_DATABASES'  => get_cnt($sql, 'sql_database', 'sqld_id','', ''), 
     351                        'SQL_USERS'  => get_sql_user_count($sql) 
     352                        ) 
     353                ); 
    349354} 
    350355 
     
    353358{ 
    354359 
    355     $query = <<<SQL_QUERY 
    356             SELECT 
    357                 t1.admin_id, t1.admin_name, IFNULL(t2.admin_name, '') AS created_by 
    358             FROM 
    359                 admin AS t1 
    360               LEFT JOIN 
    361                 admin AS t2 ON t1.created_by = t2.admin_id 
    362             WHERE 
    363                 t1.admin_type='admin' 
    364             ORDER BY 
    365                 t1.admin_name 
     360       $query = <<<SQL_QUERY 
     361                       SELECT 
     362                               t1.admin_id, t1.admin_name, IFNULL(t2.admin_name, '') AS created_by 
     363                       FROM 
     364                               admin AS t1 
     365                         LEFT JOIN 
     366                               admin AS t2 ON t1.created_by = t2.admin_id 
     367                       WHERE 
     368                               t1.admin_type='admin' 
     369                       ORDER BY 
     370                               t1.admin_name 
    366371                        ASC 
    367372SQL_QUERY; 
    368373 
    369     $rs = exec_query($sql, $query, array()); 
    370  
    371     $i = 0; 
    372  
    373     if ($rs -> RecordCount() == 0) { 
     374       $rs = exec_query($sql, $query, array()); 
     375 
     376       $i = 0; 
     377 
     378       if ($rs -> RecordCount() == 0) { 
    374379 
    375380        $tpl -> assign( 
    376                         array( 
    377                                 'ADMIN_MESSAGE' => tr('Adminitrators list is empty!'), 
    378                                 'ADMIN_LIST' => '' 
    379                            
    380                       ); 
    381  
    382         $tpl -> parse('ADMIN_MESSAGE', 'admin_message'); 
    383  
    384     } else { 
     381                                               array( 
     382                                                               'ADMIN_MESSAGE' => tr('Adminitrators list is empty!'), 
     383                                                               'ADMIN_LIST' => '' 
     384                                                       
     385                                         ); 
     386 
     387               $tpl -> parse('ADMIN_MESSAGE', 'admin_message'); 
     388 
     389       } else { 
    385390 
    386391        $tpl -> assign( 
    387                 array( 
    388                         'TR_ADMIN_USERNAME' => tr('Username'), 
    389                         'TR_AD