Jlog PHP Cross Reference Blogging Systems

Source: /admin/login.php - 57 lines - 1881 bytes - Summary - Text - Print

   1  <?php
   2  ### Loginscript taken form <http://aktuell.de.selfhtml.org/tippstricks/php/loginsystem/>
   3  ### autor: Benjamin Wilfing
   4  ### email: benjamin.wilfing@selfhtml.org
   5  ### homepage: <http://wilfing-home.de>
   6  ###
   7  ### adapted for Jlog by Jeena Paradies
   8  
   9   define("JLOG_ADMIN", true);
  10   define("JLOG_LOGIN", true);
  11   require_once('..'.DIRECTORY_SEPARATOR.'personal'.DIRECTORY_SEPARATOR.'settings.inc.php');
  12  
  13       if ($_SERVER['REQUEST_METHOD'] == 'POST') {
  14        session_start();
  15  
  16        $passwort = $_POST['password'];
  17        $url = $_POST['url'];
  18  
  19        $hostname = $_SERVER['HTTP_HOST'];
  20        $path = dirname($_SERVER['PHP_SELF']);
  21  
  22        // password verification
  23        if ( md5( $passwort ) == JLOG_ADMIN_PASSWORD) {
  24         $_SESSION['logged_in'] = true;
  25  
  26         // go to admin index page
  27         if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') {
  28          if (php_sapi_name() == 'cgi') {
  29           header('Status: 303 See Other');
  30          }
  31          else {
  32           header('HTTP/1.1 303 See Other');
  33          }
  34         }
  35           if(!empty($url)) $path = $url;
  36            else $path_addition = '/';
  37         header('Location: http://'.$hostname.($path == '/' ? '' : $path).$path_addition);
  38         exit;
  39         }
  40        }
  41        
  42   $c['meta']['title'] = $l['admin']['login_headline'];
  43   $c['main'] = '
  44    <h2>'.$l['admin']['login_headline'].'</h2>
  45    <form action="login.php" method="post">
  46     <p><label for="password">'.$l['admin']['login_password'].'</label>
  47        <input class="userdata" id="password" type="password" name="password" />
  48        <input style="display: none;" name="username" type="text" value="do-not-change" /></p>
  49     <p>'.$l['admin']['login_cookies'].'</p>
  50     <p><input type="hidden" name="url" value="'.$_GET['url'].'" />
  51        <input type="submit" value="'.$l['admin']['login_send'].'" /></p>
  52    </form>
  53  ';
  54  
  55  require_once (JLOG_BASEPATH.'scripts'.DIRECTORY_SEPARATOR.'do_template.php');
  56  echo $body;
  57  

title

Description

title

Description

title

Description

title

title

Body