From: Joe Hunt Date: Sat, 9 May 2015 21:07:36 +0000 (+0200) Subject: Merge branch 'master' of ssh://git.code.sf.net/p/frontaccounting/git X-Git-Tag: 2.3-final~46 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=c85c10b86be48b2b1df728f4751adbb38f2ac8d4;hp=d98d5ca511b72958927336e294afc65f7e7ab3b7;p=fa-stable.git Merge branch 'master' of ssh://git.code.sf.net/p/frontaccounting/git --- diff --git a/admin/users.php b/admin/users.php index 135e0068..2074bc19 100644 --- a/admin/users.php +++ b/admin/users.php @@ -23,7 +23,7 @@ include_once($path_to_root . "/admin/db/users_db.inc"); simple_page_mode(true); //------------------------------------------------------------------------------------------------- -function can_process() +function can_process($new) { if (strlen($_POST['user_id']) < 4) @@ -33,7 +33,7 @@ function can_process() return false; } - if ($_POST['password'] != "") + if (!$new && ($_POST['password'] != "")) { if (strlen($_POST['password']) < 4) { @@ -58,7 +58,7 @@ function can_process() if (($Mode=='ADD_ITEM' || $Mode=='UPDATE_ITEM') && check_csrf_token()) { - if (can_process()) + if (can_process($Mode == 'ADD_ITEM')) { if ($selected_id != -1) { diff --git a/includes/db_pager.inc b/includes/db_pager.inc index c2ae04b6..522b04b6 100644 --- a/includes/db_pager.inc +++ b/includes/db_pager.inc @@ -287,11 +287,8 @@ class db_pager { } if ($where) $where = " WHERE ($where)"; - if ($count) { - $group = $group == '' ? "*" : "DISTINCT $group"; - - return "SELECT COUNT(*) FROM (SELECT $group FROM $from $where) tmp_count"; - } + if ($count) + return "SELECT COUNT(*) FROM ($this->sql) tmp_count"; $sql = "$select FROM $from $where"; if ($group) $sql.= " GROUP BY $group"; @@ -303,8 +300,8 @@ class db_pager { if(isset($col['ord_priority'])) { $columns[$col['ord_priority']] = $col; } - } - krsort($columns); + } + krsort($columns); foreach ($columns as $col) { if (isset($col['ord'])) { @@ -313,7 +310,7 @@ class db_pager { } } } - + if (count($ord)) { $ord = array_map(function_exists('mysql_real_escape_string') ? 'mysql_real_escape_string': 'mysql_escape_string', $ord); diff --git a/includes/ui/ui_lists.inc b/includes/ui/ui_lists.inc index 456f0193..2cc16888 100644 --- a/includes/ui/ui_lists.inc +++ b/includes/ui/ui_lists.inc @@ -678,7 +678,7 @@ return combo_input($name, $selected_id, $sql, 'id', '', function _format_fiscalyears($row) { return sql2date($row[1]) . " - " . sql2date($row[2]) - . "  " . ($row[3] ? _('Closed') : _('Active')) . "\n"; + . "  " . ($row[3] ? _('Closed') : _('Active')); } function fiscalyears_list_cells($label, $name, $selected_id=null)