Changeset 1152
- Timestamp:
- 05/15/08 12:46:49
(2 months ago)
- Author:
- kilburn
- Message:
* Fixed #1254: Admin level hosting plans option is not working
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1151 |
r1152 |
|
| 1 | 1 | ispCP ω 1.0.0 Changelog |
|---|
| 2 | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| | 3 | |
|---|
| | 4 | 2008-05-15 Marc Pujol |
|---|
| | 5 | - GUI |
|---|
| | 6 | * Fixed #1254: Admin level hosting plans are not working |
|---|
| 3 | 7 | |
|---|
| 4 | 8 | 2008-05-13 Benedikt Heintel |
|---|
| r1014 |
r1152 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| 25 | | if ($cfg['HOSTING_PLANS_LEVEL'] != strtolower('admin')) { |
|---|
| | 25 | if (strtolower($cfg['HOSTING_PLANS_LEVEL']) != 'admin') { |
|---|
| 26 | 26 | header("Location: index.php"); |
|---|
| 27 | 27 | die(); |
|---|
| … | … | |
| 31 | 31 | $tpl->define_dynamic('page', $cfg['ADMIN_TEMPLATE_PATH'] . '/ahp.tpl'); |
|---|
| 32 | 32 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 33 | | global $cfg; |
|---|
| | 33 | |
|---|
| 34 | 34 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 35 | 35 | |
|---|
| … | … | |
| 123 | 123 | $tpl->assign('MESSAGE', ''); |
|---|
| 124 | 124 | } // End of gen_empty_hp_page() |
|---|
| | 125 | |
|---|
| 125 | 126 | // Show last entered data for new hp |
|---|
| 126 | 127 | function gen_data_ahp_page(&$tpl) { |
|---|
| … | … | |
| 189 | 190 | $price = 0; |
|---|
| 190 | 191 | } else { |
|---|
| 191 | | $price = $_POST['hp_price']; |
|---|
| | 192 | $price = clean_input($_POST['hp_price']); |
|---|
| 192 | 193 | } |
|---|
| 193 | 194 | if (empty($_POST['hp_setupfee'])) { |
|---|
| 194 | 195 | $setup_fee = 0; |
|---|
| 195 | 196 | } else { |
|---|
| 196 | | $setup_fee = $_POST['hp_setupfee']; |
|---|
| | 197 | $setup_fee = clean_input($_POST['hp_setupfee']); |
|---|
| 197 | 198 | } |
|---|
| 198 | 199 | |
|---|
| … | … | |
| 207 | 208 | $hp_cgi = $_POST['cgi'];; |
|---|
| 208 | 209 | |
|---|
| 209 | | if (empty($hp_name)) { |
|---|
| | 210 | if ($hp_name == '') { |
|---|
| 210 | 211 | $ahp_error = tr('Incorrect template name length!'); |
|---|
| 211 | 212 | } |
|---|
| 212 | 213 | |
|---|
| 213 | | if (empty($description)) { |
|---|
| | 214 | if ($description == '') { |
|---|
| 214 | 215 | $ahp_error = tr('Incorrect template description length!'); |
|---|
| 215 | 216 | } |
|---|
| 216 | 217 | if (!is_numeric($price)) { |
|---|
| 217 | | $ahp_error = tr('Incorrect price syntax!'); |
|---|
| | 218 | $ahp_error = tr('Price must be a number!'); |
|---|
| 218 | 219 | } |
|---|
| 219 | 220 | |
|---|
| 220 | 221 | if (!is_numeric($setup_fee)) { |
|---|
| 221 | | $ahp_error = tr('Incorrect setup fee syntax!'); |
|---|
| | 222 | $ahp_error = tr('Setup fee must be a number!'); |
|---|
| 222 | 223 | } |
|---|
| 223 | 224 | |
|---|
| r1148 |
r1152 |
|
| 22 | 22 | check_login(__FILE__); |
|---|
| 23 | 23 | |
|---|
| 24 | | global $cfg; |
|---|
| | 24 | if (strtolower($cfg['HOSTING_PLANS_LEVEL']) != 'admin') { |
|---|
| | 25 | header('Location: index.php'); |
|---|
| | 26 | die(); |
|---|
| | 27 | } |
|---|
| | 28 | |
|---|
| 25 | 29 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 26 | 30 | |
|---|
| 27 | 31 | if(isset($_GET['hpid']) && is_numeric($_GET['hpid'])) |
|---|
| 28 | 32 | $hpid = $_GET['hpid']; |
|---|
| 29 | | else{ |
|---|
| | 33 | else { |
|---|
| 30 | 34 | $_SESSION['hp_deleted'] = '_no_'; |
|---|
| 31 | 35 | Header("Location: hp.php"); |
|---|
| … | … | |
| 33 | 37 | } |
|---|
| 34 | 38 | |
|---|
| | 39 | // Check if there is no order for this plan |
|---|
| | 40 | $res = exec_query($sql, "SELECT COUNT(id) FROM orders WHERE plan_id=?", 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 | |
|---|
| 35 | 48 | // Try to delete hosting plan from db |
|---|
| 36 | | // |
|---|
| 37 | 49 | $query = "delete from hosting_plans where id=?"; |
|---|
| 38 | 50 | $res = exec_query($sql, $query, array($hpid)); |
|---|
| r1014 |
r1152 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| 25 | | if ($cfg['HOSTING_PLANS_LEVEL'] != strtolower('admin')) { |
|---|
| | 25 | if (strtolower($cfg['HOSTING_PLANS_LEVEL']) != 'admin') { |
|---|
| 26 | 26 | header("Location: index.php"); |
|---|
| 27 | 27 | die(); |
|---|
| … | … | |
| 32 | 32 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 33 | 33 | |
|---|
| 34 | | global $cfg; |
|---|
| 35 | 34 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 36 | 35 | |
|---|
| … | … | |
| 72 | 71 | 'TR_NO' => tr('no'), |
|---|
| 73 | 72 | 'TR_BILLING_PROPS' => tr('Billing Settings'), |
|---|
| 74 | | 'TR_PRICE_STYLE' => tr('Price Style'), |
|---|
| 75 | 73 | 'TR_PRICE' => tr('Price'), |
|---|
| 76 | 74 | 'TR_SETUP_FEE' => tr('Setup fee'), |
|---|
| … | … | |
| 79 | 77 | 'TR_STATUS' => tr('Available for purchasing'), |
|---|
| 80 | 78 | 'TR_TEMPLATE_DESCRIPTON' => tr('Description'), |
|---|
| 81 | | 'TR_EXAMPEL' => tr('(e.g. EUR)'), |
|---|
| | 79 | 'TR_EXAMPLE' => tr('(e.g. EUR)'), |
|---|
| 82 | 80 | 'TR_UPDATE_PLAN' => tr('Update plan'))); |
|---|
| 83 | 81 | |
|---|
| r1014 |
r1152 |
|
| 24 | 24 | check_login(__FILE__); |
|---|
| 25 | 25 | |
|---|
| 26 | | if ($cfg['HOSTING_PLANS_LEVEL'] != strtolower('admin')) { |
|---|
| 27 | | header("Location: index.php"); |
|---|
| 28 | | |
|---|
| | 26 | if (strtolower($cfg['HOSTING_PLANS_LEVEL']) != 'admin') { |
|---|
| | 27 | header('Location: index.php'); |
|---|
| 29 | 28 | die(); |
|---|
| 30 | 29 | } |
|---|
| … | … | |
| 33 | 32 | $tpl->define_dynamic('page', $cfg['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'); |
|---|
| | 35 | |
|---|
| 37 | 36 | // Table with hosting plans |
|---|
| 38 | 37 | $tpl->define_dynamic('hp_table', 'page'); |
|---|
| 39 | 38 | $tpl->define_dynamic('hp_entry', 'hp_table'); |
|---|
| | 39 | $tpl->define_dynamic('hp_delete', 'page'); |
|---|
| | 40 | $tpl->define_dynamic('hp_menu_add', 'page'); |
|---|
| 40 | 41 | |
|---|
| 41 | | global $cfg; |
|---|
| 42 | 42 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 43 | 43 | |
|---|
| 44 | | $tpl->assign(array('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']))); |
|---|
| | 44 | $tpl->assign(array( |
|---|
| | 45 | 'TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Administrator/Hosting Plan Management'), |
|---|
| | 46 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 47 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 48 | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| | 49 | )); |
|---|
| 48 | 50 | |
|---|
| 49 | 51 | /* |
|---|
| … | … | |
| 57 | 59 | gen_hp_table($tpl, $_SESSION['user_id']); |
|---|
| 58 | 60 | |
|---|
| 59 | | $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| 60 | | 'TR_PAGE_MENU' => tr('Manage hosting plans'), |
|---|
| 61 | | 'TR_PURCHASING' => tr('Purchasing'), |
|---|
| 62 | | 'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), |
|---|
| 63 | | 'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), |
|---|
| 64 | | 'TR_BACK' => tr('Back'), |
|---|
| 65 | | 'TR_TITLE_BACK' => tr('Return to previous menu'), |
|---|
| 66 | | 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete'))); |
|---|
| | 61 | |
|---|
| | 62 | $tpl->assign(array( |
|---|
| | 63 | 'TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| | 64 | 'TR_PAGE_MENU' => tr('Manage hosting plans'), |
|---|
| | 65 | 'TR_PURCHASING' => tr('Purchasing'), |
|---|
| | 66 | 'TR_ADD_HOSTING_PLAN' => tr('Add hosting plan'), |
|---|
| | 67 | 'TR_TITLE_ADD_HOSTING_PLAN' => tr('Add new user hosting plan'), |
|---|
| | 68 | 'TR_BACK' => tr('Back'), |
|---|
| | 69 | 'TR_TITLE_BACK' => tr('Return to previous menu'), |
|---|
| | 70 | 'TR_MESSAGE_DELETE' => tr('Are you sure you want to delete') |
|---|
| | 71 | )); |
|---|
| 67 | 72 | |
|---|
| 68 | 73 | gen_hp_message(); |
|---|
| 69 | 74 | gen_page_message($tpl); |
|---|
| | 75 | |
|---|
| 70 | 76 | $tpl->parse('PAGE', 'page'); |
|---|
| 71 | 77 | $tpl->prnt(); |
|---|
| … | … | |
| 75 | 81 | function gen_hp_message () { |
|---|
| 76 | 82 | // global $externel_event, $hp_added, $hp_deleted, $hp_updated; |
|---|
| 77 | | // global $external_event; |
|---|
| | 83 | global $external_event; |
|---|
| | 84 | |
|---|
| 78 | 85 | if (isset($_SESSION["hp_added"]) && $_SESSION["hp_added"] == '_yes_') { |
|---|
| 79 | | // $external_event = '_on_'; |
|---|
| | 86 | $external_event = '_on_'; |
|---|
| 80 | 87 | set_page_message(tr('Hosting plan added!')); |
|---|
| 81 | 88 | unset($_SESSION["hp_added"]); |
|---|
| … | … | |
| 83 | 90 | unset($GLOBALS['hp_added']); |
|---|
| 84 | 91 | } else if (isset($_SESSION["hp_deleted"]) && $_SESSION["hp_deleted"] == '_yes_') { |
|---|
| 85 | | // $external_event = '_on_'; |
|---|
| | 92 | $external_event = '_on_'; |
|---|
| 86 | 93 | set_page_message(tr('Hosting plan deleted!')); |
|---|
| 87 | 94 | unset($_SESSION["hp_deleted"]); |
|---|
| … | … | |
| 89 | 96 | unset($GLOBALS['hp_deleted']); |
|---|
| 90 | 97 | } else if (isset($_SESSION["hp_updated"]) && $_SESSION["hp_updated"] == '_yes_') { |
|---|
| 91 | | // $external_event = '_on_'; |
|---|
| | 98 | $external_event = '_on_'; |
|---|
| 92 | 99 | set_page_message(tr('Hosting plan updated!')); |
|---|
| 93 | 100 | unset($_SESSION["hp_updated"]); |
|---|
| 94 | 101 | if (isset($GLOBALS['hp_updated'])) |
|---|
| 95 | 102 | unset($GLOBALS['hp_updated']); |
|---|
| | 103 | } else if (isset($_SESSION["hp_deleted_ordererror"]) && $_SESSION["hp_deleted_ordererror"] == '_yes_') { |
|---|
| | 104 | //$external_event = '_on_'; |
|---|
| | 105 | set_page_message(tr('Hosting plan can\'t be deleted, there are orders!')); |
|---|
| | 106 | unset($_SESSION["hp_deleted_ordererror"]); |
|---|
| 96 | 107 | } |
|---|
| 97 | 108 | } // End of gen_hp_message() |
|---|
| | 109 | |
|---|
| 98 | 110 | // Extract and show data for hosting plans |
|---|
| 99 | 111 | function gen_hp_table(&$tpl, $reseller_id) { |
|---|
| … | … | |
| 101 | 113 | |
|---|
| 102 | 114 | $query = <<<SQL_QUERY |
|---|
| 103 | | SELECT |
|---|
| 104 | | t1.id, t1.reseller_id, t1.name, t1.props, t1.status, |
|---|
| | 115 | SELECT |
|---|
| | 116 | t1.id, t1.reseller_id, t1.name, t1.props, t1.status, |
|---|
| 105 | 117 | t2.admin_id, t2.admin_type |
|---|
| 106 | | FROM |
|---|
| 107 | | hosting_plans AS t1, |
|---|
| | 118 | FROM |
|---|
| | 119 | hosting_plans AS t1, |
|---|
| 108 | 120 | admin AS t2 |
|---|
| 109 | | WHERE |
|---|
| 110 | | t2.admin_type = ? |
|---|
| | 121 | WHERE |
|---|
| | 122 | t2.admin_type = ? |
|---|
| 111 | 123 | AND |
|---|
| 112 | 124 | t1.reseller_id = t2.admin_id |
|---|
| 113 | | ORDER BY |
|---|
| 114 | | t1.name |
|---|
| | 125 | ORDER BY |
|---|
| | 126 | t1.name |
|---|
| 115 | 127 | SQL_QUERY; |
|---|
| | 128 | |
|---|
| 116 | 129 | $rs = exec_query($sql, $query, array('admin')); |
|---|
| 117 | 130 | $tr_edit = tr('Edit'); |
|---|
| … | … | |
| 123 | 136 | $tpl->assign('HP_TABLE', ''); |
|---|
| 124 | 137 | } else { // There are data for hosting plants :-) |
|---|
| 125 | | /*if ($GLOBALS['external_event'] == '_off_') { |
|---|
| | 138 | if (isset($external_event) && $external_event == '_off_') { |
|---|
| 126 | 139 | $tpl -> assign('HP_MESSAGE', ''); |
|---|
| 127 | | }*/ |
|---|
| | 140 | } |
|---|
| 128 | 141 | |
|---|
| 129 | | $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| 130 | | 'TR_NOM' => tr('No.'), |
|---|
| 131 | | 'TR_EDIT' => $tr_edit, |
|---|
| 132 | | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| 133 | | 'TR_ACTION' => tr('Action'))); |
|---|
| | 142 | $tpl->assign(array( |
|---|
| | 143 | 'TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| | 144 | 'TR_NOM' => tr('No.'), |
|---|
| | 145 | 'TR_EDIT' => $tr_edit, |
|---|
| | 146 | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| | 147 | 'TR_ACTION' => tr('Action') |
|---|
| | 148 | )); |
|---|
| 134 | 149 | |
|---|
| 135 | 150 | $i = 1; |
|---|
| … | … | |
| 148 | 163 | } |
|---|
| 149 | 164 | |
|---|
| 150 | | $tpl->assign(array('PLAN_NOM' => $i++, |
|---|
| 151 | | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| 152 | | 'PLAN_ACTION' => tr('Delete'), |
|---|
| 153 | | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| 154 | | 'PURCHASING' => $status, |
|---|
| 155 | | 'HP_ID' => $data['id'], |
|---|
| 156 | | 'ADMIN_ID' => $_SESSION['user_id'])); |
|---|
| | 165 | $tpl->assign(array( |
|---|
| | 166 | 'PLAN_NOM' => $i++, |
|---|
| | 167 | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| | 168 | 'PLAN_ACTION' => tr('Delete'), |
|---|
| | 169 | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| | 170 | 'PURCHASING' => $status, |
|---|
| | 171 | 'HP_ID' => $data['id'], |
|---|
| | 172 | 'ADMIN_ID' => $_SESSION['user_id'] |
|---|
| | 173 | )); |
|---|
| 157 | 174 | $tpl->parse('HP_ENTRY', '.hp_entry'); |
|---|
| | 175 | |
|---|
| 158 | 176 | } // End loop |
|---|
| | 177 | |
|---|
| 159 | 178 | $tpl->parse('HP_TABLE', 'hp_table'); |
|---|
| 160 | 179 | } |
|---|
| 161 | 180 | } // End of gen_hp_table() |
|---|
| | 181 | |
|---|
| 162 | 182 | // ****************************** |
|---|
| 163 | 183 | // END OF FUNCTION DECLARE PATH |
|---|
| r1014 |
r1152 |
|
| 106 | 106 | gen_admin_menu($tpl, $cfg['ADMIN_TEMPLATE_PATH'] . '/menu_manage_users.tpl'); |
|---|
| 107 | 107 | |
|---|
| | 108 | if (!isset($cfg['HOSTING_PLANS_LEVEL']) || strtolower($cfg['HOSTING_PLANS_LEVEL']) !== 'admin') { |
|---|
| | 109 | $tpl->assign('EDIT_OPTION', ''); |
|---|
| | 110 | } |
|---|
| | 111 | |
|---|
| 108 | 112 | get_admin_manage_users($tpl, $sql); |
|---|
| 109 | 113 | |
|---|
| r1144 |
r1152 |
|
| 723 | 723 | 'URL_CHANGE_INTERFACE' => "change_user_interface.php?to_id=" . $rs->fields['domain_admin_id'], |
|---|
| 724 | 724 | 'USR_USERNAME' => $rs->fields['domain_name'], |
|---|
| | 725 | 'TR_EDIT_DOMAIN' => tr('Edit domain'), |
|---|
| | 726 | 'TR_EDIT_USR' => tr('Edit user'), |
|---|
| 725 | 727 | ) |
|---|
| 726 | 728 | ); |
|---|
| r1147 |
r1152 |
|
| 195 | 195 | if (!$cfg['ISPCP_SUPPORT_SYSTEM']) { |
|---|
| 196 | 196 | $tpl->assign('ISACTIVE_SUPPORT', ''); |
|---|
| | 197 | } |
|---|
| | 198 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL']) === 'admin') { |
|---|
| | 199 | $tpl->assign('HP_MENU_ADD', ''); |
|---|
| 197 | 200 | } |
|---|
| 198 | 201 | |
|---|
| r1144 |
r1152 |
|
| 23 | 23 | check_login(__FILE__); |
|---|
| 24 | 24 | |
|---|
| 25 | | if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] == strtolower('admin')) { |
|---|
| | 25 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL']) == 'admin') { |
|---|
| 26 | 26 | Header("Location: hp.php"); |
|---|
| 27 | | |
|---|
| 28 | 27 | die(); |
|---|
| 29 | 28 | } |
|---|
| … | … | |
| 302 | 301 | |
|---|
| 303 | 302 | $_SESSION['hp_added'] = '_yes_'; |
|---|
| 304 | | header("Location: ehp.php"); |
|---|
| | 303 | header("Location: hp.php"); |
|---|
| 305 | 304 | die(); |
|---|
| 306 | 305 | } |
|---|
| r1144 |
r1152 |
|
| 77 | 77 | 'TR_STATUS' => tr('Available for purchasing'), |
|---|
| 78 | 78 | 'TR_TEMPLATE_DESCRIPTON' => tr('Description'), |
|---|
| 79 | | 'TR_EXAMPEL' => tr('(e.g. EUR)'), |
|---|
| | 79 | 'TR_EXAMPLE' => tr('(e.g. EUR)'), |
|---|
| 80 | 80 | 'TR_EDIT_HOSTING_PLAN' => tr('Update plan'), |
|---|
| 81 | 81 | 'TR_UPDATE_PLAN' => tr('Update plan') |
|---|
| r1014 |
r1152 |
|
| 12 | 12 | * This program is free software; you can redistribute it and/or modify it under |
|---|
| 13 | 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 |
|---|
| | 14 | * Foundation; either version 2.1 of the License, or (at your option) any later |
|---|
| 15 | 15 | * version. |
|---|
| 16 | 16 | * You should have received a copy of the MPL Mozilla Public License along with |
|---|
| … | … | |
| 28 | 28 | $tpl->define_dynamic('page_message', 'page'); |
|---|
| 29 | 29 | $tpl->define_dynamic('logged_from', 'page'); |
|---|
| | 30 | |
|---|
| 30 | 31 | // Table with hosting plans |
|---|
| 31 | 32 | $tpl->define_dynamic('hp_table', 'page'); |
|---|
| … | … | |
| 36 | 37 | $theme_color = $cfg['USER_INITIAL_THEME']; |
|---|
| 37 | 38 | |
|---|
| 38 | | $tpl->assign( |
|---|
| 39 | | array( |
|---|
| 40 | | 'TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Reseller/Main Index'), |
|---|
| 41 | | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 42 | | 'THEME_CHARSET' => tr('encoding'), |
|---|
| 43 | | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| 44 | | ) |
|---|
| 45 | | ); |
|---|
| | 39 | $tpl->assign(array( |
|---|
| | 40 | 'TR_RESELLER_MAIN_INDEX_PAGE_TITLE' => tr('ispCP - Reseller/Main Index'), |
|---|
| | 41 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| | 42 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| | 43 | 'ISP_LOGO' => get_logo($_SESSION['user_id']) |
|---|
| | 44 | )); |
|---|
| 46 | 45 | |
|---|
| 47 | 46 | /* |
|---|
| … | … | |
| 53 | 52 | gen_reseller_mainmenu($tpl, $cfg['RESELLER_TEMPLATE_PATH'] . '/main_menu_hp.tpl'); |
|---|
| 54 | 53 | gen_reseller_menu($tpl, $cfg['RESELLER_TEMPLATE_PATH'] . '/menu_hp.tpl'); |
|---|
| 55 | | |
|---|
| 56 | 54 | gen_logged_from($tpl); |
|---|
| 57 | | |
|---|
| 58 | 55 | gen_hp_table($tpl, $_SESSION['user_id']); |
|---|
| 59 | 56 | |
|---|
| 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 | | ); |
|---|
| | 57 | $tpl->assign(array( |
|---|
| | 58 | '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') |
|---|
| | 66 | )); |
|---|
| 72 | 67 | |
|---|
| 73 | 68 | gen_hp_message($tpl); |
|---|
| … | … | |
| 77 | 72 | $tpl->prnt(); |
|---|
| 78 | 73 | |
|---|
| 79 | | // BEGIN FUNCTION DECLARE PATH |
|---|
| | 74 | // BEGIN FUNCTION DECLARE PAT |
|---|
| 80 | 75 | |
|---|
| 81 | 76 | function gen_hp_message (&$tpl) { |
|---|
| … | … | |
| 101 | 96 | if (isset($GLOBALS['hp_updated'])) |
|---|
| 102 | 97 | unset($GLOBALS['hp_updated']); |
|---|
| 103 | | } |
|---|
| 104 | | else if (isset($_SESSION["hp_deleted_ordererror"]) && $_SESSION["hp_deleted_ordererror"] == '_yes_') { |
|---|
| | 98 | } else if (isset($_SESSION["hp_deleted_ordererror"]) && $_SESSION["hp_deleted_ordererror"] == '_yes_') { |
|---|
| 105 | 99 | //$external_event = '_on_'; |
|---|
| 106 | 100 | set_page_message(tr('Hosting plan can\'t be deleted, there are orders!')); |
|---|
| … | … | |
| 113 | 107 | global $sql, $cfg, $external_event; |
|---|
| 114 | 108 | |
|---|
| 115 | | if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin') { |
|---|
| | 109 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL']) === 'admin') { |
|---|
| 116 | 110 | $query = <<<SQL_QUERY |
|---|
| 117 | 111 | SELECT |
|---|
| … | … | |
| 159 | 153 | } |
|---|
| 160 | 154 | |
|---|
| 161 | | $tpl->assign(array('TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| 162 | | 'TR_NOM' => tr('No.'), |
|---|
| 163 | | 'TR_EDIT' => $tr_edit, |
|---|
| 164 | | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| 165 | | 'TR_ACTION' => tr('Action'))); |
|---|
| | 155 | $tpl->assign(array( |
|---|
| | 156 | 'TR_HOSTING_PLANS' => tr('Hosting plans'), |
|---|
| | 157 | 'TR_NOM' => tr('No.'), |
|---|
| | 158 | 'TR_EDIT' => $tr_edit, |
|---|
| | 159 | 'TR_PLAN_NAME' => tr('Name'), |
|---|
| | 160 | 'TR_ACTION' => tr('Action') |
|---|
| | 161 | )); |
|---|
| 166 | 162 | |
|---|
| 167 | 163 | $i = 1; |
|---|
| … | … | |
| 180 | 176 | } |
|---|
| 181 | 177 | |
|---|
| 182 | | $tpl->assign(array('PLAN_NOM' => $i++, |
|---|
| 183 | | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| 184 | | 'PLAN_ACTION' => tr('Delete'), |
|---|
| 185 | | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| 186 | | 'PURCHASING' => $status, |
|---|
| 187 | | 'HP_ID' => $data['id'], |
|---|
| 188 | | 'RESELLER_ID' => $_SESSION['user_id'])); |
|---|
| | 178 | $tpl->assign(array( |
|---|
| | 179 | 'PLAN_NOM' => $i++, |
|---|
| | 180 | 'PLAN_NAME' => stripslashes($data['name']), |
|---|
| | 181 | 'PLAN_ACTION' => tr('Delete'), |
|---|
| | 182 | 'PLAN_SHOW' => tr('Show hosting plan'), |
|---|
| | 183 | 'PURCHASING' => $status, |
|---|
| | 184 | 'HP_ID' => $data['id'], |
|---|
| | 185 | 'RESELLER_ID' => $_SESSION['user_id'] |
|---|
| | 186 | )); |
|---|
| 189 | 187 | $tpl->parse('HP_ENTRY', '.hp_entry'); |
|---|
| | 188 | |
|---|
| 190 | 189 | } // End loop |
|---|
| | 190 | |
|---|
| 191 | 191 | $tpl->parse('HP_TABLE', 'hp_table'); |
|---|
| 192 | 192 | } |
|---|
| … | … | |
| 196 | 196 | // END OF FUNCTION DECLARE PATH |
|---|
| 197 | 197 | // ***************************** |
|---|
| 198 | | if ($cfg['DUMP_GUI_DEBUG']) |
|---|
| 199 | | dump_gui_debug(); |
|---|
| | 198 | if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); |
|---|
| 200 | 199 | |
|---|
| 201 | 200 | unset_messages(); |
|---|
| r1014 |
r1152 |
|
| 115 | 115 | } |
|---|
| 116 | 116 | // we have plans only for admins |
|---|
| 117 | | if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin') { |
|---|
| | 117 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL']) === 'admin') { |
|---|
| 118 | 118 | $dmn_pt = '_no_'; |
|---|
| 119 | 119 | } |
|---|
| r1020 |
r1152 |
|
| 214 | 214 | unset($_SESSION["ch_hpprops"]); |
|---|
| 215 | 215 | } else { |
|---|
| 216 | | $query = "select props from hosting_plans where reseller_id = ? and id = ?"; |
|---|
| 217 | | $res = exec_query($sql, $query, array($reseller_id, $hpid)); |
|---|
| | 216 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL'] == 'admin')) { |
|---|
| | 217 | $query = 'select props from hosting_plans where id = ?'; |
|---|
| | 218 | $res = exec_query($sql, $query, array($hpid)); |
|---|
| | 219 | } else { |
|---|
| | 220 | $query = "select props from hosting_plans where reseller_id = ? and id = ?"; |
|---|
| | 221 | $res = exec_query($sql, $query, array($reseller_id, $hpid)); |
|---|
| | 222 | } |
|---|
| 218 | 223 | $data = $res->FetchRow(); |
|---|
| 219 | 224 | $props = $data['props']; |
|---|
| r1014 |
r1152 |
|
| 122 | 122 | ); |
|---|
| 123 | 123 | |
|---|
| 124 | | if (isset($cfg['HOSTING_PLANS_LEVEL']) && $cfg['HOSTING_PLANS_LEVEL'] === 'admin') { |
|---|
| | 124 | if (isset($cfg['HOSTING_PLANS_LEVEL']) && strtolower($cfg['HOSTING_PLANS_LEVEL']) === 'admin') { |
|---|
| 125 | 125 | $tpl->assign('EDIT_OPTION', ''); |
|---|
| 126 | 126 | } |
|---|
| r1076 |
r1152 |
|
| 35 | 35 | </tr> |
|---|
| 36 | 36 | <tr> |
|---|
| 37 | | <td style="width: 195px; vertical-align: top;">{SUB_MENU}</td> |
|---|
| | 37 | <td style="width: 195px; vertical-align: top;">{MENU}</td> |
|---|
| 38 | 38 | <td colspan=2 style="vertical-align: top;"><table style="width: 100%; border-collapse: collapse;padding:0;margin:0;"> |
|---|
| 39 | 39 | <tr height="95";> |
|---|
| r1076 |
r1152 |
|
| 28 | 28 | </tr> |
|---|
| 29 | 29 | <tr> |
|---|
| 30 | | <td style="width: 195px; vertical-align: top;">{SUB_MENU}</td> |
|---|
| | 30 | <td style="width: 195px; vertical-align: top;">{MENU}</td> |
|---|
| 31 | 31 | <td colspan=2 style="vertical-align: top;"><table style="width: 100%; border-collapse: collapse;padding:0;margin:0;"> |
|---|
| 32 | 32 | <tr height="95";> |
|---|
| … | … | |
| 149 | 149 | <tr> |
|---|
| 150 | 150 | <td> </td> |
|---|
| 151 | | <td class="content2">{TR_CURRENCY}</td> |
|---|
| | 151 | <td class="content2">{TR_VALUE}</td> |
|---|
| 152 | 152 | <td class="content"><input name="hp_currency" {READONLY} type="text" class="textinput" id="hp_currency" style="width:100px" value="{HP_CURRENCY}"> |
|---|
| 153 | | <small>{TR_EXAMPEL}</small></td> |
|---|
| | 153 | <small>{TR_EXAMPLE}</small></td> |
|---|
| 154 | 154 | </tr> |
|---|
| 155 | 155 | <tr> |
|---|
| r1076 |
r1152 |
|
| 28 | 28 | </tr> |
|---|
| 29 | 29 | <tr> |
|---|
| 30 | | <td style="width: 195px; vertical-align: top;">{SUB_MENU}</td> |
|---|
| | 30 | <td style="width: 195px; vertical-align: top;">{MENU}</td> |
|---|
| 31 | 31 | <td colspan=2 style="vertical-align: top;"><table style="width: 100%; border-collapse: collapse;padding:0;margin:0;"> |
|---|
| 32 | 32 | <tr height="95";> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r811 |
r1152 |
|
| 15 | 15 | <td class="menu"><div align="center"><a href="manage_users.php" class="menu_active" onMouseOver="MM_swapImage('manage_users','','{THEME_COLOR_PATH}/images/icons/manage_users_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_MANAGE_USERS}</a></div></td> |
|---|
| 16 | 16 | </tr> |
|---|
| | 17 | <!-- BDP: hosting_plans --> |
|---|
| | 18 | </table></td> |
|---|
| | 19 | <td width="30"> </td> |
|---|
| | 20 | <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|---|
| | 21 | <tr> |
|---|
| | 22 | <td class="menu"><div align="center"><a href="hp.php" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()"><img src="{THEME_COLOR_PATH}/images/icons/hosting_plans.gif" name="hosting_plans" width="47" height="46" border="0" id="hosting_plans" /></a></div></td> |
|---|
| | 23 | </tr><tr> |
|---|
| | 24 | <td class="menu"><div align="center"><a href="hp.php" class="menu_active" onMouseOver="MM_swapImage('hosting_plans','','{THEME_COLOR_PATH}/images/icons/hosting_plans_a.gif',1)" onMouseOut="MM_swapImgRestore()">{TR_MENU_HOSTING_PLANS}</a></div></td> |
|---|
| | 25 | </tr> |
|---|
| | 26 | <!-- EDP: hosting_plans --> |
|---|
| 17 | 27 | </table></td> |
|---|
| 18 | 28 | <td width="30"> </td> |
|---|
| r1076 |
r1152 |
|
| 222 | 222 | <td width="100" align="center" class="content3"><b>{TR_CREATED_ON}</b></td> |
|---|
| 223 | 223 | <td width="100" align="center" class="content3"><b>{TR_USR_CREATED_BY}</b></td> |
|---|
| 224 | | <td colspan="4" align="center" class="content3"><b>{TR_USR_OPTIONS}</b></td> |
|---|
| | 224 | &nbs |
|---|
|