示例#1
0
文件: layout.php 项目: nham/odious
<!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>
示例#2
0
文件: create.php 项目: nham/odious
<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>
示例#3
0
文件: index.php 项目: nham/odious
  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.");
    }
  }
示例#4
0
文件: edit.php 项目: nham/odious
<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!
     }
 }
示例#6
0
文件: index.php 项目: nham/odious
<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>