[ Index ]
 

Code source de Plume CMS 1.2.2

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/manager/ -> login.php (source)

   1  <?php
   2  /*
   3  # ***** BEGIN LICENSE BLOCK *****
   4  # This file is part of Plume CMS, a website management application.
   5  # Copyright (C) 2001-2005 Loic d'Anterroches and contributors.
   6  #
   7  # Plume CMS is free software; you can redistribute it and/or modify
   8  # it under the terms of the GNU General Public License as published by
   9  # the Free Software Foundation; either version 2 of the License, or
  10  # (at your option) any later version.
  11  #
  12  # Plume CMS is distributed in the hope that it will be useful,
  13  # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15  # GNU General Public License for more details.
  16  #
  17  # You should have received a copy of the GNU General Public License
  18  # along with this program; if not, write to the Free Software
  19  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  20  #
  21  # ***** END LICENSE BLOCK ***** */
  22  
  23  require_once 'path.php';
  24  require_once $_PX_config['manager_path'].'/prepend.php';
  25  
  26  if (!empty($_GET['logout'])) {
  27      auth::logout();
  28      header('Location: index.php');
  29      exit;
  30  }
  31  
  32  
  33  $errorinlogin = false;
  34  $website = '';
  35  if (isset($_POST['username']) && isset($_POST['password'])) {
  36      if (!empty($_COOKIE['website_id'])) $website = $_COOKIE['website_id'];
  37      if (auth::login($_POST['username'], $_POST['password'], $website)) {
  38          header('Location: index.php');
  39          exit;
  40      } 
  41      $errorinlogin = true;
  42      $_COOKIE['website_id'] = '';
  43  }
  44  if (isset($_POST['username'])) $px_username = text::secure($_POST['username']);
  45  else $px_username = '';
  46  $px_password = '';
  47  
  48  if (empty($_POST['username']) && !empty($_GET['username'])) $px_username = text::secure($_GET['username']);
  49  if (empty($_POST['password']) && !empty($_GET['password'])) $px_password = text::secure($_GET['password']);
  50  
  51  $locales = l10n::getAvailableLocales();
  52  
  53  if (!empty($_COOKIE['lang']) && in_array($_COOKIE['lang'], $locales)) $lang = $_COOKIE['lang'];
  54  else $lang = l10n::getAcceptedLanguage($locales);
  55  
  56  $l = new l10n($lang);
  57  
  58  // Here you can consider that username/password was not good, or not given.
  59  header('Content-Type: text/html; charset='.strtolower(config::f('encoding')));
  60  ?>
  61  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  62  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  63  
  64  <html xmlns="http://www.w3.org/1999/xhtml">
  65  <head>
  66  <title>PLUME CMS</title>
  67  <link rel="stylesheet" type="text/css" href="themes/default/style.css" />
  68  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo strtolower(config::f('encoding')); ?>" />
  69  </head>
  70  <body>
  71  
  72  
  73  <div style="text-align:center;">
  74  <h1><img src="themes/default/images/logo.png" alt="PLUME CMS" /></h1>
  75  
  76  <form action="login.php" method="post">
  77  <div class="login">

  78  <h2><?php echo __('Manager Access'); ?></h2>

  79  
  80  <?php
  81  if ($errorinlogin)
  82  {
  83      echo '<p><strong>'.__('There is an error with your login or your password.').'</strong></p>';
  84      $px_password = '';
  85  }
  86  ?>
  87  
  88  
  89  <p><label for="username"><strong><?php echo __('Login:'); ?></strong></label>
  90  <input name="username" id="username" type="text" maxlength="32"
  91  value="<?php echo $px_username; ?>" tabindex="1"/></p>
  92  
  93  <p><label for="password"><strong><?php echo __('Password:'); ?></strong></label>
  94  <input name="password" id="password" type="password" value="<?php echo $px_password; ?>" tabindex="2" /></p>
  95  
  96  <p><input class="submit" type="submit" value="<?php echo __('Ok'); ?>" /></p>
  97  
  98  <p><?php echo __('You need to accept the cookies to access the manager.'); ?></p>
  99  
 100  </div>
 101  </form>
 102  </div>
 103  
 104  </body>
 105  </html>


Généré le : Mon Nov 26 11:57:01 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics