From 268e3c31889f9246bb40c2f40b5c003effa5034a Mon Sep 17 00:00:00 2001 From: Marco De Donno Date: Mon, 18 May 2020 18:40:59 +0200 Subject: [PATCH] Add the getSearchableData() function (users, exercises, groups, folders and images) --- backend/TE/AppDB.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/backend/TE/AppDB.php b/backend/TE/AppDB.php index b00cdc6..17e6fee 100644 --- a/backend/TE/AppDB.php +++ b/backend/TE/AppDB.php @@ -1940,6 +1940,24 @@ class AppDB_TE extends AppDB /* * Admin view */ + public function getSearchableData() + { + if( ! $_SESSION[ 'user' ][ 'isadmin' ] ) + { + throw new Exception( "Access denied" ); + } else { + $ret = Array(); + + $ret[ "users" ] = $this->getUserList(); + $ret[ "exercises" ] = $this->getAllExercises(); + $ret[ "usergroups" ] = $this->getUserGroups(); + $ret[ "folders" ] = $this->getFolders(); + $ret[ "images" ] = $this->getImageLibrary(); + + return $ret; + } + } + public function getUserList( $only_users = 0 ) { if( ! $_SESSION[ 'user' ][ 'isadmin' ] ) -- GitLab