本文整理汇总了PHP中LoginAuth类的典型用法代码示例。如果您正苦于以下问题:PHP LoginAuth类的具体用法?PHP LoginAuth怎么用?PHP LoginAuth使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LoginAuth类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: checkform
<div><input name="alias" id="alias" /></div>
<div style="margin-top:3px;">
文章访问密码:<input type="text" value="" name="password" id="password" style="width:80px;" />
<span id="post_options">
<input type="checkbox" value="y" name="top" id="top" />
<label for="top">首页置顶</label>
<input type="checkbox" value="y" name="sortop" id="sortop" />
<label for="sortop">分类置顶</label>
<input type="checkbox" value="y" name="allow_remark" id="allow_remark" checked="checked" />
<label for="allow_remark">允许评论</label>
</span>
</div>
</div>
<div id="post_button">
<input name="token" id="token" value="<?php
echo LoginAuth::genToken();
?>
" type="hidden" />
<input type="hidden" name="ishide" id="ishide" value="">
<input type="submit" value="发布文章" onclick="return checkform();" class="button" />
<input type="hidden" name="author" id="author" value=<?php
echo UID;
?>
/>
<input type="button" name="savedf" id="savedf" value="保存草稿" onclick="autosave(2);" class="button" />
</div>
</div>
</form>
<div class=line></div>
<script>
loadEditor('content');
开发者ID:LockGit,项目名称:emlog,代码行数:31,代码来源:add_log.php
示例2: login
function login($username, $password)
{
$username = addslashes($username);
$password = addslashes($password);
// 检查用户权限
if (true !== LoginAuth::checkUser($username, $password, '', 'n')) {
error_message(403, '用户名密码错误');
return false;
}
// 返回用户信息
return LoginAuth::getUserDataByLogin($username);
}
开发者ID:szshenjian,项目名称:JIEWU,代码行数:12,代码来源:xmlrpc.php
示例3: array_push
array_push($custom_topimgs, substr($topimg_path, 3));
Option::updateOption('topimg', substr($topimg_path, 3));
Option::updateOption('custom_topimgs', serialize($custom_topimgs));
$CACHE->updateCache('options');
emDirect("./template.php?action=custom-top&activated=1");
}
//安装模板
if ($action == 'install') {
include View::getView('header');
require_once View::getView('template_install');
include View::getView('footer');
View::output();
}
//上传zip模板
if ($action == 'upload_zip') {
LoginAuth::checkToken();
$zipfile = isset($_FILES['tplzip']) ? $_FILES['tplzip'] : '';
if ($zipfile['error'] == 4) {
emDirect("./template.php?action=install&error_d=1");
}
if (!$zipfile || $zipfile['error'] >= 1 || empty($zipfile['tmp_name'])) {
emMsg('模板上传失败');
}
if (getFileSuffix($zipfile['name']) != 'zip') {
emDirect("./template.php?action=install&error_a=1");
}
$ret = emUnZip($zipfile['tmp_name'], '../content/templates/', 'tpl');
switch ($ret) {
case 0:
emDirect("./template.php?activate_install=1#tpllib");
break;
开发者ID:MikeCoder,项目名称:mblog,代码行数:31,代码来源:template.php
示例4: define
define('OFFICIAL_SERVICE_HOST', 'http://www.emlog.net/');
//官方服务域名
$sta_cache = $CACHE->readCache('sta');
$user_cache = $CACHE->readCache('user');
$action = isset($_GET['action']) ? addslashes($_GET['action']) : '';
//登录验证
if ($action == 'login') {
$username = isset($_POST['user']) ? addslashes(trim($_POST['user'])) : '';
$password = isset($_POST['pw']) ? addslashes(trim($_POST['pw'])) : '';
$ispersis = isset($_POST['ispersis']) ? intval($_POST['ispersis']) : false;
$img_code = Option::get('login_code') == 'y' && isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
$loginAuthRet = LoginAuth::checkUser($username, $password, $img_code);
if ($loginAuthRet === true) {
LoginAuth::setAuthCookie($username, $ispersis);
emDirect("./");
} else {
LoginAuth::loginPage($loginAuthRet);
}
}
//退出
if ($action == 'logout') {
setcookie(AUTH_COOKIE_NAME, ' ', time() - 31536000, '/');
emDirect("../");
}
if (ISLOGIN === false) {
LoginAuth::loginPage();
}
$request_uri = strtolower(substr(basename($_SERVER['SCRIPT_NAME']), 0, -4));
if (ROLE == ROLE_WRITER && !in_array($request_uri, array('write_log', 'admin_log', 'attachment', 'blogger', 'comment', 'index', 'save_log'))) {
emMsg('权限不足!', './');
}
开发者ID:flyysr,项目名称:emlog,代码行数:31,代码来源:globals.php
示例5: error_reporting
<?php
/**
* 全局项加载
* @copyright (c) Emlog All Rights Reserved
*/
error_reporting(7);
ob_start();
header('Content-Type: text/html; charset=UTF-8');
define('EMLOG_ROOT', dirname(__FILE__));
require_once EMLOG_ROOT . '/config.php';
require_once EMLOG_ROOT . '/include/lib/function.base.php';
doStripslashes();
$CACHE = Cache::getInstance();
$userData = array();
define('ISLOGIN', LoginAuth::isLogin());
//用户组:admin管理员, writer联合撰写人, visitor访客
define('ROLE_ADMIN', 'admin');
define('ROLE_WRITER', 'writer');
define('ROLE_VISITOR', 'visitor');
//用户角色
define('ROLE', ISLOGIN === true ? $userData['role'] : ROLE_VISITOR);
//用户ID
define('UID', ISLOGIN === true ? $userData['uid'] : '');
//站点固定地址
define('BLOG_URL', Option::get('blogurl'));
//模板库地址
define('TPLS_URL', BLOG_URL . 'content/templates/');
//模板库路径
define('TPLS_PATH', EMLOG_ROOT . '/content/templates/');
//解决前台多域名ajax跨域
开发者ID:LockGit,项目名称:emlog,代码行数:31,代码来源:init.php
示例6: dbSanitize
<?php
require_once "../../includes/engine.php";
templates::display('header');
if (isset($_POST['MYSQL'])) {
$login = $_POST['MYSQL'];
$username = dbSanitize($login['username']);
$pass = dbSanitize($login['password']);
$accepted = LoginAuth::loginUser($username, $pass);
if ($accepted) {
$feedback = "<div class='alert alert-success'> Logged In Successfully! </div>";
header("refresh:3;url=/");
} else {
if (!LoginAuth::checkUsername($username)) {
$feedback = "<div class='alert alert-danger'> Login Failed, wrong <strong><u> username </u></strong> please try again </div>";
} else {
$feedback = "<div class='alert alert-danger'> Login Failed, wrong <strong><u> password </u></strong> please try again </div>";
}
}
$localvars->set('feedback', $feedback);
}
?>
<div class="row">
<div class="col-xs-12 col-sm-offset-2 col-sm-8">
<h2> Login </h2>
</div>
<div class="col-xs-12 col-sm-offset-2 col-sm-8 register well">
{local var="feedback"}
<form action=<?php
开发者ID:ddavisgraphics,项目名称:LearningApp,代码行数:31,代码来源:index.php
示例7:
<?php
require_once "../../includes/engine.php";
// Just save the session info
if (LoginAuth::checkAuthorization()) {
ProgressLog::saveSession();
}
header("refresh:5;url=/?sessionSaved");
templates::display('header');
?>
<div class="row">
<div class="col-xs-12 col-sm-offset-2 col-sm-8 well text-center">
<h2> Logging Out</h2><br>
<i class="fa fa-spinner fa-spin fa-5x"></i><br><br>
<p> Saving your information into the system so that your information and progress remains intact while finishing the course modules. </p>
</div>
</div>
<?php
templates::display('footer');
开发者ID:ddavisgraphics,项目名称:LearningApp,代码行数:21,代码来源:index.php
示例8: header
<?php
require_once "../../includes/engine.php";
if (!isset($_GET['MYSQL']['username'])) {
header('Location:/');
}
$username = $_GET['MYSQL']['username'];
$userExsists = array(LoginAuth::checkUsername($username));
header('Content-Type: application/json');
print json_encode($userExsists);
开发者ID:ddavisgraphics,项目名称:LearningApp,代码行数:10,代码来源:index.php
示例9:
<?php
$localvars = localvars::getInstance();
$authorized = LoginAuth::checkAuthorization();
if (!$authorized) {
$loginHTML = "<div class='login'>";
$loginHTML .= "<a href='/registration' class='btn btn-primary'> Register For Account </a>";
$loginHTML .= "<a href='/login' class='btn btn-primary'> Login </a>";
$loginHTML .= "</div>";
} else {
$loginHTML = "<div class='login'>";
$loginHTML .= "<a href='/login/logout' class='btn btn-primary logout'> Logout </a>";
$loginHTML .= "</div>";
}
$localvars->set('login', $loginHTML);
开发者ID:ddavisgraphics,项目名称:LearningApp,代码行数:15,代码来源:checkAuthorization.php
示例10:
exit;
} else {
if (isset($_POST['RK_Remove'])) {
echo Film_Model::RK_Remove($_POST['filmid'], $_POST['type']);
exit;
} else {
if (isset($_POST['RK_Error'])) {
echo Film_Model::Fav_Error($_POST['epid']);
exit;
} else {
if (isset($_POST['RK_Support'])) {
echo Support_Model::AddLog($_POST['type'], $_POST['text']);
exit;
} else {
if (isset($_POST['RK_Edituser'])) {
echo LoginAuth::Edituser($_POST['fullname'], $_POST['facebookid'], $_POST['captcha']);
exit;
} else {
if (isset($_POST['RK_Download'])) {
echo GetLink::buil_down($_POST['epid']);
exit;
}
}
}
}
}
}
}
}
}
}
开发者ID:jassonlazo,项目名称:GamersInvasion-Peliculas,代码行数:31,代码来源:index.php
示例11: emDirect
emDirect("./?action=tw");
}
if ($action == 'login') {
Option::get('login_code') == 'y' ? $ckcode = "<span>验证码</span>\n <div class=\"val\"><img src=\"../include/lib/checkcode.php\" /><br />\n\t<input name=\"imgcode\" id=\"imgcode\" type=\"text\" />\n </div>" : ($ckcode = '');
include View::getView('header');
include View::getView('login');
include View::getView('footer');
View::output();
}
if ($action == 'auth') {
session_start();
$username = addslashes(trim($_POST['user']));
$password = addslashes(trim($_POST['pw']));
$img_code = Option::get('login_code') == 'y' && isset($_POST['imgcode']) ? addslashes(trim(strtoupper($_POST['imgcode']))) : '';
$ispersis = true;
if (LoginAuth::checkUser($username, $password, $img_code) === true) {
loginAuth::setAuthCookie($username, $ispersis);
emDirect('?tem=' . time());
} else {
emDirect("?action=login");
}
}
if ($action == 'logout') {
setcookie(AUTH_COOKIE_NAME, ' ', time() - 31536000, '/');
emDirect('?tem=' . time());
}
function mMsg($msg, $url)
{
include View::getView('header');
include View::getView('msg');
include View::getView('footer');
开发者ID:LockGit,项目名称:emlog,代码行数:31,代码来源:index.php
示例12: elseif
<div class="middle_right" style="width:35%">
<label class="tit">Recuperar</label>
<div class="stat" style="color:#414141">
Porfavor ingrese su Email correcto para que pueda recuperar su cuenta.</div>
</div>
</div>
</div>
<?php
} elseif ($userid) {
$user = MySql::dbselect('username,email,lastlogin,lastreg,facebookid,fullname,ugroup,fav_feature,fav_playlist', 'user', "id = '{$userid}'");
$fullname = $user[0][5];
$username = $user[0][0];
$email = $user[0][1];
$lastlogin = GetDateT($user[0][2]);
$lastreg = GetDateT($user[0][3]);
$ugroup = LoginAuth::GroupUser($user[0][6]);
$facebookurl = $user[0][4];
if (!$image) {
$image = TEMPLATE_URL . 'images/noavatar.jpg';
}
?>
<div class="p-profile-cover">
<!-- <a href="javascript:void(0)" class="change-cover">Thay đổi ảnh bìa</a>-->
</div>
<div class="p-profile clearfix" id="edit_user">
<div class="basic-info">
<img src="<?php
echo $image;
?>
" alt=""/>
<div class="profile-name">
开发者ID:jassonlazo,项目名称:GamersInvasion-Peliculas,代码行数:31,代码来源:member.php
示例13: showTwiter
/**
* @des 前台微语界面输出发布微语框
* @param null
* @return string
*/
function showTwiter()
{
if (!isUserLogin()) {
return '';
}
//尚未登录直接返回
//默认采用后台上传的头像图片 后台未上传图片或被删除 使用gravatar头像
global $CACHE;
$Usr = $CACHE->readCache('user');
$Gravatar = BLOG_URL . $Usr[1]['avatar'];
if (!$Usr[1]['avatar']) {
$Gravatar = J_getGravatar($Usr[1]['mail'], 100);
}
$Token = LoginAuth::genToken();
$BLOG_URL = BLOG_URL;
$gav = '<div class="addTwiterContainer"><div class="addTwiterAvatar"><img src="' . $Gravatar . '" title="' . $Usr[1]['name'] . '"></div>';
$addView = <<<STR
\t<div class="addTwiterContent">
\t\t<form method="post" action="{$BLOG_URL}admin/twitter.php?action=post" class="addTwiterForm">
\t\t\t<input name="token" id="token" value="{$Token}" type="hidden" />
\t\t\t<p class="addTwiterInput"><textarea id="addTwiter" title="来点碎碎念吧~" placeholder="来点碎碎念吧~" name="t"></textarea></p>
\t\t\t<p class="AddTwiterSubmit"><button type="submit" name="submit" class="sub_btn addTwiterBtn"><i class="fa fa-check-circle-o"></i> 发布微语</button><span class="addTwiterInfo">Ctrl+Enter快速提交</span></p>
\t\t</form>
\t</div>
\t</div>
STR;
return $gav . $addView;
}
开发者ID:jjonline,项目名称:J4,代码行数:33,代码来源:functions.php
示例14: header
$errors['password'] = "passwords do not match";
}
if (count($password) >= 8) {
$errors['passwordLength'] = "password is not long enough";
}
if (!$validate->emailAddr($email)) {
$errors['email'] = "email is not valid";
}
if (LoginAuth::checkEmail($email)) {
$errors['email'] = "user email is already in the system, please try logging in";
}
if (LoginAuth::checkUsername($username)) {
$errors['username'] = "user exsists, please pick a different username";
}
if (is_empty($errors)) {
$test = LoginAuth::registerUser($username, $password, $email);
$succString = "<div class='alert alert-success'> <strong> {$username} Congrats </strong>, you have been registered. </div>";
$localvars->set('feedback', $succString);
header("refresh:3;url=/login");
} else {
$errorString = "<div class='alert alert-danger'><ul><li>" . implode("</li><li>", $errors) . "</li></ul></div>";
$localvars->set('feedback', $errorString);
}
}
?>
<div class="col-xs-12 col-sm-offset-2 col-sm-8">
<h2> Register </h2>
</div>
<div class="col-xs-12 col-sm-offset-2 col-sm-8 register well">
开发者ID:ddavisgraphics,项目名称:LearningApp,代码行数:31,代码来源:index.php
示例15: array_unshift
array_unshift($superglobals, $_SESSION);
}
foreach ($superglobals as $superglobal) {
extract($superglobal, EXTR_SKIP);
}
ini_set('register_globals', true);
}
define('RK_ROOT', dirname(__FILE__));
require_once RK_ROOT . '/config.php';
define('CACHE_PATH', RK_ROOT . '/content/cache/');
define('CACHE_TIME', 86400);
// Tiempo caché próxima vez
define('CACHE_EXT', '.vantoan');
//Archivo de caché de cola
define('TEMPLATE_PATH', RK_ROOT . '/content/template/');
define('TEMPLATE_URL', SITE_URL . '/content/template/');
define('TEMPLATE_M_PATH', RK_ROOT . '/content/mobile/');
define('TEMPLATE_M_URL', SITE_URL . '/content/mobile/');
define('UPLOAD_PATH', RK_ROOT . '/content/uploadfile/');
define('UPLOAD_URL', SITE_URL . '/content/uploadfile/');
define('ADMINCP_PATH', RK_ROOT . '/content/admincp/');
define('ADMINCP_URL', SITE_URL . '/content/admincp/');
define('ADMINCP_NAME', 'admin');
//Directorios admin
define('s404_URL', SITE_URL . '/ann/404/');
//Página de error
require_once RK_ROOT . '/include/lib/mysql.php';
require_once RK_ROOT . '/include/lib/functions.php';
define('IS_LOGIN', LoginAuth::isLogin());
define('IS_ADMIN', LoginAuth::isLoginADMIN());
开发者ID:jassonlazo,项目名称:GamersInvasion-Peliculas,代码行数:30,代码来源:init.php
注:本文中的LoginAuth类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论