Example #1
0
     session_required();
     Response::send(Database::get_list_of_users_who_have_added_user($_SESSION['id']));
     break;
     // word lists
     // add word list
 // word lists
 // add word list
 case 'add-word-list':
     session_required();
     Response::send(Database::add_word_list($_SESSION['id'], Validation::format_text($_GET['name'])));
     break;
     // list of word lists
 // list of word lists
 case 'list-of-word-lists':
     session_required();
     Response::send(Database::get_word_lists_of_user($_SESSION['id']));
     break;
     // list of shared word lists with user
 // list of shared word lists with user
 case 'list-of-shared-word-lists-with-user':
     session_required();
     Response::send(Database::get_list_of_shared_word_lists_with_user($_SESSION['id']));
     break;
     // get word list
 // get word list
 case 'get-word-list':
     session_required();
     $res = Database::get_word_list($_SESSION['id'], Validation::format_text($_GET['word_list_id']), true);
     if ($res !== NULL) {
         // list is null if it doesn't exist of has been deleted
         // stores whether the requesting unser is the list creator