phplib-users Mailing List for PHPLIB (Page 42)
Brought to you by:
nhruby,
richardarcher
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(106) |
Sep
(99) |
Oct
(44) |
Nov
(97) |
Dec
(60) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(56) |
Feb
(81) |
Mar
(134) |
Apr
(69) |
May
(106) |
Jun
(122) |
Jul
(98) |
Aug
(52) |
Sep
(184) |
Oct
(219) |
Nov
(102) |
Dec
(106) |
| 2003 |
Jan
(88) |
Feb
(37) |
Mar
(46) |
Apr
(51) |
May
(30) |
Jun
(17) |
Jul
(45) |
Aug
(19) |
Sep
(5) |
Oct
(4) |
Nov
(12) |
Dec
(7) |
| 2004 |
Jan
(11) |
Feb
(7) |
Mar
|
Apr
(15) |
May
(17) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
(8) |
Oct
(6) |
Nov
(21) |
Dec
(13) |
| 2005 |
Jan
(4) |
Feb
(3) |
Mar
(7) |
Apr
(7) |
May
|
Jun
(11) |
Jul
(7) |
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2006 |
Jan
(3) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(9) |
Nov
|
Dec
(5) |
| 2007 |
Jan
(15) |
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(9) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
(3) |
Jul
(1) |
Aug
(19) |
Sep
(2) |
Oct
|
Nov
|
Dec
(6) |
| 2009 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
|
From: Karsten S. <Sa...@it...> - 2002-10-02 07:29:25
|
ich habe probleme sessions in durch ein template generierte seiten einzubinden der befehl wird mit geparsed i ' ve got problems to combine sessions with my site generated by a template. finally i get this error message: Parse error: parse error in ...on line 17 Thanks for any help. Karsten |
|
From: Marko K. <M.K...@os...> - 2002-10-02 06:57:10
|
> use either show_elements OR ge dont use echo ge
Why?
If I want to fill in the elements in my form template I need to only get
the element, that is why I need to use get_element() or ge()! echo ge
works fine with other elements, only the radio buttons and checkboxes seem
t be a problem.
> Try $radioValue =3D "Choice".$i;
> and then $f->ge("radioButtonName",$radioValue);
W=EDll try that.
Marko
|
|
From: Dr T. S. <ta...@sa...> - 2002-10-02 02:30:41
|
use either show_elements OR ge dont use echo ge
Try $radioValue = "Choice".$i;
and then $f->ge("radioButtonName",$radioValue);
HTH
Tarique
P.S I am out for 5 days - hope to see a PHP4lib release by then :-)
--
=============================================================
PHP Applications for E-Biz: http://www.sanisoft.com
Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
=============================================================
|
|
From: Marko K. <M.K...@os...> - 2002-10-01 12:38:14
|
Hi Tarique,
> > for($i=0;$i<4;$i++)
> > echo '<BR>'.$f->ge('question','Choice #'.$i)
> What do you mean by that?
> What are you expecting and what are you getting?
sorry for being so incorrect.
I thought I would get the strings Choice #0, ..., Choice #3 appeneded to
the radio buttons as I thought to have seen hints in the Documentation.
But instead the second parameter in ge() seems not to be used at all. The
same doesn't work for the checkbox controls. I didn't check the inner
mechanisms of the oohform-framework, since it gets quite confusing for me,
but instead tried to ask whether somebody got this to work, because it
can't be that it doesn't work as wanted. Must be my fault somehow. I am
sure about that. That's why I proposed that the manual should be improoved
at this point.
Looks like I misunderstood something?!
Marko
|
|
From: Dr T. S. <ta...@sa...> - 2002-10-01 12:25:17
|
On Tue, 1 Oct 2002, Marko Kaening wrote:
>
> and output them with:
>
> for($i=0;$i<4;$i++)
> echo '<BR>'.$f->ge('question','Choice #'.$i)
>
> The text Choice#? won't be rendered as expected. The same for the
What do you mean by that?
What are you expecting and what are you getting?
Tarique
--
=============================================================
PHP Applications for E-Biz: http://www.sanisoft.com
Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
=============================================================
|
|
From: Marko K. <M.K...@os...> - 2002-10-01 11:01:08
|
> Unfortunately I can't find any examples in the documentation
> on how to define radio buttons.
The same problem with examples for checkboxes. Also it's not really
obvious how to validate radiobuttons and checkboxes? How to properly
define a default value (since usually there is nothing selected at the
beginning) and how to process the result. Would be really good to improove
the manual for this part. I also experimented with it, but couldn't really
make it work.
For instance, if I define my radio controls using:
$f->add_element(array('type'=>'radio',
'name'=>'question',
'valid_e'=>'Please select an option',
'multiple'=>TRUE));
and output them with:
for($i=0;$i<4;$i++)
echo '<BR>'.$f->ge('question','Choice #'.$i)
The text Choice#? won't be rendered as expected. The same for the
checkboxes. Does anyone have a properly working example for these
controls?
Thanks in advance!
Marko
|
|
From: Hans-Peter Z. <han...@un...> - 2002-10-01 07:24:54
|
Dear all, I just started using PHPLib and want to use some input fields of type 'radio' in my forms. Unfortunately I can't find any examples in the documentation on how to define radio buttons. I tried to use it in (more or less) the same way like the 'select' type, but it doesn't work. What would help me is a short sample code on using form elements of type 'radio'. Thanks for any help. Hans-Peter |
|
From: Joe S. <jo...@be...> - 2002-09-30 18:36:37
|
On Mon, Sep 30, 2002 at 07:32:28PM +0200, Giancarlo wrote: > Il 16:50, lunedì 30 settembre 2002, Joe Stewart ha scritto: > > > > I agree this should have been the way it worked inside the class instead > > of the way it actually works ( always displays the form related to the > > mode variable). > > Yes, but then this original aim of auth->mode seems has been abandoned along > the way by phplib, and mutated to a default... In fact the doc speaks of it > as an intended default... and, as the auth_doregister method is to be > provoded in local.inc. one can always have his extended auth class where > auth_dorgister says "sorry you cannot register for this"... I have doubts > about the original intentions, but now auth->mode is accepted as meaning > the default mode... And i I see from your example, you adopted another var, > authmode, to indicate the mode allowed. Right? > Correct - the authmode sets what is allowed. So if request url contains ?mode=reg but authmode is "log", the loginform will be displayed not the registerform. |
|
From: Joe S. <jo...@be...> - 2002-09-30 18:32:35
|
On Mon, Sep 30, 2002 at 12:48:21AM +0200, Giancarlo wrote: > > Or how, anyhow, can you prevent registering to a particular auth class? > I took a look at the code that Kristian posted and it looks like if auth_doregister is called in "log" mode an error message is generated in his example. http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/phplib/php-lib/php/local.inc?rev=1.29&content-type=text/vnd.viewcvs-markup Seems to me that it is more elegant to never call auth_doregister in "log" mode. Joe > Gian > > |
|
From: Giancarlo <gia...@na...> - 2002-09-30 17:36:55
|
Il 16:50, luned=EC 30 settembre 2002, Joe Stewart ha scritto: > > I agree this should have been the way it worked inside the class instea= d > of the way it actually works ( always displays the form related to the > mode variable). Yes, but then this original aim of auth->mode seems has been abandoned al= ong=20 the way by phplib, and mutated to a default... In fact the doc speaks of = it=20 as an intended default... and, as the auth_doregister method is to be=20 provoded in local.inc. one can always have his extended auth class where=20 auth_dorgister says "sorry you cannot register for this"... I have doubts= =20 about the original intentions, but now auth->mode is accepted as meaning = =20 the default mode... And i I see from your example, you adopted another va= r,=20 authmode, to indicate the mode allowed. Right?=20 Gian |
|
From: Mike G. <Mik...@sa...> - 2002-09-30 15:18:53
|
Tok, tok! [Sound of index finger drumming on empty skull behind very red face ;-)] Thanks! Swati Sani wrote: > On Mon, 30 Sep 2002, Mike Green wrote: > > > $cstr = "dbname=".$this->Database. > > $this->ifadd($this->Host, "host="). > ^^ > > You missed out on the . at the end of each line > > HTH > > Tarique > > -- > ============================================================= > PHP Applications for E-Biz: http://www.sanisoft.com > > Indian PHP User Group: http://groups.yahoo.com/group/in-phpug > ============================================================= -- _______________________________________________________________________ Michael D Green SaeSolved:: Custom-Built Web Applications -- http://www.saesolved.com 1552 Beachview Drive, Virginia Beach, VA 23464-7225, USA; 757.467.1552 http://www.everypeople.net http://www.sitewidgets.com _______________________________________________________________________ |
|
From: Joe S. <jo...@be...> - 2002-09-30 14:52:46
|
On Mon, Sep 30, 2002 at 12:48:21AM +0200, Giancarlo wrote:
> At the moment an auth class can have mode = log or reg, and we intend it as
> a default about which form to show.
>
> This value can be overridden by a ?mode= as a GET param
>
> But at a deeper exam, I came to a different conclusion, and wondere if some
> oddieties of phplib's logic, in regard, weren't due to an original
> consideration of this $auth->mode different than the I think we intend, and
> can be with good reasons
>
> In fact there is no need to specify that a protected page is mode=log, every
> protected page must be accessible by a login_page.
>
> But what if the programmer does nmot want to concede the possibility to
> 'register' for a certain class of auth, let's say admins.
> In this case, wasn't auth->mode="reg"n intended to say:
>
> for this page is alsopossible to register? So ?I'll listen to the ?mode=reg
> param?
I agree this should have been the way it worked inside the class instead
of the way it actually works ( always displays the form related to the
mode variable).
Reg mode should have only allowed a registration form, while log mode
would never show a registration form.
> What about the auth->mode==log meaning 'any', you can register to this
> service too by overriding with by ?mode=reg ??
>
> Or how, anyhow, can you prevent registering to a particular auth
class?
>
You may have seen how I did this.
In a configuration file I have:
; allow self registration.
; set to 'reg' for self registration, 'log' otherwise.
authmode = "reg"
This gets set to $_PSL['authmode'] in the application.
In the class extending auth, I have this conditional:
var $mode = "log";
...skip...
if ($HTTP_GET_VARS['mode']=='reg') {
if( !empty($_PSL['authmode'])) {
$this->mode = $_PSL['authmode'];
} else {
$this->mode='reg';
}
} else {
$this->mode='log';
}
in auth.inc
So, if regmode is requested and regmode is allowed a registration form
will be shown. Otherwise only the loginform will be shown.
Joe
> Gian
>
|
|
From: Mike G. <Mik...@sa...> - 2002-09-30 13:38:42
|
The function connect in db_pgsql.inc reads:
function connect() {
if ( 0 == $this->Link_ID ) {
$cstr = "dbname=".$this->Database.
$this->ifadd($this->Host, "host=").
$this->ifadd($this->Port, "port=").
$this->ifadd($this->User, "user=").
$this->ifadd($this->Password, "password=");
$this->Link_ID=pg_pconnect($cstr);
if (!$this->Link_ID) {
$this->halt("Link-ID == false, pconnect
failed");
}
}
}
It would seem to me that it should be:
function connect() {
if ( 0 == $this->Link_ID ) {
$cstr = "dbname=".$this->Database.
$cstr .= $this->ifadd($this->Host, "host=").
$cstr .= $this->ifadd($this->Port, "port=").
$cstr .= $this->ifadd($this->User, "user=").
$cstr .= $this->ifadd($this->Password, "password=");
$this->Link_ID=pg_pconnect($cstr);
if (!$this->Link_ID) {
$this->halt("Link-ID == false, pconnect
failed");
}
}
}
Yet it seems to work as it is. What am I missing?
Cheers!
Mike Green
|
|
From: Uli L. <web...@li...> - 2002-09-30 13:17:38
|
Hello Tarique!
>
> Sorry, I did not look at your regex properly
>
> You must use ^...$ if you want the regex to match the whole entry (which I
> almost always do ;)
OK, I changed it to:
"valid_regex"=>"^[a-z0-9_-]+(\.[a-z0-9_-]+)
*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+
([a-z]{2,4}|museum)$",
But it still tell's me "no valid E-Mail Adresse" if I leave the field
blank...
My I ask you again for an other Idea???
Uli
> > Hi Tarique!
> >
> > > Just dont use min_length attribute in your element.
> >
> > I don't use it:
> >
> > $f->add_element(array("type"=>"text",
> > "name"=>"EMail",
> > "size"=>$form_size1,
> > "valid_regex"=>"[a-z0-9_-]+(\.[a-z0-9_-]+)
> > *@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+
> > ([a-z]{2,4}|museum)",
> > "valid_e"=>"Die E-Mail-Adresse ist unvollständig...",
> > "icase"=>"1",
> > "maxlength"=>"100"));
> >
> > > BY default if the value is blank then OOHform will not validate it
> >
> > But it does...
> >
> > Any other Idea?
> >
> > Uli
> >
> >
>
> --
> =============================================================
> PHP Applications for E-Biz: http://www.sanisoft.com
>
> Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
> =============================================================
>
>
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
|
|
From: Dr T. S. <ta...@sa...> - 2002-09-30 13:08:24
|
On Mon, 30 Sep 2002, Uli Linn wrote:
Hello Uli,
Sorry, I did not look at your regex properly
You must use ^...$ if you want the regex to match the whole entry (which I
almost always do ;)
HTH
Tarique
> Hi Tarique!
>=20
> > Just dont use min_length attribute in your element.
>=20
> I don't use it:
>=20
> $f->add_element(array("type"=3D>"text",
> "name"=3D>"EMail",
> "size"=3D>$form_size1,
> "valid_regex"=3D>"[a-z0-9_-]+(\.[a-z0-9_-]+)
> *@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+
> ([a-z]{2,4}|museum)",
> =09=09 "valid_e"=3D>"Die E-Mail-Adresse ist unvollst=E4ndig...",
> "icase"=3D>"1",
> "maxlength"=3D>"100"));
>=20
> > BY default if the value is blank then OOHform will not validate it
>=20
> But it does...
>=20
> Any other Idea?
>=20
> Uli
>=20
>=20
--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
PHP Applications for E-Biz: http://www.sanisoft.com
Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|
|
From: Dr T. S. <ta...@sa...> - 2002-09-30 10:55:57
|
On Mon, 30 Sep 2002, Uli Linn wrote:
Just dont use min_length attribute in your element.
BY default if the value is blank then OOHform will not validate it
HTH
Tarique
> Good morning List!
>=20
> Im just trying to get some forms with OOHForms working (I hope this is no=
t
> off-topic). There is one Problem left:
>=20
> I have a form, where I ask for adress, phone, e-mail an so on.
>=20
> E-Mail is not required, but if the user fills out the E-Mail field, i wan=
t
> to validate the e-mail. I do the validation with the regular expression:
>=20
> [a-z0-9_-]+(\.[a-z0-9_-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+([a-z]{2,4}|mu=
seu
> m)
>=20
> The validation is OK. But what do I have to do, so that an empty E-Mail
> field is also accepted?
>=20
> Thank you all for your help!
>=20
> Uli
>=20
> ------------------------------------------------------
> Uli Linn LINN Internet Marketing
> Fon: +49-6831-976789 Waldstra=DFe 19
> Fax: +49-6831-976788 D-66763 Dillingen
> Mail: U....@Li... URL: http://www.LinnWeb.de
>=20
>=20
>=20
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
>=20
--=20
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
PHP Applications for E-Biz: http://www.sanisoft.com
Indian PHP User Group: http://groups.yahoo.com/group/in-phpug
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
|
|
From: Uli L. <U....@Li...> - 2002-09-30 08:09:55
|
Good morning List!
Im just trying to get some forms with OOHForms working (I hope this is not
off-topic). There is one Problem left:
I have a form, where I ask for adress, phone, e-mail an so on.
E-Mail is not required, but if the user fills out the E-Mail field, i want
to validate the e-mail. I do the validation with the regular expression:
[a-z0-9_-]+(\.[a-z0-9_-]+)*@([0-9a-z][0-9a-z-]*[0-9a-z]\.)+([a-z]{2,4}|museu
m)
The validation is OK. But what do I have to do, so that an empty E-Mail
field is also accepted?
Thank you all for your help!
Uli
------------------------------------------------------
Uli Linn LINN Internet Marketing
Fon: +49-6831-976789 Waldstraße 19
Fax: +49-6831-976788 D-66763 Dillingen
Mail: U....@Li... URL: http://www.LinnWeb.de
|
|
From: Giancarlo <gia...@na...> - 2002-09-29 23:19:27
|
if you are using session4, you should add this function to your auth.class,
to fix asecurity hole by which username and passwd are in plaintxt in
/tmp/sess_ files
It is very simple, thanks to the foreard looking design of phplib.
###
# add this if you are running authed pages
# with php4 native session handling
###
function __sleep () {
return $this->persistent_slots;
}
I short, the auth object was being dumped full variables, not respecting the
persistent_slot rule.
Add this whenever you rely on freezeing selectively based only the vars named
into the persistent_slot array
Gian
|
|
From: Giancarlo <gia...@na...> - 2002-09-29 22:52:40
|
At the moment an auth class can have mode = log or reg, and we intend it as a default about which form to show. This value can be overridden by a ?mode= as a GET param But at a deeper exam, I came to a different conclusion, and wondere if some oddieties of phplib's logic, in regard, weren't due to an original consideration of this $auth->mode different than the I think we intend, and can be with good reasons In fact there is no need to specify that a protected page is mode=log, every protected page must be accessible by a login_page. But what if the programmer does nmot want to concede the possibility to 'register' for a certain class of auth, let's say admins. In this case, wasn't auth->mode="reg"n intended to say: for this page is alsopossible to register? So ?I'll listen to the ?mode=reg param? What about the auth->mode==log meaning 'any', you can register to this service too by overriding with by ?mode=reg ?? Or how, anyhow, can you prevent registering to a particular auth class? Gian |
|
From: Giancarlo <gia...@na...> - 2002-09-27 11:07:12
|
Il 11:10, venerd=EC 27 settembre 2002, Maxim Derkachev ha scritto: > Hello Marko, > > The problem described by Giancarlo does not apply to the PHP's > serialize behavior, not Session4_Custom in particular. If you want to > make serialize not to save all the class variables, you should define > __sleep & __wakeup in serialized classes. This also apply to the > classes saved by User4, since it also serializes objects using PHP > serialize(). Ok. Now look at how the auth object is serialized. Suppose you have an auth object created by the Example_auth class. the on= ly=20 persistent slot is designed to be the $auth->auth array. Not even classna= me. You make persisten a session that has an auth class with classname=20 Example_auth and nobody=3Dfalse (no default_auth). You then open a page that HAS default_auth. It resumes from persistance a= =20 completely different auth object.=20 IF (and only if) here was not one persistent, it creates one, with classn= ame=20 Example_auth and, most important, var $nobody=3Dtrue. It will obviously i= nherit=20 the whole $auth->auth array, but these properties, that were meant to sta= y=20 OUT of pertsistance, are not, and thus not respected. So really a bug it is, for me Gian |
|
From: Maxim D. <max...@bo...> - 2002-09-27 09:11:21
|
Hello Marko, The problem described by Giancarlo does not apply to the PHP's serialize behavior, not Session4_Custom in particular. If you want to make serialize not to save all the class variables, you should define __sleep & __wakeup in serialized classes. This also apply to the classes saved by User4, since it also serializes objects using PHP serialize(). Friday, September 27, 2002, 12:42:37 PM, you wrote: >> G> With persistent slot you don't leave unconscoiusly, unaccounted or unwanted >> G> data around. >> ....................................... >> <skipped> >> Did you read my yesterday's message concerning __sleep & __wakeup? >> MK> Well, I noticed that the custom sessions (if you're not using extensively MK> many session variables, which I don't do since everything is stored via MK> your user4) slows my app only by 3% down in comparison to pure php4 MK> sessions. So, for security one could simply use the session4_custom.inc MK> instead. -- Best regards, Maxim Derkachev mailto:max...@bo... IT manager, Symbol-Plus Publishing Ltd. phone: +7 (812) 324-53-53 www.books.ru, www.symbol.ru |
|
From: Marko K. <M.K...@os...> - 2002-09-27 08:42:49
|
> G> With persistent slot you don't leave unconscoiusly, unaccounted or unwanted > G> data around. > ....................................... > <skipped> > Did you read my yesterday's message concerning __sleep & __wakeup? > Well, I noticed that the custom sessions (if you're not using extensively many session variables, which I don't do since everything is stored via your user4) slows my app only by 3% down in comparison to pure php4 sessions. So, for security one could simply use the session4_custom.inc instead. Marko |
|
From: Giancarlo <gia...@na...> - 2002-09-27 08:27:41
|
Can you please give it a try?
Read the page.inc, and compare to any other page.inc, and you find why the
auth object with a different class name and a nobody property no among
persistent_slots, could not be reinstantiated as needed with php4's
freeze/thaw practice. e
This explain why auth and default auth switching does not work, and probably
could not even with php3lib
my POP server is damn down
Gian
I forward pieces of previous messages and explainations on this. I solved
this into my auth, but it may regard phplib too
24,28c26,52
<
< if (!is_object($auth)) {
< $auth = new $feature["auth"];
< }
< $auth->start();
---
> $auth_slots=$auth->auth;
> $auth = new $feature["auth"];
> echo "TROVATA auth->classname ".$auth->classname."<br>";
> echo "trovata auth->auth[uid] ".$auth->auth["uid"]."<br>";
> $auth->auth=$auth_slots;
>
>
>
> if ($auth->start() )
> {
> $LOGGED_IN=true;
> }
> else
> {
> if ($auth->nobody)
> {
> $LOGGED_IN=false;
> }
> else
> {
> page_showform(); ### splash the form
> $sess->freeze(); ### save state
> exit;
> }
> }
Ithink this applied to any php4 implentation we have, where default_auth does
not work.
Gian
-------------------------------------------------------
---------- Messaggio inoltrato ----------
Subject: MO: auth for php4
Date: Fri, 27 Sep 2002 01:43:02 +0200
From: Giancarlo <gia...@na...>
To: Dr Tarique Sani <ta...@sa...>
Cc: Joe Stewart <jo...@be...>, Chris Johnson <ch...@ch...>
I have added some comments to my code in the previous:
> Read the page.inc, and compare to any other page.inc, and you find why the
> auth object with a different class name and a nobody property no among
> persistent_slots, could not be reinstantiated as needed with php4's
> freeze/thaw practice
>
>
> 24,28c26,52
Prevoius code:
-------------
> <
global $auth; is just here
> < if (!is_object($auth)) {
> < $auth = new $feature["auth"];
> < }
> < $auth->start();
> ---
If the auth object does not exist, generate a new one
If it exists, it has ALL the properties of that left peristent by a previous
page
New code
-------
global $auth; is just here
> > $auth_slots=$auth->auth;
save the $auth->auth array, as retrieved from persistance
> > $auth = new $feature["auth"];
start a new $auth object as instructed by the page_open funct
can be a different than the one stored, eg have nobody=true, or a
differebt classname
> > $auth->auth=$auth_slots;
merge back the persistent auth->auth array into the type of $auth
obj we have just generated. The nobody's field is not there.
> > if ($auth->start() )
if start method returns true we either:
are already authed and auth is not expired
have just submitted the correct login fields and are auther
have just posted correct reginfo and are authed
> > {
> > $LOGGED_IN=true;
if you need to use it, anycase.
> > }
> > else
He is or has not logged in
> > {
> > if ($auth->nobody)
if this page uses default_auth
> > {
> > $LOGGED_IN=false;
for later use,
> > }
> > else
> > {
if this page didn't use default auth, block
> > page_showform(); ### splash the form
> > $sess->freeze(); ### save state
> > exit;
> > }
> > }
PS, for some reason I cannot get mail now.
You have to consider this even if you don't mean to adopt a new auth.
As phplib is now, even session3, doesn't allow to have different 'areas'
with different access methods: blocking or interinal(?), You have to choose
one or another. Do you think this mught have been caused by this?
Can we provide some guidelines also for security? I noticed Michael's Chaney
latest message whe he sad his phpauth unsets the db obj before page_close,
and I was VERY demoralized when I saw all the db connection details in
plaintext in an autheed /tmp/sess_ file
There are obviously object persistence and resumption techniques that we have
to learn, and be aware of, with php4.
Gian
-------------------------------------------------------
---------- Messaggio inoltrato ----------
Subject: auth for php4
Date: Fri, 27 Sep 2002 01:13:28 +0200
From: Giancarlo <gia...@na...>
To: Dr Tarique Sani <ta...@sa...>
Cc: Joe Stewart <jo...@be...>, Chris Johnson <ch...@ch...>
I am sorry to disturb you with a piece of attachment here, but this is the
snapshot of something I really was looking for.
This is wat needed to run, gunzip under document root ;-), modify only
path prepend.php3 in the pages dir, local.inc, open the index in the pages
dir.
scripts are full of debug comments.
This is quite my new auth, but what is more important is I found a bug in the
way auth object resumption was made. I explained that better in my last
mesage to the list
<snip>
When phplib sess stores the object, it stores text, wich is in fact code that
is evalued at runtime. This text says: generate a new class by that class
name, and instantiate these varalues and properties. It does not reinsantiate
all properties, but only those that were marked as persistent_slots. In
practice it generates a new object with the name and definition available at
runtime, and merges into theat the persistent_slots found.
php4, on the other hand, stores full object and reinstiantiates them
automatically at startup, with all the values like they were. At runtime
these values are reloaded, ALL the values are taken back. It is not a merge.
I think this is a major difference
</snip>
Now the two page.inc_DEFERFORM and page.inc.SPLASHFORM are merged i a single,
and it should be capable, upon seeing if his own class supports 'nobody', to
manage one or the other behaviour. Of course, de deferred behavioir can be
customized, I simply use a global $IS_LOGGED variable for use later.
So it is somehow backwards compat, because it honourd scripts that already
use one or both the two existing different auth classes
|
|
From: Maxim D. <max...@bo...> - 2002-09-27 06:53:20
|
Hello Giancarlo, Friday, September 27, 2002, 2:07:52 AM, you wrote: G> php4, on the other hand, stores full object and reinstiantiates them G> automatically at startup, with all the values like they were. At runtime G> these values are reloaded, ALL the values are taken back. It is not a merge. G> I think this is a major difference G> With persistent slot you don't leave unconscoiusly, unaccounted or unwanted G> data around. ....................................... <skipped> Did you read my yesterday's message concerning __sleep & __wakeup? -- Best regards, Maxim Derkachev mailto:max...@bo... IT manager, Symbol-Plus Publishing Ltd. phone: +7 (812) 324-53-53 www.books.ru, www.symbol.ru |
|
From: Mike G. <mi...@op...> - 2002-09-27 03:12:29
|
Ya know.. PHPLIB & phpList are not the same thing.. But when you're tired and you are using nicknames it's easy to confuse the two.. Appologies! Mike On Thu, 2002-09-26 at 21:01, Mike Gifford wrote: > Hello Michiel, > > Couple of problems with 1.7.1 that I've noticed thus far. Might just be > my install.. But I can't seem to change preferences: > > http://www.billblaikie.org/lists/?p=preferences&uid=12d9d3bc007ee4d2c9f37ebeebe8e553 > > > When you are unsubscribing it seems to toss in no header and the phplist > footer (though it must not be referring to config/footer.inc as that's > just a symbolic link to my footer. The unsubscribe works (which is the > most important thing), but would like the consistency of the > header/footer files: > > http://www.billblaikie.org/lists/?p=unsubscribe&hash=12d9d3bc007ee4d2c9f37ebeebe8e553 > I'd also like to know if we can assume that the admin directory doesn't > need a separate password on it now with the default login structure. > This would be ideal so folks wouldn't have to login twice. > > Probably would have better thought out questions but I've been writing > this with a screaming child under foot. > > Mike > -- > Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca > Open Source Web Applications for Social Change. > Featured Clients - http://kenora.clc-ctc.ca | http://kingston.clc-ctc.ca > We are drowning in information, but starved for knowledge. - John > Naisbilt -- Mike Gifford, OpenConcept Consulting, http://www.openconcept.ca Open Source Web Applications for Social Change. Featured Clients - http://kenora.clc-ctc.ca | http://kingston.clc-ctc.ca We are drowning in information, but starved for knowledge. - John Naisbilt |