Exemplo n.º 1
0
/**
 * Prints the album password form
 *
 * @param string $hint hint to the password
 * @param bool $showProtected set false to supress the password protected message
 * @param bool $showuser set true to force the user name filed to be present
 * @param string $redirect optional URL to send the user to after successful login
 *
 * @since 1.1.3
 */
function printPasswordForm($_password_hint, $_password_showuser = NULL, $_password_showProtected = true, $_password_redirect = NULL)
{
    global $_zp_login_error, $_zp_password_form_printed, $_zp_current_search, $_zp_gallery, $_zp_gallery_page, $_zp_current_album, $_zp_current_image, $theme, $_zp_current_zenpage_page, $_zp_authority;
    if ($_zp_password_form_printed) {
        return;
    }
    $_zp_password_form_printed = true;
    if (is_null($_password_redirect)) {
        $_password_redirect = getPageRedirect();
    }
    if (is_null($_password_showuser)) {
        $_password_showuser = $_zp_gallery->getUserLogonField();
    }
    ?>
	<div id="passwordform">
		<?php 
    if ($_password_showProtected && !$_zp_login_error) {
        ?>
			<p>
				<?php 
        echo gettext("The page you are trying to view is password protected.");
        ?>
			</p>
			<?php 
    }
    if ($loginlink = zp_apply_filter('login_link', NULL)) {
        $logintext = gettext('login');
        ?>
			<a href="<?php 
        echo $loginlink;
        ?>
" title="<?php 
        echo $logintext;
        ?>
"><?php 
        echo $logintext;
        ?>
</a>
			<?php 
    } else {
        $_zp_authority->printLoginForm($_password_redirect, false, $_password_showuser, false, $_password_hint);
    }
    ?>
	</div>
	<?php 
}
/**
 * Prints the album password form
 *
 * @param string $hint hint to the password
 * @param bool $showProtected set false to supress the password protected message
 * @param bool $showuser set true to force the user name filed to be present
 * @param string $redirect optional URL to send the user to after successful login
 *
 *@since 1.1.3
 */
function printPasswordForm($_password_hint, $_password_showProtected = true, $_password_showuser = NULL, $_password_redirect = NULL)
{
    global $_zp_login_error, $_zp_password_form_printed, $_zp_current_search, $_zp_gallery, $_zp_gallery_page, $_zp_current_album, $_zp_current_image, $theme, $_zp_current_zenpage_page, $_zp_authority;
    if ($_zp_password_form_printed) {
        return;
    }
    if (is_null($_password_showuser)) {
        $_password_showuser = $_zp_gallery->getUserLogonField();
    }
    if (is_null($_password_redirect)) {
        $_password_redirect = getPageRedirect();
    }
    $_zp_password_form_printed = true;
    ?>
	<div id="passwordform">
	<?php 
    if ($_password_showProtected && !$_zp_login_error) {
        ?>
		<p>
			<?php 
        echo gettext("The page you are trying to view is password protected.");
        ?>
		</p>
		<?php 
    }
    $passwordform = SERVERPATH . '/' . THEMEFOLDER . '/' . $theme . '/password_form.php';
    if (file_exists($passwordform)) {
        deprecated_function_notify(gettext('printPasswordForm custom theme password forms is deprecated. You should style the form created by the Zenphoto_Authority class (or its derivatives) instead. Use of these forms will prevent alternative credentials implementations from working with a theme.'));
        include $passwordform;
    } else {
        $_zp_authority->printLoginForm($_password_redirect, false, $_password_showuser, false, $_password_hint);
    }
    ?>
	</div>
	<?php 
}