Menu

#99 another default login problem

open
docs (5)
5
2002-08-29
2002-08-29
Anonymous
No

I guess i have a Problem with the default login
(login_if)

in the documentation on page
http://www.sanisoft.com/phplib/manual/authAdde
dInfo.php

there is an error in the code
<A HREF="<?php $sess->purl('$PHP_SELF?
again=yes') ?>">Relogin</A>
<<< seams to be wrong >>>

it must look like

<A HREF="<?php $sess->purl($PHP_SELF.'?
again=yes') ?>">Relogin</A>

because the link should not look like this
http://yourweb.de/$PHP_SELF?again=yes

but i have another problem.
If I use the relogin by failure i cant get out of it.
What if i do not want to login because i have no
login and would like to surf as nobody on the page ?

i cant get out of it because there is a active session
created which i must delete on the database by
hand :( so i could use the page as a nobody (default
login) again.

Do i make a mistake ? or must i only place a cancel
button on the login screen to delete the session ?

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I had this problem and I think it is valid for all types of
    authentications, not just default auths. I had to add some
    code to the auth class to get around it and it seems to work
    fine now.<br>
    <br>
    <pre>
    .......
    $strPrevious = $strLast;
    $strLast = $_SERVER["PHP_SELF"];
    $sess->register("strLast");
    if ($strPrevious != $strLast) {
    $$cl = true;
    $sess->unregister("strLast");
    }

    # Check current auth state. Should be one of
    # 1) Not logged in (no valid auth info or auth expired)
    # 2) Logged in (valid auth info)
    # 3) Login in progress (if $$cl, revert to state 1)
    if ($this->is_authenticated()) {
    </pre>

    Hope this helps. If anyone else can think of a better way of
    doing this without a cancel button, please let us know.

     

Log in to post a comment.