ZenphotoCMS Forum
Login-out link and form remains if false - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Login-out link and form remains if false (/thread-7999.html)



Login-out link and form remains if false - gwmbox - 2010-12-26

For the function

printUserLogin_out($before='', $after='', $showLoginForm=false, $logouttext=NULL)

I have set it as

printUserLogin_out(' | ','',false,'Log-out')

But the form is still being shown when the person logs out.

Build 6394 12/24

Cheers and Happy Holidays all

GW




Login-out link and form remains if false - sbillard - 2010-12-26

maybe you have the option user_logout_login_form set? That overrides.




Login-out link and form remains if false - gwmbox - 2010-12-26

aw... redface... oops

Cheers

GW




Login-out link and form remains if false - sbillard - 2010-12-26

Well, not so much an error. Probably the plugin should distinguish between passing a parameter and leaving it to the default. So we will make that change.




Login-out link and form remains if false - gwmbox - 2010-12-27

Ok thanks guys.

I hope you have had at least a small break

Ok I have tried in vane to get this to work.

I have the plugin user login-out installed and in the plugin options the enable box is ticked.

Now in the Gallery options the login-out box is NOT checked (BTW this does not work when I untick the box and APPLY within the admin, I need to set the item as unchecked in phpmyadmin - not sure why this happens and it may be the cause of the issue???)

Now in the front end when logged in my log-out link is shown, but when I use that link and log out I can then see a password field... however I have set it to false, as in not show the form.

Any other ideas for me to try?

Using build 6400 (12/25)

Cheers

GW




Login-out link and form remains if false - sbillard - 2010-12-27

If you have password protected items and a not logged-in visitor visits the page he will get a login form. This has nothing to do with the login-out plugin. That plugin is only so that you can display the form on a not protected page as well.

The form shown can be made theme dependent, thought, so you may want to play with a theme password.php script.




Login-out link and form remains if false - sbillard - 2010-12-27

What specific gallery option are you refering to? The only one I know of there is to control the "user" field of the login form.




Login-out link and form remains if false - gwmbox - 2010-12-28

Thanks for the replies, probably best if I try and show you want I mean.

User-login plugin is enabled.

Plugin is enabled in the Options -> Plugin

If I set the Gallery Behaviour to enabled for the user login

The result is this when logged in or like this when logged out.

When I turn OFF the Gallery Behaviour user login which I have to do via phpadmin as it does not allow me to do it via the ZP admin, the result when not logged in is this. That field is the password field. We do not want anything shown at all.

I might have to write my own function which is fine but just thought if I show you the behaviour you can work out if it is working as it should or should not, and also see if there is a fix to enable the user-login field in the gallery behaviour to be saved in admin as that is not happening now.

The code used on the page to call it is

``

Note that this is on a page and not an album.

Thanks

GW




Login-out link and form remains if false - sbillard - 2010-12-28

Quote:If I set the Gallery Behaviour to enabled for the user login
There is no such option. I think you are looking at enable user name login field Not at all the same thing. This just allows/disallows the field for the user name. E.g. with this disabled all you get is the password field. [BTW, click on the "details" links in the description area for more details (naturally).]

In addtion, this option is invalidated if any guest logon credentials require a user name (else how would the guest enter it?)

There is [b]NEVER[/b] nothing shown in a normal gallery when a login is required. Else guests would have no way to log into the gallery. Writing a function will do you no good. Instead write a logon form script. As suggested above: a theme resident password.php script.

As I previsously mentioned. this has nothing to do with the user login-out plugin. All that plugin does is present a login form on pages that would not otherwise require it.

It does not matter what script you are trying to access. If the element is marked as protected with a guest password (and user?) then anyone not logged in will not get to see it. They will instead be presented the results of the password.php script, normally a logon form.




Login-out link and form remains if false - gwmbox - 2010-12-28

That is fine, I did a duplicate of the
function printUserLogin_out

and placed it in my themes function.php file and gave it a new name and then changed

$showLoginForm = true;

to

$showLoginForm = false;

and it works as I want, this is with the gallery behaviour enable user name login field selected.

While it might not have been designed to work that way the result is the desired outcome

Cheers

GW




Login-out link and form remains if false - sbillard - 2010-12-28

Ok, glad you have what you want. I suspect that I have not properly understood your descriptions. Setting the $showLoginForm to false will only disable the form for users who are already logged in. If that is what you want, then setting the plugin option off would have done the same the same thing. If the page is protected and the visitor is not logged on, your theme scripts are not loaded, so no setting for the plugin matters.