#148 DB login not working

1.3.x
open
None
5
2012-10-11
2006-07-28
Poptarts
No

I have had problems integrating a DB login with PhpWiki
for several versions now and keep having the same
problems. I waited for a new release hoping it would
fix my problems but it didn't.

I can always sign in using the PhpWiki admin account
specified in the config.ini, however trying to login as
anything else brings up the following error:

Fatal Error:

lib/WikiDB/backend/PearDB.php:1028: Error:
wikidb_backend_peardb_mysql: fatal database error

* DB Error: unknown error
* ( [nativecode=1065 ** Query was empty])
*

lib/WikiUser/PearDb.php:172: Warning: sprintf(): Too
few arguments

Currently I am configured as follows:

ALLOW_ANON_EDIT = false
ALLOW_BOGO_LOGIN = false
ALLOW_USER_PASSWORDS = true

USER_AUTH_ORDER = "Db"
USER_AUTH_POLICY = "strict"

// My user database is stored in w3t_Users as
U_LoginName and U_Password

DBAUTH_AUTH_USER_EXISTS = "SELECT U_LoginName FROM
w3t_Users WHERE U_LoginName='$userid'"

DBAUTH_AUTH_CHECK = "SELECT
IF(U_Password=PASSWORD('$password'),1,0) AS ok FROM
w3t_Users WHERE U_LoginName='$userid'"

DBAUTH_AUTH_CRYPT_METHOD = "crypt"

(If I change ALLOW_USER_PASSWORDS to false, the error
goes away, but non-admin logins do not work)

Any help on this matter would be greatly appreciated.

Discussion

  • Reini Urban

    Reini Urban - 2006-08-05

    Logged In: YES
    user_id=13755

    versions 1.3.12p2, 1.3.12p3 and current CVS don't have a
    sprintf at lib/WikiUser/PearDb.php:172: Warning: sprintf():
    Too few arguments

    The argument order for sprintf() was fixed some time ago.
    Please try a newer release. Which one do you have?

     
  • Poptarts

    Poptarts - 2006-08-07

    Logged In: YES
    user_id=1562903

    I am using v1.3.12p3.

    What should the line 172 be instead? I will change it.

     
  • Poptarts

    Poptarts - 2006-08-09

    Logged In: YES
    user_id=1562903

    Ok I replaced the entire PearDB.php file with the correct
    one that you sent me. I made sure that my all of my files
    were fresh and reuploaded v1.3.12p3 onto my server.
    However, the sprintf error still remains, plus I have found
    another error that occurrs when I try to login with a
    non-existent user:

    Fatal error: Call to a member function on a non-object in
    /home/sbawpic/public_html/sb2wpedia/lib/WikiUser/PearDb.php
    on line 190

    Furthermore... if I am reading the following error
    correctly, it appears that sprintf is not the problem, but
    some 'database error' is causing the sprintf error to
    occur.. Do my original configuration variables look ok?

    Fatal Error:

    lib/WikiDB/backend/PearDB.php:1028: Error:
    wikidb_backend_peardb_mysql: fatal database error

    * DB Error: unknown error
    * ( [nativecode=1065 ** Query was empty])
    *
    

    lib/WikiUser/PearDb.php:186: Warning: sprintf(): Too few
    arguments

    Fatal PhpWiki Error

    lib/WikiDB/backend/PearDB.php:1028: Error:
    wikidb_backend_peardb_mysql: fatal database error

    * DB Error: unknown error
    * ( [nativecode=1065 ** Query was empty])
    
     

Log in to post a comment.