• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP is_loggedin函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中is_loggedin函数的典型用法代码示例。如果您正苦于以下问题:PHP is_loggedin函数的具体用法?PHP is_loggedin怎么用?PHP is_loggedin使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了is_loggedin函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     if (is_loggedin() == TRUE) {
         redirect('admin/members/view_all_main');
     }
     $this->form_validation->set_rules('username', 'Username', 'trim|required');
     $this->form_validation->set_rules('password', 'Password', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $this->load->view('admin/login');
     } else {
         $username = $this->input->post('username');
         $password = $this->input->post('password');
         $fetch_data = $this->admin_m->get(array('uname' => $username));
         if (!empty($fetch_data)) {
             $decode_password = $this->encrypt->decode($fetch_data['pass']);
             if ($decode_password == $password) {
                 $array_session = array('id' => $fetch_data['id'], 'username' => $fetch_data['uname'], 'loggedin' => TRUE);
                 $this->session->set_userdata($array_session);
                 $this->session->set_flashdata('success', 'Successfull Login.');
                 redirect('admin/members/view_all_main');
             } else {
                 $this->session->set_flashdata('error', 'Username or Password incorrect.Please try again.');
                 redirect('admin');
             }
         } else {
             $this->session->set_flashdata('error', 'Username or Password incorrect.Please try again.');
             redirect('admin');
         }
     }
 }
开发者ID:virendrapatel99,项目名称:sns,代码行数:30,代码来源:Admin.php


示例2: __construct

 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     $this->output->enable_profiler($this->config->item('debug_site'));
     $this->PER_PAGE = get_per_page_value();
     #defined in auth helper
     $this->active_theme = get_active_theme();
     if (!is_loggedin()) {
         redirect(site_url(''));
     }
     //$this->load->model('show_model');
     $this->load->model('profile_model');
     $this->load->model('user/user_model');
     $this->load->library('encrypt');
     $this->load->helper('text');
     if (isset($_POST['view_orderby'])) {
         $this->session->set_userdata('view_orderby', $this->input->post('view_orderby'));
     }
     if (isset($_POST['view_ordertype'])) {
         $this->session->set_userdata('view_ordertype', $this->input->post('view_ordertype'));
     }
     $system_currency_type = get_settings('site_settings', 'system_currency_type', 0);
     if ($system_currency_type == 0) {
         $system_currency = get_currency_icon(get_settings('site_settings', 'system_currency', 'USD'));
     } else {
         $system_currency = get_settings('site_settings', 'system_currency', 'USD');
     }
     $this->session->set_userdata('system_currency', $system_currency);
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
开发者ID:ageo80,项目名称:test,代码行数:32,代码来源:profile.php


示例3: __construct

 public function __construct()
 {
     parent::__construct();
     $exceptional_url = array('admin', 'admin/logout', 'admin/forgot_password', 'admin/change', 'admin/reset_password');
     if (in_array(uri_string(), $exceptional_url) == FALSE && is_loggedin() == FALSE) {
         // redirect('admin');
     }
 }
开发者ID:virendrapatel99,项目名称:surat,代码行数:8,代码来源:MY_Controller.php


示例4: member_id

function member_id()
{
    $CI =& get_instance();
    if (is_loggedin()) {
        return (int) $CI->session->userdata('member_id');
    }
    // Failsafe, shouldn't happen.
    error('ERROR! Requested member_id but no member is signed in.');
    redirect();
}
开发者ID:johusman,项目名称:internal,代码行数:10,代码来源:makerspace_helper.php


示例5: index

 public function index()
 {
     // Force login
     if (!is_loggedin()) {
         redirect('auth/login');
     }
     // Redirect to member overview for now...
     redirect('members');
     $head = array('title' => 'Internal');
     $this->load->view('header', $head);
     $this->load->view('internal/index');
     $this->load->view('footer');
 }
开发者ID:johusman,项目名称:internal,代码行数:13,代码来源:internal.php


示例6: index

 public function index()
 {
     $remember_me = get_cookie('Remember_me');
     /* 	If Remember_key Cookie exists in browser then it wil fetch data using it's value and 
     			set sessin data and force login User/Admin  */
     if (isset($remember_me)) {
         $remember_me_decode = $this->encrypt->decode($remember_me);
         $rem_data = select('admin', FALSE, array('where' => array('id' => $remember_me_decode)), array('single' => TRUE));
         $array_session = array('id' => $rem_data['id'], 'username' => $rem_data['username'], 'loggedin' => TRUE);
         $this->session->set_userdata($array_session);
     }
     /* is_logginin() in cms_helper.php It will Check Admin is loggen or not. */
     if (is_loggedin() == TRUE) {
         redirect('admin/dashboard');
     }
     $this->form_validation->set_rules('username', 'Username', 'trim|required');
     $this->form_validation->set_rules('password', 'Password', 'trim|required');
     if ($this->form_validation->run() == FALSE) {
         $this->load->view('admin/login/index');
     } else {
         $username = $this->input->post('username');
         $password = $this->input->post('password');
         $data = array('username' => $username);
         $fetch_data = select('admin', FALSE, array('where' => $data), array('single' => TRUE));
         if (!empty($fetch_data)) {
             $db_pass = $this->encrypt->decode($fetch_data['password']);
             if ($db_pass == $password) {
                 /* If remember Me Checkbox is clicked */
                 /* Set Cookie IF Start */
                 if (isset($_POST['remember_me'])) {
                     $cookie = array('name' => 'Remember_me', 'value' => $this->encrypt->encode($fetch_data['id']), 'expire' => '172800');
                     $this->input->set_cookie($cookie);
                 }
                 /* Set Cookie IF END */
                 $array_session = array('id' => $fetch_data['id'], 'username' => $fetch_data['username'], 'loggedin' => TRUE);
                 $this->session->set_userdata($array_session);
                 $this->session->set_flashdata('success', 'Successfull Login.');
                 redirect(base_url() . 'admin/dashboard');
             } else {
                 $this->session->set_flashdata('error', 'Invalid Username and Password.');
                 redirect('admin');
             }
         } else {
             $this->session->set_flashdata('error', 'Invalid Username and Password.');
             redirect('admin');
         }
     }
 }
开发者ID:virendrapatel99,项目名称:surat,代码行数:48,代码来源:Admin.php


示例7: __construct

 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('account/trylogin'));
     }
     $this->per_page = get_per_page_value();
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('user/post_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger form-error">', '</div>');
 }
开发者ID:GiovanniV,项目名称:Santa-Barbara-Business-Directory,代码行数:17,代码来源:user_core.php


示例8: __construct

 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     checksavedlogin();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->load->model('media_model');
     $this->load->library('form_validation');
     $this->form_validation->set_error_delimiters('<div class="alert alert-error input-xxlarge"">', '</div>');
 }
开发者ID:firastunsi,项目名称:oskon,代码行数:17,代码来源:media_core.php


示例9: __construct

 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     checksavedlogin();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('admin/auth'));
     }
     $this->per_page = get_per_page_value();
     #defined in auth helper
     $this->load->model('users_model');
     $this->form_validation->set_error_delimiters('<div class="alert alert-danger">', '</div>');
 }
开发者ID:priyranjansingh,项目名称:classified,代码行数:18,代码来源:users_core.php


示例10: login

 public function login($data, $session = true)
 {
     // Check if e-mail exists.
     $member = $this->get_member('email', $data['email']);
     if (!$member) {
         // Log unsuccessful logins for sessions.
         if ($session) {
             $this->db->insert('logins', array('ip_address' => ip_address(), 'timestamp' => time()));
         }
         // That's a negative
         return false;
     }
     // If we're going to set a session, check that member is an admin or boardmember
     if ($session && !$this->is_boardmember($member->id) && !$this->is_admin($member->id)) {
         return false;
     }
     // Load password library
     $this->load->library('Pass');
     // Verify password
     $result = $this->pass->verify($data['password'], $member->password);
     if (!$result) {
         // Log unsuccessful login to database
         $this->db->insert('logins', array('member_id' => $member->id, 'ip_address' => ip_address(), 'timestamp' => time()));
         return false;
     }
     // Check if wanna start a session or not
     if ($session) {
         // Set session
         $userdata = array('member_id' => $member->id, 'email' => $data['email'], 'logged_in' => true);
         if (!empty($data['remember'])) {
             $userdata['remember_me'] = true;
         }
         $this->session->set_userdata($userdata);
         // Log successful login in database
         $this->db->insert('logins', array('member_id' => $member->id, 'ip_address' => ip_address(), 'timestamp' => time(), 'valid' => 1));
         // Failsafe
         return is_loggedin();
     } else {
         // No session, but return true
         return true;
     }
     return false;
 }
开发者ID:johusman,项目名称:internal,代码行数:43,代码来源:member_model.php


示例11: __construct

 public function __construct()
 {
     parent::__construct();
     is_installed();
     #defined in auth helper
     if (!is_loggedin()) {
         if (count($_POST) <= 0) {
             $this->session->set_userdata('req_url', current_url());
         }
         redirect(site_url('account/trylogin'));
     }
     //$this->per_page = get_per_page_value();
     $this->load->database();
     $this->active_theme = get_active_theme();
     $this->load->model('user_model');
     $this->load->model('show/post_model');
     $this->load->helper('dbcvote');
     $this->form_validation->set_error_delimiters('<label class="col-lg-2 control-label">&nbsp;</label><div class="col-lg-8"><div class="alert alert-danger" style="margin-bottom:0;">', '</div></div>');
     //$this->output->enable_profiler(TRUE);
 }
开发者ID:ageo80,项目名称:test,代码行数:20,代码来源:user_core.php


示例12: plugin_load_config

<?php

/**
 * Load Config
 *
 * Load the config early so we can
 * use it below.
 */
$_ce_config = plugin_load_config('cms-editor');
/**
 * Initiate the Editor
 * This only happens if the current
 * user is logged in.
 */
if (is_loggedin() && in_array($path, $_ce_config['pages'])) {
    # Stylesheets
    $_config['stylesheets'] = array_merge($_config['stylesheets'], $_ce_config['assets']['stylesheets']);
    # Javascript
    $_config['scripts'] = array_merge($_config['scripts'], $_ce_config['assets']['scripts']);
}
开发者ID:chrismademe,项目名称:php-starter,代码行数:20,代码来源:functions.php


示例13: mysql_query

    $i = 1;
    $sql = 'SELECT songs.SongID, songs.SongName, artist.ArtistName, album.AlbumName, songs.Link, album.Cover 
            FROM songs 
            INNER JOIN album 
            ON album.AlbumID = songs.AlbumID 
            INNER JOIN artist
            ON artist.ArtistID = songs.ArtistID
            INNER JOIN mood 
            ON mood.MoodID = songs.MoodID 
            WHERE mood.Mood = "' . $moodinput . '"';
    $result = mysql_query($sql);
    if (mysql_num_rows($result) > 0) {
        // output data of each row
        while ($row = mysql_fetch_assoc($result)) {
            echo "<div class='music' class='animated fadeIn'>";
            echo "<div class='song-details'>";
            echo "<div class='cover'><img src='" . $row["Cover"] . "' alt='cover'><span class='overlay'></span></div>";
            echo "<h4>" . $row["ArtistName"] . "</h4> <h5> " . $row["AlbumName"] . " </h5> <h3> " . $row["SongName"] . "</h3>";
            $song_id = $row["SongID"];
            if (is_loggedin() && usersong_exists($user_id, $song_id) === false) {
                echo "<a name='song' class='alink" . $i . "' onclick='add(" . $song_id . ", " . $i . ");'>Add this to your playlist</a>";
            }
            $like = like_percentage($song_id);
            echo "<div id='" . $i . "link' class='link'>" . $row["Link"] . "</div>";
            echo "<div class='like-bar'><div class='like' style='width:" . $like . "%'></div></div>";
            echo "</div></div>";
            $i++;
            //use this variable to give each div a separate id
        }
    }
}
开发者ID:alexandrastoica,项目名称:soundmood-database-app,代码行数:31,代码来源:get.php


示例14: vars

{
    # Get Variables Object
    global $_variables;
    # Get Variable
    if (!is_null($name)) {
        return $_variables->get($name);
    }
    # Get All Variables
    return $_variables->get();
}
/**
 * Get Variables
 *
 * @since 1.0.0
 */
function vars()
{
    return get();
}
# Debug helpers
set('dev', array('localhost' => is_localhost()));
# Page variables
set('page', array('is_home' => is_home(), 'path' => $_path, 'slug' => get_page()), true);
# User variables
set('user', array('is_loggedin' => is_loggedin()));
# Various useful variables
set('this_year', this_year());
# Trigger: variables_init
if (extras_enabled()) {
    do_trigger('variables_init');
}
开发者ID:chrismademe,项目名称:basstime-react,代码行数:31,代码来源:variables.php


示例15: switch

<?php

# Check user & validate data
switch (true) {
    # Not logged in
    case is_loggedin():
        JSON::parse(100, 'negative', '<i class="fa fa-exclamation-triangle"></i> You\'re already logged in!', null, true);
        break;
        # No post data
    # No post data
    case !is_form_data():
        JSON::parse(100, 'negative', '<i class="fa fa-exclamation-triangle"></i> There was a problem logging you in. (Error: No data received)', null, true);
        break;
}
# Create User Object
$_ce_user = new CMSEditor\User($_ce_config);
# New GUMP Object
$form = new GUMP();
# Get Input
$data = form_data();
# Validate Input
$form->validate($data, array('username' => 'required', 'password' => 'required'));
# Run GUMP
$response = $form->run($data);
# Get Response
if ($response === false) {
    JSON::parse(100, 'negative', $form->get_readable_errors(true));
} else {
    # Attempt login
    $_ce_user->login($data['username'], $data['password']);
}
开发者ID:chrismademe,项目名称:php-starter,代码行数:31,代码来源:ce-ajax-login.php


示例16: get_accessible_plugins

/**
 * Get all of the plugins the currently logged in user can access
 *
 * @param $selectFromPendingPool If returned plugins can include plugins from the pending pool
 * @return array Plugin
 */
function get_accessible_plugins($selectFromPendingPool = true)
{
    global $_SESSION, $master_db_handle;
    // The plugins we can access
    $plugins = array();
    // Make sure they are plugged in
    if (!is_loggedin()) {
        return $plugins;
    }
    // Query for all of the plugins
    $statement = $master_db_handle->prepare('SELECT Plugin, ID, Name, Parent, Plugin.Author, Hidden, GlobalHits, Created, Pending, Rank, LastRank, LastRankChange, LastUpdated, ServerCount30 FROM AuthorACL LEFT OUTER JOIN Plugin ON Plugin.ID = Plugin WHERE AuthorACL.Author = ? ORDER BY Name ASC');
    $statement->execute(array($_SESSION['uid']));
    while ($row = $statement->fetch()) {
        if ($selectFromPendingPool == false && $row['Pending'] == 1) {
            continue;
        }
        $plugin = resolvePlugin($row);
        $plugin->setPendingAccess($row['Pending'] == 1);
        $plugins[] = $plugin;
    }
    return $plugins;
}
开发者ID:willies952002,项目名称:mcstats.org,代码行数:28,代码来源:func.php


示例17: show_msgs

}
?>

			<!-- CENTER CONTENT -->
			<div class="span-24 center-content">
					<?php 
show_msgs();
if (is_loggedin() && is_admin() || is_viewer()) {
    if (file_exists("modules/{$MOD}/{$ENTITY}/controller.php")) {
        include "modules/" . $MOD . "/" . $ENTITY . "/controller.php";
    }
} else {
    if (is_loggedin() && is_supervisor()) {
        include "modules/admin/vehicle/controller.php";
    } else {
        if (is_loggedin() && is_superuser()) {
            include "modules/admin/travel/controller.php";
        } else {
            add_msg('SUCCESS', "Welcome to {$DOMAIN}. Please login to start using your account");
            show_msgs();
        }
    }
}
?>
			</div>
			<!-- END CENTER CONTENT -->

			<!-- FOOTER -->
			<?php 
include "static/html/footer.html";
?>
开发者ID:teju,项目名称:Android,代码行数:31,代码来源:index.php


示例18: follow_button

    function follow_button($user_id)
    {
        if (is_loggedin()) {
            if (user_session_id() != $user_id) {
                echo '<script src="' . theme_url() . '/assets/js/top_follow.js"></script>
<style type="text/css">

.follow_b
{
    border:#dedede solid 2px;
    background-color:#f5f5f5;
    color:#000;
    font-size:12px;
    font-weight:bold;
    padding: 5px;
    -moz-border-radius: 6px; -webkit-border-radius: 6px; 
}
.youfollowing_b
{
    font-size:14px; color:#006600; font-weight:bold;
}
.remove_b
{
    border:#dedede solid 2px;
    background-color:#f5f5f5;
    color:#CC3333;
    font-size:12px;
    padding-left:4px ;
    padding-right:4px ;
    font-weight:bold;
    margin-left:240px;
    -moz-border-radius: 6px; -webkit-border-radius: 6px; 
}


</style>';
                if (user_follow($user_id) == 1) {
                    echo '	<script>
					$(function() 
					{
						$("#remove"+' . $user_id . ').fadeOut(2000).show();
					});
</script>';
                } else {
                    echo '          <script>
	$(function() 
	{

		$("#follow"+' . $user_id . ').fadeOut(2000).show();
	});
</script>';
                }
                echo '  <div id="follow' . $user_id . '" style="display:none">
<a href="#" class="follow" id="' . $user_id . '">
<span class="follow_b">' . lang_key('Follow') . ' </span></a>
</div>


<div class="youfollowing_b" id="remove' . $user_id . '" style="display:none"> 
' . lang_key('Your Following') . ' <a href="#" class="remove" id="' . $user_id . '">
<span class="remove_b"> ' . lang_key('Unfollow') . ' </span></a>
</div>';
            }
        }
    }
开发者ID:ageo80,项目名称:test,代码行数:65,代码来源:follow_helper.php


示例19: site_url

                            <li><a href="sidebar-left.html">Left Sidebar</a></li>

                            <li class="active"><a href="sidebar-right.html">Right Sidebar</a></li>

                        </ul>

                    </li-->

                    <!--li><a href="<?php 
echo site_url('show/contact');
?>
">Contact</a></li-->

                    <?php 
if (!is_loggedin()) {
    ?>

                    <?php 
    if (get_settings('realestate_settings', 'enable_signup', 'Yes') == 'Yes') {
        ?>

                    <li><a class="btn" data-toggle="modal" href="#myModal"><?php 
        echo lang_key('sign_in');
        ?>
</a></li>

                    <li><a class="btn" href="<?php 
        echo site_url('account/signup');
        ?>
"><?php 
开发者ID:ageo80,项目名称:test,代码行数:30,代码来源:header.php


示例20: Variables

<?php

use Theme\Variables;
/**
 * Variables Object
 */
$variables = new Variables($_config);
# Include Variable Functions
require __DIR__ . '/functions/variables.php';
# Debug helpers
add_var('dev', array('localhost' => is_localhost()));
# Page variables
add_var('page', array('is_home' => is_home(), 'path' => $path, 'slug' => get_page()), true);
# User variables
add_var('user', array('is_loggedin' => is_loggedin()));
# Various useful variables
add_var('this_year', this_year());
开发者ID:chrismademe,项目名称:php-starter,代码行数:17,代码来源:variables.php



注:本文中的is_loggedin函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP is_login函数代码示例发布时间:2022-05-15
下一篇:
PHP is_logged_in函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap