debugging info auth.php

Niels Berkers niels at quotar.com
Mon Apr 9 15:09:59 PDT 2007


# in 
http://www.openidenabled.com/resources/downloads/php-server/PHP-server-1.1.tar.gz
#
# their is still some debugging info active....
#
# src/auth.php line 105:               print_r($result);
# src/auth.php line 105: #            print_r($result);

Thanks, Niels.  Considering what it's printing, I'm inclined to
believe it's probably best that it stay; that error condition
indicates catastrophic failure anyway, so it's best that you find out
exactly what went wrong.

-- 
   Jonathan Daugherty
   JanRain, Inc.
   irc.freenode.net: cygnus in #openid
   cygnus.myopenid.com

--------------------------------------------------

I disagree with that... if their is a database error the user will get 
this whole dump on screen. This is not in a rare occassion. Because 
their is no check in place if the username already exists in the 
database, a user could trigger a duplicate key error.

so better turn it off... in case if you have more users who want to use 
the name John ;)

br,

Niels

     function newAccount($username, $password, $query)
     {
         $username = strtolower($username);
         $result = $this->db->query("INSERT INTO accounts (username, 
password) " .
                                    "VALUES (?, ?)",
                                    array($username,
 
$this->_encodePassword($password)));

         // $query is ignored for this implementation, but you might
         // choose to change the login process to incorporate other
         // user details like an email address.  $query is the HTTP
         // query in which the account registration form was submitted.
         // You'll only need to bother with $query if you've modified
         // the account registration form template and need to access
         // your new fields.

         if (PEAR::isError($result)) {
     //        print_r($result);
             return false;
         } else {
             return true;
         }
     }




More information about the Dev mailing list