本文整理汇总了PHP中loggedin函数的典型用法代码示例。如果您正苦于以下问题:PHP loggedin函数的具体用法?PHP loggedin怎么用?PHP loggedin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了loggedin函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirmlogin
function confirmlogin()
{
if (!loggedin()) {
header("Location: ./index.php");
/* Redirect browser */
exit;
}
}
示例2: index
/**
* Index Page for this controller.
*
* Maps to the following URL
* http://example.com/index.php/welcome
* - or -
* http://example.com/index.php/welcome/index
* - or -
* Since this controller is set as the default controller in
* config/routes.php, it's displayed at http://example.com/
*
* So any other public methods not prefixed with an underscore will
* map to /index.php/welcome/<method_name>
* @see http://codeigniter.com/user_guide/general/urls.html
*/
public function index() {
$this->load->view('top');
if(loggedin()) {
$this->load->view('loggedin');
} else {
$this->load->view('login');
}
$this->load->view('bottom');
}
示例3: profile
public function profile() {
if(loggedin() ) {
$data['content'] = 'profile';
$this->load->model('User_model');
$data['info'] = $this->User_model->getUserinfo();
$this->load->view('template', $data);
} else {
redirect(base_url().'news/', 'refresh');
}
}
示例4: index
public function index() {
if(loggedin() ) {
$this->load->model('events_model');
$data['events'] = $this->events_model->get_last_events();
$data['content'] = 'events';
$this->load->view('template', $data);
} else {
redirect(base_url().'news/', 'refresh');
}
}
示例5: isEditor
function isEditor()
{
if (loggedin()) {
if (!empty($_SESSION['user_type'])) {
if ($_SESSION['user_type'] == 'edit') {
return true;
}
}
}
return false;
}
示例6: submissionform_redo
function submissionform_redo()
{
global $logged_in, $user, $HTTP_POST_VARS, $SUBMISSION, $MAIN;
$WORK = loggedin();
//lets redraw the submission form.
$WORK = insert_into_template($SUBMISSION, "{LOGGEDIN}", $WORK);
$WORK = insert_into_template($WORK, "{REQUESTFOR}", $HTTP_POST_VARS['request_for']);
$WORK = insert_into_template($WORK, "{REQUEST}", $HTTP_POST_VARS['request']);
$WORK = insert_into_template($MAIN, "{CONTENT}", $WORK);
$WORK = filltemplate($WORK, "Submit a Prayer Request");
printf("%s", striptemplate($WORK));
}
示例7: submissionform_redo
function submissionform_redo()
{
global $logged_in, $user, $HTTP_POST_VARS, $HTTP_GET_VARS, $MAIN, $LEAVEPRAISE;
$WORK = loggedin();
//lets redraw the request form.
$WORK = insert_into_template($LEAVEPRAISE, "{LOGGEDIN}", $WORK);
$WORK = insert_into_template($WORK, "{REQUESTID}", $HTTP_GET_VARS['request']);
$WORK = insert_into_template($WORK, "{PREFILL}", $HTTP_POST_VARS['praise']);
$WORK = insert_into_template($MAIN, "{CONTENT}", $WORK);
$WORK = filltemplate($WORK, "Leave Praise");
printf("%s", striptemplate($WORK));
}
示例8: getuser
function getuser()
{
global $conn;
if (loggedin()) {
$query = "SELECT * FROM `users` WHERE `username` = '" . $_SESSION['username'] . "'";
} else {
$query = "SELECT * FROM `users` WHERE `username` = '" . $conn->real_escape_string($_POST['username']) . "'";
}
$result = $conn->query($query);
if ($result->num_rows > 0) {
return $result->fetch_assoc();
}
}
示例9: signin
function signin($db)
{
echo "Enter username:" . "\n";
$name = trim(fgets(STDIN));
echo "Enter password:\n";
$pass = trim(fgets(STDIN));
$val = $db->checkUser($name, $pass);
if ($val) {
echo "\n** Welcome ----login successfull**\n";
loggedin($db);
} else {
echo "login fails";
}
}
示例10: getfield
function getfield($field, $table, $conn)
{
if (loggedin()) {
$userid = $_SESSION['userid'];
$query = "SELECT {$field} FROM {$table} WHERE id='{$userid}'";
if ($result = $conn->query($query)) {
if ($result->num_rows > 0) {
if ($result = $result->fetch_row()) {
return $result;
} else {
echo "fetch row fault";
}
} elseif ($result->num_rows < 0) {
echo "num_rows < 0";
} else {
echo "cant detect";
}
} else {
echo "failed - in getfield";
}
}
}
示例11: tmpCountModules
function tmpCountModules($module_name)
{
if (substr($module_name, 0, 4) == 'user') {
return false;
}
if ($module_name == 'quicklinks') {
return false;
}
if ($module_name == 'right') {
return false;
}
if ($module_name == 'commands') {
return loggedin() && !gpExists('x4Page');
}
if ($module_name == 'menuright') {
return loggedin();
}
if (gpExists('x4Page')) {
return false;
}
return true;
}
示例12: listing
public function listing() {
if(loggedin() ) {
$ppage = 5;
$start = 0;
$this->load->model('Events_model');
$config['base_url'] = base_url().'event/listing/page/';
$config['total_rows'] = count($this->Events_model->get_events_by_user($_SESSION['id']));
$config['per_page'] = $ppage;
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$this->pagination->initialize($config);
if($this->uri->segment(4) != '') {
$start = $this->uri->segment(4);
}
$data['events'] = $this->Events_model->get_events_by_user($_SESSION['id'], $start, $ppage);
$data['content'] = 'events';
$data['pages'] = $this->pagination->create_links();
$this->load->view('template', $data);
} else {
redirect(base_url().'news/', 'refresh');
}
}
示例13: if
<div class="menu_bg">
<ul>
<li><a href="<?php echo $sitepath; ?>/index.php">Home</a></li>
<li><a href="<?php echo $sitepath; ?>/about.php">About</a></li>
<li><a href="<?php echo $sitepath; ?>/services.php">Services</a></li>
<li><a href="<?php echo $sitepath; ?>/faq.php">FAQ</a></li>
<li><a href="<?php echo $sitepath; ?>/terms.php">Terms</a></li>
<li><a href="<?php echo $sitepath; ?>/contact.php">Contact Us</a></li>
<li><a href="<?php echo $sitepath; ?>/signup.php">Registration</a></li>
</ul>
</div>
<span class="nav_icon_right"></span>
</div>
<div class="login_button">
<span class="login_icon"></span>
<?php if(loggedin())
{
?>
<h1><a href="<?php echo $sitepath; ?>/logout.php">Logout</a></h1>
<?php
}
else
{
?>
<h1><a href="<?php echo $sitepath; ?>/login.php">Login</a></h1>
<?php
}
?>
</div>
</div>
</div>
示例14: session_start
<?php
session_start();
include 'config.php';
include 'functions.php';
@($uid = $_SESSION['user_id']);
@($user = $_SESSION['user']);
$date = time();
$dateAjax = date("M j G", $date);
echo "<div id='dateAjax' class='{$dateAjax}'></div>";
loggedin();
//IF USER ONLINE OR NO
$unread_notif = unread_notif($uid);
echo "Welcome back , " . $user;
echo "\t <a href='user/{$user}'>PROFILE</a> | <a href='friends.php?id={$uid}'>My friends</a> |<a href='notifications.php'>Notifications (" . $unread_notif . ")</a> | <a href='freq.php'>Friend requests( " . Nfreq($uid) . " )</a> |<a href='settings.php'>Settings</a>| <a href='search.php'>Search</a> | Help | <a href='logout.php'>Sign out</a><hr />";
//GET LAST ID POSTED
$lastID = mysql_query("select * from notes order by notes_id desc limit 1");
$IDoop = mysql_fetch_array($lastID);
$lastUsedID = $IDoop['notes_id'];
$lastUsedID1 = $lastUsedID++;
$lastUsedID = hashit($lastUsedID);
echo "<input type='hidden' name='lastID' id='lastID' value='{$lastUsedID}' />";
?>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
jQuery(function($) {
//ADD A NOTE///////////////////////////////////////////////////////////////////////
$('#send_note').click(function() {
示例15: array
<body>
<div id="header">
<h1><?php
echo SITE_TITLE;
?>
</h1>
<?php
$menuitems = array();
if ($GLOBALS["page"] != "mainMenu") {
$menuitems[] = "<a href=\"" . SITEROOT_WEB . "\">Back to main menu</a>";
}
$menuitems[] = "<a href=\"" . SITEROOT_WEB . "eqiat\">Authoring tool</a>";
if (loggedin() && $GLOBALS["page"] != "logout") {
$menuitems[] = "<a id=\"logoutlink\" href=\"" . SITEROOT_WEB . "?page=logout\">Log out (<strong>" . htmlspecialchars(username()) . "</strong>)</a>";
} else {
if (!loggedin() && ($GLOBALS["page"] != "login" && !isset($_SESSION["nextpage"]))) {
$menuitems[] = "<a href=\"" . SITEROOT_WEB . "?page=login\">Log in</a>";
}
}
if ($GLOBALS["page"] != "help") {
$menuitems[] = "<a href=\"" . SITEROOT_WEB . "?page=help\">Help</a>";
}
if (!empty($menuitems)) {
?>
<ul id="headermenu">
<?php
foreach ($menuitems as $menuitem) {
?>
<li><?php
echo $menuitem;
?>