Changeset 1620

Show
Ignore:
Timestamp:
12/13/2006 12:06:11 AM (2 years ago)
Author:
jeena
Message:

hint by false password added

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/admin/login.php

    r1598 r1620  
    1010 define("JLOG_LOGIN", true); 
    1111 require_once('..'.DIRECTORY_SEPARATOR.'personal'.DIRECTORY_SEPARATOR.'settings.inc.php'); 
     12 $false_password = ""; 
     13 $get = strip($_GET); 
     14 $post = strip($_POST); 
    1215 
    13     if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
    14       session_start(); 
    15  
    16       $passwort = $_POST['password']; 
    17       $url = !empty($_POST['url']) ? $_POST['url'] : ""; 
    18  
    19       $hostname = $_SERVER['HTTP_HOST']; 
    20       $path = dirname($_SERVER['PHP_SELF']) . "/"; 
    21  
    22       // password verification 
    23       if ( md5( $passwort ) == JLOG_ADMIN_PASSWORD) { 
    24         $_SESSION['logged_in'] = true; 
    25  
    26         // go to admin index page 
    27         if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { 
    28           if (php_sapi_name() == 'cgi') { 
    29            header('Status: 303 See Other'); 
    30           } 
    31           else { 
    32            header('HTTP/1.1 303 See Other'); 
    33           } 
    34         } 
    35         if(!empty($url)) $path = $url; 
    36         header('Location: http://'.$hostname.$path); 
    37         exit; 
    38        } 
     16        if ($_SERVER['REQUEST_METHOD'] == 'POST') { 
     17                session_start(); 
     18                $passwort = $post['password']; 
     19                $url = !empty($post['url']) ? $post['url'] : ""; 
     20                $hostname = $_SERVER['HTTP_HOST']; 
     21                $path = dirname($_SERVER['PHP_SELF']) . "/"; 
     22                 
     23                if ( md5( $passwort ) == JLOG_ADMIN_PASSWORD) { 
     24                $_SESSION['logged_in'] = true; 
     25                if ($_SERVER['SERVER_PROTOCOL'] == 'HTTP/1.1') { 
     26                        if (php_sapi_name() == 'cgi') header('Status: 303 See Other'); 
     27                        else header('HTTP/1.1 303 See Other'); 
     28                } 
     29                        if(!empty($url)) $path = $url; 
     30                        header('Location: http://'.$hostname.$path); 
     31                        exit; 
     32                } 
     33                else { 
     34                        $false_password = "  <p class='error'>".$l['admin']['login_false_pw']."</p>\n"; 
     35                } 
    3936    } 
    4037       
     
    4239 $c['main'] = ' 
    4340  <h2>'.$l['admin']['login_headline'].'</h2> 
     41  '.$false_password.' 
    4442  <form action="login.php" method="post"> 
    4543   <p><label for="password">'.$l['admin']['login_password'].'</label> 
     
    4745      <input style="display: none;" name="username" type="text" value="do-not-change" /></p> 
    4846   <p>'.$l['admin']['login_cookies'].'</p> 
    49    <p><input type="hidden" name="url" value="'.$_GET['url'].'" /> 
     47   <p><input type="hidden" name="url" value="'.(!empty($get['url']) ? $get['url'] : $post['url']).'" /> 
    5048      <input type="submit" value="'.$l['admin']['login_send'].'" /></p> 
    5149  </form> 
  • trunk/lang/lang-admin.inc.php

    r1613 r1620  
    216216"login_send"               => "Einloggen", 
    217217"login_cookies"            => "Hinweis! Cookies müssen aktiv sein.", 
     218"login_false_pw"           => "Es wurde ein falsches Passwort eingegeben.", 
    218219 
    219220"cat_name"                 => "Name der Kategorie",