root/trunk/gui/orderpanel/package_info.php

Revision 1327, 5.9 kB (checked in by rats, 3 months ago)

* Fixed: --scan-knownbad-files and --check-deleted are no longer supported by rkhunter
* Fixed #1471: chkrootkit should be in lenny / hardy
* Updated Chinese (simplified)
* Updated German
* Fixed #1475: typo on installation (ispcp-setup)
* Fixed: default user for rkhunter.log

Line 
1 <?php
2 /**
3  * ispCP ω (OMEGA) a Virtual Hosting Control System
4  *
5  * @copyright     2001-2006 by moleSoftware GmbH
6  * @copyright     2006-2008 by ispCP | http://isp-control.net
7  * @version     SVN: $Id$
8  * @link         http://isp-control.net
9  * @author         ispCP Team
10  *
11  * @license
12  *   This program is free software; you can redistribute it and/or modify it under
13  *   the terms of the MPL General Public License as published by the Free Software
14  *   Foundation; either version 1.1 of the License, or (at your option) any later
15  *   version.
16  *   You should have received a copy of the MPL Mozilla Public License along with
17  *   this program; if not, write to the Open Source Initiative (OSI)
18  *   http://opensource.org | osi@opensource.org
19  */
20
21 require '../include/ispcp-lib.php';
22
23 $tpl = new pTemplate();
24
25 $tpl->define_dynamic('page', Config::get('PURCHASE_TEMPLATE_PATH') . '/package_info.tpl');
26 $tpl->define_dynamic('purchase_list', 'page');
27 $tpl->define_dynamic('purchase_message', 'page');
28 $tpl->define_dynamic('purchase_header', 'page');
29 $tpl->define_dynamic('purchase_footer', 'page');
30
31 /*
32 * Functions start
33 */
34
35 function translate_sse($value)
36 {
37     if ($value == '_yes_') {
38         return tr('Yes');
39     } else if ($value == '_no_') {
40         return tr('No');
41     } else {
42         return $value;
43     }
44 }
45
46 function gen_plan_details(&$tpl, &$sql, $user_id, $plan_id) {
47     if (Config::exists('HOSTING_PLANS_LEVEL') && Config::get('HOSTING_PLANS_LEVEL') === 'admin') {
48         $query = <<<SQL_QUERY
49             select
50                 *
51             from
52                 hosting_plans
53             where
54                 id = ?
55 SQL_QUERY;
56
57         $rs = exec_query($sql, $query, array($plan_id));
58     } else {
59         $query = <<<SQL_QUERY
60             select
61                 *
62             from
63                 hosting_plans
64             where
65                 reseller_id = ?
66               and
67                 id = ?
68 SQL_QUERY;
69
70         $rs = exec_query($sql, $query, array($user_id, $plan_id));
71     }
72     if ($rs->RecordCount() == 0) {
73         header("Location: index.php?user_id=$user_id");
74         die();
75     } else {
76         $props = $rs->fields['props'];
77         list($hp_php, $hp_cgi, $hp_sub, $hp_als, $hp_mail, $hp_ftp, $hp_sql_db, $hp_sql_user, $hp_traff, $hp_disk) = explode(";", $props);
78
79         $price = $rs->fields['price'];
80         $setup_fee = $rs->fields['setup_fee'];
81
82         if ($price == 0 || $price == '') {
83             $price = tr('free of charge');
84         } else {
85             $price = $price . " " . $rs->fields['value'] . " " . $rs->fields['payment'];
86         }
87
88         if ($setup_fee == 0 || $setup_fee == '') {
89             $setup_fee = tr('free of charge');
90         } else {
91             $setup_fee = $setup_fee . " " . $rs->fields['value'];
92         }
93         $description = $rs->fields['description'];
94
95         $hp_disk = translate_limit_value($hp_disk, true) . "<br>";
96
97         $hp_traff = translate_limit_value($hp_traff, true);
98
99         $tpl->assign(
100             array('PACK_NAME' => $rs->fields['name'],
101                 'DESCRIPTION' => $description,
102                 'PACK_ID' => $rs->fields['id'],
103                 'USER_ID' => $user_id,
104                 'PURCHASE' => tr('Purchase'),
105                 'ALIAS' => translate_limit_value($hp_als),
106                 'SUBDOMAIN' => translate_limit_value($hp_sub),
107                 'HDD' => $hp_disk,
108                 'TRAFFIC' => $hp_traff,
109                 'PHP' => translate_sse($hp_php),
110                 'CGI' => translate_sse($hp_cgi),
111                 'MAIL' => translate_limit_value($hp_mail),
112                 'FTP' => translate_limit_value($hp_ftp),
113                 'SQL_DB' => translate_limit_value($hp_sql_db),
114                 'SQL_USR' => translate_limit_value($hp_sql_user),
115                 'PRICE' => $price,
116                 'SETUP' => $setup_fee,
117
118                 )
119             );
120     }
121 }
122
123 /*
124 * Functions end
125 */
126
127 /*
128 *
129 * static page messages.
130 *
131 */
132
133 if (isset($_GET['id'])) {
134     $plan_id = $_GET['id'];
135     $_SESSION['plan_id'] = $plan_id;
136     if (isset($_SESSION['user_id'])) {
137         $user_id = $_SESSION['user_id'];
138     } else if (isset($_GET['user_id'])) {
139         $user_id = $_GET['user_id'];
140         $_SESSION['user_id'] = $user_id;
141     } else {
142         system_message(tr('You do not have permission to access this interface!'));
143     }
144 } else {
145     system_message(tr('You do not have permission to access this interface!'));
146 }
147
148 gen_purchase_haf($tpl, $sql, $user_id);
149 gen_plan_details($tpl, $sql, $user_id, $plan_id);
150
151 gen_page_message($tpl);
152
153 $tpl->assign(
154     array('TR_DOMAINS' => tr('Domains'),
155         'TR_WEBSPACE' => tr('Webspace'),
156         'TR_HDD' => tr('Disk limit'),
157         'TR_TRAFFIC' => tr('Traffic limit'),
158         'TR_FEATURES' => tr('Domain Features'),
159         'TR_STANDARD_FEATURES' => tr('Package Features'),
160         'TR_WEBMAIL' => tr('Webmail'),
161         'TR_FILEMANAGER' => tr('Filemanager'),
162         'TR_BACKUP' => tr('Backup and Restore'),
163         'TR_ERROR_PAGES' => tr('Custom Error Pages'),
164         'TR_HTACCESS' => tr('Protected Areas'),
165         'TR_PHP_SUPPORT' => tr('PHP support'),
166         'TR_CGI_SUPPORT' => tr('CGI support'),
167         'TR_MYSQL_SUPPORT' => tr('SQL support'),
168         'TR_SUBDOMAINS' => tr('Subdomains'),
169         'TR_DOMAIN_ALIAS' => tr('Domain aliases'),
170         'TR_MAIL_ACCOUNTS' => tr('Mail accounts'),
171         'TR_FTP_ACCOUNTS' => tr('FTP accounts'),
172         'TR_SQL_DATABASES' => tr('SQL databases'),
173         'TR_SQL_USERS' => tr('SQL users'),
174         'TR_STATISTICS' => tr('Statistics'),
175         'TR_CUSTOM_LOGS' => tr('Custom Apache Logs'),
176         'TR_ONLINE_SUPPORT' => tr('Web & E-Mail Support'),
177         'TR_OWN_DOMAIN' => tr('Your Own Domain'),
178         'TR_ISPCP' => tr('ispCP Control Panel'),
179         'TR_UPDATES' => tr('Automatic Updates'),
180         'TR_PRICE' => tr('Price'),
181         'TRR_PRICE' => tr('Package Price'),
182         'TR_SETUP_FEE' => tr('Setup Fee'),
183         'TR_PERFORMANCE' => tr('Performance'),
184         'TR_PURCHASE' => tr('Purchase'),
185         'TR_BACK' => tr('Back'),
186         'YES' => tr('Yes')
187         )
188     );
189
190 $tpl->parse('PAGE', 'page');
191 $tpl->prnt();
192
193 if (Config::get('DUMP_GUI_DEBUG'))
194     dump_gui_debug();
195
196 unset_messages();
197
198 ?>
Note: See TracBrowser for help on using the browser.