Example #1
0
function confirm_logged_in()
{
    if (!logged_in()) {
        header("Location:handler.php?not=1");
        exit;
    }
}
Example #2
0
 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);
     }
 }
Example #3
0
 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();
     }
 }
 /**
  * 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);
 }
Example #5
0
 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');
         }
     }
 }
function refresh_session()
{
    if (logged_in()) {
        $time = time();
        $_SESSION['refresh_time'] = $time;
    }
}
function protect_page()
{
    if (logged_in() === false) {
        header("Location:login.php");
        exit;
    }
}
Example #8
0
function protect_page()
{
    if (logged_in() === false) {
        header('Location: protected.php');
        exit;
    }
}
Example #9
0
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;
    }
}
Example #10
0
function confirm_logged_in()
{
    $logged = logged_in();
    if ($logged == FALSE) {
        redirect_to("login.php");
    }
}
Example #11
0
 public function __init()
 {
     $this->user = logged_in() ? Visitor::current()->login : "******";
     $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, "/");
             }
         }
     }
 }
Example #12
0
function verify_session()
{
    if (!logged_in()) {
        header("Location:http://nubespic.com/index.php");
        exit;
    }
}
Example #13
0
function verify_session()
{
    if (!logged_in()) {
        session_msg("Debe iniciar sesion para ingresar");
        header("Location:../index.php");
        exit;
    }
}
Example #14
0
 public function index()
 {
     if (logged_in()) {
         echo "Logged in!";
     } else {
         echo "Not logged baby";
     }
 }
 public function index()
 {
     if (logged_in()) {
         $this->ag_auth->view('user/dashboard_view');
     } else {
         $this->ag_auth->view('login');
     }
 }
 public function index()
 {
     if (logged_in()) {
         $this->ag_auth->view('dashboard');
     } else {
         $this->login();
     }
 }
Example #17
0
function nav_print()
{
    if (logged_in()) {
        nav_logged();
    } else {
        nav_not_logged();
    }
}
Example #18
0
 public function index()
 {
     if (logged_in()) {
         $this->ag_auth->view('home');
     } else {
         $this->ag_auth->view('home');
     }
 }
Example #19
0
function list_verify()
{
    if (logged_in() != TRUE) {
        //echo 'You are not logged in';
        direct('login.php', 0);
        //echo 'hih';
    }
}
Example #20
0
function login_required()
{
    if (logged_in()) {
        return true;
    } else {
        header('Location: login.php');
    }
}
function protect_page()
{
    //Skyddar sidan från besökare som inte är inloggade
    if (logged_in() === false) {
        header('Location: index.php');
        exit;
    }
}
Example #22
0
 public function showForgotPassword()
 {
     $this->pageSetting(['title' => 'ลืมรหัสผ่าน | MEA FUND']);
     if (logged_in()) {
         return redirect()->to('/');
     }
     return view('frontend.pages.forgotpassword');
 }
Example #23
0
/**
 * If user is not logged in, display a 
 * message and exit the page cleanly
 * @gloabl $mysqli MySQL databse connection object
 **/
function login_protect()
{
    global $mysqli;
    if (!logged_in()) {
        output("You must be logged in to view this page!");
        include "./footer.php";
        exit;
    }
}
Example #24
0
function login_required()
{
    if (logged_in()) {
        return true;
    } else {
        header('Location: ' . DIRADMIN . 'login.php');
        exit;
    }
}
Example #25
0
 public function index()
 {
     if (logged_in()) {
         echo "Logged in!";
     } else {
         echo "Not logged baby";
         $this->load->view('users/login', array());
     }
 }
Example #26
0
 public function index()
 {
     if (logged_in()) {
         $this->data['information'] = $this->edit_my_profile->getInfo();
         $this->ag_auth->view('teacher/editprofile', $this->data);
     } else {
         $this->login();
     }
 }
Example #27
0
function check_user_permissions()
{
    if (logged_in()) {
        return true;
    } else {
        flashmsg('You must be logged in to access this', 'error');
        redirect('auth/login');
    }
}
Example #28
0
function confirm_admin_logged_in()
{
    if (!admin_logged_in()) {
        if (logged_in()) {
            redirect_to("index.php?admin=0");
        } else {
            redirect_to("index.php");
        }
    }
}
 /**
  * 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('admin/login');
     }
     if (!in_array(get_user_group(), Config::get('mea.admin_groups'))) {
         return redirect()->to('admin/login');
     }
     return $next($request);
 }
function information_field_tag($field)
{
    global $user, $current_user;
    $value = $user[$field];
    if (logged_in() && $current_user["id"] === $user["id"]) {
        return "<input type=\"text\" name=\"{$field}\" value=\"{$value}\" form=\"update_prof\" \\>";
    } else {
        return $user["{$field}"];
    }
}