[ Index ]
 

Code source de Dotclear 1.2.5

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

title

Body

[fermer]

/ecrire/ -> auth.php (source)

   1  <?php
   2  # ***** BEGIN LICENSE BLOCK *****
   3  # This file is part of DotClear.
   4  # Copyright (c) 2004 Olivier Meunier and contributors. All rights
   5  # reserved.
   6  #
   7  # DotClear 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  # DotClear 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 DotClear; if not, write to the Free Software
  19  # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  20  #
  21  # ***** END LICENSE BLOCK *****
  22   
  23  $do_auth = true;
  24  
  25  require dirname(__FILE__).'/inc/prepend.php';
  26  
  27  if(!empty($_POST['user_id']) && !empty($_POST['user_pwd']))
  28  {
  29      $user_id = $_POST['user_id'];
  30      $user_remember = !empty($_POST['user_remember']) ? true : false;
  31      
  32      if($auth->perform($user_id,$_POST['user_pwd'],1,true,$user_remember))
  33      {
  34          $_SESSION['sess_user_id'] = $user_id;
  35          
  36          $redir = 'index.php';
  37          
  38          if (!empty($_SESSION['sess_auth_from']))
  39          {
  40              if ($_SESSION['sess_auth_from'] != $_SERVER['REQUEST_URI']) {
  41                  $redir = $_SESSION['sess_auth_from'];
  42              }
  43              unset($_SESSION['sess_auth_from']);
  44          }
  45          header('Location: '.$redir);
  46          exit;
  47      }
  48      else
  49      {
  50          $err = __('Login failed. Please try again.');
  51      }
  52  }
  53  else
  54  {
  55      $user_id = '';
  56  }
  57  
  58  header('Content-Type: text/html; charset='.dc_encoding);
  59  ?>
  60  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  61  <html xmlns="http://www.w3.org/1999/xhtml"
  62  xml:lang="<?php echo DC_LANG; ?>" lang="<?php echo DC_LANG; ?>">
  63  <head>
  64    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo dc_encoding; ?>" />
  65    <meta http-equiv="Content-Script-Type" content="text/javascript" />
  66    <meta http-equiv="Content-Style-Type" content="text/css" />
  67    <meta http-equiv="Content-Language" content="<?php echo DC_LANG; ?>" />
  68    <title><?php echo dc_blog_name; ?> - DotClear</title>
  69    <style type="text/css">
  70    @import url(style/default.css); 
  71    </style>
  72  
  73  </head>
  74  <body>
  75  
  76  
  77  <div style="text-align:center;">
  78  <h1><img src="images/logo.png" alt="dotclear" /></h1>
  79  
  80  <form action="auth.php" method="post">
  81  <div class="login">
  82  <?php
  83  if(!empty($err))
  84  {
  85      echo '<p><strong>'.$err.'</strong></p>';
  86  }
  87  ?>
  88  
  89  <p><label for="user_id"><strong><?php echo __('Login'); ?> :</strong></label>
  90  <input name="user_id" id="user_id" type="text" maxlength="32"
  91  value="<?php echo $user_id; ?>" tabindex="1"/></p>
  92  
  93  <p><label for="user_pwd"><strong><?php echo __('Password'); ?> :</strong></label>
  94  <input name="user_pwd" id="user_pwd" type="password" tabindex="2" /></p>
  95  
  96  <p><input type="checkbox" id="user_remember" name="user_remember" value="1" />
  97  <label class="inline" for="user_remember"><?php echo __('Remember me'); ?></label></p>
  98  
  99  <p><input class="submit" type="submit" value="<?php echo __('ok'); ?>" /></p>
 100  
 101  <p><?php echo __('You must accept cookies in order to use the private area.'); ?></p>
 102  
 103  </div>
 104  </form>
 105  </div>
 106  
 107  <script type="text/javascript">
 108  document.forms[0]['user_id'].focus();
 109  </script>
 110  
 111  </body>
 112  </html>


Généré le : Fri Feb 23 21:40:15 2007 par Balluche grâce à PHPXref 0.7