summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-09-26 11:36:06 +0200
committerFlorian Pritz <bluewind@xinu.at>2016-11-01 17:29:04 +0100
commite59da00f40e33975cc8ab33fa4a9aca9262eb83e (patch)
tree562a7cfe9bc961477fdf2fd09b6270875fa30925 /application
parente9b1fc5637b8412038a9c400c983c526829b6664 (diff)
Remove special handling of cli clients
Signed-off-by: Florian Pritz <bluewind@xinu.at>
Diffstat (limited to 'application')
-rw-r--r--application/controllers/file/file_default.php22
-rw-r--r--application/controllers/user.php6
2 files changed, 2 insertions, 26 deletions
diff --git a/application/controllers/file/file_default.php b/application/controllers/file/file_default.php
index 82e933021..563102026 100644
--- a/application/controllers/file/file_default.php
+++ b/application/controllers/file/file_default.php
@@ -553,10 +553,6 @@ class File_default extends MY_Controller {
}
}
- if (is_cli_client()) {
- $redirect = false;
- }
-
if ($redirect && count($ids) == 1) {
redirect($this->data['urls'][0], "location", 303);
} else {
@@ -770,14 +766,8 @@ class File_default extends MY_Controller {
);
}
- $order = is_cli_client() ? "ASC" : "DESC";
-
- uasort($history["items"], function($a, $b) use ($order) {
- if ($order == "ASC") {
- return $a["date"] - $b["date"];
- } else {
+ uasort($history["items"], function($a, $b) {
return $b["date"] - $a["date"];
- }
});
foreach($history["items"] as $key => $item) {
@@ -786,16 +776,6 @@ class File_default extends MY_Controller {
if (isset($item['preview_text'])) {
$history["items"][$key]["preview_text"] = htmlentities($item['preview_text']);
}
-
- if (is_cli_client()) {
- // Keep track of longest string to pad plaintext output correctly
- foreach($fields as $length_key => $value) {
- $len = mb_strlen($history["items"][$key][$length_key]);
- if ($len > $lengths[$length_key]) {
- $lengths[$length_key] = $len;
- }
- }
- }
}
$this->data["items"] = $history["items"];
diff --git a/application/controllers/user.php b/application/controllers/user.php
index a298d1076..28abf74a5 100644
--- a/application/controllers/user.php
+++ b/application/controllers/user.php
@@ -93,11 +93,7 @@ class User extends MY_Controller {
$key = \service\user::create_apikey($userid, $comment, $access_level);
- if (is_cli_client()) {
- echo "$key\n";
- } else {
- redirect("user/apikeys");
- }
+ redirect("user/apikeys");
}
function delete_apikey()