$app->abort(401, "password incorrect"); } case "protectView": $password = $app['request']->get('password'); protectView($url, $password, $pdo); return true; case "protectEdit": $password = $app['request']->get('password'); protectEdit($url, $password, $pdo); return true; case "changeUrl": $new_url = $app['request']->get('new_url'); changeUrl($url, $new_url, $pdo); return true; case "save": if (!isEditProtected($url, $pdo)) { $content = $app['request']->get('content'); updateNote($url, $content, $pdo); return True; } else { if (isset($app['session']) and $app['session']->get('id') == $url and $app['session']->get('edit')) { $content = $app['request']->get('content'); updateNote($url, $content, $pdo); return True; } else { return False; // sinon on arrete } } default: $app->abort(403, "wallah le problème");
$app->abort(401, "password incorrect"); } case "protectView": $password = $app['request']->get('password'); protectView($url, $password, $pdo); return true; case "protectEdit": $password = $app['request']->get('password'); protectEdit($url, $password, $pdo); return true; case "changeUrl": $new_url = $app['request']->get('new_url'); changeUrl($url, $new_url, $pdo); return true; case "save": if (!isEditProtected($url)) { $content = $app['request']->get('content'); updateNote($url, $content, $pdo); return True; } else { if (isset($app['session']) and $app['session']->get('id') == $url and $app['session']->get('edit')) { $content = $app['request']->get('content'); updateNote($url, $content, $pdo); return True; } else { return False; // sinon on arrete } } default: $app->abort(403, "wallah le problème");