[BW-dev-discussion] about redirection

Michael Dettbarn micha ...
Mon Jan 14 16:40:31 UTC 2008


> C) Don't use a centralized login page, but allow to login on every page.

The myTravelbook was build like this. I changed parts of the page.php
back to its default and now have the login-form on every page of my
local bw-install here. The necessary code in page.php is the
following:

       <?php $User->displayLoginForm(); ?>

Put it where ever you want your login form to show up on your page.
Note that this only works due to the implementation of the
User-Controller in the beginning. We never deactivated it although it
is used for the login-form (and the status info when logged in) only.

Go try it and say if you think this is the way to go. We could also
integrate the login-form in our header or in a div that can be
hidden/revealed via javascript..

cheers
Micha


> This would mean 4+ cases for building a page:
> - logged in as member xy
> - not logged in
> - not logged in, but receiving 'login_submit' command with $_POST
> parameters (username, pw)
> - logged in, but receiving a 'logout' command.
>
> evtl, if we don't want to have the login fields on every page:
> - not logged in, but receiving a 'login' command
>   -> show login form on this page
>   -> in old bw, this could be done with $_GET parameters:
> 'bw/member.php?cid=kiwi&show_login_fields=1'
>   -> in rox, it could be 'member/kiwi/login' or 'member/kiwi/action:login'
> (we can still talk about the design of our url strings)
> - receiving 'login_submit' command.
>
> As I heard, PT does already provide something similar?
>
>
> >
> > The second option is probably a bit quicker to do (unfortunately I don't
> > feel like touching too muche the PT Login, i mean it is a bit
> > touchy-core PT
> > area).
> >
> > nota 1 : I'm sorry for the poor documentation of the MustLogIn()
> > functiun,
> > the doc inside is a comment telling the role of teh parameter. Basically,
> > the old BW Login used to do a header("location", ...) with this
> > parameter,
> > or by default forwarded the index page).
> >> From my experience, these header location trick can work perfectly but
> >> are
> > tricky to tune. It is a bit fussy.
> > nota 2 : there is probably a similar mecanism in PT, coudl we imagine
> > MustLogIn() to call this mecanism ?
> >
> > what do you think A) or B) ?
> >
> > JeanYves
> >
> >
> >> -----Message d'origine-----
> >> De : bw-dev-discussion-bounces at bewelcome.org
> >> [mailto:bw-dev-discussion-bounces at bewelcome.org] De la part
> >> de Felix van Hove
> >> Envoyé : dimanche 13 janvier 2008 23:32
> >> À : BeWelcome Developers Team
> >> Objet : Re: [BW-dev-discussion] keep rox out of bw
> >>
> >> Hello Andreas,
> >>
> >> while porting code into the platformPT framework I ususally
> >> fix bugs (and add new one's of course - as the one Jean-Yves
> >> obviously recently found in MOD_Log). In my opinion it
> >> doesn't make sense to start to fix bugs in both old BW and
> >> new BW. I regard it as practically impossible to maintain two
> >> complete code sets, which pretend to do the same, but in a
> >> completely different manner. Instead we should strive for a
> >> proceeding replacement of old BW functions by new Rox
> >> functions. Would you like to implement all your changes of
> >> the words module simultaneously in the ww function? Don't you
> >> think the words module should replace lang.php as soon as possible?
> >>
> >> Just two points:
> >>
> >> - We need your work for better reasons than keeping ww and
> >> getBuffered in sync.
> >>
> >> - It really gets hard to track down problems, if we e.g.
> >> don't know, which update of the words table (the BW-function
> >> or the Rox-function) is responsible for some entries.
> >>
> >> Or may be I misunderstood you?
> >>
> >> In regard to the lost redirect during the old login: A brief
> >> look at our active tickets didn't lead me to the description
> >> - do we have one? I'd take care for the fix.
> >>
> >> So long,
> >> Felix
> >>
> >>
> >> Andreas (lemon-head) wrote:
> >> > Hi.
> >> >
> >> > Felix and me have recently worked on keeping all the old bw
> >> functions
> >> > out of the rox part, to avoid unmanageable side effects. We had to
> >> > re-code several of the bw functions, but finally it works (on
> >> > test.bw). I was able to rename my bw directories on
> >> localhost, and the rox part still worked.
> >> >
> >> > Now I'm thinking if we could do the reverse for the old bw
> >> part, for
> >> > the time we still have it (which can be a long time):
> >> > - Keep all rox php includes out of bw
> >> > - re-implement (copypaste+modify) rox stuff in bw, if necessary.
> >> >
> >> > The only shared things for bw and rox would be
> >> > - the $_SESSION vars
> >> > - information stored on client side (cookies, login?), and
> >> what else
> >> > we need for the logins (so far I have not checked how the
> >> login works)
> >> > - the database tables
> >> > - the config.inc.php file.
> >> > - some shared media resources such as memberphotos files, etc.
> >> > - I'm not sure about stylesheets, I think they can also be shared.
> >> >
> >> > Is this something realistic?
> >> > The main benefit would be, again, to avoid nasty side
> >> effects or make
> >> > them easier to manage.
> >> > I imagine the biggest problem would be the logins. (But I
> >> can't really
> >> > say)
> >> >
> >> > ----
> >> >
> >> > One particular issue can be found in
> >> > htdocs/bw/lib/rights.php
> >> > function MustLogIn(..)
> >> >
> >> > This function uses rox functionality.
> >> > In the past there was a redirect from the login page to the
> >> page you
> >> > wanted to see - now this redirect doesn't work anymore, and
> >> it will be
> >> > hard to find out why, if it's just a side effect of bw vs rox.
> >> >
> >> > ----
> >> >
> >> > Any thoughts?
> >> >
> >> > regards,
> >> > Andreas
> >> > _______________________________________________
> >> > bw-dev-discussion mailing list
> >> > bw-dev-discussion at bewelcome.org
> >> > http://bewelcome.org/mailman/listinfo/bw-dev-discussion
> >> >
> >> _______________________________________________
> >> bw-dev-discussion mailing list
> >> bw-dev-discussion at bewelcome.org
> >> http://bewelcome.org/mailman/listinfo/bw-dev-discussion
> >>
> >>
> >
> > _______________________________________________
> > bw-dev-discussion mailing list
> > bw-dev-discussion at bewelcome.org
> > http://bewelcome.org/mailman/listinfo/bw-dev-discussion
>
>
> _______________________________________________
> bw-dev-discussion mailing list
> bw-dev-discussion at bewelcome.org
> http://bewelcome.org/mailman/listinfo/bw-dev-discussion
>
>


More information about the bw-dev-discussion mailing list