Example #1
0
     include "views/subject.view.php";
 } else {
     if ($action == 'favsrm') {
         // remove a favourite
         switch ($params['type']) {
             default:
                 Error::generate('suspicious', 'Bad fav type in rm');
                 $params['owner'] = false;
                 break;
             case 'topic':
             case 'course':
         }
         if (!$params['owner'] || !User::IsAuthenticated()) {
             check_perms(false);
         } else {
             if (!User::DeleteAttrib(User::GetAuthenticatedID(), $params['type'] . 'fav', $params['cid'])) {
                 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
                 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                 header("Cache-Control: no-cache, must-revalidate");
                 header("Pragma: no-cache");
                 header("Content-Type: text/html");
                 echo "Could not remove from favs.";
                 Error::generate('warn', 'Could not remove from favourites.');
             } else {
                 header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
                 header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
                 header("Cache-Control: no-cache, must-revalidate");
                 header("Pragma: no-cache");
                 header("Content-Type: text/html");
                 echo "Removed from favs.";
             }