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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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'"
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
This was buggy in the 1.3.10 release, and was fixed recently.
Please try the latest CVS.
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'"
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
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.
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.
sweet!!! worked like a charm. thanks