No login field

I am using version 1.2.2 and the default theme set to "dark". I can log in via the admin.php URL but if I log out there is nowhere to log in while looking at the gallery? I have to go to the admin.php URL. Is there a way around this? If I go to "options" -> "gallery config" I have this field checked: "Enable user name login field:" but still no log in field in the gallery...

Comments

  • enable the `user_logout` plugin. Place a call on `printUserLogout()` where you would like the log-out/log-in links to appear. Set the third parameter of `printUserLogout()` to `true`.

    The Effervescence+ theme has this full functionality. The example theme uses the `printUserLogout()` plugin, but does not enable the login form.
  • I enabled the user_logout but I have no idea about the rest of what you said.

    Here is what I have:

    <?php
    /**
    * Provides a link so that users who have logged into zenphoto can logout.
    *
    * Place a call on printUserLogout() where you want the logout link to appear.
    *
    * @author Stephen Billard (sbillard)
    * @version 1.0.0
    * @package plugins
    */

    $plugin_description = gettext("Provides a means for placing a user logout link on your theme pages.");
    $plugin_author = "Stephen Billard (sbillard)";
    $plugin_version = '1.0.0';
    $plugin_URL = "http://www.zenphoto.org/documentation/plugins/_plugins---user_logout.php.html";

    $cookiepath = WEBPATH;
    if (WEBPATH == '') { $cookiepath = '/'; }

    if (!OFFSET_PATH) {
    $cookies = array();
    $candidate = array_unique(Array_merge(array_keys($_COOKIE), $_SESSION));
    foreach ($candidate as $cookie) {
    if ($cookie == 'zenphoto_auth' || $cookie == 'zp_gallery_auth' || $cookie == 'zp_search_auth' || strpos($cookie, 'zp_album_auth_') !== false) {
    $cookies[] = $cookie;
    }
    }
    if (isset($_GET['userlog'])) { // process the logout.
    if ($_GET['userlog'] == 0) {
    foreach($cookies as $cookie) {
    zp_setcookie($cookie, "", time()-368000, $cookiepath);
    }
    $_zp_loggedin = false;
    $saved_auth = NULL;
    $cookies = array();
    $_zp_pre_authorization = array();
    }
    }
    }

    /**
    * Prints the logout link if the user is logged in.
    * This is for album passwords only, not admin users;
    *
    * @param string $before before text
    * @param string $after after text
    * @param bool $showLoginForm set to true to display a login form if no one is logged in
    */
    function printUserLogout($before='', $after='', $showLoginForm=false) {
    global $cookies;
    if ($showLoginForm) {
    $showLoginForm = !checkforPassword(true);
    }
    if (empty($cookies) && $showLoginForm) {
    printPasswordForm('', false);
    } else {
    echo $before.''.gettext("logout").''.$after;
    }
    }

    ?>

    What do I need to do? What is a "call"?

    Thanks for your patience..
  • What 'call' means is that you have to insert the function into your theme script. As to where you put it, that depends on where you want the form to be placed. This is not the script as listed above, but the name of the function and its parameter list.

    If this is all greek to you, then maybe you should look at the two themes noted above and see how they did it. If that is still greek this is not going to be easy.
  • It's all greek to me...I guess I'll live without.

    Thanks for the replies.
Sign In or Register to comment.