- saas patch #1
This commit is contained in:
parent
9cd389d16b
commit
b8d6132b52
6 changed files with 69 additions and 25 deletions
|
@ -329,14 +329,24 @@ class Application_Model_User
|
|||
$res = Application_Model_Datatables::findEntries($con, $displayColumns, $fromTable, $datatables);
|
||||
|
||||
// mark record which is for the current user
|
||||
foreach ($res['aaData'] as &$record) {
|
||||
foreach($res['aaData'] as $key => &$record){
|
||||
if ($record['login'] == $username) {
|
||||
$record['delete'] = "self";
|
||||
} else {
|
||||
$record['delete'] = "";
|
||||
}
|
||||
|
||||
if($record['login'] == 'sourcefabric_admin'){
|
||||
//arrays in PHP are basically associative arrays that can be iterated in order.
|
||||
//Deleting an earlier element does not change the keys of elements that come after it. --MK
|
||||
unset($res['aaData'][$key]);
|
||||
$res['iTotalDisplayRecords']--;
|
||||
$res['iTotalRecords']--;
|
||||
}
|
||||
}
|
||||
|
||||
$res['aaData'] = array_values($res['aaData']);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue