hasRole(AdminModel::ADMIN_TYPE_COMMENTI_SUPERVISOR)){ GUIHandler::redirect("admin/index.php"); } MenuGenerator::generateMenu(); HTMLHelper::generateAdminHead(); try{ $error = ""; $id = PostHandler::get("id"); if (is_null($id) && strcmp("", $id)!=0){ GUIHandler::redirect("admin/unacceptedCommenti.php"); } $commento = GlobalVariables::get("dao")->getFirst("CommentoModel",array("id"=>$id)); if (is_null($commento)){ GUIHandler::redirect("admin/unacceptedCommenti.php"); } $action = PostHandler::get("action"); if (!is_null($action) && strcmp("", $action)!=0){ if (strcmp("cancel", $action)==0){ GUIHandler::redirectPost("admin/validateCommento.php",array("id"=>$id)); } else if (strcmp("save", $action)==0){ $commento->titolo = PostHandler::get("titolo"); $commento->testo = PostHandler::get("testo"); GlobalVariables::get("dao")->save($commento); GUIHandler::redirectPost("admin/validateCommento.php",array("id"=>$id)); } } }catch(GUIException $ex){ $error = $ex->getMessage(); }catch (Exception $exec){ $msg = LogModel::fromException($exec); GlobalVariables::get("dao")->save($msg); $error = "Si รจ verificato un errore inatteso durante l'esecuzione della pagina. Contattare il supporto tecnico comunicando il seguente codice di erore '".$msg->getCode()."'"; } ?>