Menu

db authentication

Help
2004-06-07
2012-10-11
  • Dmitry Beransky

    Dmitry Beransky - 2004-06-07

    Hi,

    I'm not having any luck getting DB authentication to work in 1.3.10.

    Here are my requirements:

    1. No anonymous users
    2. Users cannot self register
    3. Only users with existing accounts can log in

    Following the documentation I set the following coinfig options:

    ENABLE_USER_NEW = true
    ALLOW_ANON_USER = false
    ALLOW_ANON_EDIT = false
    ALLOW_BOGO_LOGIN = false
    ALLOW_USER_PASSWORDS = true
    USER_AUTH_ORDER = "Db"
    USER_AUTH_POLICY = strict
    DBAUTH_AUTH_DSN = "mysql://uuuuu:ppppp@unix(/var/lib/mysql/mysql.sock)/wiki"
    DBAUTH_AUTH_CHECK = "SELECT IF(passwd='$password',1,0) FROM user WHERE userid='$userid'"
    DBAUTH_AUTH_CRYPT_METHOD = plain
    DBAUTH_AUTH_UPDATE = "UPDATE user SET passwd='$password' WHERE userid='$userid'"
    DBAUTH_AUTH_CREATE = "INSERT INTO user SET passwd=PASSWORD('$password'),userid='$userid'"
    DBAUTH_PREF_SELECT = "SELECT prefs FROM user WHERE userid='$userid'"

    phpwiki has no problems accessing the database to store session info, but the log doesn't show any authentication related access.

    What am I missing?

     
    • Reini Urban

      Reini Urban - 2004-06-07

      This was buggy in the 1.3.10 release, and was fixed recently.
      Please try the latest CVS.

       
      • Dmitry Beransky

        Dmitry Beransky - 2004-06-11

        one more question.

        Now that I got basic wiki setup going, I'd like to integrate phpWiki's authentication with an existing user database.  I've changed DBAUTH_AUTH_CHECK to reflect the proper table name and user field name, but it doesn't seem like that value is being used.  When I try to log in, I get this error: (SELECT userid FROM user WHERE userid='dberansky' [nativecode=1054 ** Unknown column 'userid' in 'field list'])

        Here's what DBAUTH_AUTH_CHECK looks like in my config.ini:

        "SELECT IF(passwd='$password',1,0) FROM user WHERE name='$userid'"

         
        • Dmitry Beransky

          Dmitry Beransky - 2004-06-13

          ok, i've found the problem.  apparently, i didn't define  DBAUTH_AUTH_USER_EXISTS in the config.ini, so phpWiki was pulling a default value from config-default.ini

           
    • August E. Brunsman IV

      I installed the current CVS and I'm getting the following error when I try to authenticate as any user other than admin:

      Fatal error: Call to undefined function: getauthparam() in /home/httpd/vhosts/august.skeptics.net/httpdocs/phpwiki/lib/WikiUserNew.php on line 1663

      dberansky, did you get it working?

      Thanks, Reini.  phpwiki is great despite the bugs.

       
      • Reini Urban

        Reini Urban - 2004-06-08

        uuh a typo!
        thanks.

        please change lib/WikiUserNew.php on line 1663
        $this->_authcreate = $this->prepare($dbh->getAuthParam('auth_create'),

        to

        $this->_authcreate = $this->prepare($dbi->getAuthParam('auth_create'),

        as above.

         
    • Dmitry Beransky

      Dmitry Beransky - 2004-06-07

      sweet!!! worked like a charm.  thanks

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.