CC-2126: User should not be delete himself
Done.
This commit is contained in:
parent
b9c1f7356f
commit
2a5df8bed9
2 changed files with 24 additions and 2 deletions
|
@ -159,7 +159,25 @@ class User {
|
|||
public static function getUsersDataTablesInfo($datatables_post) {
|
||||
|
||||
$fromTable = "cc_subjs";
|
||||
return StoredFile::searchFiles($fromTable, $datatables_post);
|
||||
|
||||
// get current user
|
||||
$username = "";
|
||||
$auth = Zend_Auth::getInstance();
|
||||
|
||||
if ($auth->hasIdentity()) {
|
||||
$username = $auth->getIdentity()->login;
|
||||
}
|
||||
|
||||
$res = StoredFile::searchFiles($fromTable, $datatables_post);
|
||||
|
||||
// mark record which is for the current user
|
||||
foreach($res['aaData'] as &$record){
|
||||
if($record[1] == $username){
|
||||
$record[5] = "self";
|
||||
}
|
||||
}
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
public static function getUserData($id){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue