php_lib_login weiterleitung bei falschem passwort

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • php_lib_login weiterleitung bei falschem passwort

    hallo zusammen,

    hoffe das jemand die php_lib_login_libary und ihre funktionen kennt, ein - wie der name schon verät - ein passwortschutz-skript.
    nun hab ich folgendes problem:

    logge ich mich mit einem falschem usernamen bzw passwort ein, erscheint normalerweise eine zeile mit einer fehlermeldung über den beiden eingabefeldern.

    nun möchte ich aber, das die fehlermeldung auf einer anderen seite (in einem frameset)erscheint, kann aber keine
    betreffende zeile in der ich diesen befehl eingeben muss finden.


    würde den code jetzt gerne posten, der ist aber insgesamt 900 zeile lang, wer sich also auskennt, bitte melden...

    danke
    b.

  • #2
    poste nur den teil, der den fehler erzeugt
    h.a.n.d.
    Schmalle

    http://impressed.by
    http://blog.schmalenberger.it



    Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
    ... nur ohne :-)

    Kommentar


    • #3
      denke das ist der relevante teil...


      /*---------------------------------------------------------------------*
      ** lib_login_check_valid_lp *
      ** accepts a username and password, confirms their validity. redirects *
      ** on failure with $error set to nature of error *
      **---------------------------------------------------------------------*/
      function lib_login_check_valid_lp($username, $password)
      {
      GLOBAL $UBER_USER;
      GLOBAL $UBER_PASS;
      GLOBAL $ADMIN_EMAIL;
      GLOBAL $LOG_MESSAGE;
      GLOBAL $gDB;
      $db = $gDB;
      /*----------------------------------*
      ** uberuser account starts with *
      ** $UBER_PASS as a password. when *
      ** that combo is called we test to *
      ** see if an account for it already *
      ** exists. if not, we make one. *
      ** otherwise we pass on to the rest *
      ** of the function... *
      **----------------------------------*/

      // this is not as insecure as it looks...
      if (($username == $UBER_USER) &&
      ($password == $UBER_PASS) &&
      !lib_login_account_exists($UBER_USER))
      {
      $foo = lib_login_create_account($UBER_USER, $UBER_PASS, $UBER_PASS, $ADMIN_EMAIL, "", "");
      if($foo != "success")
      {
      echo "<h1>a serious error has ocurred in creating the uber user account</h1>";
      echo "php _lib_login was unable to create an account for the uber user with";
      echo "the data<p>$UBER_USER<br>$UBER_PASS<br>$ADMIN_EMAIL<p>";
      echo "the following error was thrown:<p> <b>$foo</b><p>";
      echo "please consult your configuration and try again.<p>";
      echo "this system is currently completely insecure";
      }
      return $UBER_USER;
      }


      $username = trim("$username");
      $password = trim("$password");

      $password = md5($password); //store encrypted passwords only

      $sql_valid_lp_test =<<<SQL
      SELECT *
      FROM tbl_users
      WHERE username='$username'
      AND password='$password'
      SQL;
      /*----------------------------------*
      ** test for valid l/p *
      **----------------------------------*/
      $result = $db->Execute($sql_valid_lp_test);


      // if the field is NULL, no rows were returned and,
      // therefor the l/p is wrong so we redirect to the login page

      if($result->EOF)
      {
      // strip GET off of URL
      $login_page = GetReferer(); // oops... maybe referer not login page...
      $login_page = explode("?", $login_page);
      $login_page = $login_page[0];

      if($username == $UBER_USER)
      lib_login_write_log($LOG_MESSAGE[2], $username);
      else
      lib_login_write_log($LOG_MESSAGE[1], $username);

      header("Location: $login_page?error=invalid");
      die; // don't let the rest of the code run if login fails!!
      }
      lib_login_write_log($LOG_MESSAGE[0], $username);
      return ($result->Fields["username"]);
      }

      Kommentar

      Lädt...
      X