- Timestamp:
- 01/31/10 01:24:59 (2 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
-
. (modified) (1 prop)
-
CHANGELOG (modified) (1 diff)
-
gui/admin/reseller_edit.php (modified) (2 diffs)
-
gui/include/admin-functions.php (modified) (2 diffs)
-
gui/include/reseller-functions.php (modified) (9 diffs)
-
gui/reseller/domain_edit.php (modified) (2 diffs)
-
gui/reseller/orders_update.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/2152 (added) merged: 2547-2555
- Property svn:mergeinfo changed
-
trunk/CHANGELOG
r2553 r2556 1 1 ispCP ω 1.0.4 Changelog 2 2 ~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 4 2010-01-31 Sascha Bay 5 - GUI: 6 * Fixed #2152: Wrong limited count in reseller gui 3 7 4 8 2010-01-27 Marc Pujol -
trunk/gui/admin/reseller_edit.php
r2533 r2556 5 5 * @copyright 2001-2006 by moleSoftware GmbH 6 6 * @copyright 2006-2010 by ispCP | http://isp-control.net 7 * @version SVN: $I D$7 * @version SVN: $Id$ 8 8 * @link http://isp-control.net 9 9 * @author ispCP Team … … 348 348 if ($unlimited == '_off_') { 349 349 // We have something like that: $u <= ($umax = $r) <= $rmax 350 if ($r != $u && $r > 0) { // ... && $u != unlimited 350 //if ($r != $u && $r > 0) { // ... && $u != unlimited 351 if ($r != $umax && $r > 0) { // We have to check the res current against the sum of all users max - TheCry 351 352 $err = tr('Reseller data inconsistency!').' '.$service; //really? 352 353 $err .= tr("! Trying to correct!"); -
trunk/gui/include/admin-functions.php
r2520 r2556 5 5 * @copyright 2001-2006 by moleSoftware GmbH 6 6 * @copyright 2006-2010 by ispCP | http://isp-control.net 7 * @version SVN: $I D$7 * @version SVN: $Id$ 8 8 * @link http://isp-control.net 9 9 * @author ispCP Team … … 1008 1008 AND `mail_acc` != 'postmaster' 1009 1009 AND `mail_acc` != 'webmaster' 1010 AND ` domain_id`1011 AND ` mail_type` NOT RLIKE '_catchall'";1010 AND `mail_type` NOT RLIKE '_catchall' 1011 AND `domain_id`"; 1012 1012 $mail_current = records_count( 'mail_users', $where, $user_id); 1013 1013 } -
trunk/gui/include/reseller-functions.php
r2530 r2556 5 5 * @copyright 2001-2006 by moleSoftware GmbH 6 6 * @copyright 2006-2010 by ispCP | http://isp-control.net 7 * @version SVN: $I D$7 * @version SVN: $Id$ 8 8 * @link http://isp-control.net 9 9 * @author ispCP Team … … 568 568 AND `mail_acc` != 'postmaster' 569 569 AND `mail_acc` != 'webmaster' 570 AND ` domain_id`571 AND ` mail_type` NOT RLIKE '_catchall'";570 AND `mail_type` NOT RLIKE '_catchall' 571 AND `domain_id`"; 572 572 $mail_current = records_count('mail_users', $where, $user_id); 573 573 } … … 1727 1727 /** 1728 1728 * Get count from table by given domain_id's 1729 * 1729 1730 * @param $tablename string database table name 1730 1731 * @param $ua array domain_ids 1731 * @return int egercount1732 * @return int count 1732 1733 */ 1733 1734 function get_reseller_detail_count($tablename, $ua) { … … 1761 1762 /** 1762 1763 * Recalculate current_ properties of reseller 1763 * @param $reseller_id integer ID of the reseller 1764 * 1765 * @param int $reseller_id unique reseller identifiant 1764 1766 * @return array list of properties 1765 1767 */ 1766 1768 function recalc_reseller_c_props($reseller_id) { 1769 1767 1770 global $sql; 1768 1771 1769 1772 // current_dmn_cnt = domain 1770 1773 // current_sub_cnt = subdomain … … 1774 1777 // current_sql_db_cnt = sql_database 1775 1778 // current_sql_user_cnt = sql_user 1776 1779 // current_disk_amnt = disk_space 1780 // current_traff_amnt = traffic 1781 1777 1782 $delstatus = Config::get('ITEM_DELETE_STATUS'); 1778 1783 1779 1784 // Get all users of reseller: 1780 1785 $query = " 1781 1786 SELECT 1782 `domain_id`, 1783 `domain_uid` 1787 COUNT(`domain_id`) AS crn_domains, 1788 IFNULL(SUM(`domain_subd_limit`), 0) AS current_sub_cnt, 1789 IFNULL(SUM(`domain_alias_limit`), 0) AS current_als_cnt, 1790 IFNULL(SUM(`domain_mailacc_limit`), 0) AS current_mail_cnt, 1791 IFNULL(SUM(`domain_ftpacc_limit`), 0) AS current_ftp_cnt, 1792 IFNULL(SUM(`domain_sqld_limit`), 0) AS current_sql_db_cnt, 1793 IFNULL(SUM(`domain_sqlu_limit`), 0) AS current_sql_user_cnt, 1794 IFNULL(SUM(`domain_disk_limit`), 0) AS current_disk_amnt, 1795 IFNULL(SUM(`domain_traffic_limit`), 0) AS current_traff_amnt 1784 1796 FROM 1785 1797 `domain` … … 1790 1802 "; 1791 1803 $res = exec_query($sql, $query, array($reseller_id, $delstatus)); 1792 $user_array = $systemuser_array = array(); 1793 while ($data = $res->FetchRow()) { 1794 $user_array[] = $data['domain_id']; 1795 $systemuser_array[] = $data['domain_uid']; 1796 } 1797 $current_dmn_cnt = count($user_array); 1804 1805 $current_dmn_cnt = $res -> fields['crn_domains']; 1806 1798 1807 if ($current_dmn_cnt > 0) { 1799 $current_sub_cnt = get_reseller_detail_count('subdomain', $user_array); 1800 $current_als_cnt = get_reseller_detail_count('domain_aliasses', $user_array); 1801 $current_mail_cnt = get_reseller_detail_count('mail_users', $user_array); 1802 $current_ftp_cnt = get_reseller_detail_count('ftp_users', $systemuser_array); 1803 $current_sql_db_cnt = get_reseller_detail_count('sql_database', $user_array); 1804 1805 $query = "SELECT COUNT(*) AS cnt FROM `sql_user`"; 1806 $query .= " WHERE `sqld_id` IN ("; 1807 $query .= "SELECT sqld_id FROM sql_database"; 1808 $query .= " WHERE `domain_id` IN (".implode(',', $user_array)."))"; 1809 $res = exec_query($sql, $query); 1810 $current_sql_user_cnt = $res->fields['cnt']; 1808 $current_sub_cnt = $res -> fields['current_sub_cnt']; 1809 $current_als_cnt = $res -> fields['current_als_cnt']; 1810 $current_mail_cnt = $res -> fields['current_mail_cnt']; 1811 $current_ftp_cnt = $res -> fields['current_ftp_cnt']; 1812 $current_sql_db_cnt = $res->fields['current_sql_db_cnt']; 1813 $current_sql_user_cnt = $res->fields['current_sql_user_cnt']; 1814 $current_disk_amnt = $res->fields['current_disk_amnt']; 1815 $current_traff_amnt = $res->fields['current_traff_amnt']; 1811 1816 } else { 1812 $current_sub_cnt = 1813 $current_als_cnt = 1814 $current_mail_cnt = 1815 $current_ftp_cnt = 1816 $current_sql_db_cnt = 1817 $current_sub_cnt = 0; 1818 $current_als_cnt = 0; 1819 $current_mail_cnt = 0; 1820 $current_ftp_cnt = 0; 1821 $current_sql_db_cnt = 0; 1817 1822 $current_sql_user_cnt = 0; 1818 } 1819 1820 return array($current_dmn_cnt, $current_sub_cnt, $current_als_cnt, 1821 $current_mail_cnt, $current_ftp_cnt, $current_sql_db_cnt, 1822 $current_sql_user_cnt); 1823 $current_disk_amnt = 0; 1824 $current_traff_amnt = 0; 1825 } 1826 1827 return array( 1828 $current_dmn_cnt, 1829 $current_sub_cnt, 1830 $current_als_cnt, 1831 $current_mail_cnt, 1832 $current_ftp_cnt, 1833 $current_sql_db_cnt, 1834 $current_sql_user_cnt, 1835 $current_disk_amnt, 1836 $current_traff_amnt 1837 ); 1823 1838 } 1824 1839 1825 1840 /** 1826 1841 * Recalculate current_ properties of reseller 1827 * @param $reseller_id integer ID of the reseller 1842 * 1843 * @param int $reseller_id unique reseller identifiant 1844 * @return void 1828 1845 */ 1829 1846 function update_reseller_c_props($reseller_id) { 1830 1847 global $sql; 1831 1848 1832 1849 $query = " 1833 1850 UPDATE … … 1840 1857 `current_ftp_cnt` = ?, 1841 1858 `current_sql_db_cnt` = ?, 1842 `current_sql_user_cnt` = ? 1859 `current_sql_user_cnt` = ?, 1860 `current_disk_amnt` = ?, 1861 `current_traff_amnt` = ? 1843 1862 WHERE 1844 1863 `reseller_id` = ? 1845 1864 "; 1846 1865 1847 1866 1848 1867 $props = recalc_reseller_c_props($reseller_id); 1849 1868 $props[] = $reseller_id; 1850 1869 1851 1870 exec_query($sql, $query, $props); 1852 1871 } … … 1855 1874 * Get the reseller id of a domain 1856 1875 * moved from admin/domain_edit.php to reseller-functions.php 1857 * @param $domain_id integer ID of domain 1858 * @return integer ID of reseller or 0 in case of error 1876 * 1877 * @param int $domain_id unique domain identifiant 1878 * @return int unique reseller identifiant or 0 in on error 1859 1879 */ 1860 1880 function get_reseller_id($domain_id) { 1881 1861 1882 $sql = Database::getInstance(); 1862 1883 … … 1885 1906 * Checks if a reseller has the right to add domain aliases 1886 1907 * 1887 * @param int $reseller_id 1908 * @param int $reseller_id unique reseller identifiant 1888 1909 * @return boolean domain alias permissions 1889 1910 */ 1890 1911 function check_reseller_domainalias_permissions($reseller_id) { 1912 1891 1913 $sql = Database::getInstance(); 1892 1914 -
trunk/gui/reseller/domain_edit.php
r2536 r2556 5 5 * @copyright 2001-2006 by moleSoftware GmbH 6 6 * @copyright 2006-2010 by ispCP | http://isp-control.net 7 * @version SVN: $I D$7 * @version SVN: $Id$ 8 8 * @link http://isp-control.net 9 9 * @author ispCP Team … … 555 555 556 556 function calculate_user_dvals($data, $u, &$umax, &$r, $rmax, &$err, $obj) { 557 if ($rmax == 0 && $umax == -1) { 557 if ($rmax == -1 && $umax >= 0) { 558 if ($u > 0) { 559 $err .= tr('The <em>%s</em> service cannot be disabled!', $obj) . tr('There are <em>%s</em> records on system!', $obj); 560 return; 561 } else if ($data != -1){ 562 $err .= tr('The <em>%s</em> have to be disabled!', $obj) . tr('The admin has <em>%s</em> disabled on this system!', $obj); 563 return; 564 } else { 565 $umax = $data; 566 } 567 return; 568 } else if ($rmax == 0 && $umax == -1) { 558 569 if ($data == -1) { 559 570 return; -
trunk/gui/reseller/orders_update.php
r2505 r2556 5 5 * @copyright 2001-2006 by moleSoftware GmbH 6 6 * @copyright 2006-2010 by ispCP | http://isp-control.net 7 * @version SVN: $I D$7 * @version SVN: $Id$ 8 8 * @link http://isp-control.net 9 9 * @author ispCP Team … … 256 256 257 257 function calculate_user_dvals($data, $u, &$umax, &$r, $rmax, &$err, $obj) { 258 if ($rmax == 0 && $umax == -1) { 258 if ($rmax == -1 && $umax >= 0) { 259 if ($u > 0) { 260 $err .= tr('The <em>%s</em> service cannot be disabled!', $obj) . tr('There are <em>%s</em> records on system!', $obj); 261 return; 262 } else if ($data != -1){ 263 $err .= tr('The <em>%s</em> have to be disabled!', $obj) . tr('The admin has <em>%s</em> disabled on this system!', $obj); 264 return; 265 } else { 266 $umax = $data; 267 } 268 return; 269 } else if ($rmax == 0 && $umax == -1) { 259 270 if ($data == -1) { 260 271 return;
Note: See TracChangeset
for help on using the changeset viewer.
