当前位置: 首页>>代码示例>>PHP>>正文


PHP logged_in函数代码示例

本文整理汇总了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;
    }
}
开发者ID:adityaup22,项目名称:Cloop,代码行数:7,代码来源:session.php

示例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);
     }
 }
开发者ID:jelek92,项目名称:Zebra,代码行数:27,代码来源:story.php

示例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();
     }
 }
开发者ID:homebru,项目名称:bandb,代码行数:26,代码来源:admin.php

示例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);
 }
开发者ID:FreelanceDArkman,项目名称:MEA,代码行数:14,代码来源:AuthenticateFrontend.php

示例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');
         }
     }
 }
开发者ID:jelek92,项目名称:Zebra,代码行数:26,代码来源:admin.php

示例6: refresh_session

function refresh_session()
{
    if (logged_in()) {
        $time = time();
        $_SESSION['refresh_time'] = $time;
    }
}
开发者ID:kalliste,项目名称:kalliste-php-framework,代码行数:7,代码来源:session.php

示例7: protect_page

function protect_page()
{
    if (logged_in() === false) {
        header("Location:login.php");
        exit;
    }
}
开发者ID:ericpauldeveloper,项目名称:login-register,代码行数:7,代码来源:general.php

示例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;
    }
}
开发者ID:1upon0,项目名称:ui,代码行数:25,代码来源:lib_auth2.php

示例9: confirm_logged_in

function confirm_logged_in()
{
    $logged = logged_in();
    if ($logged == FALSE) {
        redirect_to("login.php");
    }
}
开发者ID:LeeDavid87,项目名称:CS-313,代码行数:7,代码来源:functions.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, "/");
             }
         }
     }
 }
开发者ID:homebru,项目名称:bandb,代码行数:25,代码来源:cacher.php

示例11: verify_session

function verify_session()
{
    if (!logged_in()) {
        header("Location:http://nubespic.com/index.php");
        exit;
    }
}
开发者ID:betarip,项目名称:easyMath,代码行数:7,代码来源:sesiones.php

示例12: verify_session

function verify_session()
{
    if (!logged_in()) {
        session_msg("Debe iniciar sesion para ingresar");
        header("Location:../index.php");
        exit;
    }
}
开发者ID:vuraul94,项目名称:Proyecto_Activos,代码行数:8,代码来源:session.php

示例13: index

 public function index()
 {
     if (logged_in()) {
         echo "Logged in!";
     } else {
         echo "Not logged baby";
     }
 }
开发者ID:Moro3,项目名称:duc,代码行数:8,代码来源:testauth.php

示例14: index

 public function index()
 {
     if (logged_in()) {
         $this->ag_auth->view('user/dashboard_view');
     } else {
         $this->ag_auth->view('login');
     }
 }
开发者ID:cristminix,项目名称:7e03be2c8848cc5549cc93a3a90edb44,代码行数:8,代码来源:user.php

示例15: index

 public function index()
 {
     if (logged_in()) {
         $this->ag_auth->view('dashboard');
     } else {
         $this->login();
     }
 }
开发者ID:cristminix,项目名称:7e03be2c8848cc5549cc93a3a90edb44,代码行数:8,代码来源:admin.php


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