Re: User Authentication

"Alastair Weller" <[email protected]>
Newsgroups gmane.comp.web.wiki.phpwiki.talk
Message-ID <[email protected]>
This is from my config. Comments stripped to save space:

;========================================================================
; Part Three: User Authentication
;========================================================================

ALLOW_ANON_USER = false
ALLOW_ANON_EDIT = false
ALLOW_BOGO_LOGIN = false
ALLOW_USER_PASSWORDS = true
USER_AUTH_ORDER = "Db"
PASSWORD_LENGTH_MINIMUM = 0
USER_AUTH_POLICY = first-only

;Haven't managed to get group auth working otherwise this would be DB.
However group auth config below
GROUP_METHOD = WIKIPAGE
CATEGORY_GROUP_PAGE = CategoryGroup

DBAUTH_AUTH_DSN = "mysql://pwiki_user:pwiki_pass@localhost/pwiki_db"
DBAUTH_AUTH_USER_EXISTS = "SELECT userid FROM pref WHERE userid='$userid'"
DBAUTH_AUTH_CHECK = "SELECT IF(TRIM(passwd)='$password',1,0) AS ok FROM pref
WHERE TRIM(userid)='$userid'"
DBAUTH_AUTH_CHECK = "SELECT IF(TRIM(passwd)=PASSWORD('$password'),1,0) AS ok
FROM pref WHERE TRIM(userid)='$userid'"
DBAUTH_AUTH_UPDATE = "UPDATE pref SET passwd=PASSWORD('$password') WHERE
userid='$userid'"
DBAUTH_PREF_SELECT = "SELECT prefs FROM pref WHERE userid='$userid'"
DBAUTH_PREF_UPDATE = "UPDATE pref SET prefs='$pref_blob' WHERE
userid='$userid'"
DBAUTH_PREF_INSERT = "INSERT INTO pref (userid,prefs) VALUES
('$userid','$pref_blob')"
DBAUTH_IS_MEMBER     = "SELECT userid FROM member WHERE userid='$userid' AND
groupname='$groupname'"
DBAUTH_GROUP_MEMBERS = "SELECT DISTINCT userid FROM member WHERE
groupname='$groupname'"
DBAUTH_USER_GROUPS   = "SELECT groupname FROM member WHERE userid='$userid'"

I then did an insert through phpMyAdmin to create a new user called
TestUser. When creating the password select PASSWORD from the drop down
menu. If you want to use MD5 or SHA1 you'll have to change your queries
above and.

Hope that helps

Alastair

On 11/10/2007, Marek Lukasik <[email protected]> wrote:
> Hi Alastair,
> How did you solve the user issue?
>
>
> Regards,
> Marek
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of
> Alastair Weller
> Sent: Thursday, 11 October 2007 4:55 PM
> To: Discussion on PhpWiki features, bugs, development.
> Subject: Re: [Phpwiki-talk] User Authentication
>
> I've solved the user issue - however I now can't get my head around the
> groups issue.
>
> Alastair
>
> On 11/10/2007, Marek Lukasik <[email protected]> wrote:
> > Hi All,
> >
> > Same here, I can't access the WIKI using the admin credentials
> anymore.
> >
> >
> > Regards,
> > Marek
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf Of
> > Alastair Weller
> > Sent: Wednesday, 10 October 2007 11:55 PM
> > To: [email protected]
> > Subject: [Phpwiki-talk] User Authentication
> >
> > Hi Guys
> >
> > Just setup phpwiki and loving it so far.
> >
> > However one thing I would like to add is user authentication so that
> > only authenticatated users can login and view/edit/created pages and
> > ideally only pages in the groups/categorys there are members of ie if
> > they are in ProjectGroup they only have access to pages under
> > wikiurl/ProjectGroup if they are in ProjectGroup and ClientDetails
> > they have access to wikiurl/ProjectGroup and wikiurl/ClientDetails.
> >
> > I've had a look at the authentication options and tried turning on Db
> > user and group authentication - but it then doesn't let me login as
> > the Admin user. I've also tried to work out how to create users when
> > using the following configuration, to no avail.
> >
> > ALLOW_ANON_USER = false
> > ALLOW_ANON_EDIT = false
> > ALLOW_BOGO_LOGIN = false,
> > ALLOW_USER_PASSWORDS = true.
> >
> > I'm running this on a cpanel server with Apache Apache/1.3.37, PHP
> > 4.4.7 and MYSQL 4.1.22.
> >
> > Many thanks for any help and/or pointers.
> >
> > Alastair
> >
> > --
> > P Before you print think about the ENVIRONMENT
> >
> > ----------------------------------------------------------------------
> > --
> > -
> > This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems?  Stop.
> > Now Search log events and configuration files using AJAX and a
> browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Phpwiki-talk mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
> >
> > ----------------------------------------------------------------------
> > --- This SF.net email is sponsored by: Splunk Inc.
> > Still grepping through log files to find problems?  Stop.
> > Now Search log events and configuration files using AJAX and a
> browser.
> > Download your FREE copy of Splunk now >> http://get.splunk.com/
> > _______________________________________________
> > Phpwiki-talk mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
> >
>
>
> --
> P Before you print think about the ENVIRONMENT
>
> ------------------------------------------------------------------------
> -
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Phpwiki-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Phpwiki-talk mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
>


-- 
P Before you print think about the ENVIRONMENT

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Phpwiki-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/phpwiki-talk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.