本文整理汇总了PHP中printPasswordForm函数的典型用法代码示例。如果您正苦于以下问题:PHP printPasswordForm函数的具体用法?PHP printPasswordForm怎么用?PHP printPasswordForm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了printPasswordForm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printUserLogout
/**
* 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)) {
if ($showLoginForm) {
printPasswordForm('', false);
}
} else {
echo $before . '<a href="?userlog=0" title="' . gettext("logout") . '" >' . gettext("logout") . '</a>' . $after;
}
}
示例2: gettext
include "inc-copy.php";
?>
</div>
</div>
</div>
<div id="page">
<div class="post">
<?php
if (!zp_loggedin()) {
?>
<div class="error"><?php
echo gettext("Please Login");
?>
</div>
<?php
printPasswordForm($hint);
?>
<?php
} else {
?>
<div class="errorbox">
<p><?php
echo gettext('You are logged in...');
?>
</p>
</div>
<?php
}
?>
<?php
示例3: getGalleryIndexURL
<div id="content">
<div id="breadcrumb">
<h2><a href="<?php
echo getGalleryIndexURL();
?>
">Index</a> » <strong><?php
echo gettext("A password is required for the page you requested");
?>
</strong></h2>
</div>
<div id="content-error">
<div class="errorbox">
<?php
printPasswordForm($hint, $show);
?>
</div>
<?php
if (!zp_loggedin() && function_exists('printRegistrationForm') && $_zp_gallery->isUnprotectedPage('register')) {
printCustomPageURL(gettext('Register for this site'), 'register', '', '<br />');
echo '<br />';
}
?>
</div>
<div id="footer">
<?php
include "footer.php";
示例4: dirname
*
* Where <zenphoto install root> is the URL of your zenphoto root folder, e.g. http://myhost.com/zenphoto
*
* Of course, modify the style of this script to fit your needs.
*/
require_once dirname(__FILE__) . '/zp-core/global-definitions.php';
define('OFFSET_PATH', 0);
require_once ZENFOLDER . "/template-functions.php";
checkInstall();
if (!is_null($_zp_current_admin_obj)) {
if ($_zp_loggedin & ADMIN_RIGHTS) {
header("Location: " . WEBPATH . "/");
} else {
$albums = getManagedAlbumList();
$album = array_shift($albums);
header("Location: " . WEBPATH . "/" . $album . '/');
}
}
header('Content-Type: text/html; charset=' . getOption('charset'));
?>
<html>
<head>
<title>Zenphoto Single_login</title>
</head>
<body>
<?php
printPasswordForm('', true, false, "#");
?>
</body>
</html>
示例5: getOption
$hash = getOption('downloadList_password');
if (GALLERY_SECURITY != 'public' || $hash) {
// credentials required to download
if (!zp_loggedin(getOption('downloadList_rights') ? FILES_RIGHTS : ALL_RIGHTS)) {
$user = getOption('downloadList_user');
zp_handle_password('download_auth', $hash, $user);
if (!empty($hash) && zp_getCookie('download_auth') != $hash) {
$show = $user ? true : NULL;
$hint = '';
if (!empty($hash)) {
$hint = get_language_string(getOption('downloadList_hint'));
}
if (isset($_GET['albumzip'])) {
$item .= '&albumzip';
}
printPasswordForm($hint, true, $show, '?download=' . $item);
exitZP();
}
}
}
if (isset($_GET['albumzip'])) {
DownloadList::updateListItemCount($item . '.zip');
require_once SERVERPATH . '/' . ZENFOLDER . '/lib-zipStream.php';
if (isset($_GET['fromcache'])) {
$fromcache = sanitize($isset($_GET['fromcache']));
} else {
$fromcache = getOption('downloadList_zipFromCache');
}
AlbumZip::create($item, $fromcache);
exitZP();
} else {
示例6: printRegistrationForm
/**
* places the user registration form
*
* @param string $thanks the message shown on successful registration
*/
function printRegistrationForm($thanks = NULL)
{
global $notify, $admin_e, $admin_n, $user;
if (zp_loggedin()) {
if (isset($_GET['userlog']) && $_GET['userlog'] == 1) {
echo '<meta HTTP-EQUIV="REFRESH" content="0; url=/">';
} else {
echo '<div class="errorbox" id="fade-message">';
echo '<h2>' . gettext("you are already logged in.") . '</h2>';
echo '</div>';
}
return;
}
if (isset($notify)) {
if ($notify == 'verified' || $notify == 'accepted') {
if ($notify == 'verified') {
if (is_null($thanks)) {
$thanks = gettext("Thank you for registering.");
}
} else {
$thanks = gettext('An email has been sent to you to verify your email address.');
}
echo '<div class="Messagebox" id="fade-message">';
echo '<h2>' . gettext('Your registration has been accepted.') . '</h2>';
echo '<p>' . $thanks . '</p>';
echo '</div>';
if (function_exists('printUserLogout') && $notify == 'verified') {
?>
<p><?php
echo gettext('You may now log onto the site.');
?>
</p>
<?php
printPasswordForm('', false, true);
}
$notify = 'success';
} else {
echo '<div class="errorbox" id="fade-message">';
echo '<h2>' . gettext("Registration failed.") . '</h2>';
echo '<p>';
switch ($notify) {
case 'exists':
echo gettext('The user ID you chose is already in use.');
break;
case 'mismatch':
echo gettext('Your passwords did not match.');
break;
case 'incomplete':
echo gettext('You have not filled in all the fields.');
break;
case 'notverified':
echo gettext('Invalid verification link.');
break;
case 'invalidemail':
echo gettext('Enter a valid email address.');
break;
}
echo '</p>';
echo '</div>';
}
}
if ($notify != 'success') {
require_once dirname(__FILE__) . '/' . substr(basename(__FILE__), 0, -4) . '/' . 'register_user_form.php';
}
}
示例7: Template
$t = new Template(translate('Forgot Password'));
// Print HTML header
$t->printHTMLHeader();
// Start main table
$t->startMain();
// Set status to false so we print the form by default
$status = false;
// Determine if we are changing the password
if (isset($_POST['email_address']) && strstr($_SERVER['HTTP_REFERER'], $_SERVER['PHP_SELF'])) {
$status = changePassword();
}
// Print form or success message
if ($status) {
printSuccess();
} else {
printPasswordForm();
}
// End main table
$t->endMain();
// Print HTML footer
$t->printHTMLFooter();
/**
* Print password form
* This function prints out a form allowing
* a user to enter their email to change
* their forgotten password
* @param none
*/
function printPasswordForm()
{
?>
示例8: checkforPassword
/**
* Checks to see if a password is needed
* displays a password form if log-on is required
*
* Returns true if a login form has been displayed
*
* The password protection is hereditary. This normally only impacts direct url access to an album or image since if
* you are going down the tree you will be stopped at the first place a password is required.
*
* If the gallery is password protected then every album & image will require that password.
*
* If an album is password protected then all subalbums and images treed below that album will require
* the password. If there are multiple passwords in the tree and you direct link, the password that is
* required will be that of the nearest parent that has a password. (The gallery is the ur-parrent to all
* albums.)
*
* @param bool $silent set to true to inhibit the logon form
* @return bool
* @since 1.1.3
*/
function checkforPassword($silent = false)
{
global $_zp_current_album, $_zp_current_search, $_zp_gallery, $_zp_loggedin;
if (zp_loggedin(MAIN_RIGHTS | VIEWALL_RIGHTS | ALL_ALBUMS_RIGHTS)) {
return false;
}
// you're the admin, you don't need the passwords.
if (in_context(ZP_SEARCH)) {
// search page
$hash = getOption('search_password');
$show = getOption('search_user') != '';
$hint = get_language_string(getOption('search_hint'));
$authType = 'zp_search_auth';
if (empty($hash)) {
$hash = getOption('gallery_password');
$show = getOption('gallery_user') != '';
$hint = get_language_string(getOption('gallery_hint'));
$authType = 'zp_gallery_auth';
}
if (!empty($hash)) {
if (zp_getCookie($authType) != $hash) {
if (!$silent) {
printPasswordForm($hint, true, getOption('login_user_field') || $show);
}
return true;
}
}
} else {
if (isset($_GET['album'])) {
// album page
list($album, $image) = rewrite_get_album_image('album', 'image');
if (checkAlbumPassword($album, $hint)) {
return false;
} else {
if (!$silent) {
$alb = new Album($_zp_gallery, $album);
printPasswordForm($hint, true, getOption('login_user_field') || $alb->getUser() != '');
}
return true;
}
} else {
// index page
if ($_zp_loggedin) {
return false;
}
$hash = getOption('gallery_password');
$hint = get_language_string(getOption('gallery_hint'));
if (!empty($hash)) {
if (zp_getCookie('zp_gallery_auth') != $hash) {
if (!$silent) {
printPasswordForm($hint, true, getOption('login_user_field') || getOption('gallery_user') != '');
}
return true;
}
}
}
}
return false;
}
示例9: printRegistrationForm
//.........这里部分代码省略.........
return;
}
if (isset($_GET['login'])) {
//presumably the user failed to login....
$_notify = 'loginfailed';
}
if (!empty($_notify)) {
switch ($_notify) {
case 'verified':
if (is_null($thanks)) {
$thanks = gettext("Thank you for registering.");
}
?>
<div class="Messagebox fade-message">
<p><?php
echo $thanks;
?>
</p>
<p><?php
echo gettext('You may now log onto the site and verify your personal information.');
?>
</p>
</div>
<?php
case 'already_verified':
case 'loginfailed':
$_link = getRequestURI();
if (strpos($_link, '?') === false) {
$_SERVER['REQUEST_URI'] = $_link . '?login=true';
} else {
$_SERVER['REQUEST_URI'] = $_link . '&login=true';
}
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/user_login-out.php';
printPasswordForm(NULL, true, false, WEBPATH . '/' . ZENFOLDER . '/admin-users.php?page=users');
$_notify = 'success';
break;
case 'honeypot':
//pretend it was accepted
//pretend it was accepted
case 'accepted':
?>
<div class="Messagebox fade-message">
<p><?php
echo gettext('Your registration information has been accepted. An email has been sent to you to verify your email address.');
?>
</p>
</div>
<?php
if ($_notify != 'honeypot') {
$_notify = 'success';
}
// of course honeypot catches are no success!
break;
case 'exists':
?>
<div class="errorbox fade-message">
<h2><?php
echo gettext("Registration failed.");
?>
</h2>
<p><?php
printf(gettext('The user ID <em>%s</em> is already in use.'), $user);
?>
</p>
</div>
<?php
示例10: gettext
include 'inc_header.php';
?>
<!-- wrap -->
<!-- container -->
<!-- header -->
<h3><?php
echo gettext('Password required');
?>
</h3>
</div> <!-- /header -->
<div class="row">
<div class="span12">
<div class="post">
<?php
printPasswordForm('', true);
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#zpB_passwordform').modal({
show: true
});
});
</script>
</div>
</div>
</div>
<?php
include 'inc_footer.php';
示例11: printUserLogin_out
/**
* 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 int $showLoginForm to display a login form
* to not display a login form, but just a login link, set to 0
* to display a login form set to 1
* to display a link to a login form in colorbox, set to 2, but you must have colorbox enabled for the theme pages where this link appears.)
* @param string $logouttext optional replacement text for "Logout"
*/
function printUserLogin_out($before = '', $after = '', $showLoginForm = NULL, $logouttext = NULL)
{
global $_zp_gallery, $__redirect, $_zp_current_admin_obj, $_zp_login_error, $_zp_gallery_page;
$excludedPages = array('password.php', 'register.php', 'favorites.php', '404.php');
$logintext = gettext('Login');
if (is_null($logouttext)) {
$logouttext = gettext("Logout");
}
$params = array("'userlog=0'");
if (!empty($__redirect)) {
foreach ($__redirect as $param => $value) {
$params[] .= "'" . $param . '=' . urlencode($value) . "'";
}
}
if (is_null($showLoginForm)) {
$showLoginForm = getOption('user_logout_login_form');
}
if (is_object($_zp_current_admin_obj)) {
if (!$_zp_current_admin_obj->logout_link) {
return;
}
}
$cookies = Zenphoto_Authority::getAuthCookies();
if (empty($cookies) || !zp_loggedin()) {
if (!in_array($_zp_gallery_page, $excludedPages)) {
switch ($showLoginForm) {
case 1:
?>
<div class="passwordform">
<?php
printPasswordForm('', true, false);
?>
</div>
<?php
break;
case 2:
if (getOption('colorbox_' . $_zp_gallery->getCurrentTheme() . '_' . stripSuffix($_zp_gallery_page)) && zp_has_filter('theme_head', 'colorbox::css')) {
?>
<script type="text/javascript">
// <!-- <![CDATA[
$(document).ready(function() {
$(".logonlink").colorbox({
inline: true,
innerWidth: "400px",
href: "#passwordform",
close: '<?php
echo gettext("close");
?>
',
open: $('#passwordform_enclosure .errorbox').length
});
});
// ]]> -->
</script>
<?php
if ($before) {
echo '<span class="beforetext">' . html_encodeTagged($before) . '</span>';
}
?>
<a href="#" class="logonlink" title="<?php
echo $logintext;
?>
"><?php
echo $logintext;
?>
</a>
<span id="passwordform_enclosure" style="display:none">
<div class="passwordform">
<?php
printPasswordForm('', true, false);
?>
</div>
</span>
<?php
if ($after) {
echo '<span class="aftertext">' . html_encodeTagged($after) . '</span>';
}
}
break;
default:
if ($loginlink = zp_apply_filter('login_link', getCustomPageURL('password'))) {
if ($before) {
echo '<span class="beforetext">' . html_encodeTagged($before) . '</span>';
}
?>
<a href="<?php
echo $loginlink;
?>
//.........这里部分代码省略.........
示例12: dirname
$show = $_zp_gallery->getUser();
}
if (empty($hash) && GALLERY_SECURITY == 'private' || !empty($hash) && zp_getCookie($authType) != $hash) {
require_once dirname(__FILE__) . "/template-functions.php";
$parms = '';
if (isset($_GET['wmk'])) {
$parms = '&wmk=' . $_GET['wmk'];
}
if (isset($_GET['q'])) {
$parms .= '&q=' . sanitize_numeric($_GET['q']);
}
if (isset($_GET['dsp'])) {
$parms .= '&dsp=' . sanitize_numeric($_GET['dsp']);
}
$action = WEBPATH . '/' . ZENFOLDER . '/full-image.php?userlog=1&a=' . pathurlencode($album8) . '&i=' . urlencode($image8) . $parms;
printPasswordForm($hint, true, $_zp_gallery->getUserLogonField() || $show, $action);
exit;
}
exit;
}
$image_path = ALBUM_FOLDER_SERVERPATH . $album . '/' . $image;
$suffix = getSuffix($image_path);
$cache_file = $album . "/" . substr($image, 0, -strlen($suffix) - 1) . '_FULL.' . $suffix;
switch ($suffix) {
case 'bmp':
$suffix = 'wbmp';
break;
case 'jpg':
$suffix = 'jpeg';
break;
case 'png':
示例13: printRegistrationForm
//.........这里部分代码省略.........
$message = sprintf(get_language_string(getOption('register_user_text')), $link);
$notify = zp_mail(get_language_string(gettext('Registration confirmation')), $message, array($user => $admin_e));
if (empty($notify)) {
$notify = 'accepted';
}
}
}
}
} else {
$notify = 'mismatch';
}
} else {
$notify = 'incomplete';
}
}
if (zp_loggedin()) {
if (isset($_GET['userlog']) && $_GET['userlog'] == 1) {
echo '<meta http-equiv="refresh" content="1; url=' . WEBPATH . '/">';
} else {
echo '<div class="errorbox fade-message">';
echo '<h2>' . gettext("you are already logged in.") . '</h2>';
echo '</div>';
}
return;
}
if (!empty($notify)) {
if ($notify == 'verified' || $notify == 'accepted') {
?>
<div class="Messagebox fade-message">
<p>
<?php
if ($notify == 'verified') {
if (is_null($thanks)) {
$thanks = gettext("Thank you for registering.");
}
echo $thanks;
} else {
echo gettext('Your registration information has been accepted. An email has been sent to you to verify your email address.');
}
?>
</p>
</div>
<?php
if ($notify == 'verified') {
require_once SERVERPATH . '/' . ZENFOLDER . '/' . PLUGIN_FOLDER . '/user_login-out.php';
?>
<p><?php
echo gettext('You may now log onto the site.');
?>
</p>
<?php
printPasswordForm('', false, true, WEBPATH . '/' . ZENFOLDER . '/admin.php');
}
$notify = 'success';
} else {
echo '<div class="errorbox fade-message">';
echo '<h2>' . gettext("Registration failed.") . '</h2>';
echo '<p>';
switch ($notify) {
case 'exists':
printf(gettext('The user ID <em>%s</em> is already in use.'), $admin_e);
break;
case 'mismatch':
echo gettext('Your passwords did not match.');
break;
case 'incomplete':
echo gettext('You have not filled in all the fields.');
break;
case 'notverified':
echo gettext('Invalid verification link.');
break;
case 'invalidemail':
echo gettext('Enter a valid email address.');
break;
case 'invalidcaptcha':
echo gettext('The CAPTCHA you entered was not correct.');
break;
case 'not_verified':
echo gettext('Your registration request could not be completed.');
break;
case 'filter':
if (is_object($userobj) && !empty($userobj->msg)) {
echo $userobj->msg;
} else {
echo gettext('Your registration attempt failed a <code>register_user_registered</code> filter check.');
}
break;
default:
echo $notify;
break;
}
echo '</p>';
echo '</div>';
}
}
if ($notify != 'success') {
$form = getPlugin('register_user/register_user_form.php', true);
require_once $form;
}
}
示例14: printUserLogin_out
/**
* 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
* @param string $logouttext optional replacement text for "Logout"
*/
function printUserLogin_out($before = '', $after = '', $showLoginForm = NULL, $logouttext = NULL)
{
global $__redirect;
$cookies = array();
$candidate = array();
if (isset($_COOKIE)) {
$candidate = $_COOKIE;
}
if (isset($_SESSION)) {
$candidate = array_merge($candidate, $_SESSION);
}
$candidate = array_unique($candidate);
foreach ($candidate as $cookie => $value) {
if ($cookie == 'zenphoto_auth' || $cookie == 'zp_gallery_auth' || $cookie == 'zp_search_auth' || $cookie == 'zp_image_auth' || strpos($cookie, 'zp_album_auth_') !== false || strpos($cookie, 'zp_page_auth_') !== false || strpos($cookie, 'zp_category_auth_') !== false) {
$cookies[] = $cookie;
}
}
if (is_null($logouttext)) {
$logouttext = gettext("Logout");
}
if (is_null($showLoginForm) && getOption('user_logout_login_form')) {
$showLoginForm = true;
}
if (empty($cookies)) {
if ($showLoginForm) {
?>
<div class="passwordform">
<?php
printPasswordForm('', false);
?>
</div>
<?php
}
} else {
$params = array("'userlog=0'");
if (!empty($__redirect)) {
foreach ($__redirect as $param => $value) {
$params[] .= "'" . $param . '=' . urlencode($value) . "'";
}
}
echo "\n" . $before;
?>
<a href="javascript:launchScript('<?php
echo FULLWEBPATH . '/';
?>
',[<?php
echo implode(',', $params);
?>
]);" title="<?php
echo $logouttext;
?>
" ><?php
echo $logouttext;
?>
</a>
<?php
echo $after . "\n";
}
}
示例15: printHomeLink
<div class="left-corner">
<!-- begin content -->
<div class="main section" id="main">
<h2 id="gallerytitle">
<?php
printHomeLink('', ' » ');
printGalleryIndexURL(' » ');
echo "<em>" . gettext('Password required') . "</em>";
?>
</h2>
<h3><?php
echo gettext('A password is required to access this page.');
?>
</h3>
<?php
printPasswordForm('', true, false);
footer();
?>
<p style="clear: both;"></p>
</div>
<!-- end content -->
<span class="clear"></span> </div>
</div>
</div>
</div>
<span class="clear"></span>
</div><!-- /container -->
</div>
<?php
zp_apply_filter('theme_body_close');
?>