[ Index ]
 

Code source de Zen Cart E-Commerce Shopping Cart 1.3.7.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/admin/ -> login.php (source)

   1  <?php
   2  //

   3  // +----------------------------------------------------------------------+

   4  // |zen-cart Open Source E-commerce                                       |

   5  // +----------------------------------------------------------------------+

   6  // | Copyright (c) 2003 The zen-cart developers                           |

   7  // |                                                                      |

   8  // | http://www.zen-cart.com/index.php                                    |

   9  // |                                                                      |

  10  // | Portions Copyright (c) 2003 osCommerce                               |

  11  // +----------------------------------------------------------------------+

  12  // | This source file is subject to version 2.0 of the GPL license,       |

  13  // | that is bundled with this package in the file LICENSE, and is        |

  14  // | available through the world-wide-web at the following url:           |

  15  // | http://www.zen-cart.com/license/2_0.txt.                             |

  16  // | If you did not receive a copy of the zen-cart license and are unable |

  17  // | to obtain it through the world-wide-web, please send a note to       |

  18  // | license@zen-cart.com so we can mail you a copy immediately.          |

  19  // +----------------------------------------------------------------------+

  20  //  $Id: login.php 6525 2007-06-25 21:49:57Z drbyte $

  21  //

  22  
  23    require ('includes/application_top.php');
  24  
  25    $message = false;
  26    if (isset($_POST['submit'])) {
  27      $admin_name = zen_db_prepare_input($_POST['admin_name']);
  28      $admin_pass = zen_db_prepare_input($_POST['admin_pass']);
  29      $sql = "select admin_id, admin_name, admin_pass from " . TABLE_ADMIN . " where admin_name = '" . zen_db_input($admin_name) . "'";
  30      $result = $db->Execute($sql);
  31      if (!($admin_name == $result->fields['admin_name'])) {
  32        $message = true;
  33        $pass_message = ERROR_WRONG_LOGIN;
  34      }
  35      if (!zen_validate_password($admin_pass, $result->fields['admin_pass'])) {
  36        $message = true;
  37        $pass_message = ERROR_WRONG_LOGIN;
  38      }
  39      if ($message == false) {
  40        $_SESSION['admin_id'] = $result->fields['admin_id'];
  41        if (SESSION_RECREATE == 'True') {
  42          zen_session_recreate();
  43        }
  44        zen_redirect(zen_href_link(FILENAME_DEFAULT, '', 'SSL'));
  45      }
  46    }
  47  ?>
  48  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  49  <html xmlns="http://www.w3.org/1999/xhtml" <?php echo HTML_PARAMS; ?>>
  50  <head>
  51  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  52  <title><?php echo TITLE; ?></title>
  53  <link href="includes/stylesheet.css" rel="stylesheet" type="text/css" />
  54  </head>
  55  <body id="login" onload="document.getElementById('admin_name').focus()">
  56  <form name="login" action="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>" method = "POST">
  57    <fieldset>
  58      <legend><?php echo HEADING_TITLE; ?></legend>
  59      <label class="loginLabel" for="admin_name"><?php echo TEXT_ADMIN_NAME; ?></label>
  60  <input style="float: left" type="text" id="admin_name" name="admin_name" value="<?php echo zen_output_string($admin_name); ?>" />
  61  <br class="clearBoth" />
  62      <label  class="loginLabel" for="admin_pass"><?php echo TEXT_ADMIN_PASS; ?></label>
  63  <input style="float: left" type="password" id="admin_pass" name="admin_pass" value="<?php echo zen_output_string($admin_pass); ?>" />
  64  <br class="clearBoth" />
  65      <?php echo $pass_message; ?>
  66      <input type="submit" name="submit" class="button" value="Login" />
  67      <?php echo '<a style="float: right;" href="' . zen_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a>'; ?>
  68    </fieldset>
  69  </form>
  70  </body>
  71  </html>
  72  <?php require ('includes/application_bottom.php'); ?>


Généré le : Mon Nov 26 16:45:43 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics