root/trunk/gui/client/ftp_accounts.php

Revision 1373, 4.3 kB (checked in by rats, 1 month ago)

* Added Mailsize function
* Fixed #1594: (CentOS) More perl dependencies on CentOS
* Fixed #1595: (CentOS) CentOS perl docs: Advice to autoconfigure first
* Fixed #1483: Misleading information in INSTALL-files
* Fixed #1512: Subdomains for domain-aliases
* Fixed #1509: New subdomain management system
* Fixed Order delete bug
* Fixed #1507: Some errors on around "Execute Query" option on a database
* Fixed #1511: e-mail aliases & autoreply
* Fixed #1151: Update Hosting Package should only visible for a customer if a hosting plan to update is available (thanks Feg)
* Fixed #1556: Special Characters like Umlauts (äüöÄÜÖ) and Ligatures (ß) in Javascript messages are encoded, wrongly.
* PHPmyAdmin 3.0.0

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 check_login(__FILE__);
24
25 $tpl = new pTemplate();
26 $tpl->define_dynamic('page', Config::get('CLIENT_TEMPLATE_PATH') . '/ftp_accounts.tpl');
27 $tpl->define_dynamic('page_message', 'page');
28 $tpl->define_dynamic('logged_from', 'page');
29 $tpl->define_dynamic('mail_message', 'page');
30 $tpl->define_dynamic('mail_item', 'page');
31 $tpl->define_dynamic('mail_auto_respond', 'mail_item');
32 $tpl->define_dynamic('mails_total', 'page');
33 $tpl->define_dynamic('catchall_message', 'page');
34 $tpl->define_dynamic('catchall_item', 'page');
35 $tpl->define_dynamic('ftp_message', 'page');
36 $tpl->define_dynamic('ftp_item', 'page');
37 $tpl->define_dynamic('no_mails', 'page');
38
39 // page functions.
40
41 function gen_page_ftp_list(&$tpl, &$sql, $dmn_id, $dmn_name) {
42     $query = <<<SQL_QUERY
43         SELECT
44             gid,
45             members
46         FROM
47             ftp_group
48         WHERE
49             groupname = ?
50 SQL_QUERY;
51
52     $rs = exec_query($sql, $query, array($dmn_name));
53
54     if ($rs->RecordCount() == 0) {
55         $tpl->assign(
56             array('FTP_MSG' => tr('FTP list is empty!'),
57                 'FTP_ITEM' => '',
58                 'FTPS_TOTAL' => ''
59                 )
60             );
61
62         $tpl->parse('FTP_MESSAGE', 'ftp_message');
63     } else {
64         $tpl->assign('FTP_MESSAGE', '');
65
66         $ftp_accs = split(',', $rs->fields['members']);
67         sort($ftp_accs);
68         reset($ftp_accs);
69
70         for ($i = 0; $i < count($ftp_accs); $i++) {
71             if ($i % 2 == 0) {
72                 $tpl->assign('ITEM_CLASS', 'content');
73             } else {
74                 $tpl->assign('ITEM_CLASS', 'content2');
75             }
76
77             $ftp_accs_encode[$i] = decode_idna($ftp_accs[$i]);
78
79             $tpl->assign(
80                 array('FTP_ACCOUNT' => $ftp_accs_encode[$i],
81                     'UID' => urlencode ($ftp_accs[$i])
82                     )
83                 );
84
85             $tpl->parse('FTP_ITEM', '.ftp_item');
86         }
87
88         $tpl->assign('TOTAL_FTP_ACCOUNTS', count($ftp_accs));
89     }
90 }
91
92 function gen_page_lists(&$tpl, &$sql, $user_id) {
93     list($dmn_id,
94         $dmn_name,
95         $dmn_gid,
96         $dmn_uid,
97         $dmn_created_id,
98         $dmn_created,
99         $dmn_last_modified,
100         $dmn_mailacc_limit,
101         $dmn_ftpacc_limit,
102         $dmn_traff_limit,
103         $dmn_sqld_limit,
104         $dmn_sqlu_limit,
105         $dmn_status,
106         $dmn_als_limit,
107         $dmn_subd_limit,
108         $dmn_ip_id,
109         $dmn_disk_limit,
110         $dmn_disk_usage,
111         $dmn_php,
112         $dmn_cgi) = get_domain_default_props($sql, $user_id);
113
114     gen_page_ftp_list($tpl, $sql, $dmn_id, $dmn_name);
115     // return $total_mails;
116 }
117
118 // common page data.
119
120 $theme_color = Config::get('USER_INITIAL_THEME');
121
122 $tpl->assign(
123     array('TR_CLIENT_MANAGE_USERS_PAGE_TITLE' => tr('ispCP - Client/Manage Users'),
124         'THEME_COLOR_PATH' => "../themes/$theme_color",
125         'THEME_CHARSET' => tr('encoding'),
126         'ISP_LOGO' => get_logo($_SESSION['user_id'])
127         )
128     );
129
130 // dynamic page data.
131
132 if (isset($_SESSION['email_support']) && $_SESSION['email_support'] == "no") {
133     $tpl->assign('NO_MAILS', '');
134 }
135
136 gen_page_lists($tpl, $sql, $_SESSION['user_id']);
137
138 // static page messages.
139
140 gen_client_mainmenu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/main_menu_ftp_accounts.tpl');
141 gen_client_menu($tpl, Config::get('CLIENT_TEMPLATE_PATH') . '/menu_ftp_accounts.tpl');
142
143 gen_logged_from($tpl);
144
145 check_permissions($tpl);
146
147 $tpl->assign(
148     array('TR_MANAGE_USERS' => tr('Manage users'),
149         'TR_TYPE' => tr('Type'),
150         'TR_STATUS' => tr('Status'),
151         'TR_ACTION' => tr('Action'),
152         'TR_TOTAL_FTP_ACCOUNTS' => tr('FTPs total'),
153         'TR_DOMAIN' => tr('Domain'),
154         'TR_FTP_USERS' => tr('FTP users'),
155         'TR_FTP_ACCOUNT' => tr('FTP account'),
156         'TR_FTP_ACTION' => tr('Action'),
157         'TR_EDIT' => tr('Edit'),
158         'TR_DELETE' => tr('Delete'),
159         'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete %s?', true, '%s')
160         )
161     );
162
163 gen_page_message($tpl);
164
165 $tpl->parse('PAGE', 'page');
166 $tpl->prnt();
167
168 if (Config::get('DUMP_GUI_DEBUG'))
169     dump_gui_debug();
170
171 unset_messages();
172
173 ?>
174
Note: See TracBrowser for help on using the browser.