Changeset 1173
- Timestamp:
- 05/27/08 11:06:53
(6 months ago)
- Author:
- rats
- Message:
* Fixed #1291: reseller/ahp.php complains about already sent header
* Fixed #1293: in client/protect_it.php template variable {USER_SELECTED} is not set
* Fixed #1294: id has to be unique in the whole html file, but in the list in admin/settings_ports.php|.tpl are several unique id's
* Fixed #1299: there is a typo in the whole ispcp, cannot is wrongly written separated, but it is used to write it together
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r1171 |
r1173 |
|
| 2 | 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|---|
| 3 | 3 | |
|---|
| | 4 | 2008-05-27 Benedikt Heintel |
|---|
| | 5 | - GUI: |
|---|
| | 6 | * Fixed #1291: reseller/ahp.php complains about already sent header |
|---|
| | 7 | * Fixed #1293: in client/protect_it.php template variable {USER_SELECTED} is not set |
|---|
| | 8 | * Fixed #1294: id has to be unique in the whole html file, but in the list in admin/settings_ports.php|.tpl are several unique id's |
|---|
| | 9 | * Fixed #1299: there is a typo in the whole ispcp, cannot is wrongly written separated, but it is used to write it together |
|---|
| | 10 | * Fixed #1300: some html fixes; replaced <font> with external CSS class or span; webmail/pma theme css fixes - Part 7 |
|---|
| | 11 | |
|---|
| 4 | 12 | 2008-05-26 Jochen Manz |
|---|
| 5 | 13 | - GUI: |
|---|
| … | … | |
| 15 | 23 | * Fixed #1284: Some HTML, JS fixes, removed ugly/useless whitespace removed useles height="*" - Part 4 |
|---|
| 16 | 24 | * Fixed #1275: TR_PHP_YES, TR_PHP_NO, TR_CGI_YES, TR_CGI_NO and TR_STATUS_YES aren't replaced correctly |
|---|
| 17 | | |
|---|
| | 25 | |
|---|
| 18 | 26 | 2008-05-23 Jochen Manz |
|---|
| 19 | 27 | - GUI: |
|---|
| … | … | |
| 26 | 34 | 2008-05-22 Benedikt Heintel |
|---|
| 27 | 35 | - GUI: |
|---|
| 28 | | * Fixed #1275: Some HTML and CSS fixes in the HTML templates and some PHP files - Part 2 |
|---|
| | 36 | * Fixed #1275: Some HTML and CSS fixes in the HTML templates and some PHP files - Part 2 |
|---|
| 29 | 37 | * Fixed #1273: some HTML fixes in the HTML templates - Part 1 |
|---|
| 30 | 38 | * Fixed #1274: remove Disallow /ispcp/ from robots.txt |
|---|
| r1035 |
r1173 |
|
| 439 | 439 | |
|---|
| 440 | 440 | if ($res != 1) { |
|---|
| 441 | | push_el(\@main::el, 'setfmode()', "ERROR: Can not change permissions of file '$fname' !"); |
|---|
| | 441 | push_el(\@main::el, 'setfmode()', "ERROR: cannot change permissions of file '$fname' !"); |
|---|
| 442 | 442 | return -1; |
|---|
| 443 | 443 | } |
|---|
| … | … | |
| 446 | 446 | |
|---|
| 447 | 447 | if ($res != 1) { |
|---|
| 448 | | push_el(\@main::el, 'setfmode()', "ERROR: Can not change user/group of file '$fname' !"); |
|---|
| | 448 | push_el(\@main::el, 'setfmode()', "ERROR: cannot change user/group of file '$fname' !"); |
|---|
| 449 | 449 | return -1; |
|---|
| 450 | 450 | |
|---|
| r1160 |
r1173 |
|
| 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 | } |
|---|
| r1163 |
r1173 |
|
| 829 | 829 | |
|---|
| 830 | 830 | $tpl->parse('PAGE', 'page'); |
|---|
| 831 | | |
|---|
| 832 | 831 | $tpl->prnt(); |
|---|
| 833 | 832 | |
|---|
| 834 | | if ($cfg['DUMP_GUI_DEBUG']) dump_gui_debug(); |
|---|
| | 833 | if ($cfg['DUMP_GUI_DEBUG']) |
|---|
| | 834 | dump_gui_debug(); |
|---|
| 835 | 835 | |
|---|
| 836 | 836 | unset_messages(); |
|---|
| r1014 |
r1173 |
|
| 369 | 369 | $err .= tr('<b>%1$s</b> has unlimited rights for a <b>%2$s</b> Service !<br>', $uname, $obj); |
|---|
| 370 | 370 | |
|---|
| 371 | | $err .= tr('You can not move <b>%1$s</b> in a destination reseller,<br>which has limits for the <b>%2$s</b> service!', $uname, $obj); |
|---|
| | 371 | $err .= tr('You cannot move <b>%1$s</b> in a destination reseller,<br>which has limits for the <b>%2$s</b> service!', $uname, $obj); |
|---|
| 372 | 372 | |
|---|
| 373 | 373 | return; |
|---|
| … | … | |
| 435 | 435 | $err = ''; |
|---|
| 436 | 436 | } |
|---|
| 437 | | $err .= tr('<b>%s</b> has IP address that can not be managed from the destination reseller !<br>This user can not be moved!', $domain_name); |
|---|
| | 437 | $err .= tr('<b>%s</b> has IP address that cannot be managed from the destination reseller !<br>This user cannot be moved!', $domain_name); |
|---|
| 438 | 438 | |
|---|
| 439 | 439 | return false; |
|---|
| r1122 |
r1173 |
|
| 118 | 118 | $tpl->assign('LOSTPASSWORD_SELECTED_OFF', 'selected="selected"'); |
|---|
| 119 | 119 | } |
|---|
| 120 | | if ($cfg['PASSWD_CHARS']) { |
|---|
| 121 | | $tpl->assign('{PASSWD_STRONG_ON}', 'selected="selected"'); |
|---|
| 122 | | $tpl->assign('{PASSWD_STRONG_OFF}', ''); |
|---|
| 123 | | } else { |
|---|
| 124 | | $tpl->assign('{PASSWD_STRONG_ON}', ''); |
|---|
| 125 | | $tpl->assign('{PASSWD_STRONG_OFF}', 'selected="selected"'); |
|---|
| | 120 | |
|---|
| | 121 | if ($cfg['PASSWD_STRONG']) { |
|---|
| | 122 | $tpl->assign('PASSWD_STRONG_ON', 'selected="selected"'); |
|---|
| | 123 | $tpl->assign('PASSWD_STRONG_OFF', ''); |
|---|
| | 124 | } else { |
|---|
| | 125 | $tpl->assign('PASSWD_STRONG_ON', ''); |
|---|
| | 126 | $tpl->assign('PASSWD_STRONG_OFF', 'selected="selected"'); |
|---|
| 126 | 127 | } |
|---|
| 127 | 128 | |
|---|
| r1014 |
r1173 |
|
| 32 | 32 | |
|---|
| 33 | 33 | $tpl->assign( |
|---|
| 34 | | array('TR_ADMIN_SETTINGS_PAGE_TITLE' => tr('ispCP - Admin/Settings'), |
|---|
| | 34 | array( |
|---|
| | 35 | 'TR_ADMIN_SETTINGS_PAGE_TITLE' => tr('ispCP - Admin/Settings'), |
|---|
| 35 | 36 | 'THEME_COLOR_PATH' => "../themes/$theme_color", |
|---|
| 36 | 37 | 'THEME_CHARSET' => tr('encoding'), |
|---|
| … | … | |
| 196 | 197 | $tpl->assign(array('SERVICE' => $name . "<input name=\"name[]\" type=\"hidden\" id=\"name\" value=\"" . $name . "\" />")); |
|---|
| 197 | 198 | $tpl->assign( |
|---|
| 198 | | array('PORT_READONLY' => 'readonly', |
|---|
| | 199 | array( |
|---|
| | 200 | 'PORT_READONLY' => 'readonly', |
|---|
| 199 | 201 | 'PROTOCOL_READONLY' => 'disabled', |
|---|
| 200 | 202 | 'TR_DELETE' => '-', |
|---|
| 201 | | 'PORT_DELETE_LINK' => '' |
|---|
| | 203 | 'PORT_DELETE_LINK' => '', |
|---|
| | 204 | 'NUM' => $row |
|---|
| 202 | 205 | ) |
|---|
| 203 | 206 | ); |
|---|
| … | … | |
| 206 | 209 | $tpl->assign(array('SERVICE' => "<input name=\"name[]\" type=\"text\" id=\"name\" value=\"" . $name . "\" class=\"textinput\" maxlength=\"25\" />")); |
|---|
| 207 | 210 | $tpl->assign( |
|---|
| 208 | | array('PORT_READONLY' => '', |
|---|
| | 211 | array( |
|---|
| | 212 | 'PORT_READONLY' => '', |
|---|
| 209 | 213 | 'PROTOCOL_READONLY' => '', |
|---|
| 210 | 214 | 'TR_DELETE' => tr('Delete'), |
|---|
| 211 | 215 | 'URL_DELETE' => 'settings_ports.php?delete=' . $rs->fields['name'], |
|---|
| 212 | | 'PORT_DELETE_SHOW' => '' |
|---|
| | 216 | 'PORT_DELETE_SHOW' => '', |
|---|
| | 217 | 'NUM' => $row |
|---|
| 213 | 218 | ) |
|---|
| 214 | 219 | ); |
|---|
| … | … | |
| 217 | 222 | |
|---|
| 218 | 223 | $tpl->assign( |
|---|
| 219 | | array('CUSTOM' => $custom, |
|---|
| | 224 | array( |
|---|
| | 225 | 'CUSTOM' => $custom, |
|---|
| 220 | 226 | 'VAR_NAME' => $rs->fields['name'], |
|---|
| 221 | 227 | 'PORT' => $port, |
|---|
| … | … | |
| 252 | 258 | |
|---|
| 253 | 259 | $tpl->assign( |
|---|
| 254 | | array('TR_ACTION' => tr('Action'), |
|---|
| | 260 | array( |
|---|
| | 261 | 'TR_ACTION' => tr('Action'), |
|---|
| 255 | 262 | 'TR_UDP' => tr('udp'), |
|---|
| 256 | 263 | 'TR_TCP' => tr('tcp'), |
|---|
| … | … | |
| 274 | 281 | |
|---|
| 275 | 282 | $tpl->parse('PAGE', 'page'); |
|---|
| 276 | | |
|---|
| 277 | 283 | $tpl->prnt(); |
|---|
| 278 | 284 | |
|---|
| r1157 |
r1173 |
|
| 451 | 451 | |
|---|
| 452 | 452 | if ($_POST['dmn_type'] === 'sub' && $_POST['sub_id'] === 'n/a') { |
|---|
| 453 | | set_page_message(tr('Subdomain list is empty! You can not add FTP accounts there!')); |
|---|
| | 453 | set_page_message(tr('Subdomain list is empty! You cannot add FTP accounts there!')); |
|---|
| 454 | 454 | return; |
|---|
| 455 | 455 | } |
|---|
| 456 | 456 | |
|---|
| 457 | 457 | if ($_POST['dmn_type'] === 'als' && $_POST['als_id'] === 'n/a') { |
|---|
| 458 | | set_page_message(tr('Alias list is empty! You can not add FTP accounts there!')); |
|---|
| | 458 | set_page_message(tr('Alias list is empty! You cannot add FTP accounts there!')); |
|---|
| 459 | 459 | return; |
|---|
| 460 | 460 | } |
|---|
| r1157 |
r1173 |
|
| 406 | 406 | |
|---|
| 407 | 407 | if ($_POST['dmn_type'] === 'sub' && !isset($_POST['sub_id'])) { |
|---|
| 408 | | set_page_message(tr('Subdomain list is empty! You can not add mail accounts!')); |
|---|
| | 408 | set_page_message(tr('Subdomain list is empty! You cannot add mail accounts!')); |
|---|
| 409 | 409 | return; |
|---|
| 410 | 410 | } |
|---|
| 411 | 411 | |
|---|
| 412 | 412 | if ($_POST['dmn_type'] === 'als' && !isset($_POST['als_id'])) { |
|---|
| 413 | | set_page_message(tr('Alias list is empty! You can not add mail accounts!')); |
|---|
| | 413 | set_page_message(tr('Alias list is empty! You cannot add mail accounts!')); |
|---|
| 414 | 414 | return; |
|---|
| 415 | 415 | } |
|---|
| r1014 |
r1173 |
|
| 44 | 44 | $list = $vfs->ls($path); |
|---|
| 45 | 45 | if (!$list) { |
|---|
| 46 | | set_page_message(tr('Can not open directory !<br>Please contact your administrator !')); |
|---|
| | 46 | set_page_message(tr('cannot open directory !<br>Please contact your administrator !')); |
|---|
| 47 | 47 | return; |
|---|
| 48 | 48 | } |
|---|
| r1161 |
r1173 |
|
| 92 | 92 | $user_id .= $users[$i]; |
|---|
| 93 | 93 | if ($user_id == '-1' || $user_id == '') { |
|---|
| 94 | | set_page_message(tr('You can not protect area without selected user(s)')); |
|---|
| | 94 | set_page_message(tr('You cannot protect area without selected user(s)')); |
|---|
| 95 | 95 | return; |
|---|
| 96 | 96 | } |
|---|
| … | … | |
| 105 | 105 | $group_id .= $groups[$i]; |
|---|
| 106 | 106 | if ($group_id == '-1' || $group_id == '') { |
|---|
| 107 | | set_page_message(tr('You can not protect area without selected group(s)')); |
|---|
| | 107 | set_page_message(tr('You cannot protect area without selected group(s)')); |
|---|
| 108 | 108 | return; |
|---|
| 109 | 109 | } |
|---|
| … | … | |
| 117 | 117 | $alt_path = $path . "/"; |
|---|
| 118 | 118 | $query = <<<SQL_QUERY |
|---|
| 119 | | select |
|---|
| | 119 | SELECT |
|---|
| 120 | 120 | id |
|---|
| 121 | | from |
|---|
| | 121 | FROM |
|---|
| 122 | 122 | htaccess |
|---|
| 123 | | where |
|---|
| | 123 | WHERE |
|---|
| 124 | 124 | dmn_id = ? |
|---|
| 125 | | and |
|---|
| | 125 | AND |
|---|
| 126 | 126 | (path = ? |
|---|
| 127 | | or |
|---|
| | 127 | OR |
|---|
| 128 | 128 | path = ?) |
|---|
| 129 | 129 | SQL_QUERY; |
|---|
| … | … | |
| 136 | 136 | $update_id = $rs->fields['id']; |
|---|
| 137 | 137 | $query = <<<SQL_QUERY |
|---|
| 138 | | update htaccess |
|---|
| 139 | | set |
|---|
| | 138 | UPDATE |
|---|
| | 139 | htaccess |
|---|
| | 140 | SET |
|---|
| 140 | 141 | user_id = ?, |
|---|
| 141 | 142 | group_id = ?, |
|---|
| … | … | |
| 143 | 144 | path = ?, |
|---|
| 144 | 145 | status = ? |
|---|
| 145 | | where |
|---|
| | 146 | WHERE |
|---|
| 146 | 147 | id = '$update_id' |
|---|
| 147 | 148 | SQL_QUERY; |
|---|
| … | … | |
| 153 | 154 | } else { |
|---|
| 154 | 155 | $query = <<<SQL_QUERY |
|---|
| 155 | | insert into htaccess |
|---|
| | 156 | INSERT INTO |
|---|
| | 157 | htaccess |
|---|
| 156 | 158 | (dmn_id, user_id, group_id, auth_type, auth_name, path, status) |
|---|
| 157 | | values |
|---|
| | 159 | VALUES |
|---|
| 158 | 160 | (?, ?, ?, ?, ?, ?, ?) |
|---|
| 159 | 161 | SQL_QUERY; |
|---|
| … | … | |
| 177 | 179 | $group_id = 0; |
|---|
| 178 | 180 | $tpl->assign( |
|---|
| 179 | | array('PATH' => '', |
|---|
| | 181 | array( |
|---|
| | 182 | 'PATH' => '', |
|---|
| 180 | 183 | 'AREA_NAME' => '', |
|---|
| 181 | 184 | 'UNPROTECT_IT' => '', |
|---|
| … | … | |
| 190 | 193 | |
|---|
| 191 | 194 | $query = <<<SQL_QUERY |
|---|
| 192 | | select |
|---|
| | 195 | SELECT |
|---|
| 193 | 196 | * |
|---|
| 194 | | from |
|---|
| | 197 | FROM |
|---|
| 195 | 198 | htaccess |
|---|
| 196 | | where |
|---|
| | 199 | WHERE |
|---|
| 197 | 200 | dmn_id = ? |
|---|
| 198 | | and |
|---|
| | 201 | AND |
|---|
| 199 | 202 | id = ? |
|---|
| 200 | 203 | SQL_QUERY; |
|---|
| … | … | |
| 220 | 223 | |
|---|
| 221 | 224 | $tpl->assign( |
|---|
| 222 | | array('PATH' => $path, |
|---|
| | 225 | array( |
|---|
| | 226 | 'PATH' => $path, |
|---|
| 223 | 227 | 'AREA_NAME' => $auth_name, |
|---|
| 224 | 228 | ) |
|---|
| … | … | |
| 260 | 264 | |
|---|
| 261 | 265 | $query = <<<SQL_QUERY |
|---|
| 262 | | select |
|---|
| | 266 | SELECT |
|---|
| 263 | 267 | * |
|---|
| 264 | | from |
|---|
| | 268 | FROM |
|---|
| 265 | 269 | htaccess_users |
|---|
| 266 | | where |
|---|
| | 270 | WHERE |
|---|
| 267 | 271 | dmn_id = ? |
|---|
| 268 | | |
|---|
| 269 | 272 | SQL_QUERY; |
|---|
| 270 | 273 | |
|---|
| … | … | |
| 273 | 276 | if ($rs->RecordCount() == 0) { |
|---|
| 274 | 277 | $tpl->assign( |
|---|
| 275 | | array('USER_VALUE' => "-1", |
|---|
| 276 | | 'USER_LEBEL' => tr('You have no users !') |
|---|
| | 278 | array( |
|---|
| | 279 | 'USER_VALUE' => "-1", |
|---|
| | 280 | 'USER_LABEL' => tr('You have no users !'), |
|---|
| | 281 | 'USER_SELECTED' => '' |
|---|
| 277 | 282 | ) |
|---|
| 278 | 283 | ); |
|---|
| … | … | |
| 293 | 298 | array( |
|---|
| 294 | 299 | 'USER_VALUE' => $rs->fields['id'], |
|---|
| 295 | | 'USER_LEBEL' => $rs->fields['uname'], |
|---|
| | 300 | 'USER_LABEL' => $rs->fields['uname'], |
|---|
| 296 | 301 | 'USER_SELECTED' => $usr_selected, |
|---|
| 297 | 302 | ) |
|---|
| … | … | |
| 305 | 310 | |
|---|
| 306 | 311 | $query = <<<SQL_QUERY |
|---|
| 307 | | select |
|---|
| | 312 | SELECT |
|---|
| 308 | 313 | * |
|---|
| 309 | | from |
|---|
| | 314 | FROM |
|---|
| 310 | 315 | htaccess_groups |
|---|
| 311 | | where |
|---|
| | 316 | WHERE |
|---|
| 312 | 317 | dmn_id = ? |
|---|
| 313 | | |
|---|
| 314 | 318 | SQL_QUERY; |
|---|
| 315 | 319 | |
|---|
| … | … | |
| 320 | 324 | array( |
|---|
| 321 | 325 | 'GROUP_VALUE' => "-1", |
|---|
| 322 | | 'GROUP_LEBEL' => tr('You have no groups!') |
|---|
| | 326 | 'GROUP_LABEL' => tr('You have no groups!'), |
|---|
| | 327 | 'GROUP_SELECTED' => '' |
|---|
| 323 | 328 | ) |
|---|
| 324 | 329 | ); |
|---|
| … | … | |
| 339 | 344 | array( |
|---|
| 340 | 345 | 'GROUP_VALUE' => $rs->fields['id'], |
|---|
| 341 | | 'GROUP_LEBEL' => $rs->fields['ugroup'], |
|---|
| | 346 | 'GROUP_LABEL' => $rs->fields['ugroup'], |
|---|
| 342 | 347 | 'GROUP_SELECTED' => $grp_selected, |
|---|
| 343 | 348 | ) |
|---|
| r1152 |
r1173 |
|
| 951 | 951 | |
|---|
| 952 | 952 | if ($sub_max != -1) { |
|---|
| 953 | | if ($sub_max == 0) $rsub_uf = '_on_'; |
|---|
| | 953 | if ($sub_max == 0) |
|---|
| | 954 | $rsub_uf = '_on_'; |
|---|
| 954 | 955 | |
|---|
| 955 | 956 | $rsub_current += $sub_current; |
|---|
| … | … | |
| 958 | 959 | |
|---|
| 959 | 960 | if ($als_max != -1) { |
|---|
| 960 | | if ($als_max == 0) $rals_uf = '_on_'; |
|---|
| | 961 | if ($als_max == 0) |
|---|
| | 962 | $rals_uf = '_on_'; |
|---|
| 961 | 963 | |
|---|
| 962 | 964 | $rals_current += $als_current; |
|---|
| … | … | |
| 964 | 966 | } |
|---|
| 965 | 967 | |
|---|
| 966 | | if ($mail_max == 0) $rmail_uf = '_on_'; |
|---|
| | 968 | if ($mail_max == 0) |
|---|
| | 969 | $rmail_uf = '_on_'; |
|---|
| 967 | 970 | |
|---|
| 968 | 971 | $rmail_current += $mail_current; |
|---|
| 969 | 972 | $rmail_max += $mail_max; |
|---|
| 970 | 973 | |
|---|
| 971 | | if ($ftp_max == 0) $rftp_uf = '_on_'; |
|---|
| | 974 | if ($ftp_max == 0) |
|---|
| | 975 | $rftp_uf = '_on_'; |
|---|
| 972 | 976 | |
|---|
| 973 | 977 | $rftp_current += $ftp_current; |
|---|
| … | … | |
| 975 | 979 | |
|---|
| 976 | 980 | if ($sql_db_max != -1) { |
|---|
| 977 | | if ($sql_db_max == 0) $rsql_db_uf = '_on_'; |
|---|
| | 981 | if ($sql_db_max == 0) |
|---|
| | 982 | $rsql_db_uf = '_on_'; |
|---|
| 978 | 983 | |
|---|
| 979 | 984 | $rsql_db_current += $sql_db_current; |
|---|
| … | … | |
| 982 | 987 | |
|---|
| 983 | 988 | if ($sql_user_max != -1) { |
|---|
| 984 | | if ($sql_user_max == 0) $rsql_user_uf = '_on_'; |
|---|
| | 989 | if ($sql_user_max == 0) |
|---|
| | 990 | $rsql_user_uf = '_on_'; |
|---|
| 985 | 991 | |
|---|
| 986 | 992 | $rsql_user_current += $sql_user_current; |
|---|
| … | … | |
| 988 | 994 | } |
|---|
| 989 | 995 | |
|---|
| 990 | | if ($traff_max == 0) $rtraff_uf = '_on_'; |
|---|
| | 996 | if ($traff_max == 0) |
|---|
| | 997 | $rtraff_uf = '_on_'; |
|---|
| 991 | 998 | |
|---|
| 992 | 999 | $rtraff_current += $traff_current; |
|---|
| 993 | 1000 | $rtraff_max += $traff_max; |
|---|
| 994 | 1001 | |
|---|
| 995 | | if ($disk_max == 0) $rdisk_uf = '_on_'; |
|---|
| | 1002 | if ($disk_max == 0) |
|---|
| | 1003 | $rdisk_uf = '_on_'; |
|---|
| 996 | 1004 | |
|---|
| 997 | 1005 | $rdisk_current += $disk_current; |
|---|
| … | … | |
| 1040 | 1048 | $als_current = records_count('alias_id', 'domain_aliasses', 'domain_id', $user_id); |
|---|
| 1041 | 1049 | $als_max = $rs->fields['domain_alias_limit']; |
|---|
| 1042 | | // Sorry 4 the strange Hack, but it works - RatS |
|---|
| | 1050 | // Sorry for the strange Hack, but it works - RatS |
|---|
| 1043 | 1051 | $mail_current = records_count('mail_id', 'mail_users', 'mail_type NOT RLIKE \'_catchall\' AND domain_id', $user_id); |
|---|
| 1044 | 1052 | $mail_max = $rs->fields['domain_mailacc_limit']; |
|---|
| 1045 | 1053 | |
|---|
| 1046 | | $ftp_current = sub_records_rlike_count('domain_name', 'domain', 'domain_id', $user_id, |
|---|
| 1047 | | 'userid', 'ftp_users', 'userid', '@', '' |
|---|
| 1048 | | ); |
|---|
| | 1054 | $ftp_current = sub_records_rlike_count( 'domain_name', 'domain', 'domain_id', $user_id, |
|---|
| | 1055 | 'userid', 'ftp_users', 'userid', '@', ''); |
|---|
| 1049 | 1056 | |
|---|
| 1050 | 1057 | $ftp_current += sub_records_rlike_count('subdomain_name', 'subdomain', 'domain_id', $user_id, |
|---|
| 1051 | | 'userid', 'ftp_users', 'userid', '@', '' |
|---|
| 1052 | | ); |
|---|
| | 1058 | 'userid', 'ftp_users', 'userid', '@', ''); |
|---|
| 1053 | 1059 | |
|---|
| 1054 | 1060 | $ftp_current += sub_records_rlike_count('alias_name', 'domain_aliasses', 'domain_id', $user_id, |
|---|
| 1055 | | 'userid', 'ftp_users', 'userid', '@', '' |
|---|
| 1056 | | ); |
|---|
| | 1061 | 'userid', 'ftp_users', 'userid', '@', ''); |
|---|
| 1057 | 1062 | |
|---|
| 1058 | 1063 | $ftp_max = $rs->fields['domain_ftpacc_limit']; |
|---|
| … | … | |
| 1061 | 1066 | $sql_db_max = $rs->fields['domain_sqld_limit']; |
|---|
| 1062 | 1067 | |
|---|
| 1063 | | $sql_user_current = sub_records_count('sqld_id', 'sql_database', 'domain_id', $user_id, |
|---|
| 1064 | | 'sqlu_id', 'sql_user', 'sqld_id', '', '' |
|---|
| 1065 | | ); |
|---|
| | 1068 | $sql_user_current = sub_records_count( 'sqld_id', 'sql_database', 'domain_id', $user_id, |
|---|
| | 1069 | 'sqlu_id', 'sql_user', 'sqld_id', '', ''); |
|---|
| 1066 | 1070 | |
|---|
| 1067 | 1071 | $sql_user_max = $rs->fields['domain_sqlu_limit']; |
|---|
| … | … | |
| 1071 | 1075 | $disk_max = $rs->fields['domain_disk_limit']; |
|---|
| 1072 | 1076 | |
|---|
| 1073 | | return array($sub_current, $sub_max, |
|---|
| 1074 | | $als_current, $als_max, |
|---|
| 1075 | | $mail_current, $mail_max, |
|---|
| 1076 | | $ftp_current, $ftp_max, |
|---|
| 1077 | | $sql_db_current, $sql_db_max, |
|---|
| 1078 | | $sql_user_current, $sql_user_max, |
|---|
| 1079 | | $traff_max, |
|---|
| 1080 | | $disk_max); |
|---|
| | 1077 | return array( |
|---|
| | 1078 | $sub_current, $sub_max, $als_current, $als_max, |
|---|
| | 1079 | $mail_current, $mail_max, $ftp_current, $ftp_max, |
|---|
| | 1080 | $sql_db_current, $sql_db_max, $sql_user_current, |
|---|
| | 1081 | $sql_user_max, $traff_max, $disk_max); |
|---|
| 1081 | 1082 | } |
|---|
| 1082 | 1083 | |
|---|
| … | … | |
| 2228 | 2229 | function gen_purchase_haf(&$tpl, &$sql, $user_id, $encode = false) { |
|---|
| 2229 | 2230 | global $cfg; |
|---|
| 2230 | | |
|---|
| | 2231 | |
|---|
| 2231 | 2232 | $query = <<<SQL_QUERY |
|---|
| 2232 | 2233 | SELECT |
|---|
| r1171 |
r1173 |
|
| 831 | 831 | // drop desired database; |
|---|
| 832 | 832 | $query = <<<SQL_QUERY |
|---|
| 833 | | DROP DATABASE |
|---|
| 834 | | SQL_QUERY; |
|---|
| 835 | | |
|---|
| 836 | | $query .= $db_name; |
|---|
| 837 | | |
|---|
| 838 | | $rs = exec_query($sql, $query, array()); |
|---|
| | 833 | DROP DATABASE ?; |
|---|
| | 834 | SQL_QUERY; |
|---|
| | 835 | |
|---|
| | 836 | $rs = exec_query($sql, $query, array($db_name)); |
|---|
| 839 | 837 | |
|---|
| 840 | 838 | write_log($_SESSION['user_logged'] . ": delete SQL database: " . $db_name); |
|---|
| r1073 |
r1173 |
|
| 77 | 77 | // the following variables are overriden via admin cp |
|---|
| 78 | 78 | $cfg['DOMAIN_ROWS_PER_PAGE'] = 10; |
|---|
| 79 | | // 'admin' => hosting plans are available only in admin level, reseller can not make custom changes |
|---|
| | 79 | // 'admin' => hosting plans are available only in admin level, reseller cannot make custom changes |
|---|
| 80 | 80 | // 'reseller' => hosting plans are available only in reseller level |
|---|
| 81 | 81 | $cfg['HOSTING_PLANS_LEVEL'] = 'reseller'; |
|---|
| r1157 |
r1173 |
|
| 59 | 59 | |
|---|
| 60 | 60 | if (!is_userdomain_ok($uname)) { |
|---|
| 61 | | write_log($uname." Domain status is not OK - user can not login"); |
|---|
| | 61 | write_log($uname." Domain status is not OK - user cannot login"); |
|---|
| 62 | 62 | system_message(tr("%s's account status is not ok!", $uname)); |
|---|
| 63 | 63 | return false; |
|---|
| r1152 |
r1173 |
|
| 1314 | 1314 | if ($dmn_max != 0) { |
|---|
| 1315 | 1315 | if ($dmn_current + 1 > $dmn_max) { |
|---|
| 1316 | | set_page_message(tr('You have reached your domains limit.<br>You can not add more domains!')); |
|---|
| | 1316 | set_page_message(tr('You have reached your domains limit.<br>You cannot add more domains!')); |
|---|
| 1317 | 1317 | $error = true; |
|---|
| 1318 | 1318 | } |
|---|
| … | … | |
| 1322 | 1322 | if ($sub_new != -1) { |
|---|
| 1323 | 1323 | if ($sub_new == 0) { |
|---|
| 1324 | | set_page_message(tr('You have a subdomains limit!<br>You can not add an user with unlimited subdomains!')); |
|---|
| | 1324 | set_page_message(tr('You have a subdomains limit!<br>You cannot add an user with unlimited subdomains!')); |
|---|
| 1325 | 1325 | $error = true; |
|---|
| 1326 | 1326 | } else if ($sub_current + $sub_new > $sub_max) { |
|---|
| … | … | |
| 1334 | 1334 | if ($als_new != -1) { |
|---|
| 1335 | 1335 | if ($als_new == 0) { |
|---|
| 1336 | | set_page_message(tr('You have an aliases limit!<br>You can not add an user with unlimited aliases!')); |
|---|
| | 1336 | set_page_message(tr('You have an aliases limit!<br>You cannot add an user with unlimited aliases!')); |
|---|
| 1337 | 1337 | $error = true; |
|---|
| 1338 | 1338 | } else if ($als_current + $als_new > $als_max) { |
|---|
| … | … | |
| 1345 | 1345 | if ($mail_max != 0) { |
|---|
| 1346 | 1346 | if ($mail_new == 0) { |
|---|
| 1347 | | set_page_message(tr('You have a mail accounts limit!<br>You can not add an user with unlimited mail accounts!')); |
|---|
| | 1347 | set_page_message(tr('You have a mail accounts limit!<br>You cannot add an user with unlimited mail accounts!')); |
|---|
| 1348 | 1348 | $error = true; |
|---|
| 1349 | 1349 | } else if ($mail_current + $mail_new > $mail_max) { |
|---|
| … | … | |
| 1354 | 1354 | if ($ftp_max != 0) { |
|---|
| 1355 | 1355 | if ($ftp_new == 0) { |
|---|
| 1356 | | set_page_message(tr('You have a FTP accounts limit!<br>You can not add an user with unlimited FTP accounts!')); |
|---|
| | 1356 | set_page_message(tr('You have a FTP accounts limit!<br>You cannot add an user with unlimited FTP accounts!')); |
|---|
| 1357 | 1357 | $error = true; |
|---|
| 1358 | 1358 | } else if ($ftp_current + $ftp_new > $ftp_max) { |
|---|
| … | … | |
| 1365 | 1365 | if ($sql_db_new != -1) { |
|---|
| 1366 | 1366 | if ($sql_db_new == 0) { |
|---|
| 1367 | | set_page_message(tr('You have a SQL databases limit!<br>You can not add an user with unlimited SQL databases!')); |
|---|
| | 1367 | set_page_message(tr('You have a SQL databases limit!<br>You cannot add an user with unlimited SQL databases!')); |
|---|
| 1368 | 1368 | $error = true; |
|---|
| 1369 | 1369 | } else if ($sql_db_current + $sql_db_new > $sql_db_max) { |
|---|
| … | … | |
| 1377 | 1377 | if ($sql_user_new != -1) { |
|---|
| 1378 | 1378 | if ($sql_user_new == 0) { |
|---|
| 1379 | | set_page_message(tr('You have an SQL users limit!<br>You can not add an user with unlimited SQL users!')); |
|---|
| | 1379 | set_page_message(tr('You have an SQL users limit!<br>You cannot add an user with unlimited SQL users!')); |
|---|
| 1380 | 1380 | $error = true; |
|---|
| 1381 | 1381 | } else if ($sql_db_new == -1) { |
|---|
| 1382 | | set_page_message(tr('You have disabled SQL databases for this user!<br>You can not have SQL users here!')); |
|---|
| | 1382 | set_page_message(tr('You have disabled SQL databases for this user!<br>You cannot have SQL users here!')); |
|---|
| 1383 | 1383 | $error = true; |
|---|
| 1384 | 1384 | } else if ($sql_user_current + $sql_user_new > $sql_user_max) { |
|---|
| … | … | |
| 1391 | 1391 | if ($traff_max != 0) { |
|---|
| 1392 | 1392 | if ($traff_new == 0) { |
|---|
| 1393 | | set_page_message(tr('You have a traffic limit!<br>You can not add an user with unlimited traffic!')); |
|---|
| | 1393 | set_page_message(tr('You have a traffic limit!<br>You cannot add an user with unlimited traffic!')); |
|---|
| 1394 | 1394 | $error = true; |
|---|
| 1395 | 1395 | } else if ($traff_current + $traff_new > $traff_max) { |
|---|
| … | … | |
| 1401 | 1401 | if ($disk_max != 0) { |
|---|
| 1402 | 1402 | if ($disk_new == 0) { |
|---|
| 1403 | | set_page_message(tr('You have a disk limit!<br>You can not add an user with unlimited disk!')); |
|---|
| | 1403 | set_page_message(tr('You have a disk limit!<br>You cannot add an user with unlimited disk!')); |
|---|
| 1404 | 1404 | & |
|---|
|