本文整理汇总了PHP中USER::is_logged_in方法的典型用法代码示例。如果您正苦于以下问题:PHP USER::is_logged_in方法的具体用法?PHP USER::is_logged_in怎么用?PHP USER::is_logged_in使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USER
的用法示例。
在下文中一共展示了USER::is_logged_in方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: USER
<?php
session_start();
require_once 'class.user.php';
$user = new USER();
if ($user->is_logged_in() != "") {
$user->redirect('home.php');
}
if (isset($_POST['btn-submit'])) {
$email = $_POST['txtemail'];
$stmt = $user->runQuery("SELECT userID FROM tbl_users WHERE userEmail=:email LIMIT 1");
$stmt->execute(array(":email" => $email));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() == 1) {
$id = base64_encode($row['userID']);
$code = md5(uniqid(rand()));
$stmt = $user->runQuery("UPDATE tbl_users SET tokenCode=:token WHERE userEmail=:email");
$stmt->execute(array(":token" => $code, "email" => $email));
$message = "\n\t\t\t\t Hello , {$email}\n\t\t\t\t <br /><br />\n\t\t\t\t We got requested to reset your password, if you did this then just click the following link to reset your password, if not just ignore this email,\n\t\t\t\t <br /><br />\n\t\t\t\t Click the Following Link To Reset Your Password \n\t\t\t\t <br /><br />\n\t\t\t\t <a href='http://localhost/event_management/resetpass.php?id={$id}&code={$code}'>click here to reset your password</a>\n\n\t\t\t\t <br /><br />\n\t\t\t\t thank you :)\n\t\t\t\t ";
$subject = "Password Reset";
$user->send_mail($email, $message, $subject);
$msg = "<div class='alert alert-success'>\n\t\t\t\t\t<button class='close' data-dismiss='alert'>×</button>\n\t\t\t\t\tWe've sent an email to {$email}.\n Please click on the password reset link in the email to generate new password. \n\t\t\t \t</div>";
} else {
$msg = "<div class='alert alert-danger'>\n\t\t\t\t\t<button class='close' data-dismiss='alert'>×</button>\n\t\t\t\t\t<strong>Sorry!</strong> this email not found. \n\t\t\t </div>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
示例2: USER
<?php
session_start();
require_once 'classes/class.user.php';
$user_home = new USER();
if (!$user_home->is_logged_in()) {
$user_home->redirect('index.php');
}
$stmt = $user_home->runQuery("SELECT * FROM users WHERE id=:uid");
$stmt->execute(array(":uid" => $_SESSION['userSession']));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!DOCTYPE html>
<html>
<title>Suppliers</title>
<?php
include "include/head.php";
?>
<div class="wrapper">
<?php
include "include/header.php";
?>
<!-- Left side column. contains the logo and sidebar -->
<aside class="main-sidebar">
<!-- sidebar: style can be found in sidebar.less -->
<!-- sidebar: style can be found in sidebar.less -->
<section class="sidebar">
<!-- sidebar menu: : style can be found in sidebar.less -->
示例3: array
<?include('./templates/layout/page-top.php')?>
<?
if(! USER::is_logged_in()):
$panels = array(array(
'legend'=>'Information',
'body'=>"<p><b>Please log in to use this function <a href='user-registration.php'>or click here to register</a>.</b></p>",
));
elseif($tct < 1):
$panels = array(array(
'legend'=>'Information',
'body' =>"<p class='success'>You have no favourites.</p>",
));
endif;
?>
<div id="middle">
<?include('./templates/parts/panels.php')?>
<?include('./templates/parts/ad-list.php')?>
<br />
</div>
<?include('./templates/layout/page-right.php')?>
<?include('./templates/layout/page-footer.php')?>
示例4: USER
<?php
session_start();
require_once 'class.user.php';
$reg_user = new USER();
if ($reg_user->is_logged_in() != "") {
$reg_user->redirect('home.php');
}
if (isset($_POST['btn-signup'])) {
$uname = trim($_POST['txtuname']);
$email = trim($_POST['txtemail']);
$upass = trim($_POST['txtpass']);
$code = md5(uniqid(rand()));
$stmt = $reg_user->runQuery("SELECT * FROM tbl_users WHERE userEmail=:email_id");
$stmt->execute(array(":email_id" => $email));
$row = $stmt->fetch(PDO::FETCH_ASSOC);
if ($stmt->rowCount() > 0) {
$msg = "\n\t\t <div class='alert alert-error'>\n\t\t\t\t<button class='close' data-dismiss='alert'>×</button>\n\t\t\t\t\t<strong>Sorry !</strong> email allready exists , Please Try another one\n\t\t\t </div>\n\t\t\t ";
} else {
if ($reg_user->register($uname, $email, $upass, $code)) {
$id = $reg_user->lasdID();
$key = base64_encode($id);
$id = $key;
$message = "\t\t\t\t\t\n\t\t\t\t\t\tHello {$uname},\n\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\tWelcome to Coding Cage!<br/>\n\t\t\t\t\t\tTo complete your registration please , just click following link<br/>\n\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\t<a href='http://www.SITEURL.com/verify.php?id={$id}&code={$code}'>Click HERE to Activate :)</a>\n\t\t\t\t\t\t<br /><br />\n\t\t\t\t\t\tThanks,";
$subject = "Confirm Registration";
$reg_user->send_mail($email, $message, $subject);
$msg = "\n\t\t\t\t\t<div class='alert alert-success'>\n\t\t\t\t\t\t<button class='close' data-dismiss='alert'>×</button>\n\t\t\t\t\t\t<strong>Success!</strong> We've sent an email to {$email}.\n Please click on the confirmation link in the email to create your account. \n\t\t\t \t\t</div>\n\t\t\t\t\t";
} else {
echo "sorry , Query could no execute...";
}
}
示例5: array
$panel = array(
'legend'=>'Please correct the following errors',
'body'=>$body
);
array_unshift($panels,$panel);
endif;
endif;
endif;
endif;
?>
<div id="middle">
<?include('./templates/parts/panels.php')?>
<?php
if (USER::is_logged_in()) {
include './templates/forms/ad-report-form.php';
}
?>
<br />
</div>
<?include ('./templates/layout/page-right.php')?>
<?include ('./templates/layout/page-footer.php')?>
示例6: USER
<?php
session_start();
require_once 'class.user.php';
$user_login = new USER();
if ($user_login->is_logged_in() != "") {
$user_login->redirect('home.php');
}
if (isset($_POST['btn-login'])) {
$email = trim($_POST['txtemail']);
$upass = trim($_POST['txtupass']);
if ($user_login->login($email, $upass)) {
$user_login->redirect('home.php');
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Login | Coding Cage</title>
<!-- Bootstrap -->
<link href="bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href="bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet" media="screen">
<link href="assets/styles.css" rel="stylesheet" media="screen">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
示例7: trim
$user_login->redirect('account.php');
exit();
}*/
/*if($user_login->is_logged_in()!="")
{
$user_login->redirect('account.php');
}*/
if (isset($_POST['btn-login'])) {
$email = trim($_POST['txtemail']);
$upass = trim($_POST['txtupass']);
if ($user_login->login($email, $upass) && $_SERVER['HTTP_REFERER'] != 'http://' . $_SERVER['HTTP_HOST'] . '/account.php') {
$user_login->redirect('account.php');
}
}
// show username, email and password if user is logged in
if ($user_login->is_logged_in() == 1) {
list($username, $email, $password) = $user_login->getMember($_SESSION['userSession']);
}
// add +1 to php variable counter
if (isset($_POST['counter'])) {
$count = $_POST['counter'];
} else {
$count = 1;
}
// Check if a search query is set
if (isset($_GET['s'])) {
$search_string = $_GET['s'];
}
// Check if a deck id exists
if (isset($_GET['c']) && isset($count)) {
$c = $_GET['c'];