<!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>lacking refinement</title> <link rel="stylesheet" href="<?= site_page('assets/style.css') ?>" type="text/css" /> </head> <body> <div id="page"> <header> <h1 id="blog-title"><a href="<?= site_page('')?>">lacking refinement</a></h1> </header> <section id="content"> <?= $content ?> </section> </div> </body> </html>
<a href="<?= site_page('admin/')?>">Admin index</a> <form method="post"> <input type="text" name="title" placeholder="Article title" /> <textarea name="body" placeholder="Article content"></textarea> <input type="password" name="password" placeholder="Password" /> <input type="submit" value="Create new article" /> </form>
function POST() { $P = new Password(); $data['pass_exists'] = $P->passExists(); if($data['pass_exists'] && !$P->isValid($_POST['password'])) { $this->layout_vars = array( 'content' => "The password you entered is incorrect."); return; } if($_POST['newpass'] != $_POST['passconfirm']) { $data['confirm_failed'] = true; $this->layout_vars = array( 'content' => new View('admin/setpw', $data)); return; } if($P->setPassword($_POST['newpass'])) { $this->layout_vars = array( 'content' => "Password set successfully. <a href=\"".site_page('admin/')."\">Go to index</a>"); } else { $this->layout_vars = array( 'content' => "Couldn't create the password file. Y'all need to check permissions."); } }
<a href="<?= site_page('admin/')?>">Admin index</a> | <a href="<?= site_page('admin/create')?>">Create new article</a> <form method="post"> <input type="text" name="title" value="<?= $article['title'] ?>"/> <textarea name="body"><?= $article['body'] ?></textarea> <input type="password" name="password" /> <input type="submit" name="submit" value="Save changes" /> </form>
/** * Do it on your own! * @deprecated */ function require_permission($permission, $redirect = 'login.php?redirect=', $preFunction = '', $postFunction = '') { if (!has_permission($permission)) { if (is_logged()) { echo HTML::tag('p', _("Non hai permessi a sufficienza.")); } else { http_redirect(site_page($redirect . urlencode(site_page($_SERVER['REQUEST_URI'])))); } get_footer(); exit; // Yes! } }
<a href="<?= site_page('admin/create')?>">new article</a> <ul id="index-list"> <?php foreach ($articles as $article): ?> <li> <a href="<?= site_page($article['desc']) ?>"><?= $article['title']?></a> <span class="date">(<?= $article['timestamp'] ?>)</span> <span class="options"> <a href="<?= site_page("admin/{$article['desc']}/edit")?>">edit</a> <a href="<?= site_page("admin/{$article['desc']}/delete")?>">delete</a> </span> </li> <?php endforeach; ?> </ul>