summaryrefslogtreecommitdiffstats
path: root/application
diff options
context:
space:
mode:
Diffstat (limited to 'application')
-rw-r--r--[-rwxr-xr-x]application/.htaccess0
-rw-r--r--[-rwxr-xr-x]application/cache/.htaccess0
-rw-r--r--[-rwxr-xr-x]application/cache/index.html0
-rw-r--r--application/config/config.php21
-rw-r--r--application/config/migration.php2
-rw-r--r--application/controllers/file.php7
-rw-r--r--[-rwxr-xr-x]application/controllers/index.html0
-rw-r--r--application/controllers/user.php2
-rw-r--r--application/core/MY_Controller.php3
-rw-r--r--[-rwxr-xr-x]application/core/index.html0
-rw-r--r--[-rwxr-xr-x]application/errors/error_404.php0
-rw-r--r--[-rwxr-xr-x]application/errors/error_db.php0
-rw-r--r--[-rwxr-xr-x]application/errors/error_general.php0
-rw-r--r--[-rwxr-xr-x]application/errors/error_php.php0
-rw-r--r--[-rwxr-xr-x]application/errors/index.html0
-rw-r--r--application/helpers/filebin_helper.php106
-rw-r--r--[-rwxr-xr-x]application/helpers/index.html0
-rw-r--r--[-rwxr-xr-x]application/hooks/index.html0
-rw-r--r--[-rwxr-xr-x]application/index.html0
-rw-r--r--[-rwxr-xr-x]application/language/english/index.html0
-rw-r--r--application/libraries/Ddownload/Ddownload.php34
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_lighttpd.php26
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_nginx.php29
-rw-r--r--application/libraries/Ddownload/drivers/Ddownload_php.php111
-rw-r--r--application/libraries/Duser/Duser.php33
-rw-r--r--application/libraries/Duser/drivers/Duser_db.php12
-rw-r--r--application/libraries/Duser/drivers/Duser_fluxbb.php53
-rw-r--r--[-rwxr-xr-x]application/libraries/index.html0
-rw-r--r--[-rwxr-xr-x]application/logs/index.html0
-rw-r--r--application/migrations/010_files_innodb.php16
-rw-r--r--[-rwxr-xr-x]application/models/index.html0
-rw-r--r--application/models/mfile.php18
-rw-r--r--application/models/muser.php4
-rw-r--r--[-rwxr-xr-x]application/third_party/index.html0
-rw-r--r--application/views/file/file_info.php54
-rw-r--r--application/views/file/html_header.php170
-rw-r--r--application/views/file/nav_history.php2
-rw-r--r--application/views/file/upload_form.php88
-rw-r--r--application/views/file/upload_history.php46
-rw-r--r--application/views/file/upload_history_thumbnails.php2
-rw-r--r--application/views/footer.php9
-rw-r--r--application/views/header.php48
-rw-r--r--[-rwxr-xr-x]application/views/index.html0
-rw-r--r--application/views/user/apikeys.php62
-rw-r--r--application/views/user/hash_password.php29
-rw-r--r--application/views/user/invite.php38
-rw-r--r--application/views/user/login.php14
-rw-r--r--application/views/user/nav.php8
-rw-r--r--application/views/user/profile.php42
-rw-r--r--application/views/user/register.php50
-rw-r--r--application/views/user/reset_password_form.php30
-rw-r--r--application/views/user/reset_password_username_form.php18
52 files changed, 733 insertions, 454 deletions
diff --git a/application/.htaccess b/application/.htaccess
index 14249c50b..14249c50b 100755..100644
--- a/application/.htaccess
+++ b/application/.htaccess
diff --git a/application/cache/.htaccess b/application/cache/.htaccess
index 3418e55a6..3418e55a6 100755..100644
--- a/application/cache/.htaccess
+++ b/application/cache/.htaccess
diff --git a/application/cache/index.html b/application/cache/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/cache/index.html
+++ b/application/cache/index.html
diff --git a/application/config/config.php b/application/config/config.php
index 388776cda..54870b37b 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -408,9 +408,30 @@ if (extension_loaded("ldap")) {
);
}
+// This is only used it the driver is set to fluxbb
+$config['auth_fluxbb'] = array(
+ 'database' => 'fluxbb'
+);
+
// possible values: production, development
$config['environment'] = "production";
+// This sets the download implementation. Possible values are php, nginx and lighttpd
+// The nginx and lighttpd drivers make use of the server's sendfile feature.
+$config['download_driver'] = 'php';
+// The lighttpd driver requires the following directive to be set in your fastcgi.server configuration:
+// "allow-x-send-file" => "enable"
+// See http://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModFastCGI#X-Sendfile
+//
+// When using the nginx download driver you need to define an internal location
+// from which nginx will serve your uploads:
+// location ^~ /protected-uploads/ {
+// internal;
+// alias <upload_path>/;
+// }
+// See http://wiki.nginx.org/X-accel
+$config['download_nginx_location'] = '/protected-uploads';
+
if (file_exists(FCPATH.'application/config/config-local.php')) {
include FCPATH.'application/config/config-local.php';
}
diff --git a/application/config/migration.php b/application/config/migration.php
index 5fef0ad40..6cfd09a30 100644
--- a/application/config/migration.php
+++ b/application/config/migration.php
@@ -21,7 +21,7 @@ $config['migration_enabled'] = true;
| be upgraded / downgraded to.
|
*/
-$config['migration_version'] = 9;
+$config['migration_version'] = 10;
/*
diff --git a/application/controllers/file.php b/application/controllers/file.php
index 98ccae884..6ac0bc28c 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";
@@ -99,10 +98,12 @@ class File extends MY_Controller {
exit();
}
+ $this->load->driver("ddownload");
+
// user wants the plain file
if ($lexer == 'plain') {
handle_etag($etag);
- rangeDownload($file, $filedata["filename"], "text/plain");
+ $this->ddownload->serveFile($file, $filedata["filename"], "text/plain");
exit();
}
@@ -123,7 +124,7 @@ class File extends MY_Controller {
header("$header_name: allow 'none'; img-src *; media-src *; font-src *; style-src * 'unsafe-inline'; script-src 'none'; object-src *; frame-src 'none'; ");
}
handle_etag($etag);
- rangeDownload($file, $filedata["filename"], $filedata["mimetype"]);
+ $this->ddownload->serveFile($file, $filedata["filename"], $filedata["mimetype"]);
exit();
}
diff --git a/application/controllers/index.html b/application/controllers/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/controllers/index.html
+++ b/application/controllers/index.html
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/core/index.html b/application/core/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/core/index.html
+++ b/application/core/index.html
diff --git a/application/errors/error_404.php b/application/errors/error_404.php
index 792726a67..792726a67 100755..100644
--- a/application/errors/error_404.php
+++ b/application/errors/error_404.php
diff --git a/application/errors/error_db.php b/application/errors/error_db.php
index b396cda9f..b396cda9f 100755..100644
--- a/application/errors/error_db.php
+++ b/application/errors/error_db.php
diff --git a/application/errors/error_general.php b/application/errors/error_general.php
index 6c67fa33f..6c67fa33f 100755..100644
--- a/application/errors/error_general.php
+++ b/application/errors/error_general.php
diff --git a/application/errors/error_php.php b/application/errors/error_php.php
index 5f91e07a0..5f91e07a0 100755..100644
--- a/application/errors/error_php.php
+++ b/application/errors/error_php.php
diff --git a/application/errors/index.html b/application/errors/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/errors/index.html
+++ b/application/errors/index.html
diff --git a/application/helpers/filebin_helper.php b/application/helpers/filebin_helper.php
index bed696c8c..71ce7e6ca 100644
--- a/application/helpers/filebin_helper.php
+++ b/application/helpers/filebin_helper.php
@@ -20,105 +20,6 @@ function format_bytes($size)
}
}
-// Original source: http://www.phpfreaks.com/forums/index.php?topic=198274.msg895468#msg895468
-function rangeDownload($file, $filename, $type)
-{
- $fp = @fopen($file, 'r');
-
- $size = filesize($file); // File size
- $length = $size; // Content length
- $start = 0; // Start byte
- $end = $size - 1; // End byte
- // Now that we've gotten so far without errors we send the accept range header
- /* At the moment we only support single ranges.
- * Multiple ranges requires some more work to ensure it works correctly
- * and comply with the spesifications: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
- *
- * Multirange support annouces itself with:
- * header('Accept-Ranges: bytes');
- *
- * Multirange content must be sent with multipart/byteranges mediatype,
- * (mediatype = mimetype)
- * as well as a boundry header to indicate the various chunks of data.
- */
- header("Accept-Ranges: 0-$length");
- // header('Accept-Ranges: bytes');
- // multipart/byteranges
- // http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
- if (isset($_SERVER['HTTP_RANGE']))
- {
- $c_start = $start;
- $c_end = $end;
- // Extract the range string
- list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
- // Make sure the client hasn't sent us a multibyte range
- if (strpos($range, ',') !== false)
- {
- // (?) Shoud this be issued here, or should the first
- // range be used? Or should the header be ignored and
- // we output the whole content?
- header('HTTP/1.1 416 Requested Range Not Satisfiable');
- header("Content-Range: bytes $start-$end/$size");
- // (?) Echo some info to the client?
- exit;
- }
- // If the range starts with an '-' we start from the beginning
- // If not, we forward the file pointer
- // And make sure to get the end byte if spesified
- if ($range{0} == '-')
- {
- // The n-number of the last bytes is requested
- $c_start = $size - substr($range, 1);
- }
- else
- {
- $range = explode('-', $range);
- $c_start = $range[0];
- $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
- }
- /* Check the range and make sure it's treated according to the specs.
- * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
- */
- // End bytes can not be larger than $end.
- $c_end = ($c_end > $end) ? $end : $c_end;
- // Validate the requested range and return an error if it's not correct.
- if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size)
- {
- header('HTTP/1.1 416 Requested Range Not Satisfiable');
- header("Content-Range: bytes $start-$end/$size");
- // (?) Echo some info to the client?
- exit;
- }
- $start = $c_start;
- $end = $c_end;
- $length = $end - $start + 1; // Calculate new content length
- fseek($fp, $start);
- header('HTTP/1.1 206 Partial Content');
- // Notify the client the byte range we'll be outputting
- header("Content-Range: bytes $start-$end/$size");
- }
- header("Content-Length: $length");
- header("Content-disposition: inline; filename=\"".$filename."\"\n");
- header("Content-Type: ".$type."\n");
-
- // Start buffered download
- $buffer = 1024 * 8;
- while(!feof($fp) && ($p = ftell($fp)) <= $end)
- {
- if ($p + $buffer > $end)
- {
- // In case we're only outputtin a chunk, make sure we don't
- // read past the length
- $buffer = $end - $p + 1;
- }
- set_time_limit(0); // Reset time limit for big files
- echo fread($fp, $buffer);
- flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit.
- }
-
- fclose($fp);
-}
-
function even_odd($reset = false)
{
static $counter = 1;
@@ -323,13 +224,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/helpers/index.html b/application/helpers/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/helpers/index.html
+++ b/application/helpers/index.html
diff --git a/application/hooks/index.html b/application/hooks/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/hooks/index.html
+++ b/application/hooks/index.html
diff --git a/application/index.html b/application/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/index.html
+++ b/application/index.html
diff --git a/application/language/english/index.html b/application/language/english/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/language/english/index.html
+++ b/application/language/english/index.html
diff --git a/application/libraries/Ddownload/Ddownload.php b/application/libraries/Ddownload/Ddownload.php
new file mode 100644
index 000000000..808dfe776
--- /dev/null
+++ b/application/libraries/Ddownload/Ddownload.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+abstract class Ddownload_Driver extends CI_Driver {
+
+ abstract public function serveFile($file, $filename, $type);
+}
+
+class Ddownload extends CI_Driver_Library {
+
+ protected $_adapter = null;
+
+ protected $valid_drivers = array(
+ 'ddownload_php', 'ddownload_nginx', 'ddownload_lighttpd'
+ );
+
+ function __construct()
+ {
+ $CI =& get_instance();
+
+ $this->_adapter = $CI->config->item('download_driver');
+ }
+
+ public function serveFile($file, $filename, $type)
+ {
+ $this->{$this->_adapter}->serveFile($file, $filename, $type);
+ }
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php b/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php
new file mode 100644
index 000000000..780f60838
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_lighttpd.php
@@ -0,0 +1,26 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_lighttpd extends Ddownload_Driver {
+
+ public function serveFile($file, $filename, $type)
+ {
+ $CI =& get_instance();
+ $upload_path = $CI->config->item('upload_path');
+
+ if (strpos($file, $upload_path) !== 0) {
+ show_error('Invalid file path');
+ }
+
+ header('Content-disposition: inline; filename="'.$filename."\"\n");
+ header('Content-Type: '.$type."\n");
+ header('X-Sendfile: '.$file."\n");
+ }
+
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_nginx.php b/application/libraries/Ddownload/drivers/Ddownload_nginx.php
new file mode 100644
index 000000000..2410df4d4
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_nginx.php
@@ -0,0 +1,29 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_nginx extends Ddownload_Driver {
+
+ public function serveFile($file, $filename, $type)
+ {
+ $CI =& get_instance();
+ $upload_path = $CI->config->item('upload_path');
+ $download_location = $CI->config->item('download_nginx_location');
+
+ if (strpos($file, $upload_path) === 0) {
+ $file_path = substr($file, strlen($upload_path));
+ } else {
+ show_error('Invalid file path');
+ }
+
+ header('Content-disposition: inline; filename="'.$filename."\"\n");
+ header('Content-Type: '.$type."\n");
+ header('X-Accel-Redirect: '.$download_location.$file_path."\n");
+ }
+
+}
diff --git a/application/libraries/Ddownload/drivers/Ddownload_php.php b/application/libraries/Ddownload/drivers/Ddownload_php.php
new file mode 100644
index 000000000..344db53f0
--- /dev/null
+++ b/application/libraries/Ddownload/drivers/Ddownload_php.php
@@ -0,0 +1,111 @@
+<?php
+/*
+ * Copyright 2013 Florian "Bluewind" Pritz <bluewind@server-speed.net>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Ddownload_php extends Ddownload_Driver {
+
+ // Original source: http://www.phpfreaks.com/forums/index.php?topic=198274.msg895468#msg895468
+ public function serveFile($file, $filename, $type)
+ {
+ $fp = @fopen($file, 'r');
+
+ $size = filesize($file); // File size
+ $length = $size; // Content length
+ $start = 0; // Start byte
+ $end = $size - 1; // End byte
+ // Now that we've gotten so far without errors we send the accept range header
+ /* At the moment we only support single ranges.
+ * Multiple ranges requires some more work to ensure it works correctly
+ * and comply with the spesifications: http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
+ *
+ * Multirange support annouces itself with:
+ * header('Accept-Ranges: bytes');
+ *
+ * Multirange content must be sent with multipart/byteranges mediatype,
+ * (mediatype = mimetype)
+ * as well as a boundry header to indicate the various chunks of data.
+ */
+ header("Accept-Ranges: 0-$length");
+ // header('Accept-Ranges: bytes');
+ // multipart/byteranges
+ // http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.2
+ if (isset($_SERVER['HTTP_RANGE']))
+ {
+ $c_start = $start;
+ $c_end = $end;
+ // Extract the range string
+ list(, $range) = explode('=', $_SERVER['HTTP_RANGE'], 2);
+ // Make sure the client hasn't sent us a multibyte range
+ if (strpos($range, ',') !== false)
+ {
+ // (?) Shoud this be issued here, or should the first
+ // range be used? Or should the header be ignored and
+ // we output the whole content?
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ // (?) Echo some info to the client?
+ exit;
+ }
+ // If the range starts with an '-' we start from the beginning
+ // If not, we forward the file pointer
+ // And make sure to get the end byte if spesified
+ if ($range{0} == '-')
+ {
+ // The n-number of the last bytes is requested
+ $c_start = $size - substr($range, 1);
+ }
+ else
+ {
+ $range = explode('-', $range);
+ $c_start = $range[0];
+ $c_end = (isset($range[1]) && is_numeric($range[1])) ? $range[1] : $size;
+ }
+ /* Check the range and make sure it's treated according to the specs.
+ * http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html
+ */
+ // End bytes can not be larger than $end.
+ $c_end = ($c_end > $end) ? $end : $c_end;
+ // Validate the requested range and return an error if it's not correct.
+ if ($c_start > $c_end || $c_start > $size - 1 || $c_end >= $size)
+ {
+ header('HTTP/1.1 416 Requested Range Not Satisfiable');
+ header("Content-Range: bytes $start-$end/$size");
+ // (?) Echo some info to the client?
+ exit;
+ }
+ $start = $c_start;
+ $end = $c_end;
+ $length = $end - $start + 1; // Calculate new content length
+ fseek($fp, $start);
+ header('HTTP/1.1 206 Partial Content');
+ // Notify the client the byte range we'll be outputting
+ header("Content-Range: bytes $start-$end/$size");
+ }
+ header("Content-Length: $length");
+ header("Content-disposition: inline; filename=\"".$filename."\"\n");
+ header("Content-Type: ".$type."\n");
+
+ // Start buffered download
+ $buffer = 1024 * 8;
+ while(!feof($fp) && ($p = ftell($fp)) <= $end)
+ {
+ if ($p + $buffer > $end)
+ {
+ // In case we're only outputtin a chunk, make sure we don't
+ // read past the length
+ $buffer = $end - $p + 1;
+ }
+ set_time_limit(0); // Reset time limit for big files
+ echo fread($fp, $buffer);
+ flush(); // Free up memory. Otherwise large files will trigger PHP's memory limit.
+ }
+
+ fclose($fp);
+ }
+
+}
diff --git a/application/libraries/Duser/Duser.php b/application/libraries/Duser/Duser.php
index 96d61e3cc..07a16190c 100644
--- a/application/libraries/Duser/Duser.php
+++ b/application/libraries/Duser/Duser.php
@@ -9,14 +9,11 @@
abstract class Duser_Driver extends CI_Driver {
- // List of optional functions or function groups that are implemented
+ // List of optional functions that are implemented
//
- // Possible values are names of functions already implemented in this
- // abstract class or the function groups listed below.
- //
- // Possible function groups are:
- // - can_register_new_users
- // - can_reset_password
+ // Possible values are:
+ // - can_register_new_users (only supported with the DB driver!)
+ // - can_reset_password (only supported with the DB driver!)
public $optional_functions = array();
/*
@@ -24,12 +21,26 @@ abstract class Duser_Driver extends CI_Driver {
* - username string
* - userid INT > 0
*
+ * @param username
+ * @param password
* @return mixed array on success, false on failure
*/
abstract public function login($username, $password);
+ /*
+ * @param username
+ * @return boolean true is username exists, false otherwise
+ */
public function username_exists($username) {
- return false;
+ return null;
+ }
+
+ /*
+ * @param userid
+ * @return string email address of the user
+ */
+ public function get_email($userid) {
+ return null;
}
}
@@ -38,7 +49,7 @@ class Duser extends CI_Driver_Library {
protected $_adapter = null;
protected $valid_drivers = array(
- 'duser_db', 'duser_ldap'
+ 'duser_db', 'duser_ldap', 'duser_fluxbb'
);
function __construct()
@@ -87,8 +98,6 @@ class Duser extends CI_Driver_Library {
public function username_exists($username)
{
- $this->require_implemented(__FUNCTION__);
-
if ($username === false) {
return false;
}
@@ -98,8 +107,6 @@ class Duser extends CI_Driver_Library {
public function get_email($userid)
{
- $this->require_implemented(__FUNCTION__);
-
return $this->{$this->_adapter}->get_email($userid);
}
}
diff --git a/application/libraries/Duser/drivers/Duser_db.php b/application/libraries/Duser/drivers/Duser_db.php
index 1258ec585..a58b5a298 100644
--- a/application/libraries/Duser/drivers/Duser_db.php
+++ b/application/libraries/Duser/drivers/Duser_db.php
@@ -9,11 +9,13 @@
class Duser_db extends Duser_Driver {
+ /* FIXME: If you use this driver as a template, remove can_reset_password
+ * and can_register_new_users. These features require the DB driver and
+ * will NOT work with other drivers.
+ */
public $optional_functions = array(
- 'username_exists',
'can_reset_password',
'can_register_new_users',
- 'get_email',
);
public function login($username, $password)
@@ -26,11 +28,7 @@ class Duser_db extends Duser_Driver {
WHERE `username` = ?
', array($username))->row_array();
- if (!isset($query["username"]) || $query["username"] !== $username) {
- return false;
- }
-
- if (!isset($query["password"])) {
+ if (empty($query)) {
return false;
}
diff --git a/application/libraries/Duser/drivers/Duser_fluxbb.php b/application/libraries/Duser/drivers/Duser_fluxbb.php
new file mode 100644
index 000000000..1790e830b
--- /dev/null
+++ b/application/libraries/Duser/drivers/Duser_fluxbb.php
@@ -0,0 +1,53 @@
+<?php
+/*
+ * Copyright 2013 Pierre Schmitz <pierre@archlinux.de>
+ *
+ * Licensed under AGPLv3
+ * (see COPYING for full license text)
+ *
+ */
+
+class Duser_fluxbb extends Duser_Driver {
+
+ private $CI = null;
+ private $config = array();
+
+ function __construct()
+ {
+ $this->CI =& get_instance();
+ $this->config = $this->CI->config->item('auth_fluxbb');
+ }
+
+ public function login($username, $password)
+ {
+ $query = $this->CI->db->query('
+ SELECT username, id
+ FROM '.$this->config['database'].'.users
+ WHERE username = ? AND password = ?
+ ', array($username, sha1($password)))->row_array();
+
+ if (!empty($query)) {
+ return array(
+ 'username' => $query['username'],
+ 'userid' => $query['id']
+ );
+ } else {
+ return false;
+ }
+ }
+
+ public function username_exists($username)
+ {
+ $query = $this->CI->db->query('
+ SELECT id
+ FROM '.$this->config['database'].'.users
+ WHERE username = ?
+ ', array($username));
+
+ if ($query->num_rows() > 0) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+}
diff --git a/application/libraries/index.html b/application/libraries/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/libraries/index.html
+++ b/application/libraries/index.html
diff --git a/application/logs/index.html b/application/logs/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/logs/index.html
+++ b/application/logs/index.html
diff --git a/application/migrations/010_files_innodb.php b/application/migrations/010_files_innodb.php
new file mode 100644
index 000000000..b32f94724
--- /dev/null
+++ b/application/migrations/010_files_innodb.php
@@ -0,0 +1,16 @@
+<?php
+defined('BASEPATH') OR exit('No direct script access allowed');
+
+class Migration_files_innodb extends CI_Migration {
+
+ public function up()
+ {
+ $this->db->query("
+ ALTER TABLE `files` ENGINE = InnoDB;
+ ");
+ }
+
+ public function down()
+ {
+ }
+}
diff --git a/application/models/index.html b/application/models/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/models/index.html
+++ b/application/models/index.html
diff --git a/application/models/mfile.php b/application/models/mfile.php
index e862f1930..e70b5c812 100644
--- a/application/models/mfile.php
+++ b/application/models/mfile.php
@@ -476,11 +476,29 @@ class Mfile extends CI_Model {
$extension = substr($name, strrpos($name, ".") + 1);
$extensionarray = array(
+ 'awk' => 'awk',
+ 'c' => 'c',
'coffee' => 'coffee-script',
+ 'cpp' => 'cpp',
+ 'diff' => 'diff',
+ 'h' => 'c',
+ 'hs' => 'haskell',
+ 'html' => 'xml',
+ 'java' => 'java',
+ 'js' => 'js',
+ 'lua' => 'lua',
'mli' => 'ocaml',
'mll' => 'ocaml',
'ml' => 'ocaml',
'mly' => 'ocaml',
+ 'patch' => 'diff',
+ 'php' => 'php',
+ 'pl' => 'perl',
+ 'py' => 'python',
+ 'rb' => 'ruby',
+ 's' => 'asm',
+ 'sh' => 'bash',
+ 'svg' => 'xml',
'tcl' => 'tcl',
'tex' => 'tex',
);
diff --git a/application/models/muser.php b/application/models/muser.php
index 2dd7280e8..7a3627b18 100644
--- a/application/models/muser.php
+++ b/application/models/muser.php
@@ -142,10 +142,6 @@ class Muser extends CI_Model {
function get_email($userid)
{
- if (!$this->duser->is_implemented("get_email")) {
- return false;
- }
-
return $this->duser->get_email($userid);
}
diff --git a/application/third_party/index.html b/application/third_party/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/third_party/index.html
+++ b/application/third_party/index.html
diff --git a/application/views/file/file_info.php b/application/views/file/file_info.php
index 82a3e4f81..6c2772a21 100644
--- a/application/views/file/file_info.php
+++ b/application/views/file/file_info.php
@@ -1,30 +1,32 @@
<div class="center">
<?php if($filedata): ?>
- <table style="margin: auto">
- <tr>
- <td class="title">ID</td>
- <td class="text"><a href="<?php echo site_url($id); ?>/"><?php echo $id; ?></a></td>
- </tr>
- <tr>
- <td class="title">Filename</td>
- <td class="text"><?php echo htmlspecialchars($filedata["filename"]); ?></td>
- </tr>
- <tr>
- <td class="title">Date of upload</td>
- <td class="text"><?php echo date("r", $filedata["date"]); ?></td>
- </tr>
- <tr>
- <td class="title">Date of removal</td>
- <td class="text"><?php echo $timeout; ?></td>
- </tr>
- <tr>
- <td class="title">Size</td>
- <td class="text"><?php echo format_bytes($filedata["filesize"]); ?></td>
- </tr>
- <tr>
- <td class="title">Mimetype</td>
- <td class="text"><?php echo $filedata["mimetype"]; ?></td>
- </tr>
- </table>
+ <div class="table-responive">
+ <table class="table" style="margin: auto">
+ <tr>
+ <td class="title">ID</td>
+ <td class="text"><a href="<?php echo site_url($id); ?>/"><?php echo $id; ?></a></td>
+ </tr>
+ <tr>
+ <td class="title">Filename</td>
+ <td class="text"><?php echo htmlspecialchars($filedata["filename"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of upload</td>
+ <td class="text"><?php echo date("r", $filedata["date"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Date of removal</td>
+ <td class="text"><?php echo $timeout; ?></td>
+ </tr>
+ <tr>
+ <td class="title">Size</td>
+ <td class="text"><?php echo format_bytes($filedata["filesize"]); ?></td>
+ </tr>
+ <tr>
+ <td class="title">Mimetype</td>
+ <td class="text"><?php echo $filedata["mimetype"]; ?></td>
+ </tr>
+ </table>
+ </div>
<?php endif; ?>
</div>
diff --git a/application/views/file/html_header.php b/application/views/file/html_header.php
index c40c35bca..2c556720c 100644
--- a/application/views/file/html_header.php
+++ b/application/views/file/html_header.php
@@ -2,93 +2,95 @@
$force_full_html = true;
include(FCPATH."application/views/header.php"); ?>
- </div>
+</div>
- <script type="text/javascript">
- /* <![CDATA[ */
- window.lexers = <?php echo json_encode($lexers); ?>;
- window.paste_base = '<?php echo site_url($id) ?>';
- /* ]]> */
- </script>
+<script type="text/javascript">
+ /* <![CDATA[ */
+ window.lexers = <?php echo json_encode($lexers); ?>;
+ window.paste_base = '<?php echo site_url($id) ?>';
+ /* ]]> */
+</script>
- <?php if (isset($error_message)) { ?>
- <div class="alert alert-block alert-error" style="text-align: center">
- <?php echo $error_message; ?>
- </div>
- <?php } ?>
+<?php if (isset($error_message)) { ?>
+<div class="alert alert-danger" style="text-align: center; border-radius: 0;">
+ <?php echo $error_message; ?>
+</div>
+<?php } ?>
- <div class="container paste-container">
- <div style="border:1px solid #ccc;">
- <div class="navbar navbar-static-top">
- <div class="navbar-inner" style="box-shadow: none;">
- <ul class="nav">
- <li><a href="#file-info" class="brand" data-toggle="modal"><?php echo $title ?></a></li>
- <li class="divider-vertical"></li>
- <li class="dropdown">
- <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="language-toggle">
- Language: <?php echo htmlspecialchars($current_highlight); ?>
- <b class="caret"></b>
- </a>
- <div class="dropdown-menu" style="padding: 15px; padding-bottom: 0px;">
- <form>
- <input type="text" id="language" placeholder="Language" class="input-medium">
- </form>
- </div>
- </li>
- <li class="divider-vertical"></li>
- <li>
- <a href="#file-info" role="button" data-toggle="modal">Info</a>
- <div id="file-info" class="modal hide fade">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
- <h3>Paste Information</h3>
- </div>
- <div class="modal-body">
- <table class="table">
- <tr>
- <td style="border:0;">Filename:</td>
- <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td>
- </tr>
- <tr>
- <td>Size:</td>
- <td><?php echo format_bytes($filedata["filesize"]) ?></td>
- </tr>
- <tr>
- <td>Mimetype:</td>
- <td><?php echo $filedata["mimetype"] ?></td>
- </tr>
- <tr>
- <td>Uploaded:</td>
- <td><?php echo date("r", $filedata["date"]) ?></td>
- </tr>
- <tr>
- <td>Removal:</td>
- <td><?php echo $timeout ?></td>
- </tr>
- </table>
- </div>
- <div class="modal-footer">
- <?php echo form_open("file/do_delete/", array("style" => "display: inline")); ?>
- <input type="hidden" name="ids[<?php echo $id; ?>]" value="<?php echo $id; ?>">
- <button class="btn btn-danger pull-left" aria-hidden="true">Delete</button>
- </form>
- <button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
- </div>
- </div>
- </li>
- <li class="divider-vertical"></li>
- <li><a href="<?php echo site_url('file/index?repaste='.$id); ?>" role="button">Repaste</a></li>
- </ul>
- <div class="btn-group pull-right" style="margin-top: 7px; margin-right:-10px;">
- <a id="linewrap" class="btn btn-small" rel="tooltip" title="Toggle wrapping of long lines">Linewrap</a>
- <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-small" rel="tooltip" title="View as plain text">Plain</a>
- <a href="<?php echo site_url($id) ?>" class="btn btn-small" rel="tooltip" title="View as raw file (org. mime type)">Raw</a>
- <?php if ($current_highlight === 'rmd') { ?>
- <a href="<?php echo site_url($id)."/" ?>" class="btn btn-small" rel="tooltip" title="Render as Code">Code</a>
- <?php } else { ?>
- <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-small" rel="tooltip" title="Render as Markdown">Markdown</a>
- <?php } ?>
+<div class="container paste-container">
+ <div style="border:1px solid #ccc;">
+ <div class="navbar navbar-default navbar-static-top navbar-paste">
+ <ul class="nav navbar-nav navbar-left dont-float">
+ <li><a href="#file-info" class="navbar-brand" data-toggle="modal"><?php echo $title ?></a></li>
+ <li class="divider"></li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown" id="language-toggle">
+ Language: <?php echo htmlspecialchars($current_highlight); ?>
+ <b class="caret"></b>
+ </a>
+ <div class="dropdown-menu" style="padding: 15px;">
+ <form>
+ <input type="text" id="language" placeholder="Language" class="form-control">
+ </form>
+ </div>
+ </li>
+ <li class="divider"></li>
+ <li>
+ <a href="#file-info" role="button" data-toggle="modal">Info</a>
+ </li>
+ <li class="divider"></li>
+ <li><a href="<?php echo site_url('file/index?repaste='.$id); ?>" role="button">Repaste</a></li>
+ </ul>
+ <div class="btn-group navbar-right" style="margin: 8px;">
+ <a id="linewrap" class="btn btn-default" rel="tooltip" title="Toggle wrapping of long lines">Linewrap</a>
+ <a href="<?php echo site_url($id."/plain") ?>" class="btn btn-default" rel="tooltip" title="View as plain text">Plain</a>
+ <a href="<?php echo site_url($id) ?>" class="btn btn-default" rel="tooltip" title="View as raw file (org. mime type)">Raw</a>
+ <?php if ($current_highlight === 'rmd') { ?>
+ <a href="<?php echo site_url($id)."/" ?>" class="btn btn-default" rel="tooltip" title="Render as Code">Code</a>
+ <?php } else { ?>
+ <a href="<?php echo site_url($id."/rmd") ?>" class="btn btn-default" rel="tooltip" title="Render as Markdown">Markdown</a>
+ <?php } ?>
+ </div>
+ </div> <!-- .navbar -->
+ <div id="file-info" class="modal fade" role="dialog" aria-labelledby="file-info" aria-hidden="true">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">&times;</button>
+ <h3 class="modal-title">Paste Information</h3>
+ </div>
+ <div class="modal-body">
+ <table class="table">
+ <tr>
+ <td style="border:0;">Filename:</td>
+ <td style="border:0;"><?php echo htmlspecialchars($filedata["filename"]) ?></td>
+ </tr>
+ <tr>
+ <td>Size:</td>
+ <td><?php echo format_bytes($filedata["filesize"]) ?></td>
+ </tr>
+ <tr>
+ <td>Mimetype:</td>
+ <td><?php echo $filedata["mimetype"] ?></td>
+ </tr>
+ <tr>
+ <td>Uploaded:</td>
+ <td><?php echo date("r", $filedata["date"]) ?></td>
+ </tr>
+ <tr>
+ <td>Removal:</td>
+ <td><?php echo $timeout ?></td>
+ </tr>
+ </table>
+ </div>
+ <div class="modal-footer">
+ <?php echo form_open("file/do_delete/", array("style" => "display: inline")); ?>
+ <input type="hidden" name="ids[<?php echo $id; ?>]" value="<?php echo $id; ?>">
+ <button class="btn btn-danger pull-left" aria-hidden="true">Delete</button>
+ </form>
+ <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
- <div>
+ </div> <!-- .modal -->
+ <div>
diff --git a/application/views/file/nav_history.php b/application/views/file/nav_history.php
index 1a3e55c0b..bbb695fd6 100644
--- a/application/views/file/nav_history.php
+++ b/application/views/file/nav_history.php
@@ -1,4 +1,4 @@
-<ul class="nav nav-tabs">
+<ul class="nav nav-tabs nav-history">
<?php
$nav = array(
"List" => "file/upload_history",
diff --git a/application/views/file/upload_form.php b/application/views/file/upload_form.php
index 21a2cc4e6..6fdc01cb9 100644
--- a/application/views/file/upload_form.php
+++ b/application/views/file/upload_form.php
@@ -1,39 +1,55 @@
-<?php if (user_logged_in()) { ?>
-<div class="well">
- <div class="row-fluid">
- <div class="span12 text-upload-form">
+<?php if (isset($user_logged_in) && $user_logged_in) { ?>
+<div class="row">
+ <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 text-upload-form">
<?php echo form_open_multipart('file/do_paste'); ?>
- <h2>Text paste</h2>
- <textarea name="content" class="text-upload span12"><?php
- if (isset($textarea_content)) {
- echo $textarea_content;
- }
- ?></textarea><br>
- <button type="submit" class="btn btn-primary">Paste it!</button>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">Text paste</h3>
+ </div>
+ <div class="panel-body">
+ <textarea name="content" class="form-control text-upload">
+ <?php if (isset($textarea_content)) {
+ echo $textarea_content;
+ } ?>
+ </textarea><br>
+ <button type="submit" class="btn btn-primary">Paste it!</button>
+ </div>
</form>
</div>
</div>
- <div class="row-fluid">
- <div class="span6">
- <?php echo form_open_multipart('file/do_upload'); ?>
- <h2>File upload</h2>
+</div>
+<div class="row">
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
+ <?php echo form_open_multipart('file/do_upload'); ?>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h3 class="panel-title">File upload</h3>
+ </div>
+ <div class="panel-body">
<input class="file-upload" type="file" name="file[]" multiple="multiple"><br>
<button type="submit" id="upload_button" class="btn btn-primary">Upload it!</button>
- </form>
+ </div>
</div>
- <div class="span6 alert alert-block alert-info">
- <h4 class="alert-heading">Notice!</h4>
- <p>
- Uploads/pastes are <?php if ($upload_max_age > 0) {
- echo "deleted after ".$upload_max_age." days";
- if ($small_upload_size > 0) {
- echo " unless they are smaller than ".format_bytes($small_upload_size);
- }
- } else {
- echo "stored forever";
- } ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?>.
- You can upload a maximum of <?php echo ini_get("max_file_uploads"); ?> files at once.
- </p>
+ </form>
+ </div>
+ <div class="col-lg-6 col-md-6 col-sm-6 col-xs-12">
+ <div class="panel panel-info">
+ <div class="panel-heading">
+ <h3 class="panel-title">Notice!</h3>
+ </div>
+ <div class="panel-body">
+ <p>
+ Uploads/pastes are <?php if ($upload_max_age > 0) {
+ echo "deleted after ".$upload_max_age." days";
+ if ($small_upload_size > 0) {
+ echo " unless they are smaller than ".format_bytes($small_upload_size);
+ }
+ } else {
+ echo "stored forever";
+ } ?>. Maximum upload size is <?php echo format_bytes($max_upload_size); ?>.
+ You can upload a maximum of <?php echo ini_get("max_file_uploads"); ?> files at once.
+ </p>
+ </div>
</div>
</div>
</div>
@@ -45,17 +61,17 @@
</script>
<?php } else { ?>
- <?php echo form_open('user/login'); ?>
- <input type="text" name="username" placeholder="Username" autofocus />
- <input type="password" name="password" placeholder="Password" />
- <input type="submit" class="btn btn-primary" value="Login" name="process" style="margin-bottom: 9px" />
+ <?php echo form_open('user/login', array('class' => 'form-inline')); ?>
+ <input type="text" name="username" placeholder="Username" autofocus class="form-control inline-input"/>
+ <input type="password" name="password" placeholder="Password" class="form-control inline-input"/>
+ <input type="submit" class="btn btn-primary" value="Login" name="process" />
<?php if(auth_driver_function_implemented("can_reset_password")) { ?>
- <p style="display: inline"><?php echo anchor("user/reset_password", "Forgot your password?"); ?></p>
+ <p class="help-block"><?php echo anchor("user/reset_password", "Forgot your password?"); ?></p>
<?php } ?>
</form>
<?php } ?>
<div class="row">
- <div class="span6">
+ <div class="col-lg-6">
<div class="page-header"><h1>Features</h1></div>
<p>For shell uploading/pasting and download information for the client go to <a href="<?php echo site_url("file/client"); ?>"><?php echo site_url("file/client"); ?></a></p>
<p>You can use the <?php echo anchor("file/upload_history", "history"); ?> to find old uploads.</p>
@@ -72,7 +88,7 @@
</dl>
<p>If your upload is not detected as text, only <b>/&lt;ID&gt;/qr</b>, <b>/&lt;ID&gt;/plain</b> and <b>/&lt;ID&gt;/info</b> will work as above and all others will simply return the file with the detected MIME type.</p>
</div>
- <div class="span6">
+ <div class="col-lg-6">
<div class="page-header"><h1>Information</h1></div>
<p>This website's primary goal is aiding developers, power users, students and alike in solving problems, debugging software, sharing their configuration, etc. It is not intended to distribute confidential or harmful information, scripts or software.</p>
<?php if(auth_driver_function_implemented("can_register_new_users")) { ?>
diff --git a/application/views/file/upload_history.php b/application/views/file/upload_history.php
index 344afc28a..634ad5935 100644
--- a/application/views/file/upload_history.php
+++ b/application/views/file/upload_history.php
@@ -1,30 +1,32 @@
<?php register_js_include("/data/js/jquery.tablesorter.min.js"); ?>
<?php include 'nav_history.php'; ?>
<?php echo form_open("file/do_delete") ?>
- <table id="upload_history" class="table table-striped tablesorter">
- <thead>
- <tr>
- <th><input type="checkbox" name="all-ids" id="history-all"></th>
- <th>ID</th>
- <th>Filename</th>
- <th>Mimetype
- <th>Date</th>
- <th>Size</th>
- </tr>
- </thead>
- <tbody>
- <?php foreach($query as $key => $item): ?>
+ <div class="table-responsive">
+ <table id="upload_history" class="table table-striped tablesorter">
+ <thead>
<tr>
- <td><input type="checkbox" name="ids[<?php echo $item["id"] ?>]" value="<?php echo $item["id"] ?>" class="delete-history"></td>
- <td><a href="<?php echo site_url("/".$item["id"]) ?>/"><?php echo $item["id"] ?></a></td>
- <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td>
- <td><?php echo $item["mimetype"] ?></td>
- <td class="nowrap"><?php echo date("r", $item["date"]); ?><span class="hidden">t=<?php echo $item["date"]; ?></span></td>
- <td><?php echo $item["filesize"] ?></td>
+ <th><input type="checkbox" name="all-ids" id="history-all"></th>
+ <th>ID</th>
+ <th>Filename</th>
+ <th>Mimetype
+ <th>Date</th>
+ <th>Size</th>
</tr>
- <?php endforeach; ?>
- </tbody>
- </table>
+ </thead>
+ <tbody>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><input type="checkbox" name="ids[<?php echo $item["id"] ?>]" value="<?php echo $item["id"] ?>" class="delete-history"></td>
+ <td><a href="<?php echo site_url("/".$item["id"]) ?>/"><?php echo $item["id"] ?></a></td>
+ <td class="wrap"><?php echo htmlspecialchars($item["filename"]); ?></td>
+ <td><?php echo $item["mimetype"] ?></td>
+ <td class="nowrap"><?php echo date("r", $item["date"]); ?><span class="hidden">t=<?php echo $item["date"]; ?></span></td>
+ <td><?php echo $item["filesize"] ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+ </div>
<input class="btn btn-danger" type="submit" value="Delete checked" name="process">
</form>
diff --git a/application/views/file/upload_history_thumbnails.php b/application/views/file/upload_history_thumbnails.php
index f21ffcb23..bcafc44ca 100644
--- a/application/views/file/upload_history_thumbnails.php
+++ b/application/views/file/upload_history_thumbnails.php
@@ -2,7 +2,7 @@
<?php echo form_open("file/do_delete/", array("id" => "delete_form", "style" => "display: inline")); ?>
<button class="btn btn-danger" id="delete_button" style="display: none">Delete selected</button>
</form>
- <button class="btn" id="toggle_delete_mode" style="display: inline">Delete mode</button>
+ <button class="btn btn-default" id="toggle_delete_mode" style="display: inline">Delete mode</button>
</div>
<?php include 'nav_history.php'; ?>
diff --git a/application/views/footer.php b/application/views/footer.php
index 0383e195e..e748cd4e3 100644
--- a/application/views/footer.php
+++ b/application/views/footer.php
@@ -17,9 +17,16 @@ if (is_cli_client() && !isset($force_full_html)) {
</ul>
</div>
</footer>
+
+<?php
+$CI = &get_instance();
+if ($CI->config->item("environment") == "development" && property_exists($CI, "email")) {
+ echo $CI->email->print_debugger();
+}
+?>
<?php echo include_js("/data/js/jquery-2.0.3.min.js"); ?>
<?php echo include_js("/data/js/jquery-ui-1.10.3.custom.min.js"); ?>
-<?php echo include_js("/data/js/bootstrap-2.3.2.min.js"); ?>
+<?php echo include_js("/data/js/bootstrap.min.js"); ?>
<?php echo include_js("/data/js/script.js"); ?>
<?php echo include_registered_js(); ?>
</body>
diff --git a/application/views/header.php b/application/views/header.php
index ba6d6ae9d..75f51664a 100644
--- a/application/views/header.php
+++ b/application/views/header.php
@@ -14,7 +14,7 @@ if (is_cli_client() && !isset($force_full_html)) {
<meta name="author" content="">
<link href="<?php echo link_with_mtime("/data/css/ui-lightness/jquery-ui-1.10.3.custom.min.css"); ?>" rel="stylesheet">
- <link href="<?php echo link_with_mtime("/data/css/bootstrap-2.3.2.min.css"); ?>" rel="stylesheet">
+ <link href="<?php echo link_with_mtime("/data/css/bootstrap.min.css"); ?>" rel="stylesheet">
<link href="<?php echo link_with_mtime("/data/css/style.css"); ?>" rel="stylesheet">
<?php
if (file_exists(FCPATH."data/local/style.css")) {
@@ -32,10 +32,16 @@ if (is_cli_client() && !isset($force_full_html)) {
<?php if (file_exists(FCPATH."data/local/header.inc.php")) {
include FCPATH."data/local/header.inc.php";
}?>
- <div class="navbar navbar-fixed-top navbar-inverse">
- <div class="navbar-inner">
- <div class="container">
- <a class="brand" href="<?php echo site_url(); ?>"><?php
+ <nav class="navbar navbar-fixed-top navbar-inverse" role="navigation">
+ <div class="container">
+ <div class="navbar-header">
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
+ <span class="sr-only">Toggle navigation</span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="navbar-brand" href="<?php echo site_url(); ?>"><?php
if (file_exists(FCPATH."data/local/logo.svg")) {
echo '<img src="'.link_with_mtime("/data/local/logo.svg").'" style="height: 20px"> FileBin';
} else {
@@ -43,34 +49,36 @@ if (is_cli_client() && !isset($force_full_html)) {
}
?>
</a>
+ </div>
+ <div class="collapse navbar-collapse navbar-ex1-collapse">
<?php if(!isset($GLOBALS["is_error_page"])) { ?>
- <ul class="nav pull-right">
- <?php if(user_logged_in()) { ?>
- <li><a href="<?php echo site_url("/user/logout"); ?>">Logout</a></li>
+ <ul class="nav navbar-nav navbar-right">
+ <?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">
<a class="dropdown-toggle" href="#" data-toggle="dropdown">Login <b class="caret"></b></a>
- <div class="dropdown-menu" style="padding: 15px;">
+ <div class="dropdown-menu" style="padding: 5px;">
<?php if(auth_driver_function_implemented("can_reset_password")) { ?>
<p><?php echo anchor("user/reset_password", "Forgot your password?"); ?></p>
<?php } ?>
- <?php echo form_open("user/login"); ?>
- <input type="text" name="username" placeholder="Username" class="input-medium">
- <input type="password" name="password" placeholder="Password" class="input-medium">
- <button type="submit" name="process" class="btn btn-primary pull-right">Login</button>
+ <?php echo form_open("user/login", array("class" => "form-signin")); ?>
+ <input type="text" name="username" placeholder="Username" class="form-control">
+ <input type="password" name="password" placeholder="Password" class="form-control">
+ <button type="submit" name="process" class="btn btn-default btn-block">Login</button>
</form>
</div>
</li>
<?php } ?>
</ul>
<?php }; ?>
- <ul class="nav">
- <?php if(user_logged_in()) { ?>
- <li><a href="<?php echo site_url("file/index") ?>"><i class="icon-pencil icon-white"></i> New</a></li>
- <li><a href="<?php echo site_url("file/upload_history") ?>"><i class="icon-book icon-white"></i> History</a></li>
+ <ul class="nav navbar-nav">
+ <?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">
<a href="<?php echo site_url("user/index"); ?>" class="dropdown-toggle" data-toggle="dropdown">
- <i class="icon-user icon-white"></i> Account <b class="caret"></b>
+ <span class="glyphicon glyphicon-user"></span> Account <b class="caret"></b>
</a>
<ul class="dropdown-menu">
<?php include "user/nav.php"; ?>
@@ -80,14 +88,14 @@ if (is_cli_client() && !isset($force_full_html)) {
</ul>
</div>
</div>
- </div>
+ </nav>
<div id="navbar-height"></div>
<div class="container">
<?php
if (isset($alerts)) {
foreach ($alerts as $alert) { ?>
- <div class="alert alert-block alert-<?php echo $alert["type"]; ?>" style="text-align: center">
+ <div class="alert alert-dismissable alert-<?php echo $alert["type"]; ?>" style="text-align: center">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<?php echo $alert["message"]; ?>
</div>
diff --git a/application/views/index.html b/application/views/index.html
index c942a79ce..c942a79ce 100755..100644
--- a/application/views/index.html
+++ b/application/views/index.html
diff --git a/application/views/user/apikeys.php b/application/views/user/apikeys.php
index aa268d678..872eb9ef0 100644
--- a/application/views/user/apikeys.php
+++ b/application/views/user/apikeys.php
@@ -1,36 +1,38 @@
<h2>API keys</h2>
-<table class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th>Key</th>
- <th style="width: 30%;">Comment</th>
- <th>Created on</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 1; ?>
- <?php foreach($query as $key => $item): ?>
+<div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
<tr>
- <td><?php echo $i++; ?></td>
- <td><?php echo $item["key"]; ?></td>
- <td><?php echo htmlentities($item["comment"]); ?></td>
- <td><?php echo date("Y/m/d H:i", $item["created"]); ?></td>
- <td>
- <?php echo form_open("user/delete_apikey", array("style" => "margin-bottom: 0")); ?>
- <?php echo form_hidden("key", $item["key"]); ?>
- <button class="btn btn-danger btn-mini" type="submit">Delete</input>
- </form>
- </td>
+ <th>#</th>
+ <th>Key</th>
+ <th style="width: 30%;">Comment</th>
+ <th>Created on</th>
+ <th></th>
</tr>
- <?php endforeach; ?>
- </tbody>
-</table>
+ </thead>
+ <tbody>
+ <?php $i = 1; ?>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><?php echo $i++; ?></td>
+ <td><?php echo $item["key"]; ?></td>
+ <td><?php echo htmlentities($item["comment"]); ?></td>
+ <td><?php echo date("Y/m/d H:i", $item["created"]); ?></td>
+ <td>
+ <?php echo form_open("user/delete_apikey", array("style" => "margin-bottom: 0")); ?>
+ <?php echo form_hidden("key", $item["key"]); ?>
+ <button class="btn btn-danger btn-xs" type="submit">Delete</input>
+ </form>
+ </td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+</div>
<p>
- <?php echo form_open('user/create_apikey', array("class" => "form-horizontal")); ?>
- <input type="text" name="comment" placeholder="Comment" />
- <input class="btn btn-primary" type="submit" value="Create a new key" name="process" />
- </form>
+ <?php echo form_open('user/create_apikey', array("class" => "form-inline")); ?>
+ <input type="text" name="comment" placeholder="Comment" class="form-control" style="width: 200px;"/>
+ <input class="btn btn-primary" type="submit" value="Create a new key" name="process" />
+</form>
</p>
diff --git a/application/views/user/hash_password.php b/application/views/user/hash_password.php
index d85d2810c..98bef9df5 100644
--- a/application/views/user/hash_password.php
+++ b/application/views/user/hash_password.php
@@ -1,6 +1,6 @@
<?php
if (!empty($error)) {
- echo "<p class='alert alert-error'>";
+ echo "<p class='alert alert-danger'>";
echo implode("<br />\n", $error);
echo "</p>";
}
@@ -9,23 +9,28 @@ if ($hash) {
echo "<p>Result (this hash uses a random salt, so it will be different each time you submit this form):<br />$hash</p>\n";
}
?>
-<?php echo form_open('user/hash_password', array("class" => "form-horizontal")); ?>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Password</label>
- <div class="controls">
- <input type="password" id="inputPassword" name="password" placeholder="Password">
+<?php echo form_open('user/hash_password'); ?>
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Confirm password</label>
- <div class="controls">
- <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <div class="controls">
+<div class="row">
+ <div class="form-group col-lg-10 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
<button type="submit" class="btn btn-primary" name="process">Hash it</button>
</div>
</div>
diff --git a/application/views/user/invite.php b/application/views/user/invite.php
index eba77ead0..d3e2fb7a6 100644
--- a/application/views/user/invite.php
+++ b/application/views/user/invite.php
@@ -1,4 +1,4 @@
-<div class="alert alert-block">
+<div class="alert alert-warning">
<p>
<b>Watch out!</b>
</p>
@@ -10,25 +10,27 @@
</div>
<h2>Unused invitation keys</h2>
-<table class="table table-striped">
- <thead>
- <tr>
- <th>#</th>
- <th style="width: 70%;">Key</th>
- <th>Created on</th>
- </tr>
- </thead>
- <tbody>
- <?php $i = 1; ?>
- <?php foreach($query as $key => $item): ?>
+<div class="table-responsive">
+ <table class="table table-striped">
+ <thead>
<tr>
- <td><?php echo $i++; ?></td>
- <td><?php echo anchor("user/register/".$item["key"], $item["key"]) ?></td>
- <td><?php echo date("Y/m/d H:i", $item["date"]) ?></td>
+ <th>#</th>
+ <th style="width: 70%;">Key</th>
+ <th>Created on</th>
</tr>
- <?php endforeach; ?>
- </tbody>
-</table>
+ </thead>
+ <tbody>
+ <?php $i = 1; ?>
+ <?php foreach($query as $key => $item): ?>
+ <tr>
+ <td><?php echo $i++; ?></td>
+ <td><?php echo anchor("user/register/".$item["key"], $item["key"]) ?></td>
+ <td><?php echo date("Y/m/d H:i", $item["date"]) ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+ </table>
+</div>
<p>
<?php echo form_open('user/create_invitation_key'); ?>
diff --git a/application/views/user/login.php b/application/views/user/login.php
index 761965c94..3e30d53bd 100644
--- a/application/views/user/login.php
+++ b/application/views/user/login.php
@@ -1,24 +1,24 @@
<?php
if (isset($login_error)) { ?>
- <div class="alert alert-error">The entered credentials are invalid.</div>
+ <div class="alert alert-danger">The entered credentials are invalid.</div>
<?php } ?>
-<?php echo form_open('user/login', array("class" => "form-horizontal")); ?>
- <div class="control-group">
+<?php echo form_open('user/login', array("class" => "form-horizontal login-page")); ?>
+ <div class="form-group">
<label class="control-label" for="inputUsername">Username</label>
<div class="controls">
- <input type="text" id="inputUsername" name="username" placeholder="Username">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" class="form-control">
</div>
</div>
- <div class="control-group">
+ <div class="form-group">
<label class="control-label" for="inputPassword">Password</label>
<div class="controls">
- <input type="password" id="inputPassword" name="password" placeholder="Password">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
</div>
</div>
- <div class="control-group">
+ <div class="form-group">
<div class="controls">
<button type="submit" class="btn btn-primary" name="process">Login</button>
</div>
diff --git a/application/views/user/nav.php b/application/views/user/nav.php
index 90f76e05e..49c7aa988 100644
--- a/application/views/user/nav.php
+++ b/application/views/user/nav.php
@@ -1,11 +1,11 @@
<?php if(auth_driver_function_implemented("can_register_new_users")) { ?>
-<li><a href="<?php echo site_url("user/invite") ?>"><i class="icon-plus icon-black"></i> Invite</a></li>
+<li><a href="<?php echo site_url("user/invite") ?>"><span class="glyphicon glyphicon-plus"></span> Invite</a></li>
<?php } ?>
-<li><a href="<?php echo site_url("user/profile") ?>"><i class="icon-user icon-black"></i> Profile</a></li>
-<li><a href="<?php echo site_url("user/apikeys") ?>"><i class="icon-tags icon-black"></i> API keys</a></li>
+<li><a href="<?php echo site_url("user/profile") ?>"><span class="glyphicon glyphicon-user"></span> Profile</a></li>
+<li><a href="<?php echo site_url("user/apikeys") ?>"><span class="glyphicon glyphicon-tags"></span> API keys</a></li>
<?php if(auth_driver_function_implemented("can_reset_password")) { ?>
-<li><a href="<?php echo site_url("user/reset_password") ?>"><i class="icon-lock icon-black"></i> Change password</a></li>
+<li><a href="<?php echo site_url("user/reset_password") ?>"><span class="glyphicon glyphicon-lock"></span> Change password</a></li>
<?php } ?>
diff --git a/application/views/user/profile.php b/application/views/user/profile.php
index bcd740612..74d786d3f 100644
--- a/application/views/user/profile.php
+++ b/application/views/user/profile.php
@@ -1,32 +1,40 @@
-<?php echo form_open("user/profile", array("class" => "form-horizontal")); ?>
+<?php echo form_open("user/profile"); ?>
- <div class="control-group">
- <label class="control-label" for="inputUsername">Username</label>
- <div class="controls">
- <input type="text" id="inputUsername" name="username" placeholder="Username" disabled="disabled" value="<?php echo $profile_data["username"]; ?>">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" disabled="disabled" value="<?php echo $profile_data["username"]; ?>" class="form-control">
</div>
</div>
+</div>
- <?php if(auth_driver_function_implemented("get_email")) { ?>
- <div class="control-group">
- <label class="control-label" for="inputEmail">Email</label>
- <div class="controls">
- <input type="text" id="inputEmail" name="email" placeholder="Email" disabled="disabled" value="<?php echo $profile_data["email"]; ?>">
+<?php if($profile_data["email"] !== null) { ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputEmail">Email</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputEmail" name="email" placeholder="Email" disabled="disabled" value="<?php echo $profile_data["email"]; ?>" class="form-control">
</div>
</div>
- <?php } ?>
+</div>
+<?php } ?>
- <div class="control-group">
- <label class="control-label" for="inputUploadIDLimits">Upload ID length limits</label>
- <div class="controls">
- <input type="text" id="inputUploadIDLimits" name="upload_id_limits" placeholder="number-number" value="<?php echo $profile_data["upload_id_limits"]; ?>">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUploadIDLimits">Upload ID length limits</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUploadIDLimits" name="upload_id_limits" placeholder="number-number" value="<?php echo $profile_data["upload_id_limits"]; ?>" class="form-control">
<span class="help-block">Values have to be between 3 and 64 inclusive. Please remember that longer IDs don't protect your pastes from being found if you post the link somewhere a search enginge can see it.</span>
</div>
</div>
+</div>
- <div class="control-group">
- <div class="controls">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
<button type="submit" class="btn btn-primary" name="process">Save changes</button>
</div>
</div>
+</div>
</form>
diff --git a/application/views/user/register.php b/application/views/user/register.php
index c0050508b..af4558ff9 100644
--- a/application/views/user/register.php
+++ b/application/views/user/register.php
@@ -1,41 +1,51 @@
<?php if (!empty($error)) {
- echo "<p class='alert alert-error'>";
+ echo "<p class='alert alert-danger'>";
echo implode("<br />\n", $error);
echo "</p>";
} ?>
-<?php echo form_open('user/register/'.$key, array("class" => "form-horizontal")); ?>
- <div class="control-group">
- <label class="control-label" for="inputUsername">Username</label>
- <div class="controls">
- <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo $values["username"]; ?>">
+<?php echo form_open('user/register/'.$key); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo $values["username"]; ?>" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <label class="control-label" for="inputEmail">Email</label>
- <div class="controls">
- <input type="text" id="inputEmail" name="email" placeholder="Email" value="<?php echo $values["email"]; ?>">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputEmail">Email</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputEmail" name="email" placeholder="Email" value="<?php echo $values["email"]; ?>" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Password</label>
- <div class="controls">
- <input type="password" id="inputPassword" name="password" placeholder="Password">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Confirm password</label>
- <div class="controls">
- <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <div class="controls">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
<button type="submit" class="btn btn-primary" name="process">Register</button>
</div>
</div>
+</div>
</form>
diff --git a/application/views/user/reset_password_form.php b/application/views/user/reset_password_form.php
index b93ad1370..9c8253189 100644
--- a/application/views/user/reset_password_form.php
+++ b/application/views/user/reset_password_form.php
@@ -1,27 +1,33 @@
<?php if (!empty($error)) {
- echo "<p class='alert alert-error'>";
+ echo "<p class='alert alert-danger'>";
echo implode("<br />\n", $error);
echo "</p>";
} ?>
-<?php echo form_open('user/reset_password/'.$key, array("class" => "form-horizontal")); ?>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Password</label>
- <div class="controls">
- <input type="password" id="inputPassword" name="password" placeholder="Password">
+<?php echo form_open('user/reset_password/'.$key); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPassword" name="password" placeholder="Password" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <label class="control-label" for="inputPassword">Confirm password</label>
- <div class="controls">
- <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputPassword">Confirm password</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="password" id="inputPasswordConfirm" name="password_confirm" placeholder="Password confirmation" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <div class="controls">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
<button type="submit" class="btn btn-primary" name="process">Change password</button>
</div>
</div>
+</div>
</form>
diff --git a/application/views/user/reset_password_username_form.php b/application/views/user/reset_password_username_form.php
index 674a6441d..713cd4919 100644
--- a/application/views/user/reset_password_username_form.php
+++ b/application/views/user/reset_password_username_form.php
@@ -1,15 +1,19 @@
-<?php echo form_open('user/reset_password', array("class" => "form-horizontal")); ?>
- <div class="control-group">
- <label class="control-label" for="inputUsername">Username</label>
- <div class="controls">
- <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo isset($username) ? $username : ""; ?>">
+<?php echo form_open('user/reset_password'); ?>
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <label class="control-label col-lg-2 col-md-2" for="inputUsername">Username</label>
+ <div class="col-lg-5 col-md-5">
+ <input type="text" id="inputUsername" name="username" placeholder="Username" value="<?php echo isset($username) ? $username : ""; ?>" class="form-control">
</div>
</div>
+</div>
- <div class="control-group">
- <div class="controls">
+<div class="row">
+ <div class="form-group col-lg-8 col-md-10">
+ <div class="col-lg-offset-2 col-lg-5 col-md-offset-2 col-md-5">
<button type="submit" class="btn btn-primary" name="process">Send mail</button>
</div>
</div>
+</div>
</form>