本文整理汇总了PHP中login_form函数的典型用法代码示例。如果您正苦于以下问题:PHP login_form函数的具体用法?PHP login_form怎么用?PHP login_form使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了login_form函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: routing
/**
* routing
*
* @since 1.2.1
* @deprecated 2.0.0
*
* @package Redaxscript
* @category Center
* @author Henry Ruhs
*/
function routing()
{
/* check token */
if ($_POST && $_POST['token'] != TOKEN) {
notification(l('error_occurred'), l('token_incorrect'), l('home'), ROOT);
return;
}
/* call default post */
$post_list = array('comment', 'login', 'password_reset', 'registration', 'reminder', 'search');
foreach ($post_list as $value) {
if ($_POST[$value . '_post'] && function_exists($value . '_post')) {
call_user_func($value . '_post');
return;
}
}
/* general routing */
switch (FIRST_PARAMETER) {
case 'admin':
if (LOGGED_IN == TOKEN) {
admin_routing();
} else {
notification(l('error_occurred'), l('access_no'), l('login'), 'login');
}
return;
case 'login':
login_form();
return;
case 'logout':
if (LOGGED_IN == TOKEN) {
logout();
} else {
notification(l('error_occurred'), l('access_no'), l('login'), 'login');
}
return;
case 'password_reset':
if (s('reminder') == 1 && FIRST_SUB_PARAMETER && THIRD_PARAMETER) {
password_reset_form();
} else {
notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
}
return;
case 'registration':
if (s('registration')) {
registration_form();
} else {
notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
}
return;
case 'reminder':
if (s('reminder') == 1) {
reminder_form();
} else {
notification(l('error_occurred'), l('access_no'), l('home'), ROOT);
}
return;
default:
contents();
return;
}
}
示例2: login
function login()
{
global $vars, $day, $month, $year, $phpc_script;
$html = tag('div');
//Check password and username
if (isset($vars['username'])) {
$user = $vars['username'];
$password = $vars['password'];
if (login_user($user, $password)) {
$string = "{$phpc_script}?";
$arguments = array();
if (!empty($vars['lastaction'])) {
$arguments[] = "action={$vars['lastaction']}";
}
if (!empty($vars['year'])) {
$arguments[] = "year={$year}";
}
if (!empty($vars['month'])) {
$arguments[] = "month={$month}";
}
if (!empty($vars['day'])) {
$arguments[] = "day={$day}";
}
redirect($string . implode('&', $arguments));
return tag('h2', _('Logged in.'));
}
$html->add(tag('h2', _('Sorry, Invalid Login')));
}
$html->add(login_form());
return $html;
}
示例3: actionAdmin
function actionAdmin($sName = '')
{
$GLOBALS['iAdminPage'] = 1;
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
$sUri = $this->_oConfig->getUri();
check_logged();
if (!@isAdmin()) {
send_headers_page_changed();
login_form("", 1);
exit;
}
//--- Process actions ---//
$mixedResultSettings = '';
if (isset($_POST['save']) && isset($_POST['cat'])) {
$mixedResultSettings = $this->setSettings($_POST);
}
//--- Process actions ---//
$aDetailsBox = $this->getDetailsForm(BX_PMT_ADMINISTRATOR_ID);
$aPendingOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_PENDING, BX_PMT_ADMINISTRATOR_ID);
$aProcessedOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_PROCESSED, BX_PMT_ADMINISTRATOR_ID);
$aSubscriptionOrdersBox = $this->getOrdersBlock(BX_PMT_ORDERS_TYPE_SUBSCRIPTION, BX_PMT_ADMINISTRATOR_ID);
$sContent = '';
$sContent .= $this->_oTemplate->getJsCode('orders', true);
$sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings))));
$sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_details'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $aDetailsBox[0])));
$sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_pending_orders'), $aPendingOrdersBox[0]);
$sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_processed_orders'), $aProcessedOrdersBox[0]);
$sContent .= DesignBoxAdmin(_t($this->_sLangsPrefix . 'bcpt_subscription_orders'), $aSubscriptionOrdersBox[0]);
$sContent .= $this->getMoreWindow();
$sContent .= $this->getManualOrderWindow();
$this->_oTemplate->addAdminJs(array('orders.js', '_orders.js'));
$this->_oTemplate->addAdminCss(array('orders.css', '_orders.css'));
$aParams = array('title' => array('page' => _t($this->_sLangsPrefix . 'pcpt_administration')), 'content' => array('page_main_code' => $sContent));
$this->_oTemplate->getPageCodeAdmin($aParams);
}
示例4: login
function login()
{
global $vars, $phpc_script;
$html = tag('div');
//Check password and username
if (isset($vars['username'])) {
$user = $vars['username'];
if (!isset($vars['password'])) {
message(__("No password specified."));
} else {
$password = $vars['password'];
if (login_user($user, $password)) {
$url = $phpc_script;
if (!empty($vars['lasturl'])) {
$url .= '?' . urldecode($vars['lasturl']);
}
redirect($url);
return tag('h2', __('Logged in.'));
}
$html->add(tag('h2', __('Sorry, Invalid Login')));
}
}
$html->add(login_form());
return $html;
}
示例5: reg_form
function reg_form()
{
$config = get_config();
$disable_acct = parse_bool($config, "disable_account_creation");
page_head("Register");
start_table();
echo "<tr><td>";
echo "<h3>Create an account</h3>";
create_account_form(0, "download.php");
echo "</td><td>";
echo "<h3>If you already have an account, log in</h3>";
login_form("download.php");
echo "</td></tr>";
end_table();
page_tail();
}
示例6: actionAuth
function actionAuth()
{
$oRequest = OAuth2\Request::createFromGlobals();
$oResponse = new OAuth2\Response();
// validate the authorize request
if (!$this->_oServer->validateAuthorizeRequest($oRequest, $oResponse)) {
$o = json_decode($oResponse->getResponseBody());
$this->_oTemplate->pageError($o->error_description);
}
if (!isLogged()) {
$_REQUEST['relocate'] = BX_DOL_URL_ROOT . $this->_oConfig->getBaseUri() . 'auth/?client_id=' . bx_get('client_id') . '&response_type=' . bx_get('response_type') . '&state=' . bx_get('state') . '&redirect_uri=' . bx_get('redirect_uri');
login_form('', 0, false, 'disable_external_auth no_join_text');
return;
}
if (empty($_POST)) {
$this->_oTemplate->pageAuth($this->_oDb->getClientTitle(bx_get('client_id')));
}
$this->_oServer->handleAuthorizeRequest($oRequest, $oResponse, (bool) bx_get('confirm'), getLoggedId());
$oResponse->send();
}
示例7: skin_ClientPage_Default
function skin_ClientPage_Default()
{
global $adm_pass;
global $adm_login;
global $conf_skin;
////////////////////////////////////
// Create the top banner and menu //
////////////////////////////////////
$anotherTopBanner = anotherTopBanner("DTC");
$anotherLanguageSelection = anotherLanguageSelection();
$lang_sel = skin($conf_skin, $anotherLanguageSelection, _("Language"));
if ($adm_login != "" && isset($adm_login) && $adm_pass != "" && isset($adm_pass)) {
// Fetch all the user informations, Print a nice error message if failure.
$admin = fetchAdmin($adm_login, $adm_pass);
if (($error = $admin["err"]) != 0) {
$mesg = $admin["mesg"];
$login_txt = _("Error") . " {$error} " . _("fetching admin: ") . "<font color=\"red\">{$mesg}</font><br>";
$login_txt .= login_form();
$login_skined = skin($conf_skin, $login_txt, _("Client panel:") . " " . _("Login"));
$mypage = layout_login_and_languages($login_skined, $lang_sel);
} else {
// Draw the html forms
$HTML_admin_edit_data = drawAdminTools($admin);
$mypage = $HTML_admin_edit_data;
}
} else {
$login_txt = login_form();
$login_skined = skin($conf_skin, $login_txt, _("Client panel:") . " " . _("Login"));
$mypage = layout_login_and_languages($login_skined, $lang_sel);
}
// Output the result !
if (!isset($anotherHilight)) {
$anotherHilight = "";
}
echo anotherPage("Client:", "", $anotherHilight, makePreloads(), $anotherTopBanner, "", $mypage, anotherFooter(""));
}
示例8: skin_ClientPage
function skin_ClientPage()
{
global $adm_pass;
global $adm_login;
global $conf_skin;
global $page_metacontent;
global $meta;
global $confirm_javascript;
global $java_script;
global $skinCssString;
global $console;
////////////////////////////////////
// Create the top banner and menu //
////////////////////////////////////
$anotherTopBanner = anotherTopBanner("DTC");
$anotherLanguageSelection = anotherLanguageSelection();
$lang_sel = skin($conf_skin, $anotherLanguageSelection, _("Language"));
if ($adm_login != "" && isset($adm_login) && $adm_pass != "" && isset($adm_pass)) {
// Fetch all the user informations, Print a nice error message if failure.
$admin = fetchAdmin($adm_login, $adm_pass);
if (($error = $admin["err"]) != 0) {
$mesg = $admin["mesg"];
$login_txt = _("Error") . " {$error} " . _("fetching admin: ") . "<font color=\"red\">{$mesg}</font><br>";
$login_txt .= login_form();
$login_skined = skin($conf_skin, $login_txt, _("Client panel:") . " " . _("Login"));
$mypage = layout_login_and_languages($login_skined, $lang_sel);
} else {
// Draw the html forms
$HTML_admin_edit_data = '<div class="box_wnb_content_container">' . drawAdminTools($admin) . '</div>';
$mypage = $HTML_admin_edit_data;
}
} else {
$login_txt = login_form();
$mypage = skin($conf_skin, $login_txt, _("Client panel:") . " " . _("Login"));
}
echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html>\n<head>\n<title>DTC: Client: " . $_SERVER['SERVER_NAME'] . "</title>\n{$page_metacontent}\n{$meta}\n</head>\n<body id=\"page\" leftmargin=\"0\" topmargin=\"0\" marginwidth=\"0\" marginheight=\"0\">\n\t <div id=\"outerwrapper\">\n <div id=\"wrapper\">\n\n" . makePreloads() . "\n{$confirm_javascript}\n{$java_script}\n<link rel=\"stylesheet\" href=\"gfx/skin/bwoup/skin.css\" type=\"text/css\">\n{$skinCssString}\n\n" . anotherTopBanner("DTC", "yes") . "<div id=\"usernavbarreplacement\"></div>\n<div id=\"content\"><div class=\"box_wnb_content_container\">" . $mypage . "</div></div>\n<div id=\"footer\">" . anotherFooter("Footer content<br><br>") . "</div>\n </div>\n</div>\n</body>\n</html>";
}
示例9: member_auth
function member_auth($member = 0, $error_handle = true, $bAjx = false)
{
global $site;
switch ($member) {
case 0:
$mem = 'member';
$login_page = BX_DOL_URL_ROOT . "member.php";
$iRole = BX_DOL_ROLE_MEMBER;
break;
case 1:
$mem = 'admin';
$login_page = BX_DOL_URL_ADMIN . "index.php";
$iRole = BX_DOL_ROLE_ADMIN;
break;
}
if (empty($_COOKIE['memberID']) || !isset($_COOKIE['memberPassword'])) {
if ($error_handle) {
$text = _t("_LOGIN_REQUIRED_AE1");
if ($member == 0) {
$text .= "<br />" . _t("_LOGIN_REQUIRED_AE2", $site['images'], BX_DOL_URL_ROOT, $site['title']);
}
$bAjxMode = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) and $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') ? true : false;
if ($member = 1 && $bAjx == true) {
$bAjxMode = true;
}
login_form($text, $member, $bAjxMode);
}
return false;
}
return check_login(process_pass_data($_COOKIE['memberID']), process_pass_data($_COOKIE['memberPassword']), $iRole, $error_handle);
}
示例10: actionAdmin
function actionAdmin($sName = '')
{
$GLOBALS['iAdminPage'] = 1;
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
$sUri = $this->_oConfig->getUri();
check_logged();
if (!@isAdmin()) {
send_headers_page_changed();
login_form("", 1);
exit;
}
//--- Process actions ---//
$mixedResultSettings = '';
if (isset($_POST['save']) && isset($_POST['cat'])) {
$mixedResultSettings = $this->setSettings($_POST);
}
if (isset($_POST[$sUri . '-publish'])) {
$this->_actPublish($_POST[$sUri . '-ids'], true);
} else {
if (isset($_POST[$sUri . '-unpublish'])) {
$this->_actPublish($_POST[$sUri . '-ids'], false);
} else {
if (isset($_POST[$sUri . '-featured'])) {
$this->_actFeatured($_POST[$sUri . '-ids'], true);
} else {
if (isset($_POST[$sUri . '-unfeatured'])) {
$this->_actFeatured($_POST[$sUri . '-ids'], false);
} else {
if (isset($_POST[$sUri . '-delete'])) {
$this->_actDelete($_POST[$sUri . '-ids']);
}
}
}
}
}
//--- Process actions ---//
//--- Get New/Edit form ---//
$sPostForm = '';
if (!empty($sName)) {
$sPostForm = $this->serviceEditBlock(process_db_input($sName, BX_TAGS_STRIP));
} else {
if (isset($_POST['id'])) {
$sPostForm = $this->serviceEditBlock((int) $_POST['id']);
} else {
$sPostForm = $this->servicePostBlock();
}
}
//--- Get New/Edit form ---//
$sFilterValue = '';
if (isset($_GET[$sUri . '-filter'])) {
$sFilterValue = process_db_input($_GET[$sUri . '-filter'], BX_TAGS_STRIP);
}
$sContent = DesignBoxAdmin(_t('_' . $sUri . '_bcaption_settings'), $GLOBALS['oAdmTemplate']->parseHtmlByName('design_box_content.html', array('content' => $this->getSettingsForm($mixedResultSettings))));
$sContent .= DesignBoxAdmin(_t('_' . $sUri . '_bcaption_post'), $sPostForm);
$sContent .= DesignBoxAdmin(_t('_' . $sUri . '_bcaption_all'), $this->serviceAdminBlock(0, 0, $sFilterValue));
$aParams = array('title' => array('page' => _t('_' . $sUri . '_pcaption_admin')), 'content' => array('page_main_code' => $sContent));
$this->_oTemplate->getPageCodeAdmin($aParams);
}
示例11: logout
/*
회원관리 (로그인)
2001.06 by Jungjoon Oh
*/
require "mem-lib.php";
require "db-lib.php";
if (!$url) {
$url = $home_url;
}
if ($logout == 1) {
logout($url);
} elseif ($id && $passwd) {
login($id, $passwd, $url);
} else {
login_form($url);
}
exit;
function logout($url)
{
/* 쿠키 삭제 */
setcookie("MemberID", "", time() - 3600);
print_alert("로그아웃되었습니다. ", "url|{$url}");
exit;
}
function login($id, $passwd, $url)
{
$dbh = dbconnect();
$query = "select mem_id,mem_pw from member_data where mem_id='{$id}'";
$sth = dbquery($dbh, $query);
if (!$sth) {
示例12: bx_import
<?php
/**
* Copyright (c) BoonEx Pty Limited - http://www.boonex.com/
* CC-BY License - http://creativecommons.org/licenses/by/3.0/
*/
require_once BX_DIRECTORY_PATH_INC . 'admin_design.inc.php';
bx_import('Module', $aModule);
global $_page;
global $_page_cont;
$iIndex = 9;
$_page['name_index'] = $iIndex;
$_page['header'] = _t('_bx_pageac');
if (!@isAdmin()) {
send_headers_page_changed();
login_form("", 1);
exit;
}
$oModule = new BxPageACModule($aModule);
$_page_cont[$iIndex]['page_main_code'] = $oModule->_oTemplate->getTabs();
PageCodeAdmin();
示例13: getId
$iRecipientID = getId($vRecipientID);
if ($iRecipientID) {
$sOutputHtml = get_member_thumbnail($iRecipientID, 'none');
}
break;
}
// try to define the callback function name ;
if (isset($_GET['callback_function']) and in_array($_GET['callback_function'], $aCallbackFunctions)) {
if (method_exists($oMailBox, $_GET['callback_function'])) {
$sOutputHtml = $oMailBox->{$_GET['callback_function']}();
}
}
header('Content-Type: text/html; charset=utf-8');
echo $sOutputHtml;
exit;
}
// ** prepare to output page in normal mode ;
$sPageTitle = _t('_Mailbox');
$_page['name_index'] = 7;
$_page['header'] = $sPageTitle;
$_page['header_text'] = $sPageTitle;
$_page['js_name'] = $oMailBox->getJs();
$_page['css_name'] = $oMailBox->getCss();
$aVars = array('BaseUri' => BX_DOL_URL_ROOT);
$GLOBALS['oTopMenu']->setCustomSubActions($aVars, 'Mailbox', false);
if (!$aMailBoxSettings['member_id']) {
login_form(_t("_LOGIN_OBSOLETE"), 0, false);
}
$_ni = $_page['name_index'];
$_page_cont[$_ni]['page_main_code'] = $oMailBox->getCode();
PageCode();
示例14: header
if (!session_start()) {
// If the session couldn't start, present an error
header("Location: error.php");
exit;
}
// Check to see if the user has already logged in
$loggedIn = empty($_SESSION['loggedin']) ? false : $_SESSION['loggedin'];
if ($loggedIn) {
header("Location: home.php");
exit;
}
$action = empty($_POST['action']) ? '' : $_POST['action'];
if ($action == "do_login") {
handle_login();
} else {
login_form();
}
function handle_login()
{
$username = $_POST['username'];
$password = $_POST['password'];
require_once 'db.conf';
$mysqli = new mysqli($dbhost, $dbuser, $dbpass, $dbname);
if ($mysqli->connect_error) {
$error = 'Error: ' . $mysqli->connect_errno . ' ' . $mysqli->connect_error;
require "login_form.php";
exit;
}
$username = $mysqli->real_escape_string($username);
$password = $mysqli->real_escape_string($password);
$query = "SELECT * FROM users WHERE username = '{$username}' AND password = '{$password}'";
示例15: opendir
$dp = opendir($dir);
while ($subdir = readdir($dp)) {
if ($subdir != '.' && $subdir != '..' && is_dir($dir . "/" . $subdir)) {
$action_file = $dir . "/" . $subdir . "/" . $action . ".php";
if (file_exists($action_file)) {
require_once $action_file;
$html .= $action();
}
}
}
//or show login form
} else {
if (@$_GET['auth'] == 'login') {
//Login data is correct
if (check_login()) {
$_SESSION['user'] = @$_POST['user'];
header("location: /engine.php?action=start");
//or isn't correct
} else {
$html .= login_form("<span style='color:red'>Ошибка в логине или пароле!</span><br/>");
}
} else {
//Перебрасываем на форму входа в систему
//echo generate_hash("", "");
$html .= login_form();
}
}
//Add footer
$html .= template_get('footer');
//Show HTML flow
echo $html;