summaryrefslogtreecommitdiffstats
path: root/lib/base.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/base.php')
-rw-r--r--lib/base.php87
1 files changed, 57 insertions, 30 deletions
diff --git a/lib/base.php b/lib/base.php
index b031572f177..83dd0c98f45 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -229,6 +229,39 @@ class OC{
}
}
+ public static function initTemplateEngine() {
+ // if the formfactor is not yet autodetected do the autodetection now. For possible forfactors check the detectFormfactor documentation
+ if(!isset($_SESSION['formfactor'])){
+ $_SESSION['formfactor']=OC::detectFormfactor();
+ }
+ // allow manual override via GET parameter
+ if(isset($_GET['formfactor'])){
+ $_SESSION['formfactor']=$_GET['formfactor'];
+ }
+
+ // Add the stuff we need always
+ OC_Util::addScript( "jquery-1.6.4.min" );
+ OC_Util::addScript( "jquery-ui-1.8.16.custom.min" );
+ OC_Util::addScript( "jquery-showpassword" );
+ OC_Util::addScript( "jquery.infieldlabel.min" );
+ OC_Util::addScript( "jquery-tipsy" );
+ OC_Util::addScript( "oc-dialogs" );
+ OC_Util::addScript( "js" );
+ OC_Util::addScript( "eventsource" );
+ OC_Util::addScript( "config" );
+ //OC_Util::addScript( "multiselect" );
+ OC_Util::addScript('search','result');
+ OC_Util::addStyle( "styles" );
+ OC_Util::addStyle( "multiselect" );
+ OC_Util::addStyle( "jquery-ui-1.8.16.custom" );
+ OC_Util::addStyle( "jquery-tipsy" );
+ }
+
+ public static function initSession() {
+ ini_set('session.cookie_httponly','1;');
+ session_start();
+ }
+
public static function init(){
// register autoloader
spl_autoload_register(array('OC','autoload'));
@@ -244,6 +277,24 @@ class OC{
date_default_timezone_set('Europe/Berlin');
ini_set('arg_separator.output','&');
+ //try to configure php to enable big file uploads.
+ //this doesn´t work always depending on the webserver and php configuration.
+ //Let´s try to overwrite some defaults anyways
+
+ //try to set the maximum execution time to 60min
+ @set_time_limit(3600);
+ @ini_set('max_execution_time',3600);
+ @ini_set('max_input_time',3600);
+
+ //try to set the maximum filesize to 10G
+ @ini_set('upload_max_filesize','10G');
+ @ini_set('post_max_size','10G');
+ @ini_set('file_uploads','50');
+
+ //try to set the session lifetime to 60min
+ @ini_set('gc_maxlifetime','3600');
+
+
//set http auth headers for apache+php-cgi work around
if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches))
{
@@ -270,37 +321,10 @@ class OC{
self::checkInstalled();
self::checkSSL();
- self::checkUpgrade();
- ini_set('session.cookie_httponly','1;');
- session_start();
-
- // if the formfactor is not yet autodetected do the autodetection now. For possible forfactors check the detectFormfactor documentation
- if(!isset($_SESSION['formfactor'])){
- $_SESSION['formfactor']=OC::detectFormfactor();
- }
- // allow manual override via GET parameter
- if(isset($_GET['formfactor'])){
- $_SESSION['formfactor']=$_GET['formfactor'];
- }
-
-
- // Add the stuff we need always
- OC_Util::addScript( "jquery-1.6.4.min" );
- OC_Util::addScript( "jquery-ui-1.8.16.custom.min" );
- OC_Util::addScript( "jquery-showpassword" );
- OC_Util::addScript( "jquery.infieldlabel.min" );
- OC_Util::addScript( "jquery-tipsy" );
- OC_Util::addScript( "oc-dialogs" );
- OC_Util::addScript( "js" );
- OC_Util::addScript( "eventsource" );
- OC_Util::addScript( "config" );
- //OC_Util::addScript( "multiselect" );
- OC_Util::addScript('search','result');
- OC_Util::addStyle( "styles" );
- OC_Util::addStyle( "multiselect" );
- OC_Util::addStyle( "jquery-ui-1.8.16.custom" );
- OC_Util::addStyle( "jquery-tipsy" );
+ self::initSession();
+ self::initTemplateEngine();
+ self::checkUpgrade();
$errors=OC_Util::checkServer();
if(count($errors)>0) {
@@ -341,6 +365,9 @@ class OC{
OC_App::loadApps();
}
}
+
+ // Check for blacklisted files
+ OC_Hook::connect('OC_Filesystem','write','OC_Filesystem','isBlacklisted');
//make sure temporary files are cleaned up
register_shutdown_function(array('OC_Helper','cleanTmp'));