Skip to content
Snippets Groups Projects
Commit ea02f84d authored by Rasmus Fuhse's avatar Rasmus Fuhse
Browse files

destroy everything

parent 65e79596
No related branches found
No related tags found
No related merge requests found
......@@ -45,7 +45,7 @@ class LampController extends PluginController {
throw new AccessDeniedException();
}
if (Request::isPost() && Request::submitted('create')) {
if (Request::submitted('create')) {
CSRFProtection::verifySecurityToken();
$data['user_id'] = User::findCurrent()->id;
......@@ -92,14 +92,12 @@ class LampController extends PluginController {
$this->brainstorm = new Brainstorm($id);
// Insert new subbrainstorm
if (Request::isPost() && Request::submitted('create')) {
CSRFProtection::verifySecurityToken();
if (Request::submitted('create')) {
$this->brainstorm->answer(Request::get('answer'));
}
// Check if vote is required
if (Request::isPost() && Request::submitted('vote')) {
CSRFProtection::verifySecurityToken();
if (Request::submitted('vote')) {
$brainstorm = new Brainstorm(Request::get('brainstorm_id'));
$brainstorm->vote(key(Request::getArray('vote')));
}
......
......@@ -3,7 +3,7 @@
<header>
<h1>
<a href="<?= $controller->url_for('lamp/brainstorm/' . $brainstorm->id) ?>">
<?= htmlReady($brainstorm->title) ?>
<?= $brainstorm->title ?>
</a>
</h1>
<nav>
......
......@@ -10,7 +10,7 @@
</form>
</nav>
<? if ($brainstorm->title) : ?>
<h1><?= htmlReady($brainstorm->title) ?></h1>
<h1><?= $brainstorm->title ?></h1>
<? endif ?>
<div class='power'>
<?= $brainstorm->power ?>
......
<? if ($brainstorm->parent) : ?>
<a href="<?= PluginEngine::getLink($plugin, array(), "lamp/brainstorm/".$brainstorm->parent->getId()) ?>" class="parent_brainstorm">
<div class="title"><?= htmlReady($brainstorm->parent->title) ?></div>
<div class="title"><?= $brainstorm->parent->title ?></div>
<div class="body">
<?= formatReady($brainstorm->parent->text) ?>
</div>
......@@ -17,7 +17,7 @@
<?= date("G:i d.m.Y", $brainstorm['mkdate']) ?>
</div>
<? if ($brainstorm->title) : ?>
<h1><?= htmlReady($brainstorm->title) ?></h1>
<h1><?= $brainstorm->title ?></h1>
<? endif ?>
<div class="body">
<?= formatReady($brainstorm->text) ?>
......
......@@ -16,7 +16,7 @@
<input type="text"
name="brainstorm[title]"
required
value="<?= htmlReady($brainstorm['title']) ?>"
value="<?= $brainstorm['title'] ?>"
placeholder="<?= dgettext("aladdin","Frage oder Thema") ?>">
</label>
<? endif ?>
......@@ -25,7 +25,7 @@
<?= dgettext("aladdin",'Text') ?>
<textarea name="brainstorm[text]"
required
placeholder="<?= dgettext("aladdin","Um was soll's gehen?") ?>"><?= htmlReady($brainstorm['text']) ?></textarea>
placeholder="<?= dgettext("aladdin","Um was soll's gehen?") ?>"><?= $brainstorm['text'] ?></textarea>
</label>
</fieldset>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment