Skip to content

Commit

Permalink
2.1.27
Browse files Browse the repository at this point in the history
Fix for #1740
  • Loading branch information
LAUMAILLE committed May 4, 2017
1 parent 7944010 commit bcb5551
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
2.1.27
Fix: Prevent moving a folder to one of its child folder
#1740 Missing buttons on Users page
#1737 Cannot import files
#1735 Dockerfile - PHP extension "curl" is loaded Extension curl is not loaded
#1733 Copy Item doesn't work if copy from public to public folders
Expand Down
14 changes: 7 additions & 7 deletions sources/datatable/datatable.logs.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
if (isset($_GET['action']) && $_GET['action'] == "connections") {
//Columns name
$aColumns = array('l.date', 'l.label', 'l.qui', 'u.login');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -159,7 +159,7 @@
} elseif (isset($_GET['action']) && $_GET['action'] == "errors") {
//Columns name
$aColumns = array('l.date', 'l.label', 'l.qui', 'u.login');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -258,7 +258,7 @@
} elseif (isset($_GET['action']) && $_GET['action'] == "access") {
//Columns name
$aColumns = array('l.date', 'i.label', 'u.login');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -359,7 +359,7 @@
} elseif (isset($_GET['action']) && $_GET['action'] == "copy") {
//Columns name
$aColumns = array('l.date', 'i.label', 'u.login');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -460,7 +460,7 @@
} elseif (isset($_GET['action']) && $_GET['action'] == "admin") {
//Columns name
$aColumns = array('l.date', 'u.login', 'l.label');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -561,7 +561,7 @@
require_once $_SESSION['settings']['cpassman_dir'].'/sources/main.functions.php';
//Columns name
$aColumns = array('l.date', 'i.label', 'u.login', 'l.action', 'i.perso');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down Expand Up @@ -680,7 +680,7 @@
elseif (isset($_GET['action']) && $_GET['action'] == "failed_auth") {
//Columns name
$aColumns = array('l.date', 'l.label', 'l.qui');

//Ordering
if (isset($_GET['iSortCol_0']) && isset($_GET['sSortDir_0']) && in_array(strtoupper($_GET['sSortDir_0']), $aSortTypes)) {
$sOrder = "ORDER BY ";
Expand Down
22 changes: 15 additions & 7 deletions sources/datatable/datatable.users.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
else $sWhere .= " AND ";
$sWhere .= "isAdministratedByRole IN (".implode(",", array_filter($_SESSION['user_roles'])).")";
}

db::debugmode(false);
$rows = DB::query(
"SELECT * FROM ".$pre."users
$sWhere"
Expand All @@ -122,11 +122,21 @@
);
$iFilteredTotal = DB::count();

// output
// Output
if ($iTotal == "") {
$iTotal = 0;
}

$sOutput = '{';
$sOutput .= '"sEcho": '.intval($_GET['draw']).', ';
$sOutput .= '"iTotalRecords": '.$iTotal.', ';
$sOutput .= '"iTotalDisplayRecords": '.$iTotal.', ';
$sOutput .= '"aaData": ';

if (DB::count() > 0) {
$sOutput = '[';
$sOutput .= '[';
} else {
$sOutput = '';
$sOutput .= '';
}

foreach ($rows as $record) {
Expand Down Expand Up @@ -308,6 +318,4 @@
$sOutput .= '[] }';
}

// prepare complete output

echo '{"recordsTotal": '.$iTotal.', "recordsFiltered": '.$iFilteredTotal.', "data": '.$sOutput;
echo $sOutput;
2 changes: 1 addition & 1 deletion sources/users.queries.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@
'fonction_id' => $dataReceived['groups'],
'groupes_interdits' => $dataReceived['forbidden_flds'],
'groupes_visibles' => $dataReceived['allowed_flds'],
'isAdministratedByRole' => $dataReceived['isAdministratedByRole'],
'isAdministratedByRole' => $dataReceived['isAdministratedByRole'] === "null" ? "0" : $dataReceived['isAdministratedByRole'],
'encrypted_psk' => ''
)
);
Expand Down

0 comments on commit bcb5551

Please sign in to comment.