[ Index ]
 

Code source de Phorum 5.1.25

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/include/admin/ -> login.php (source)

   1  <?php
   2  
   3  ////////////////////////////////////////////////////////////////////////////////
   4  //                                                                            //
   5  //   Copyright (C) 2006  Phorum Development Team                              //
   6  //   http://www.phorum.org                                                    //
   7  //                                                                            //
   8  //   This program is free software. You can redistribute it and/or modify     //
   9  //   it under the terms of either the current Phorum License (viewable at     //
  10  //   phorum.org) or the Phorum License that was distributed with this file    //
  11  //                                                                            //
  12  //   This program 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.                     //
  15  //                                                                            //
  16  //   You should have received a copy of the Phorum License                    //
  17  //   along with this program.                                                 //
  18  ////////////////////////////////////////////////////////////////////////////////
  19  
  20      // don't allow this page to be loaded directly
  21      if(!defined("PHORUM_ADMIN")) exit();
  22  
  23      if(isset($_POST["username"]) && isset($_POST["password"])){
  24          if(phorum_user_check_login($_POST["username"], $_POST["password"])){
  25              if($PHORUM["user"]["admin"]){
  26                  phorum_user_create_session(PHORUM_SESSION_ADMIN);
  27                  if(!empty($_POST["target"])){
  28                      phorum_redirect_by_url($_POST['target']);
  29                  } else {
  30                      phorum_redirect_by_url($PHORUM["admin_http_path"]);
  31                  }
  32                  exit();
  33              }
  34          } else {
  35              phorum_hook("failed_login", array(
  36                  "username" => $_POST["username"],
  37                  "password" => $_POST["password"],
  38                  "location" => "forum"
  39              ));
  40          }
  41      }
  42  
  43      if(!file_exists("./include/admin/PhorumInputForm.php")) {
  44  
  45          echo "./include/admin/PhorumInputForm.php doesn't exist but its required for the Phorum-Admin.<br />Please check that this file <strong>with this name</strong> exists.<br />E.g. some ftp-clients change the names to be all lower-case.";
  46  
  47          return;
  48      }
  49  
  50      if(!file_exists("./include/admin/PhorumAdminMenu.php")) {
  51          echo "<br /><br />./include/admin/PhorumAdminMenu.php doesn't exist but its required for the Phorum-Admin.<br />Please check that this file <strong>with this name</strong> exists.<br />E.g. some ftp-clients change the names to be all lower-case.";
  52  
  53          return;
  54      }
  55  
  56  
  57      include_once  "./include/admin/PhorumInputForm.php";
  58  
  59      $frm =& new PhorumInputForm ("", "post");
  60  
  61      if(!empty($_SERVER["QUERY_STRING"])){
  62  
  63          $frm->hidden("target", $PHORUM["admin_http_path"]."?".$_SERVER["QUERY_STRING"]);
  64      }
  65  
  66      $frm->addrow("Username", $frm->text_box("username", "", 30));
  67  
  68      $frm->addrow("Password", $frm->text_box("password", "", 30, 0, true));
  69  
  70      $frm->show();
  71  
  72  
  73  ?>


Généré le : Thu Nov 29 12:22:27 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics