Changeset 1243
- Timestamp:
- 06/28/08 20:44:24
(2 months ago)
- Author:
- rats
- Message:
GUI Update 1/5: admin
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1241 |
r1243 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| 25 | | if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { |
|---|
| | 25 | if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { |
|---|
| 26 | 26 | header('Location: index.php'); |
|---|
| 27 | 27 | die(); |
|---|
| … | … | |
| 189 | 189 | $price = 0; |
|---|
| 190 | 190 | } else { |
|---|
| 191 | | $price = $_POST['hp_price']; |
|---|
| | 191 | $price = clean_input($_POST['hp_price']); |
|---|
| 192 | 192 | } |
|---|
| 193 | 193 | if (empty($_POST['hp_setupfee'])) { |
|---|
| 194 | 194 | $setup_fee = 0; |
|---|
| 195 | 195 | } else { |
|---|
| 196 | | $setup_fee = $_POST['hp_setupfee']; |
|---|
| | 196 | $setup_fee = clean_input($_POST['hp_setupfee']); |
|---|
| 197 | 197 | } |
|---|
| 198 | 198 | |
|---|
| r1241 |
r1243 |
|
| 18 | 18 | * http://opensource.org | osi@opensource.org |
|---|
| 19 | 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('ADMIN_TEMPLATE_PATH') . '/change_personal.tpl'); |
|---|
| | 27 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| | 28 | $tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| | 29 | |
|---|
| | 30 | $theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| | 31 | |
|---|
| | 32 | $tpl->assign( |
|---|
| | 33 | array( |
|---|
| | 34 | 'TR_ADMIN_CHANGE_PERSONAL_DATA_PAGE_TITLE' => tr('ispCP - Admin/Change Personal Data'), |
|---|
| | 35 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 36 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 37 | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| | 38 | ) |
|---|
| | 39 | ); |
|---|
| | 40 | |
|---|
| | 41 | if (isset($_POST['uaction']) && $_POST['uaction'] === 'updt_data') { |
|---|
| | 42 | update_admin_personal_data($sql, $_SESSION['user_id']); |
|---|
| | 43 | } |
|---|
| | 44 | |
|---|
| | 45 | gen_admin_personal_data($tpl, $sql, $_SESSION['user_id']); |
|---|
| 20 | 46 | |
|---|
| 21 | 47 | function gen_admin_personal_data(&$tpl, &$sql, $user_id) { |
|---|
| … | … | |
| 113 | 139 | } |
|---|
| 114 | 140 | |
|---|
| 115 | | require '../include/ispcp-lib.php'; |
|---|
| 116 | | |
|---|
| 117 | | check_login(__FILE__); |
|---|
| 118 | | |
|---|
| 119 | | $tpl = new pTemplate(); |
|---|
| 120 | | $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/change_personal.tpl'); |
|---|
| 121 | | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 122 | | $tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| 123 | | |
|---|
| 124 | | $theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| 125 | | |
|---|
| 126 | | $tpl->assign( |
|---|
| 127 | | array( |
|---|
| 128 | | 'TR_ADMIN_CHANGE_PERSONAL_DATA_PAGE_TITLE' => tr('ispCP - Admin/Change Personal Data'), |
|---|
| 129 | | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 130 | | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 131 | | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| 132 | | ) |
|---|
| 133 | | ); |
|---|
| 134 | | |
|---|
| 135 | | if (isset($_POST['uaction']) && $_POST['uaction'] === 'updt_data') { |
|---|
| 136 | | update_admin_personal_data($sql, $_SESSION['user_id']); |
|---|
| 137 | | } |
|---|
| 138 | | |
|---|
| 139 | | gen_admin_personal_data($tpl, $sql, $_SESSION['user_id']); |
|---|
| 140 | | |
|---|
| 141 | 141 | /* |
|---|
| 142 | 142 | * |
|---|
| r1241 |
r1243 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP ? (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| 7 | 7 | * @link http://isp-control.net |
|---|
| 8 | 8 | * @author ispCP Team (2007) |
|---|
| r1241 |
r1243 |
|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| 7 | 7 | * @version SVN: $ID$ |
|---|
| 8 | 8 | * @link http://isp-control.net |
|---|
| r1241 |
r1243 |
|
| 70 | 70 | |
|---|
| 71 | 71 | |
|---|
| 72 | | if(!checkDatabaseUpdateExists()) { |
|---|
| 73 | | $tpl->assign('TR_UPDATE_MESSAGE', tr('No database updates available')); |
|---|
| 74 | | $tpl->parse('DATABASE_UPDATE_MESSAGE', 'database_update_message'); |
|---|
| 75 | | } else { |
|---|
| 76 | | $tpl->assign('DATABASE_UPDATE_MESSAGE', ''); |
|---|
| 77 | | } |
|---|
| 78 | | |
|---|
| 79 | | |
|---|
| 80 | 72 | if(checkDatabaseUpdateExists()) { |
|---|
| 81 | 73 | $tpl->assign(array( |
|---|
| 82 | | 'UPDATE_MESSAGE' => '', |
|---|
| 83 | | 'UPDATE' => tr('New Database update is now available'), |
|---|
| 84 | | 'INFOS' => tr('Do you want to execute the Updates now?'), |
|---|
| | 74 | 'UPDATE_MESSAGE' => '', |
|---|
| | 75 | 'DATABASE_UPDATE_MESSAGE' => '', |
|---|
| | 76 | 'UPDATE' => tr('New Database update is now available'), |
|---|
| | 77 | 'INFOS' => tr('Do you want to execute the Updates now?') |
|---|
| 85 | 78 | )); |
|---|
| 86 | 79 | $tpl->parse('DATABASE_UPDATE_INFOS', 'database_update_infos'); |
|---|
| 87 | 80 | } else { |
|---|
| 88 | | $tpl->assign('DATABASE_UPDATE_INFOS', ''); |
|---|
| | 81 | $tpl->assign(array( |
|---|
| | 82 | 'TR_UPDATE_MESSAGE' => tr('No database updates available'), |
|---|
| | 83 | 'DATABASE_UPDATE_INFOS' => '' |
|---|
| | 84 | )); |
|---|
| | 85 | $tpl->parse('DATABASE_UPDATE_MESSAGE', 'database_update_message'); |
|---|
| 89 | 86 | } |
|---|
| 90 | 87 | |
|---|
| r1241 |
r1243 |
|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| 7 | 7 | * @version SVN: $ID$ |
|---|
| 8 | 8 | * @link http://isp-control.net |
|---|
| … | … | |
| 92 | 92 | $ip_number = $rs->fields['ip_number']; |
|---|
| 93 | 93 | |
|---|
| 94 | | write_log("$user_logged: delete IP address $ip_number"); |
|---|
| | 94 | write_log("$user_logged: deletes IP address $ip_number"); |
|---|
| 95 | 95 | |
|---|
| 96 | 96 | /* delete it ! */ |
|---|
| r1241 |
r1243 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP ω (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 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 ispCP Team (2007) |
|---|
| | 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 |
|---|
| 9 | 10 | * |
|---|
| 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 | | |
|---|
| 20 | | |
|---|
| | 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 | */ |
|---|
| 21 | 20 | |
|---|
| 22 | 21 | require '../include/ispcp-lib.php'; |
|---|
| … | … | |
| 73 | 72 | $rs = exec_query($sql, $query, array()); |
|---|
| 74 | 73 | |
|---|
| 75 | | /* |
|---|
| 76 | | |
|---|
| 77 | | if( $exstatus != 0) { |
|---|
| 78 | | $error = "000017"; |
|---|
| 79 | | set_page_message('Error 000017!'); |
|---|
| 80 | | |
|---|
| 81 | | header( "Location: multilanguage.php" ); |
|---|
| 82 | | die(); |
|---|
| 83 | | } |
|---|
| 84 | | */ |
|---|
| 85 | | write_log("$admin_login: remove language $delete_lang!"); |
|---|
| | 74 | write_log(sprintf("%s removed language: %s", $_SESSION['user_logged'], $delete_lang)); |
|---|
| 86 | 75 | |
|---|
| 87 | 76 | set_page_message('Language was removed!'); |
|---|
| r1241 |
r1243 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP ω (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 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 ispCP Team (2007) |
|---|
| | 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 |
|---|
| 9 | 10 | * |
|---|
| 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 | | **/ |
|---|
| | 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 | */ |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | require '../include/ispcp-lib.php'; |
|---|
| … | … | |
| 72 | 73 | $rs = exec_query($sql, $query, array($delete_id)); |
|---|
| 73 | 74 | |
|---|
| 74 | | if ($rs -> fields['children'] > 0 && $local_admin_type !== 'user') { |
|---|
| | 75 | if ($rs->fields['children'] > 0 && $local_admin_type !== 'user') { |
|---|
| 75 | 76 | /* this user have domain ! */ |
|---|
| 76 | 77 | $hdomain = 1; |
|---|
| … | … | |
| 107 | 108 | $rs = exec_query($sql, $query, array($delete_id)); |
|---|
| 108 | 109 | |
|---|
| 109 | | // delete orders |
|---|
| | 110 | // delete orders |
|---|
| 110 | 111 | $query = <<<SQL_QUERY |
|---|
| 111 | 112 | delete from |
|---|
| … | … | |
| 117 | 118 | $rs = exec_query($sql, $query, array($delete_id)); |
|---|
| 118 | 119 | |
|---|
| 119 | | // delete orders settings |
|---|
| | 120 | // delete orders settings |
|---|
| 120 | 121 | $query = <<<SQL_QUERY |
|---|
| 121 | 122 | delete from |
|---|
| … | … | |
| 135 | 136 | SQL_QUERY; |
|---|
| 136 | 137 | $rs = exec_query($sql, $query, array($delete_id)); |
|---|
| 137 | | |
|---|
| 138 | | /* |
|---|
| 139 | | |
|---|
| 140 | | $query = <<<SQL_QUERY |
|---|
| 141 | | |
|---|
| 142 | | select |
|---|
| 143 | | |
|---|
| 144 | | admin_id |
|---|
| 145 | | |
|---|
| 146 | | from |
|---|
| 147 | | admin |
|---|
| 148 | | |
|---|
| 149 | | where |
|---|
| 150 | | |
|---|
| 151 | | created_by = '$delete_id' |
|---|
| 152 | | |
|---|
| 153 | | SQL_QUERY; |
|---|
| 154 | | |
|---|
| 155 | | $rs = execute_query($sql, $query); |
|---|
| 156 | | |
|---|
| 157 | | while (!$rs -> EOF) { |
|---|
| 158 | | $delete_user_account_id = $rs -> fields['admin_id']; |
|---|
| 159 | | print $delete_user_account_id."<br>"; |
|---|
| 160 | | rm_rf_user_account ($delete_user_account_id); |
|---|
| 161 | | } |
|---|
| 162 | | die (); |
|---|
| 163 | | */ |
|---|
| 164 | | |
|---|
| 165 | 138 | |
|---|
| 166 | 139 | } else if ($local_admin_type == 'user') { |
|---|
| … | … | |
| 187 | 160 | $user_logged= $_SESSION['user_logged']; |
|---|
| 188 | 161 | $local_admin_name = $_GET['delete_username']; |
|---|
| 189 | | write_log("$user_logged: delete user $local_admin_name, $local_admin_type, $delete_id!"); |
|---|
| | 162 | write_log("$user_logged: deletes user $local_admin_name, $local_admin_type, $delete_id!"); |
|---|
| 190 | 163 | $_SESSION['user_deleted'] = 1; |
|---|
| 191 | 164 | header("Location: manage_users.php"); |
|---|
| r1241 |
r1243 |
|
| 1 | 1 | <?php |
|---|
| 2 | 2 | /** |
|---|
| 3 | | * ispCP (OMEGA) - Virtual Hosting Control System | Omega Version |
|---|
| | 3 | * ispCP ω (OMEGA) a Virtual Hosting Control System |
|---|
| 4 | 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 ispCP Team (2007) |
|---|
| | 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 |
|---|
| 9 | 10 | * |
|---|
| 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 | | **/ |
|---|
| | 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 | */ |
|---|
| 19 | 20 | |
|---|
| 20 | 21 | require '../include/ispcp-lib.php'; |
|---|
| … | … | |
| 22 | 23 | check_login(__FILE__); |
|---|
| 23 | 24 | |
|---|
| 24 | | $theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| | 25 | if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { |
|---|
| | 26 | header('Location: index.php'); |
|---|
| | 27 | die(); |
|---|
| | 28 | } |
|---|
| | 29 | |
|---|
| 25 | 30 | |
|---|
| 26 | 31 | if(isset($_GET['hpid']) && is_numeric($_GET['hpid'])) |
|---|
| 27 | 32 | $hpid = $_GET['hpid']; |
|---|
| 28 | | else{ |
|---|
| | 33 | else { |
|---|
| 29 | 34 | $_SESSION['hp_deleted'] = '_no_'; |
|---|
| 30 | 35 | Header('Location: hp.php'); |
|---|
| … | … | |
| 32 | 37 | } |
|---|
| 33 | 38 | |
|---|
| | 39 | // Check if there is no order for this plan |
|---|
| | 40 | $res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); |
|---|
| | 41 | $data = $res->FetchRow(); |
|---|
| | 42 | if ($data['0'] > 0) { |
|---|
| | 43 | $_SESSION['hp_deleted_ordererror'] = '_yes_'; |
|---|
| | 44 | header("Location: hp.php"); |
|---|
| | 45 | die(); |
|---|
| | 46 | } |
|---|
| | 47 | |
|---|
| 34 | 48 | // Try to delete hosting plan from db |
|---|
| 35 | | // |
|---|
| 36 | | $query = 'delete from hosting_plans where id=?'; |
|---|
| | 49 | $query = 'delete from hosting_plans where id = ?'; |
|---|
| 37 | 50 | $res = exec_query($sql, $query, array($hpid)); |
|---|
| 38 | 51 | |
|---|
| 39 | 52 | $_SESSION['hp_deleted'] = '_yes_'; |
|---|
| 40 | 53 | |
|---|
| 41 | | Header('Location: hp.php'); |
|---|
| 42 | | |
|---|
| | 54 | header('Location: hp.php'); |
|---|
| 43 | 55 | die(); |
|---|
| 44 | 56 | |
|---|
| r1241 |
r1243 |
|
| 131 | 131 | $dstatus = translate_dmn_status($data['domain_status']); |
|---|
| 132 | 132 | } else { |
|---|
| 133 | | $dstatus = "<b><font size=3 color=red>" . $data['domain_status'] . "</font></b>"; |
|---|
| | 133 | $dstatus = "<b><font size=\"3\" color=red>" . $data['domain_status'] . "</font></b>"; |
|---|
| 134 | 134 | } |
|---|
| 135 | 135 | |
|---|
| r1241 |
r1243 |
|
| 4 | 4 | * |
|---|
| 5 | 5 | * @copyright 2001-2006 by moleSoftware GmbH |
|---|
| 6 | | * @copyright 2006-2007 by ispCP | http://isp-control.net |
|---|
| | 6 | * @copyright 2006-2008 by ispCP | http://isp-control.net |
|---|
| 7 | 7 | * @link http://isp-control.net |
|---|
| 8 | 8 | * @author ispCP Team (2007) |
|---|
| … | … | |
| 43 | 43 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 44 | 44 | 'ISP_LOGO' => get_logo($_SESSION['user_id']), |
|---|
| 45 | | |
|---|
| | 45 | |
|---|
| 46 | 46 | ) |
|---|
| 47 | 47 | ); |
|---|
| … | … | |
| 176 | 176 | $user_logged = $_SESSION['user_logged']; |
|---|
| 177 | 177 | |
|---|
| 178 | | write_log("$user_logged: change data/password for $edit_username!"); |
|---|
| | 178 | write_log("$user_logged: changes data/password of $edit_username!"); |
|---|
| 179 | 179 | |
|---|
| 180 | 180 | if (isset($_POST['send_data']) && !empty($_POST['pass'])) { |
|---|
| r1241 |
r1243 |
|
| 118 | 118 | SELECT |
|---|
| 119 | 119 | a.created_by |
|---|
| 120 | | FROM |
|---|
| | 120 | FROM |
|---|
| 121 | 121 | domain d, admin a |
|---|
| 122 | | WHERE |
|---|
| 123 | | d.domain_id = ? |
|---|
| | 122 | WHERE |
|---|
| | 123 | d.domain_id = ? |
|---|
| 124 | 124 | AND d.domain_admin_id = a.admin_id |
|---|
| 125 | 125 | SQL_QUERY; |
|---|
| … | … | |
| 347 | 347 | $ed_error .= tr('Incorrect disk quota limit!'); |
|---|
| 348 | 348 | } |
|---|
| 349 | | |
|---|
| | 349 | |
|---|
| 350 | 350 | // $user_props = generate_user_props($user_id); |
|---|
| 351 | 351 | // $reseller_props = generate_reseller_props($reseller_id); |
|---|
| … | … | |
| 486 | 486 | if ($data == -1) { |
|---|
| 487 | 487 | if ($u > 0) { |
|---|
| 488 | | $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on system!', $obj); |
|---|
| | 488 | $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on system!', $obj); |
|---|
| 489 | 489 | } else { |
|---|
| 490 | 490 | $umax = $data; |
|---|
| … | … | |
| 496 | 496 | } else if ($data > 0) { |
|---|
| 497 | 497 | if ($u > $data) { |
|---|
| 498 | | $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| | 498 | $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| 499 | 499 | } else { |
|---|
| 500 | 500 | $umax = $data; |
|---|
| … | … | |
| 506 | 506 | if ($data == -1) { |
|---|
| 507 | 507 | if ($u > 0) { |
|---|
| 508 | | $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); |
|---|
| | 508 | $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); |
|---|
| 509 | 509 | } else { |
|---|
| 510 | 510 | $r -= $umax; |
|---|
| … | … | |
| 518 | 518 | } else if ($data > 0) { |
|---|
| 519 | 519 | if ($u > $data) { |
|---|
| 520 | | $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| | 520 | $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| 521 | 521 | } else { |
|---|
| 522 | 522 | if ($umax > $data) { |
|---|
| … | … | |
| 535 | 535 | return; |
|---|
| 536 | 536 | } else if ($data == 0) { |
|---|
| 537 | | $err .= tr('The <em>%s</em> service can not be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); |
|---|
| | 537 | $err .= tr('The <em>%s</em> service cannot be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); |
|---|
| 538 | 538 | return; |
|---|
| 539 | 539 | } else if ($data > 0) { |
|---|
| 540 | 540 | if ($r + $data > $rmax) { |
|---|
| 541 | | $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); |
|---|
| | 541 | $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); |
|---|
| 542 | 542 | } else { |
|---|
| 543 | 543 | $r += $data; |
|---|
| … | … | |
| 560 | 560 | if ($data == -1) { |
|---|
| 561 | 561 | if ($u > 0) { |
|---|
| 562 | | $err .= tr('The <em>%s</em> service can not be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); |
|---|
| | 562 | $err .= tr('The <em>%s</em> service cannot be disabled! ', $obj) . tr('There are <em>%s</em> records on the system!', $obj); |
|---|
| 563 | 563 | } else { |
|---|
| 564 | 564 | $r -= $umax; |
|---|
| … | … | |
| 568 | 568 | return; |
|---|
| 569 | 569 | } else if ($data == 0) { |
|---|
| 570 | | $err .= tr('The <em>%s</em> service can not be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); |
|---|
| | 570 | $err .= tr('The <em>%s</em> service cannot be unlimited! ', $obj) . tr('There are reseller limits for the <em>%s</em> service!', $obj); |
|---|
| 571 | 571 | |
|---|
| 572 | 572 | return; |
|---|
| 573 | 573 | } else if ($data > 0) { |
|---|
| 574 | 574 | if ($u > $data) { |
|---|
| 575 | | $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| | 575 | $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('Specified number is smaller than <em>%s</em> records, present on the system!', $obj); |
|---|
| 576 | 576 | } else { |
|---|
| 577 | 577 | if ($umax > $data) { |
|---|
| … | … | |
| 582 | 582 | |
|---|
| 583 | 583 | if ($r + $data_inc > $rmax) { |
|---|
| 584 | | $err .= tr('The <em>%s</em> service can not be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); |
|---|
| | 584 | $err .= tr('The <em>%s</em> service cannot be limited! ', $obj) . tr('You are exceeding reseller limits for the <em>%s</em> service!', $obj); |
|---|
| 585 | 585 | return; |
|---|
| 586 | 586 | } |
|---|
| r1241 |
r1243 |
|
| 383 | 383 | } |
|---|
| 384 | 384 | |
|---|
| 385 | | function check_user_ip_data($reseller_id, $r_ips, $u_ips, &$err) |
|---|
| 386 | | { |
|---|
| | 385 | function check_user_ip_data($reseller_id, $r_ips, $u_ips, &$err) { |
|---|
| 387 | 386 | if ($r_ips == $u_ips) { |
|---|
| 388 | 387 | return; |
|---|
| … | … | |
| 600 | 599 | $user_logged = $_SESSION['user_logged']; |
|---|
| 601 | 600 | |
|---|
| 602 | | write_log("$user_logged: change data/password for reseller: $edit_username!"); |
|---|
| | 601 | write_log("$user_logged: changes data/password for reseller: $edit_username!"); |
|---|
| 603 | 602 | |
|---|
| 604 | 603 | if (isset($_POST['send_data']) && !empty($_POST['pass'])) { |
|---|
| … | … | |
| 830 | 829 | |
|---|
| 831 | 830 | $tpl->parse('PAGE', 'page'); |
|---|
| 832 | | |
|---|
| 833 | 831 | $tpl->prnt(); |
|---|
| 834 | 832 | |
|---|
| r1241 |
r1243 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| 25 | | if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { |
|---|
| | 25 | if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { |
|---|
| 26 | 26 | header('Location: index.php'); |
|---|
| 27 | 27 | die(); |
|---|
| r1241 |
r1243 |
|
| 88 | 88 | 'TR_SENDER_NAME' => tr('Senders name'), |
|---|
| 89 | 89 | 'TR_APPLY_CHANGES' => tr('Apply changes'), |
|---|
| | 90 | 'TR_USERTYPE' => tr('User type (admin, reseller, user)'), |
|---|
| | 91 | 'TR_BASE_SERVER_VHOST' => tr('URL to this admin panel'), |
|---|
| 90 | 92 | 'SUBJECT_VALUE' => $data['subject'], |
|---|
| 91 | 93 | 'MESSAGE_VALUE' => $data['message'], |
|---|
| r1241 |
r1243 |
|
| 24 | 24 | check_login(__FILE__); |
|---|
| 25 | 25 | |
|---|
| 26 | | if (Config::get('HOSTING_PLANS_LEVEL') != strtolower('admin')) { |
|---|
| | 26 | if (strtolower(Config::get('HOSTING_PLANS_LEVEL')) != 'admin') { |
|---|
| 27 | 27 | header('Location: index.php'); |
|---|
| 28 | | |
|---|
| 29 | 28 | die(); |
|---|
| 30 | 29 | } |
|---|
| … | … | |
| 33 | 32 | $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/hp.tpl'); |
|---|
| 34 | 33 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 35 | | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 36 | 34 | $tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| 37 | 35 | // Table with hosting plans |
|---|
| 38 | 36 | $tpl->define_dynamic('hp_table', 'page'); |
|---|
| 39 | 37 | $tpl->define_dynamic('hp_entry', 'hp_table'); |
|---|
| | 38 | $tpl->define_dynamic('hp_delete', 'page'); |
|---|
| | 39 | $tpl->define_dynamic('hp_menu_add', 'page'); |
|---|
| 40 | 40 | |
|---|
| 41 | 41 | $theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| 42 | 42 | |
|---|
| 43 | | $tpl->assign(array('TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Administrator/Hosting Plan Management'), |
|---|
| 44 | | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 45 | | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 46 | | 'ISP_LOGO' => get_logo($_SESSION['user_id']))); |
|---|
| | 43 | $tpl->assign(array( |
|---|
| | 44 | 'TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Administrator/Hosting Plan Management'), |
|---|
| | 45 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 46 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 47 | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| | 48 | )); |
|---|
| 47 | 49 | |
|---|
| 48 | 50 | /* |
|---|
| … | … | |
| 56 | 58 | gen_hp_table($tpl, $_SESSION['user_id']); |
|---|
| 57 | 59 | |
|---|
| 58 | | $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| 59 | | 'TR_PAGE_MENU' => tr('Manage hosting plans'), |
|---|
| 60 | | 'TR_PURCHASING' => tr('Purchasing'), |
|---|
| 61 | | 'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), |
|---|
| 62 | | 'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), |
|---|
| 63 | | 'TR_BACK' => tr('Back'), |
|---|
| 64 | | 'TR_TITLE_BACK' => tr('Return to previous menu'), |
|---|
| 65 | | 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete'))); |
|---|
| | 60 | $tpl->assign( |
|---|
| | 61 | array( |
|---|
| | 62 | 'TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| | 63 | 'TR_PAGE_MENU' => tr('Manage hosting plans'), |
|---|
| | 64 | 'TR_PURCHASING' => tr('Purchasing'), |
|---|
| | 65 | 'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), |
|---|
| | 66 | 'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), |
|---|
| | 67 | 'TR_BACK' => tr('Back'), |
|---|
| | 68 | 'TR_TITLE_BACK' => tr('Return to previous menu'), |
|---|
| | 69 | 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete') |
|---|
| | 70 | ) |
|---|
| | 71 | ); |
|---|
| 66 | 72 | |
|---|
| 67 | 73 | gen_hp_message(); |
|---|
| … | … | |
| 93 | 99 | if (isset($GLOBALS['hp_updated'])) |
|---|
| 94 | 100 | unset($GLOBALS['hp_updated']); |
|---|
| | 101 | } else if (isset($_SESSION["hp_deleted_ordererror"]) && $_SESSION["hp_deleted_ordererror"] == '_yes_') { |
|---|
| | 102 | //$external_event = '_on_'; |
|---|
| | 103 | set_page_message(tr('Hosting plan can\'t be deleted, there are orders!')); |
|---|
| | 104 | unset($_SESSION["hp_deleted_ordererror"]); |
|---|
| 95 | 105 | } |
|---|
| 96 | 106 | } // End of gen_hp_message() |
|---|
| … | … | |
| 126 | 136 | }*/ |
|---|
| 127 | 137 | |
|---|
| 128 | | $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| 129 | | 'TR_NOM' => tr('No.'), |
|---|
| 130 | | 'TR_EDIT' => $tr_edit, |
|---|
| 131 | | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| 132 | | 'TR_ACTION' => tr('Action'))); |
|---|
| | 138 | $tpl->assign( |
|---|
| | 139 | array( |
|---|
| | 140 | 'TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| | 141 | 'TR_NOM' => tr('No.'), |
|---|
| | 142 | 'TR_EDIT' => $tr_edit, |
|---|
| | 143 | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| | 144 | 'TR_ACTION' => tr('Action') |
|---|
| | 145 | ) |
|---|
| | 146 | ); |
|---|
| 133 | 147 | |
|---|
| 134 | 148 | $i = 1; |
|---|
| … | … | |
| 147 | 161 | } |
|---|
| 148 | 162 | |
|---|
| 149 | | $tpl->assign(array('PLAN_NOM' => $i++, |
|---|
| 150 | | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| 151 | | 'PLAN_ACTION' => tr('Delete'), |
|---|
| 152 | | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| 153 | | 'PURCHASING' => $status, |
|---|
| 154 | | 'HP_ID' => $data['id'], |
|---|
| 155 | | 'ADMIN_ID' => $_SESSION['user_id'])); |
|---|
| | 163 | $tpl->assign( |
|---|
| | 164 | array( |
|---|
| | 165 | 'PLAN_NOM' => $i++, |
|---|
| | 166 | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| | 167 | 'PLAN_ACTION' => tr('Delete'), |
|---|
| | 168 | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| | 169 | 'PURCHASING' => $status, |
|---|
| | 170 | 'HP_ID' => $data['id'], |
|---|
| | 171 | 'ADMIN_ID' => $_SESSION['user_id'] |
|---|
| | 172 | ) |
|---|
| | 173 | ); |
|---|
| 156 | 174 | $tpl->parse('HP_ENTRY', '.hp_entry'); |
|---|
| 157 | 175 | } // End loop |
|---|
| … | … | |
| 159 | 177 | } |
|---|
| 160 | 178 | } // End of gen_hp_table() |
|---|
| 161 | | // ****************************** |
|---|
| 162 | | // END OF FUNCTION DECLARE PATH |
|---|
| 163 | | // ***************************** |
|---|
| | 179 | |
|---|
| 164 | 180 | if (Config::get('DUMP_GUI_DEBUG')) dump_gui_debug(); |
|---|
| 165 | 181 | |
|---|
| r1241 |
r1243 |
|
| 70 | 70 | |
|---|
| 71 | 71 | function get_update_infos(&$tpl) { |
|---|
| | 72 | |
|---|
| | 73 | // Check if there is no order for this plan |
|---|
| | 74 | $res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); |
|---|
| | 75 | $data = $res->FetchRow(); |
|---|
| | 76 | if ($data['0'] > 0) { |
|---|
| | 77 | $_SESSION['hp_deleted_ordererror'] = '_yes_'; |
|---|
| | 78 | header("Location: hp.php"); |
|---|
| | 79 | die(); |
|---|
| | 80 | } |
|---|
| | 81 | |
|---|
| 72 | 82 | $last_update = "http://www.isp-control.net/latest.txt"; |
|---|
| 73 | 83 | // Fake the browser type |
|---|
| r1241 |
r1243 |
|
| 126 | 126 | $user_logged = $_SESSION['user_logged']; |
|---|
| 127 | 127 | |
|---|
| 128 | | write_log("$user_logged: add new IP4 address: $ip_number!"); |
|---|
| | 128 | write_log("$user_logged: adds new IPv4 address: $ip_number!"); |
|---|
| 129 | 129 | |
|---|
| 130 | 130 | $sucess = true; |
|---|
| r1241 |
r1243 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| | 25 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| | 26 | |
|---|
| | 27 | $tpl = new pTemplate(); |
|---|
| | 28 | $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl'); |
|---|
| | 29 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| | 30 | $tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| | 31 | $tpl->define_dynamic('update_message', 'page'); |
|---|
| | 32 | $tpl->define_dynamic('update_infos', 'page'); |
|---|
| | 33 | |
|---|
| | 34 | $tpl->assign( |
|---|
| | 35 | array( |
|---|
| | 36 | 'TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'), |
|---|
| | 37 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 38 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 39 | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| | 40 | ) |
|---|
| | 41 | ); |
|---|
| | 42 | |
|---|
| 25 | 43 | /* BEGIN common functions */ |
|---|
| 26 | 44 | function get_update_infos(&$tpl) { |
|---|
| | 45 | |
|---|
| | 46 | // Check if there is no order for this plan |
|---|
| | 47 | $res = exec_query($sql, "SELECT COUNT(id) FROM `orders` WHERE `plan_id`=? AND `status`='new'", array($hpid)); |
|---|
| | 48 | $data = $res->FetchRow(); |
|---|
| | 49 | if ($data['0'] > 0) { |
|---|
| | 50 | $_SESSION['hp_deleted_ordererror'] = '_yes_'; |
|---|
| | 51 | header("Location: hp.php"); |
|---|
| | 52 | die(); |
|---|
| | 53 | } |
|---|
| | 54 | |
|---|
| 27 | 55 | $info_url = 'http://www.isp-control.net/download.html'; |
|---|
| 28 | 56 | $last_update = 'http://www.isp-control.net/latest.txt'; |
|---|
| … | … | |
| 47 | 75 | if ($current_version < $last_update_result) { |
|---|
| 48 | 76 | $tpl->assign( |
|---|
| 49 | | array('UPDATE_MESSAGE' => '', |
|---|
| | 77 | array( |
|---|
| | 78 | 'UPDATE_MESSAGE' => '', |
|---|
| 50 | 79 | 'UPDATE' => tr('New ispCP update is now available'), |
|---|
| 51 | 80 | 'INFOS' => tr('Get it at') . " <a href=\"" . $info_url . "\" class=\"link\" target=\"ispcp\">" . $info_url . "</a>" |
|---|
| … | … | |
| 60 | 89 | /* END system functions */ |
|---|
| 61 | 90 | |
|---|
| 62 | | $tpl = new pTemplate(); |
|---|
| 63 | | $tpl->define_dynamic('page', Config::get('ADMIN_TEMPLATE_PATH') . '/ispcp_updates.tpl'); |
|---|
| 64 | | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 65 | | $tpl->define_dynamic('hosting_plans', 'page'); |
|---|
| 66 | | $tpl->define_dynamic('update_message', 'page'); |
|---|
| 67 | | $tpl->define_dynamic('update_infos', 'page'); |
|---|
| 68 | | |
|---|
| 69 | | $theme_color = Config::get('USER_INITIAL_THEME'); |
|---|
| 70 | | |
|---|
| 71 | | $tpl->assign( |
|---|
| 72 | | array('TR_ADMIN_ISPCP_UPDATES_PAGE_TITLE' => tr('ispCP - Virtual Hosting Control System'), |
|---|
|