summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--application/controllers/file.php1
-rw-r--r--application/controllers/user.php2
-rw-r--r--application/core/MY_Controller.php3
-rw-r--r--application/helpers/filebin_helper.php7
-rw-r--r--application/views/file/upload_form.php2
-rw-r--r--application/views/header.php4
6 files changed, 6 insertions, 13 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 98ccae884..b02cdd8ce 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -20,7 +20,6 @@ class File extends MY_Controller {
parent::__construct();
$this->load->model('mfile');
- $this->load->model('muser');
if (is_cli_client()) {
$this->var->view_dir = "file_plaintext";
diff --git a/application/controllers/user.php b/application/controllers/user.php
index 823166ea5..356cc430b 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -18,8 +18,6 @@ class User extends MY_Controller {
{
parent::__construct();
- $this->load->model("muser");
-
$this->var->view_dir = "user/";
}
diff --git a/application/core/MY_Controller.php b/application/core/MY_Controller.php
index 47083035c..043b52ef7 100644
--- a/application/core/MY_Controller.php
+++ b/application/core/MY_Controller.php
@@ -99,5 +99,8 @@ class MY_Controller extends CI_Controller {
}
$this->data['title'] = "FileBin";
+
+ $this->load->model("muser");
+ $this->data["user_logged_in"] = $this->muser->logged_in();
}
}
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index bed696c8c..6e4c84e43 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -323,13 +323,6 @@ function auth_driver_function_implemented($function)
return $result[$function];
}
-function user_logged_in()
-{
- $CI =& get_instance();
- $CI->load->model("muser");
- return $CI->muser->logged_in();
-}
-
function send_json_reply($array, $status = "success")
{
$reply = array();
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php
index a977aaa92..b472bcc10 100644
--- a/application/views/file/upload_form.php
+++ b/application/views/file/upload_form.php
@@ -1,4 +1,4 @@
-<?php if (user_logged_in()) { ?>
+<?php if (isset($user_logged_in) && $user_logged_in) { ?>
<div class="well">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-upload-form">
diff --git a/application/views/header.php b/application/views/header.php
index 396841a0e..7d4ba1f54 100644
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -54,7 +54,7 @@ if (is_cli_client() && !isset($force_full_html)) {
<div class="collapse navbar-collapse navbar-ex1-collapse">
<?php if(!isset($GLOBALS["is_error_page"])) { ?>
<ul class="nav navbar-nav navbar-right">
- <?php if(user_logged_in()) { ?>
+ <?php if (isset($user_logged_in) && $user_logged_in) { ?>
<li><a class="navbar-link" href="<?php echo site_url("/user/logout"); ?>">Logout</a></li>
<?php } else { ?>
<li class="dropdown">
@@ -74,7 +74,7 @@ if (is_cli_client() && !isset($force_full_html)) {
</ul>
<?php }; ?>
<ul class="nav navbar-nav">
- <?php if(user_logged_in()) { ?>
+ <?php if (isset($user_logged_in) && $user_logged_in) { ?>
<li><a href="<?php echo site_url("file/index") ?>"><span class="glyphicon glyphicon-pencil"></span> New</a></li>
<li><a href="<?php echo site_url("file/upload_history") ?>"><span class="glyphicon glyphicon-book"></span> History</a></li>
<li class="dropdown">