summaryrefslogtreecommitdiffstats
path: root/application/controllers
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2012-05-17 21:36:32 +0200
committerFlorian Pritz <bluewind@xinu.at>2012-05-17 21:40:00 +0200
commitac6d834e2b4f02d656e38fe300b5c6404d1f75e6 (patch)
tree8ce13504d568098e3b37501c69c562ed3fb0d074 /application/controllers
parent59b763e9896d6f6196a894c6d57d58ef9ddd6bc6 (diff)
improve is_cli_client() and use everywhere
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application/controllers')
-rw-r--r--application/controllers/file.php15
1 files changed, 6 insertions, 9 deletions
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 1ac3a79c9..b8306b5bc 100644
--- a/application/controllers/file.php
+++ b/application/controllers/file.php
@@ -31,16 +31,13 @@ class File extends CI_Controller {
$this->load->model('file_mod');
$this->load->model('muser');
- $this->var->cli_client = false;
- $this->file_mod->var->cli_client =& $this->var->cli_client;
$this->var->latest_client = false;
if (file_exists(FCPATH.'data/client/latest')) {
$this->var->latest_client = trim(file_get_contents(FCPATH.'data/client/latest'));
}
- $this->var->cli_client = is_cli_client();
- if ($this->var->cli_client) {
+ if (is_cli_client()) {
$this->var->view_dir = "file_plaintext";
} else {
$this->var->view_dir = "file";
@@ -85,11 +82,11 @@ class File extends CI_Controller {
$this->data['client_link_deb'] = base_url().'data/client/deb/';
$this->data['client_link_slackware'] = base_url().'data/client/slackware/';
- if (!$this->var->cli_client) {
+ if (is_cli_client()) {
$this->load->view($this->var->view_dir.'/header', $this->data);
}
$this->load->view($this->var->view_dir.'/client', $this->data);
- if (!$this->var->cli_client) {
+ if (is_cli_client()) {
$this->load->view($this->var->view_dir.'/footer', $this->data);
}
}
@@ -106,7 +103,7 @@ class File extends CI_Controller {
$this->load->view($this->var->view_dir.'/header', $this->data);
$this->load->view($this->var->view_dir.'/upload_form', $this->data);
- if ($this->var->cli_client) {
+ if (is_cli_client()) {
$this->client();
}
$this->load->view($this->var->view_dir.'/footer', $this->data);
@@ -155,7 +152,7 @@ class File extends CI_Controller {
foreach($query as $key => $item) {
$query[$key]["date"] = date("r", $item["date"]);
$query[$key]["filesize"] = format_bytes($item["filesize"]);
- if ($this->var->cli_client) {
+ if (is_cli_client()) {
// Keep track of longest string to pad plaintext output correctly
foreach($fields as $length_key => $value) {
$len = mb_strlen($query[$key][$length_key]);
@@ -226,7 +223,7 @@ class File extends CI_Controller {
{
$this->muser->require_access();
- if (!$this->var->cli_client) {
+ if (is_cli_client()) {
echo "Not a listed cli client, please use the history to delete uploads.\n";
return;
}