[Fwd: Re: [PEAR-DEV] Sugestions for auth]

From: Date: Fri, 31 Jan 2003 11:37:38 +0000
Subject: [Fwd: Re: [PEAR-DEV] Sugestions for auth]
Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-12861@lists.php.net to get a copy of this message
The patch I was talking about -------- Original Message -------- Subject: Re: [PEAR-DEV] Sugestions for auth Date: Tue, 5 Nov 2002 19:01:48 +0200 From: Yavor Shahpasov <yavo@nicosia.com.cy> To: Martin Jansen <mj@php.net> CC: Wolfram Kriesing <lists@kriesing.de>, <pear-dev@lists.php.net> References: <007d01c2835b$fdbb0530$01640a0a@netsmart.local> <20021103180957.GA22089@martinjansen.com> <3DC57C2E.70206@kriesing.de> <007401c283d7$c508f0e0$01640a0a@netsmart.local> <20021104204651.GA31098@martinjansen.com> I have two questions i put them here because I doubt most people will read my whole email :) a) I think auth should die() after calling the login form, I mean if the login is displayed then you probably don't want people to see that part of the page right b) Is there a way of disabling the message on the built in login form, I find it good enough for my purposes, and most times I don't need to change it. Here is the patch, i hope it is ok I did #diff -u Auth.php.orig Auth.php > Auth.php.patch let me know if the patch is not in the right format! adds three functions setRequiredUrl - initializes the required urls (accepts string or array) addRequiredUrl - appends urls to the required urls (same as above) checkRequiredUrl - checks if $_SERVER['PHP_SELF'] is in the list of urls and returns true if it is find, using stristr does a case insensiteve search, in this way if you add /admin/ everything under /admin/ would be protected. It is called in Auth::start(), it also sets Auth::showLogin to true if it is found. calls checkRequiredUrl in the Auth::start here is a small example (Tried it with Auth and Auth_HTTP) <?php ob_start(); include('Auth_HTTP/Auth_HTTP.php'); include('DB.php'); PEAR::setErrorHandling(PEAR_ERROR_PRINT); $authobj = new Auth_HTTP('DB', $dsn, false, false); $authobj->addRequiredUrl('/admin/'); $authobj->addRequiredUrl('/file.php'); $authobj->start(); ?> ----- Original Message ----- From: "Martin Jansen" <mj@php.net> To: "Yavor Shahpasov" <yavo@nicosia.com.cy> Cc: "Wolfram Kriesing" <lists@kriesing.de>; <pear-dev@lists.php.net> Sent: Monday, November 04, 2002 10:46 PM Subject: Re: [PEAR-DEV] Sugestions for auth
On Mon Nov 04, 2002 at 09:5658AM +0200, Yavor Shahpasov wrote: Does this mean I should not bother to implement it and use his auth instead
or should I make the patch You should definitively provide a patch. --
    - Martin                           Martin Jansen
                            http://martinjansen.com/
-- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.pear.dev (#12861) next »