Exemplo n.º 1
0
         }
         $currentTest = new EfrontTest($_GET['delete_test']);
         $currentTest->delete();
     } catch (Exception $e) {
         header("HTTP/1.0 500 ");
         echo $e->getMessage() . ' (' . $e->getCode() . ')';
     }
     exit;
 } elseif (isset($_GET['publish_test']) && in_array($_GET['publish_test'], $legalValues) && eF_checkParameter($_GET['publish_test'], 'id')) {
     try {
         if (!$_change_) {
             throw new EfrontUserException(_UNAUTHORIZEDACCESS, EfrontUserException::RESTRICTED_USER_TYPE);
         }
         $currentTest = new EfrontTest($_GET['publish_test']);
         $currentTest->test['publish'] == true ? $currentTest->test['publish'] = 0 : ($currentTest->test['publish'] = 1);
         $currentTest->persist();
         echo $currentTest->test['publish'];
     } catch (Exception $e) {
         header("HTTP/1.0 500 ");
         echo $e->getMessage() . ' (' . $e->getCode() . ')';
     }
     exit;
 } elseif (isset($_GET['delete_question']) && in_array($_GET['delete_question'], $legalQuestions)) {
     try {
         if (!$_change_) {
             throw new EfrontUserException(_UNAUTHORIZEDACCESS, EfrontUserException::RESTRICTED_USER_TYPE);
         }
         $currentQuestion = QuestionFactory::factory($_GET['delete_question']);
         $currentQuestion->delete();
     } catch (Exception $e) {
         header("HTTP/1.0 500 ");