本文整理汇总了PHP中logged_in函数的典型用法代码示例。如果您正苦于以下问题:PHP logged_in函数的具体用法?PHP logged_in怎么用?PHP logged_in使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了logged_in函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: confirm_logged_in
function confirm_logged_in()
{
if (!logged_in()) {
header("Location:handler.php?not=1");
exit;
}
}
示例2: submit
public function submit()
{
$this->data['page']['title'] = "Submit new news story";
$this->data['current_segment'] = "submit";
if ($this->form_validation->run('story') !== FALSE) {
if (logged_in()) {
$title = $this->input->post('title');
$slug = url_title($this->input->post('title'), '-', TRUE);
$link = $this->input->post('link', '');
$text = nl2br($this->input->post('text', ''));
$field_data = array('user_id' => current_user_id(), 'title' => $title, 'slug' => $slug, 'external_link' => $link, 'description' => $text, 'upvotes' => 1);
$insert = $this->story->insert($field_data);
if ($insert) {
$this->load->model('user/user_model', 'user');
$this->user->add_story_vote_record(current_user_id(), $this->db->insert_id());
$this->user->increment_submission_count(current_user_id());
$this->session->set_flashdata('success', lang('submission_success'));
redirect('stories/new');
}
} else {
$this->session->set_flashdata('error', lang('submission_login'));
redirect(base_url());
}
} else {
$this->parser->parse('add', $this->data);
}
}
示例3: edit
function edit()
{
$data = array('page_title' => 'Inn Strategy : Password Change');
$this->load->vars($data);
$this->load->helper('url');
$this->load->helper('html');
$this->load->library('form_validation');
if (logged_in()) {
$this->form_validation->set_rules('Password', 'Password', 'trim|required|matches[ConfirmPassword]|min_length[4]|max_length[12]');
$this->form_validation->set_rules('ConfirmPassword', 'Password Confirmation', 'trim|required');
if ($this->form_validation->run() == FALSE) {
$this->load->view('header_user');
$this->load->view('auth/change_password');
$this->load->view('footer_std');
} else {
$this->update_password($_POST['Password']);
$data['msg'] = "<p><strong>Your login Password has been successfully changed.</strong></p>\n\t\t\t\t\t\t\t\t\t<p>You will receive a confirmation email shortly.</p>";
$this->load->vars($data);
$this->load->view('header_user');
$this->load->view('auth/change_password');
$this->load->view('footer_std');
}
} else {
$this->auth->login();
}
}
示例4: handle
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @return mixed
*/
public function handle($request, Closure $next)
{
if (!logged_in()) {
return redirect()->to('login');
}
return $next($request);
}
示例5: login
public function login()
{
if ($this->form_validation->run('login') !== FALSE) {
$username = $this->input->post('username');
$password = $this->input->post('password');
if ($this->wolfauth->login($username, $password)) {
redirect('admin/dashboard');
} else {
$this->session->set_flashdata('error', $this->wolfauth->auth_errors());
$this->parser->parse('login', $this->data);
}
} else {
if (logged_in() && !is_admin()) {
set_flashdata("error", lang('no_permission'));
redirect('/');
}
if (!logged_in()) {
$this->parser->parse('admin/login.tpl', $this->data);
return;
}
// If we are logged in and admin, redirect
if (logged_in() && is_admin()) {
redirect('admin/dashboard');
}
}
}
示例6: refresh_session
function refresh_session()
{
if (logged_in()) {
$time = time();
$_SESSION['refresh_time'] = $time;
}
}
示例7: protect_page
function protect_page()
{
if (logged_in() === false) {
header("Location:login.php");
exit;
}
}
示例8: user
function user($field = false, $forced_user = false)
{
static $user = false;
$users = \ui\config('auth2_users');
if ($forced_user !== false) {
$user = $forced_user;
return true;
}
if ($user === false) {
if ($user = logged_in()) {
$user = $users[$user];
unset($user['password']);
} else {
$user = $users['guest'];
}
}
if ($field === false) {
return $user;
}
if (isset($user[$field])) {
return $user[$field];
} else {
return false;
}
}
示例9: confirm_logged_in
function confirm_logged_in()
{
$logged = logged_in();
if ($logged == FALSE) {
redirect_to("login.php");
}
}
示例10: __init
public function __init()
{
$this->user = logged_in() ? Visitor::current()->login : "guest";
$this->path = INCLUDES_DIR . "/caches/" . sanitize($this->user);
$this->caches = INCLUDES_DIR . "/caches";
$this->url = self_url();
$this->file = $this->path . "/" . md5($this->url) . ".html";
# If the cache directory is not writable, disable this module and cancel execution.
if (!is_writable($this->caches)) {
cancel_module("cacher");
}
# Prepare actions that should result in new cache files.
$this->prepare_cache_updaters();
# Remove all expired files.
$this->remove_expired();
$config = Config::current();
$config->cache_exclude = (array) $config->cache_exclude;
if (!empty($config->cache_exclude)) {
foreach ($config->cache_exclude as &$exclude) {
if (substr($exclude, 7) != "http://") {
$exclude = $config->url . "/" . ltrim($exclude, "/");
}
}
}
}
示例11: verify_session
function verify_session()
{
if (!logged_in()) {
header("Location:http://nubespic.com/index.php");
exit;
}
}
示例12: verify_session
function verify_session()
{
if (!logged_in()) {
session_msg("Debe iniciar sesion para ingresar");
header("Location:../index.php");
exit;
}
}
示例13: index
public function index()
{
if (logged_in()) {
echo "Logged in!";
} else {
echo "Not logged baby";
}
}
示例14: index
public function index()
{
if (logged_in()) {
$this->ag_auth->view('user/dashboard_view');
} else {
$this->ag_auth->view('login');
}
}
示例15: index
public function index()
{
if (logged_in()) {
$this->ag_auth->view('dashboard');
} else {
$this->login();
}
}