| 831 | 
           florian | 
           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"])!=0){
  | 
        
        
            | 
            | 
           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($_SERVER['PHP_SELF']);
  | 
        
        
            | 
            | 
           31 | 
                           }
  | 
        
        
            | 
            | 
           32 | 
                           exit();
  | 
        
        
            | 
            | 
           33 | 
                       }
  | 
        
        
            | 
            | 
           34 | 
                   }
  | 
        
        
            | 
            | 
           35 | 
               }
  | 
        
        
            | 
            | 
           36 | 
              | 
        
        
            | 
            | 
           37 | 
               include_once "./include/admin/PhorumInputForm.php";
  | 
        
        
            | 
            | 
           38 | 
              | 
        
        
            | 
            | 
           39 | 
               $frm =& new PhorumInputForm ("", "post");
  | 
        
        
            | 
            | 
           40 | 
              | 
        
        
            | 
            | 
           41 | 
               if(count($_REQUEST)){
  | 
        
        
            | 
            | 
           42 | 
              | 
        
        
            | 
            | 
           43 | 
                   $frm->hidden("target", $_SERVER["REQUEST_URI"]);
  | 
        
        
            | 
            | 
           44 | 
               }
  | 
        
        
            | 
            | 
           45 | 
              | 
        
        
            | 
            | 
           46 | 
               $frm->addrow("Username", $frm->text_box("username", "", 30));
  | 
        
        
            | 
            | 
           47 | 
              | 
        
        
            | 
            | 
           48 | 
               $frm->addrow("Password", $frm->text_box("password", "", 30, 0, true));
  | 
        
        
            | 
            | 
           49 | 
              | 
        
        
            | 
            | 
           50 | 
               $frm->show();
  | 
        
        
            | 
            | 
           51 | 
              | 
        
        
            | 
            | 
           52 | 
           ?>
  |