[ Index ]
 

Code source de Pluxml 0.3.1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/pluxml/admin/ -> auth.php (source)

   1  <?php
   2  # Copyright (c) 2006 Skyline-arts.com. All rights reserved.

   3  
   4  session_start(); # Démarrage des session 

   5  include  ('../lib/lib.util.php');
   6  
   7  
   8  $pwd = analysePwd('../conf/password.xml'); # Création du tableau login => pwd

   9  
  10  if (!empty($_POST['login']) & !empty($_POST['pwd'])){ # Si 'login' et 'pwd' sont remplis
  11      if(isset($pwd[$_POST['login']])){ # Si le login entré est dans le tableau
  12          if(md5($_POST['pwd']) == $pwd[$_POST['login']]){ # Si login et pwd concordent
  13              $_SESSION['admin'] = '1';
  14              $_SESSION['author'] = $_POST['login'];
  15              header('Location: index.php');
  16          }else{
  17              $msg = 'Mot de passe incorrect';
  18          }
  19      }else{
  20          $msg = 'Utilisateur inexistant';
  21      }
  22  }
  23  if (!empty($_GET['d'])) { # Si l'url contient la variable 'd'
  24      $_SESSION = array();
  25      session_destroy(); # On détruit la session

  26  }
  27  ?>
  28  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  29  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  30  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
  31  <head>
  32  <title>Pluxml - Page d'authentification</title>
  33  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  34  <link rel="stylesheet" type="text/css" href="admin.css" media="screen" />
  35  </head>
  36  
  37  <body>
  38  
  39  <form action="auth.php" method="post" id="auth">
  40      <fieldset>
  41          <p class="field" id="login"><label>Nom d'utilisateur&nbsp;:</label></p>
  42          <?php form::input('login', '', 'text', 20, 255);?>
  43  
  44          <p class="field" id="pwd"><label>Mot de passe&nbsp;:</label></p>
  45          <?php form::input('pwd', '', 'password', 20, 255);?>
  46  
  47          <p><input type="submit" value="Valider" /></p>
  48      </fieldset>
  49  </form>
  50  
  51  <?php
  52  if(isset($msg)){
  53      echo '<p class="msg"><strong>'.$msg.'</strong></p>'; 
  54  }
  55  ?>
  56  
  57  <p class="auth_return">Généré par <a href="http://pluxml.org">Pluxml</a></p>
  58  <p class="auth_return"><a href="../../">Retour au site</a></p>
  59  
  60  </body>
  61  </html>


Généré le : Sun Apr 8 12:13:41 2007 par Balluche grâce à PHPXref 0.7