Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Made domain-moving deactivateable, added realtime patch, added possib…

…ility to login multiple times

git-svn-id: file:///var/svn/trunk/syscp@2323 45fdb5c4-e40b-0410-b369-9aab4fe9a275
  • Loading branch information...
commit f0d1ca7f43dc4be2b19ef9ac6ce5e1b625566e48 1 parent cf1d4db
Florian Lippert authored
101 admin_domains.php
@@ -774,8 +774,7 @@
774 774 && $_POST['send'] == 'send')
775 775 {
776 776 $customer = $customer_old = $db->query_first("SELECT * FROM " . TABLE_PANEL_CUSTOMERS . " WHERE `customerid`='" . (int)$result['customerid'] . "'");
777   - $customerid = intval($_POST['customerid']);
778   - if($customerid != $result['customerid'])
  777 + if(isset($_POST['customerid']) && ($customerid = intval($_POST['customerid'])) != $result['customerid'] && $settings['panel']['allow_domain_change_customer'] == '1')
779 778 {
780 779 $customer = $db->query_first("SELECT * FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid`='" . (int)$customerid . "' AND (`subdomains_used` + " . (int)$subdomains . " <= `subdomains` OR `subdomains` = '-1' ) AND (`emails_used` + " . (int)$emails . " <= `emails` OR `emails` = '-1' ) AND (`email_forwarders_used` + " . (int)$email_forwarders . " <= `email_forwarders` OR `email_forwarders` = '-1' ) AND (`email_accounts_used` + " . (int)$email_accounts . " <= `email_accounts` OR `email_accounts` = '-1' ) " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . " ");
781 780 if(empty($customer) || $customer['customerid'] != $customerid)
@@ -783,12 +782,15 @@
783 782 standard_error('customerdoesntexist');
784 783 }
785 784 }
  785 + else
  786 + {
  787 + $customerid = $result['customerid'];
  788 + }
786 789
787 790 $admin = $admin_old = $db->query_first("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid`='" . (int)$result['adminid'] . "' ");
788 791 if($userinfo['customers_see_all'] == '1')
789 792 {
790   - $adminid = intval($_POST['adminid']);
791   - if($adminid != $result['adminid'])
  793 + if(isset($_POST['adminid']) && ($adminid = intval($_POST['adminid'])) != $result['adminid'] && $settings['panel']['allow_domain_change_admin'] == '1')
792 794 {
793 795 $admin = $db->query_first("SELECT * FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid`='" . (int)$adminid . "' AND ( `domains_used` < `domains` OR `domains` = '-1' )");
794 796 if(empty($admin) || $admin['adminid'] != $adminid)
@@ -796,6 +798,10 @@
796 798 standard_error('admindoesntexist');
797 799 }
798 800 }
  801 + else
  802 + {
  803 + $adminid = $result['adminid'];
  804 + }
799 805 }
800 806 else
801 807 {
@@ -1137,7 +1143,7 @@
1137 1143 $isemaildomain = "1";
1138 1144 }
1139 1145
1140   - if($customerid != $result['customerid'])
  1146 + if($customerid != $result['customerid'] && $settings['panel']['allow_domain_change_customer'] == '1')
1141 1147 {
1142 1148 $db->query("UPDATE `" . TABLE_MAIL_USERS . "` SET `customerid` = '" . (int)$customerid . "' WHERE `domainid` = '" . (int)$result['id']. "' ");
1143 1149 $db->query("UPDATE `" . TABLE_MAIL_VIRTUAL . "` SET `customerid` = '" . (int)$customerid . "' WHERE `domainid` = '" . (int)$result['id']. "' ");
@@ -1145,7 +1151,7 @@
1145 1151 $db->query("UPDATE `" . TABLE_PANEL_CUSTOMERS . "` SET `subdomains_used` = `subdomains_used` - '" . (int)$subdomains . "', `emails_used` = `emails_used` - '" . (int)$emails . "', `email_forwarders_used` = `email_forwarders_used` - '" . (int)$email_forwarders . "', `email_accounts_used` = `email_accounts_used` - '" . (int)$email_accounts . "' WHERE `customerid` = '" . (int)$result['customerid'] . "' ");
1146 1152 }
1147 1153
1148   - if($adminid != $result['adminid'])
  1154 + if($adminid != $result['adminid'] && $settings['panel']['allow_domain_change_admin'] == '1')
1149 1155 {
1150 1156 $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` + 1 WHERE `adminid` = '" . (int)$adminid . "' ");
1151 1157 $db->query("UPDATE `" . TABLE_PANEL_ADMINS . "` SET `domains_used` = `domains_used` - 1 WHERE `adminid` = '" . (int)$result['adminid'] . "' ");
@@ -1200,51 +1206,96 @@
1200 1206 }
1201 1207 else
1202 1208 {
1203   - $customers = '';
1204   - $result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE ( (`subdomains_used` + " . (int)$subdomains . " <= `subdomains` OR `subdomains` = '-1' ) AND (`emails_used` + " . (int)$emails . " <= `emails` OR `emails` = '-1' ) AND (`email_forwarders_used` + " . (int)$email_forwarders . " <= `email_forwarders` OR `email_forwarders` = '-1' ) AND (`email_accounts_used` + " . (int)$email_accounts . " <= `email_accounts` OR `email_accounts` = '-1' ) " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . ") OR `customerid` = '" . (int)$result['customerid'] . "' ORDER BY `name` ASC");
  1209 + if($settings['panel']['allow_domain_change_customer'] == '1')
  1210 + {
  1211 + $customers = '';
  1212 + $result_customers = $db->query("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE ( (`subdomains_used` + " . (int)$subdomains . " <= `subdomains` OR `subdomains` = '-1' ) AND (`emails_used` + " . (int)$emails . " <= `emails` OR `emails` = '-1' ) AND (`email_forwarders_used` + " . (int)$email_forwarders . " <= `email_forwarders` OR `email_forwarders` = '-1' ) AND (`email_accounts_used` + " . (int)$email_accounts . " <= `email_accounts` OR `email_accounts` = '-1' ) " . ($userinfo['customers_see_all'] ? '' : " AND `adminid` = '" . (int)$userinfo['adminid'] . "' ") . ") OR `customerid` = '" . (int)$result['customerid'] . "' ORDER BY `name` ASC");
1205 1213
1206   - while($row_customer = $db->fetch_array($result_customers))
  1214 + while($row_customer = $db->fetch_array($result_customers))
  1215 + {
  1216 + if($row_customer['company'] == '')
  1217 + {
  1218 + $customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1219 + }
  1220 + else
  1221 + {
  1222 + if($row_customer['name'] != ''
  1223 + && $row_customer['firstname'] != '')
  1224 + {
  1225 + $customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' | ' . $row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1226 + }
  1227 + else
  1228 + {
  1229 + $customers.= makeoption($row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1230 + }
  1231 + }
  1232 + }
  1233 + }
  1234 + else
1207 1235 {
1208   - if($row_customer['company'] == '')
  1236 + $customer = $db->query_first("SELECT `customerid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_CUSTOMERS . "` WHERE `customerid` = '" . (int)$result['customerid'] . "'");
  1237 + if($customer['company'] == '')
1209 1238 {
1210   - $customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1239 + $result['customername'] = $customer['name'] . ', ' . $customer['firstname'] . ' (' . $customer['loginname'] . ')';
1211 1240 }
1212 1241 else
1213 1242 {
1214   - if($row_customer['name'] != ''
1215   - && $row_customer['firstname'] != '')
  1243 + if($customer['name'] != ''
  1244 + && $customer['firstname'] != '')
1216 1245 {
1217   - $customers.= makeoption($row_customer['name'] . ', ' . $row_customer['firstname'] . ' | ' . $row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1246 + $result['customername'] = $customer['name'] . ', ' . $customer['firstname'] . ' | ' . $customer['company'] . ' (' . $customer['loginname'] . ')';
1218 1247 }
1219 1248 else
1220 1249 {
1221   - $customers.= makeoption($row_customer['company'] . ' (' . $row_customer['loginname'] . ')', $row_customer['customerid'], $result['customerid']);
  1250 + $result['customername'] = $customer['company'] . ' (' . $customer['loginname'] . ')';
1222 1251 }
1223 1252 }
1224 1253 }
1225 1254
1226   - $admins = '';
1227   -
1228 1255 if($userinfo['customers_see_all'] == '1')
1229 1256 {
1230   - $result_admins = $db->query("SELECT `adminid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_ADMINS . "` WHERE (`domains_used` < `domains` OR `domains` = '-1') OR `adminid` = '" . (int)$result['adminid'] . "' ORDER BY `name` ASC");
  1257 + if($settings['panel']['allow_domain_change_admin'] == '1')
  1258 + {
  1259 + $admins = '';
  1260 + $result_admins = $db->query("SELECT `adminid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_ADMINS . "` WHERE (`domains_used` < `domains` OR `domains` = '-1') OR `adminid` = '" . (int)$result['adminid'] . "' ORDER BY `name` ASC");
1231 1261
1232   - while($row_admin = $db->fetch_array($result_admins))
  1262 + while($row_admin = $db->fetch_array($result_admins))
  1263 + {
  1264 + if($row_admin['company'] == '')
  1265 + {
  1266 + $admins.= makeoption($row_admin['name'] . ', ' . $row_admin['firstname'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1267 + }
  1268 + else
  1269 + {
  1270 + if($row_admin['name'] != ''
  1271 + && $row_admin['firstname'] != '')
  1272 + {
  1273 + $admins.= makeoption($row_admin['name'] . ', ' . $row_admin['firstname'] . ' | ' . $row_admin['company'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1274 + }
  1275 + else
  1276 + {
  1277 + $admins.= makeoption($row_admin['company'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1278 + }
  1279 + }
  1280 + }
  1281 + }
  1282 + else
1233 1283 {
1234   - if($row_admin['company'] == '')
  1284 + $admin = $db->query_first("SELECT `adminid`, `loginname`, `name`, `firstname`, `company` FROM `" . TABLE_PANEL_ADMINS . "` WHERE `adminid` = '" . (int)$result['adminid'] . "'");
  1285 + if($admin['company'] == '')
1235 1286 {
1236   - $admins.= makeoption($row_admin['name'] . ', ' . $row_admin['firstname'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1287 + $result['adminname'] = $admin['name'] . ', ' . $admin['firstname'] . ' (' . $admin['loginname'] . ')';
1237 1288 }
1238 1289 else
1239 1290 {
1240   - if($row_admin['name'] != ''
1241   - && $row_admin['firstname'] != '')
  1291 + if($admin['name'] != ''
  1292 + && $admin['firstname'] != '')
1242 1293 {
1243   - $admins.= makeoption($row_admin['name'] . ', ' . $row_admin['firstname'] . ' | ' . $row_admin['company'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1294 + $result['adminname'] = $admin['name'] . ', ' . $admin['firstname'] . ' | ' . $admin['company'] . ' (' . $admin['loginname'] . ')';
1244 1295 }
1245 1296 else
1246 1297 {
1247   - $admins.= makeoption($row_admin['company'] . ' (' . $row_admin['loginname'] . ')', $row_admin['adminid'], $result['adminid']);
  1298 + $result['adminname'] = $admin['company'] . ' (' . $admin['loginname'] . ')';
1248 1299 }
1249 1300 }
1250 1301 }
11 admin_index.php
@@ -26,7 +26,16 @@
26 26 if($action == 'logout')
27 27 {
28 28 $log->logAction(ADM_ACTION, LOG_NOTICE, "logged out");
29   - $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
  29 +
  30 + if($settings['session']['allow_multiple_login'] == '1')
  31 + {
  32 + $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1' AND `hash` = '" . $s . "'");
  33 + }
  34 + else
  35 + {
  36 + $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['adminid'] . "' AND `adminsession` = '1'");
  37 + }
  38 +
30 39 redirectTo('index.php');
31 40 exit;
32 41 }
35 admin_settings.php
@@ -305,6 +305,22 @@
305 305 $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='" . $db->escape($value) . "' WHERE `settinggroup`='admin' AND `varname`='syscp_graphic'");
306 306 $log->logAction(ADM_ACTION, LOG_INFO, "changed syscp_graphic from '" . $settings['system']['syscp_graphic'] . "' to '" . $value . "'");
307 307 }
  308 +
  309 + if($_POST['panel_allow_domain_change_admin'] != $settings['panel']['allow_domain_change_admin']
  310 + && isset($_POST['panel_allow_domain_change_admin']))
  311 + {
  312 + $value = ($_POST['panel_allow_domain_change_admin'] == '1' ? '1' : '0');
  313 + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='" . $db->escape($value) . "' WHERE `settinggroup`='panel' AND `varname`='allow_domain_change_admin'");
  314 + $log->logAction(ADM_ACTION, LOG_INFO, "changed panel_allow_domain_change_admin from '" . $settings['panel']['allow_domain_change_admin'] . "' to '" . $value . "'");
  315 + }
  316 +
  317 + if($_POST['panel_allow_domain_change_customer'] != $settings['panel']['allow_domain_change_customer']
  318 + && isset($_POST['panel_allow_domain_change_customer']))
  319 + {
  320 + $value = ($_POST['panel_allow_domain_change_customer'] == '1' ? '1' : '0');
  321 + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='" . $db->escape($value) . "' WHERE `settinggroup`='panel' AND `varname`='allow_domain_change_customer'");
  322 + $log->logAction(ADM_ACTION, LOG_INFO, "changed panel_allow_domain_change_customer from '" . $settings['panel']['allow_domain_change_customer'] . "' to '" . $value . "'");
  323 + }
308 324 }
309 325
310 326 if(($settings_part && $_part == 'accounts')
@@ -318,6 +334,14 @@
318 334 $log->logAction(ADM_ACTION, LOG_INFO, "changed session_sessiontimeout from '" . $settings['session']['sessiontimeout'] . "' to '" . $value . "'");
319 335 }
320 336
  337 + if($_POST['session_allow_multiple_login'] != $settings['session']['allow_multiple_login']
  338 + && isset($_POST['session_allow_multiple_login']))
  339 + {
  340 + $value = ($_POST['session_allow_multiple_login'] == '1' ? '1' : '0');
  341 + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='" . $db->escape($value) . "' WHERE `settinggroup`='session' AND `varname`='allow_multiple_login'");
  342 + $log->logAction(ADM_ACTION, LOG_INFO, "changed session_allow_multiple_login from '" . $settings['session']['allow_multiple_login'] . "' to '" . $value . "'");
  343 + }
  344 +
321 345 if($_POST['login_maxloginattempts'] != $settings['login']['maxloginattempts']
322 346 && isset($_POST['login_maxloginattempts']))
323 347 {
@@ -546,6 +570,14 @@
546 570 unset($db_root);
547 571 }
548 572
  573 + if($_POST['system_realtime_port'] != $settings['system']['realtime_port']
  574 + && isset($_POST['system_realtime_port']))
  575 + {
  576 + $value = validate($_POST['system_realtime_port'], 'realtime port', '/^[0-9]+$/');
  577 + $db->query("UPDATE `" . TABLE_PANEL_SETTINGS . "` SET `value`='" . $db->escape($value) . "' WHERE `settinggroup`='system' AND `varname`='realtime_port'");
  578 + $log->logAction(ADM_ACTION, LOG_INFO, "changed system_realtime_port from '" . $settings['system']['realtime_port'] . "' to '" . $value . "'");
  579 + }
  580 +
549 581 if($_POST['index_file_extension'] != $settings['system']['index_file_extension']
550 582 && isset($_POST['index_file_extension']))
551 583 {
@@ -1524,6 +1556,9 @@
1524 1556 $quota_type_option.= makeoption($lng['emails']['quota_type']['megabyte'], 'mb', $quota_type[$i]);
1525 1557 $quota_type_option.= makeoption($lng['emails']['quota_type']['gigabyte'], 'gb', $quota_type[$i]);
1526 1558 unset($i, $quota_type);
  1559 + $session_allow_multiple_login = makeyesno('session_allow_multiple_login', '1', '0', $settings['session']['allow_multiple_login']);
  1560 + $panel_allow_domain_change_admin = makeyesno('panel_allow_domain_change_admin', '1', '0', $settings['panel']['allow_domain_change_admin']);
  1561 + $panel_allow_domain_change_customer = makeyesno('panel_allow_domain_change_customer', '1', '0', $settings['panel']['allow_domain_change_customer']);
1527 1562 $natsorting = makeyesno('panel_natsorting', '1', '0', $settings['panel']['natsorting']);
1528 1563 $mailpwcleartext = makeyesno('system_mailpwcleartext', '1', '0', $settings['system']['mailpwcleartext']);
1529 1564 $panel_sendalternativemail = makeyesno('panel_sendalternativemail', '1', '0', $settings['panel']['sendalternativemail']);
11 customer_index.php
@@ -26,7 +26,16 @@
26 26 if($action == 'logout')
27 27 {
28 28 $log->logAction(USR_ACTION, LOG_NOTICE, "logged out");
29   - $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'");
  29 +
  30 + if($settings['session']['allow_multiple_login'] == '1')
  31 + {
  32 + $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0' AND `hash` = '" . $s . "'");
  33 + }
  34 + else
  35 + {
  36 + $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['customerid'] . "' AND `adminsession` = '0'");
  37 + }
  38 +
30 39 redirectTo('index.php');
31 40 exit;
32 41 }
6 index.php
@@ -116,7 +116,11 @@
116 116 $language = $settings['panel']['standardlanguage'];
117 117 }
118 118
119   - $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['userid'] . "' AND `adminsession` = '" . $db->escape($userinfo['adminsession']) . "'");
  119 + if($settings['session']['allow_multiple_login'] != '1')
  120 + {
  121 + $db->query("DELETE FROM `" . TABLE_PANEL_SESSIONS . "` WHERE `userid` = '" . (int)$userinfo['userid'] . "' AND `adminsession` = '" . $db->escape($userinfo['adminsession']) . "'");
  122 + }
  123 +
120 124 $db->query("INSERT INTO `" . TABLE_PANEL_SESSIONS . "` (`hash`, `userid`, `ipaddress`, `useragent`, `lastactivity`, `language`, `adminsession`) VALUES ('" . $db->escape($s) . "', '" . (int)$userinfo['userid'] . "', '" . $db->escape($remote_addr) . "', '" . $db->escape($http_user_agent) . "', '" . time() . "', '" . $db->escape($language) . "', '" . $db->escape($userinfo['adminsession']) . "')");
121 125
122 126 if($userinfo['adminsession'] == '1')
4 install/syscp.sql
@@ -631,6 +631,10 @@ INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) V
631 631 INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (114, 'aps', 'webserver-htaccess', '');
632 632 INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (115, 'aps', 'php-function', '');
633 633 INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (116, 'aps', 'webserver-module', '');
  634 +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (117, 'system', 'realtime_port', '0');
  635 +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (118, 'session', 'allow_multiple_login', '0');
  636 +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (119, 'panel', 'allow_domain_change_admin', '0');
  637 +INSERT INTO `panel_settings` (`settingid`, `settinggroup`, `varname`, `value`) VALUES (120, 'panel', 'allow_domain_change_customer', '0');
634 638
635 639 # --------------------------------------------------------
636 640
16 install/updatesql_1.2.19-20.inc.php
@@ -972,6 +972,22 @@
972 972 $db->query($query);
973 973 $settings['panel']['version'] = '1.2.19-svn36';
974 974 }
  975 +
  976 + if($settings['panel']['version'] == '1.2.19-svn36')
  977 + {
  978 + $updatelog->logAction(ADM_ACTION, LOG_WARNING, "Updating from 1.2.19-svn36 to 1.2.19-svn37");
  979 + $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('system', 'realtime_port', '0')");
  980 + $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('session', 'allow_multiple_login', '0')");
  981 + $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_domain_change_admin', '0')");
  982 + $db->query("INSERT INTO `" . TABLE_PANEL_SETTINGS . "` (`settinggroup`, `varname`, `value`) VALUES ('panel', 'allow_domain_change_customer', '0')");
  983 +
  984 + // set new version
  985 +
  986 + $query = 'UPDATE `%s` SET `value` = \'1.2.19-svn37\' WHERE `settinggroup` = \'panel\' AND `varname` = \'version\'';
  987 + $query = sprintf($query, TABLE_PANEL_SETTINGS);
  988 + $db->query($query);
  989 + $settings['panel']['version'] = '1.2.19-svn37';
  990 + }
975 991 }
976 992
977 993 // php filter-extension check
29 lib/functions.php
@@ -781,7 +781,7 @@ function validate($str, $fieldname, $pattern = '', $lng = '', $emptydefault = ar
781 781
782 782 function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
783 783 {
784   - global $db;
  784 + global $db, $settings;
785 785
786 786 if($type == '1'
787 787 || $type == '3'
@@ -790,6 +790,7 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
790 790 {
791 791 $db->query('DELETE FROM `' . TABLE_PANEL_TASKS . '` WHERE `type`="' . $type . '"');
792 792 $db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`) VALUES ("' . $type . '")');
  793 + $doupdate = true;
793 794 }
794 795 elseif($type == '2'
795 796 && $param1 != ''
@@ -802,6 +803,32 @@ function inserttask($type, $param1 = '', $param2 = '', $param3 = '')
802 803 $data['gid'] = $param3;
803 804 $data = serialize($data);
804 805 $db->query('INSERT INTO `' . TABLE_PANEL_TASKS . '` (`type`, `data`) VALUES ("2", "' . $db->escape($data) . '")');
  806 + $doupdate = true;
  807 + }
  808 +
  809 + // Taken from https://wiki.syscp.org/contrib/realtime
  810 +
  811 + if($doupdate === true && (int)$settings['system']['realtime_port'] !== 0)
  812 + {
  813 + $timeout = 15;
  814 + $socket = @socket_create (AF_INET, SOCK_STREAM, SOL_UDP);
  815 + if($socket !== false) {
  816 + $time = time();
  817 + while (!@socket_connect($socket, '127.0.0.1', (int)$settings['system']['realtime_port']))
  818 + {
  819 + $err = socket_last_error($socket);
  820 + if ($err == 115 || $err == 114)
  821 + {
  822 + if ((time() - $time) >= $timeout)
  823 + {
  824 + break;
  825 + }
  826 + sleep(1);
  827 + continue;
  828 + }
  829 + }
  830 + @socket_close ($socket);
  831 + }
805 832 }
806 833 }
807 834
2  lib/tables.inc.php
@@ -88,6 +88,6 @@
88 88 define('INSTANCE_UNINSTALL', 5);
89 89 define('PACKAGE_LOCKED', 1);
90 90 define('PACKAGE_ENABLED', 2);
91   -$version = '1.2.19-svn36';
  91 +$version = '1.2.19-svn37';
92 92
93 93 ?>
13 lng/english.lng.php
@@ -1345,4 +1345,17 @@
1345 1345 $lng['error']['customerdoesntexist'] = 'The customer you have chosen doesn\'t exist.';
1346 1346 $lng['error']['admindoesntexist'] = 'The admin you have chosen doesn\'t exist.';
1347 1347
  1348 +// ADDED IN 1.2.19-svn37
  1349 +
  1350 +$lng['serversettings']['system_realtime_port']['title'] = 'Port for realtime SysCP';
  1351 +$lng['serversettings']['system_realtime_port']['description'] = 'SysCP connects to this port at localhost everytime a new cron task is scheduled. If value is 0 (zero), this feature ist deactivated.<br />See also: <a href="https://wiki.syscp.org/contrib/realtime">Make SysCP work in realtime (SysCP Wiki)</a>';
  1352 +$lng['serversettings']['session_allow_multiple_login']['title'] = 'Allow multiple login';
  1353 +$lng['serversettings']['session_allow_multiple_login']['description'] = 'If activated a user could login multiple times.';
  1354 +$lng['serversettings']['panel_allow_domain_change_admin']['title'] = 'Allow moving domains between admins';
  1355 +$lng['serversettings']['panel_allow_domain_change_admin']['description'] = 'If activated you can change the admin of a domain at domainsettings.<br /><b>Attention:</b> If a customer isn\'t assigned to the same admin as the domain, the admin can see every other domain of that customer!';
  1356 +$lng['serversettings']['panel_allow_domain_change_customer']['title'] = 'Allow moving domains between customers';
  1357 +$lng['serversettings']['panel_allow_domain_change_customer']['description'] = 'If activated you can change the customer of a domain at domainsettings.<br /><b>Attention:</b> SysCP won\'t change any paths. This could render a domain unusable!';
  1358 +$lng['domains']['associated_with_domain'] = 'Associated';
  1359 +$lng['domains']['aliasdomains'] = 'Aliasdomains';
  1360 +
1348 1361 ?>
13 lng/german.lng.php
@@ -1348,4 +1348,17 @@
1348 1348 $lng['error']['customerdoesntexist'] = 'Der ausgew&auml;hlte Kunde existiert nicht.';
1349 1349 $lng['error']['admindoesntexist'] = 'Der ausgew&auml;hlte Admin existiert nicht.';
1350 1350
  1351 +// ADDED IN 1.2.19-svn37
  1352 +
  1353 +$lng['serversettings']['system_realtime_port']['title'] = 'Port f&uuml;r Realtime SysCP';
  1354 +$lng['serversettings']['system_realtime_port']['description'] = 'Dieser Port auf localhost wird bei jedem neuen Cron-Task kontaktiert. Wenn der Wert 0 (Null) ist, dann ist dieses Feature deaktiviert.<br />Siehe dazu auch: <a href="https://wiki.syscp.org/contrib/realtime">Make SysCP work in realtime (SysCP Wiki)</a>';
  1355 +$lng['serversettings']['session_allow_multiple_login']['title'] = 'Erlaube gleichzeitigen Login';
  1356 +$lng['serversettings']['session_allow_multiple_login']['description'] = 'Wenn diese Option aktiviert ist, k&ouml;nnen sich Nutzer mehrmals gleichzeitig anmelden.';
  1357 +$lng['serversettings']['panel_allow_domain_change_admin']['title'] = 'Erlaube Verschieben von Domains unter Admins';
  1358 +$lng['serversettings']['panel_allow_domain_change_admin']['description'] = 'Wenn diese Option aktiviert ist, kann unter Domaineinstellungen die Domain einem anderen Admin zugewiesen werden.<br /><b>Achtung:</b> Wenn eine wenn der Kunde einer Domain nicht dem gleichen Admin zugeordnet ist wie die Domain selbst, kann dieser Admin alle anderen Domains des Kunden sehen!';
  1359 +$lng['serversettings']['panel_allow_domain_change_customer']['title'] = 'Erlaube Verschieben von Domains unter Kunden';
  1360 +$lng['serversettings']['panel_allow_domain_change_customer']['description'] = 'Wenn diese Option aktiviert ist, kann unter Domaineinstellungen die Domain einem anderen Kunden zugewiesen werden.<br /><b>Achtung:</b> Es werden keine Pfade bei dieser Aktion angepasst. Das kann dazu f&uuml;hren, dass die Domain nach dem Verschieben nicht mehr richtig funktioniert!';
  1361 +$lng['domains']['associated_with_domain'] = 'Verbunden mit';
  1362 +$lng['domains']['aliasdomains'] = 'Aliasdomains';
  1363 +
1351 1364 ?>
8 templates/admin/domains/domains_edit.tpl
@@ -21,12 +21,12 @@ $header
21 21 </tr>
22 22 <tr>
23 23 <td class="main_field_name">{$lng['admin']['customer']}:</td>
24   - <td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="customerid">$customers</select></td>
  24 + <td class="main_field_display" nowrap="nowrap"><if $settings['panel']['allow_domain_change_customer'] == '1'><select class="dropdown_noborder" name="customerid">$customers</select><else>{$result['customername']}</if></td>
25 25 </tr>
26 26 <if $userinfo['customers_see_all'] == '1'>
27 27 <tr>
28 28 <td class="main_field_name">{$lng['admin']['admin']}:</td>
29   - <td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="adminid">$admins</select></td>
  29 + <td class="main_field_display" nowrap="nowrap"><if $settings['panel']['allow_domain_change_admin'] == '1'><select class="dropdown_noborder" name="adminid">$admins</select><else>{$result['adminname']}</if></td>
30 30 </tr>
31 31 </if>
32 32 <if $alias_check == '0'>
@@ -35,6 +35,10 @@ $header
35 35 <td class="main_field_display" nowrap="nowrap"><select class="dropdown_noborder" name="alias">$domains</select></td>
36 36 </tr>
37 37 </if>
  38 + <tr>
  39 + <td class="main_field_name">{$lng['domains']['associated_with_domain']}:</td>
  40 + <td class="main_field_display" nowrap="nowrap">{$subdomains} {$lng['customer']['subdomains']}, {$alias_check} {$lng['domains']['aliasdomains']}, {$emails} {$lng['customer']['emails']}, {$email_accounts} {$lng['customer']['accounts']}, {$email_forwarders} {$lng['customer']['forwarders']}</td>
  41 + </tr>
38 42 <if $userinfo['change_serversettings'] == '1'>
39 43 <tr>
40 44 <td class="main_field_name">DocumentRoot:<br />({$lng['panel']['emptyfordefault']})</td>
4 templates/admin/settings/settings_accounts.tpl
@@ -11,6 +11,10 @@
11 11 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="session_sessiontimeout" value="{$settings['session']['sessiontimeout']}" /></td>
12 12 </tr>
13 13 <tr>
  14 + <td class="main_field_name"><b>{$lng['serversettings']['session_allow_multiple_login']['title']}:</b><br />{$lng['serversettings']['session_allow_multiple_login']['description']}</td>
  15 + <td class="main_field_display" nowrap="nowrap">{$session_allow_multiple_login}</td>
  16 + </tr>
  17 + <tr>
14 18 <td class="main_field_name"><b>{$lng['serversettings']['maxloginattempts']['title']}:</b><br />{$lng['serversettings']['maxloginattempts']['description']}</td>
15 19 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="login_maxloginattempts" value="{$settings['login']['maxloginattempts']}" /></td>
16 20 </tr>
20 templates/admin/settings/settings_panel.tpl
@@ -47,24 +47,26 @@
47 47 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="panel_webftp_url" value="{$settings['panel']['webftp_url']}" /></td>
48 48 </tr>
49 49 <tr>
50   - <td class="main_field_name">
51   - <b>{$lng['admin']['show_version_login']['title']}:</b><br />{$lng['admin']['show_version_login']['description']}<br />
52   - </td>
  50 + <td class="main_field_name"><b>{$lng['admin']['show_version_login']['title']}:</b><br />{$lng['admin']['show_version_login']['description']}</td>
53 51 <td class="main_field_display" nowrap="nowrap">{$frontend_syscp_version_login}</td>
54 52 </tr>
55 53 <tr>
56   - <td class="main_field_name">
57   - <b>{$lng['admin']['show_version_footer']['title']}:</b><br />{$lng['admin']['show_version_footer']['description']}<br />
58   - </td>
  54 + <td class="main_field_name"><b>{$lng['admin']['show_version_footer']['title']}:</b><br />{$lng['admin']['show_version_footer']['description']}</td>
59 55 <td class="main_field_display" nowrap="nowrap">{$frontend_syscp_version_footer}</td>
60 56 </tr>
61 57 <tr>
62   - <td class="main_field_name">
63   - <b>{$lng['admin']['syscp_graphic']['title']}:</b><br />{$lng['admin']['syscp_graphic']['description']}<br />
64   - </td>
  58 + <td class="main_field_name"><b>{$lng['admin']['syscp_graphic']['title']}:</b><br />{$lng['admin']['syscp_graphic']['description']}</td>
65 59 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="frontend_syscp_graphic" value="{$settings['admin']['syscp_graphic']}" /></td>
66 60 </tr>
67 61 <tr>
  62 + <td class="main_field_name"><b>{$lng['serversettings']['panel_allow_domain_change_admin']['title']}:</b><br />{$lng['serversettings']['panel_allow_domain_change_admin']['description']}<br /><div style="color:red">{$lng['admin']['know_what_youre_doing']}</div></td>
  63 + <td class="main_field_display" nowrap="nowrap">{$panel_allow_domain_change_admin}</td>
  64 + </tr>
  65 + <tr>
  66 + <td class="main_field_name"><b>{$lng['serversettings']['panel_allow_domain_change_customer']['title']}:</b><br />{$lng['serversettings']['panel_allow_domain_change_customer']['description']}<br /><div style="color:red">{$lng['admin']['know_what_youre_doing']}</div></td>
  67 + <td class="main_field_display" nowrap="nowrap">{$panel_allow_domain_change_customer}</td>
  68 + </tr>
  69 + <tr>
68 70 <td class="maintitle_apply_right" nowrap="nowrap" colspan="2">
69 71 <if $_part == 'panel'>
70 72 <input type="hidden" name="part" value="panel" />
4 templates/admin/settings/settings_system.tpl
@@ -27,6 +27,10 @@
27 27 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="system_mysql_access_host" value="{$settings['system']['mysql_access_host']}" /></td>
28 28 </tr>
29 29 <tr>
  30 + <td class="main_field_name"><b>{$lng['serversettings']['system_realtime_port']['title']}:</b><br />{$lng['serversettings']['system_realtime_port']['description']}</td>
  31 + <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="system_realtime_port" value="{$settings['system']['realtime_port']}" /></td>
  32 + </tr>
  33 + <tr>
30 34 <td class="main_field_name"><b>{$lng['serversettings']['index_file_extension']['title']}:</b><br />{$lng['serversettings']['index_file_extension']['description']}</td>
31 35 <td class="main_field_display" nowrap="nowrap"><input type="text" class="text" name="index_file_extension" value="{$settings['system']['index_file_extension']}" /></td>
32 36 </tr>

0 comments on commit f0d1ca7

Please sign in to comment.
Something went wrong with that request. Please try again.