From b0127e39188f2268dbd74714e5d2f0e1a2b6ce7b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sun, 16 Oct 2011 21:42:24 +0200 Subject: [PATCH 01/55] use OC_Log instead of error_log --- apps/admin_export/settings.php | 28 ++++++++++++------------ apps/media/ajax/autoupdate.php | 2 -- apps/media/lib_ampache.php | 1 - apps/media/lib_media.php | 2 -- apps/media/lib_scanner.php | 8 +++---- apps/media/server/xml.server.php | 2 +- apps/remoteStorage/lib_remoteStorage.php | 8 +++---- apps/user_openid/appinfo/app.php | 14 ++++++------ apps/user_openid/phpmyid.php | 12 ---------- apps/user_openid/user.php | 2 +- files/ajax/newfolder.php | 2 +- index.php | 6 ++--- lib/db.php | 9 ++++---- lib/filestorage/local.php | 1 - lib/installer.php | 16 +++++++------- lib/preferences.php | 1 - 16 files changed, 47 insertions(+), 67 deletions(-) diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php index 8308a2b89b5..1685e5c0ca1 100644 --- a/apps/admin_export/settings.php +++ b/apps/admin_export/settings.php @@ -26,14 +26,14 @@ if (isset($_POST['admin_export'])) { $root = OC::$SERVERROOT . "/"; $zip = new ZipArchive(); $filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; - error_log("Creating export file at: " . $filename); + OC_Log::write('admin_export',"Creating export file at: " . $filename,OC_Log::INFO); if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) { exit("Cannot open <$filename>\n"); } if (isset($_POST['owncloud_system'])) { // adding owncloud system files - error_log("Adding owncloud system files to export"); + OC_Log::write('admin_export',"Adding owncloud system files to export",OC_Log::INFO); zipAddDir($root, $zip, false); foreach (array(".git", "3rdparty", "apps", "core", "files", "l10n", "lib", "ocs", "search", "settings", "tests") as $dirname) { zipAddDir($root . $dirname, $zip, true, basename($root) . "/"); @@ -43,7 +43,7 @@ if (isset($_POST['admin_export'])) { if (isset($_POST['owncloud_config'])) { // adding owncloud config // todo: add database export - error_log("Adding owncloud config to export"); + OC_Log::write('admin_export',"Adding owncloud config to export",OC_Log::INFO); zipAddDir($root . "config/", $zip, true, basename($root) . "/"); $zip->addFile($root . '/data/.htaccess', basename($root) . "/data/owncloud.db"); } @@ -53,7 +53,7 @@ if (isset($_POST['admin_export'])) { $zip->addFile($root . '/data/.htaccess', basename($root) . "/data/.htaccess"); $zip->addFile($root . '/data/index.html', basename($root) . "/data/index.html"); foreach (OC_User::getUsers() as $i) { - error_log("Adding owncloud user files of $i to export"); + OC_Log::write('admin_export',"Adding owncloud user files of $i to export",OC_Log::INFO); zipAddDir($root . "data/" . $i, $zip, true, basename($root) . "/data/"); } } @@ -78,19 +78,19 @@ function zipAddDir($dir, $zip, $recursive=true, $internalDir='') { $internalDir.=$dirname.='/'; if ($dirhandle = opendir($dir)) { - while (false !== ( $file = readdir($dirhandle))) { + while (false !== ( $file = readdir($dirhandle))) { - if (( $file != '.' ) && ( $file != '..' )) { + if (( $file != '.' ) && ( $file != '..' )) { - if (is_dir($dir . '/' . $file) && $recursive) { - zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir); - } elseif (is_file($dir . '/' . $file)) { - $zip->addFile($dir . '/' . $file, $internalDir . $file); + if (is_dir($dir . '/' . $file) && $recursive) { + zipAddDir($dir . '/' . $file, $zip, $recursive, $internalDir); + } elseif (is_file($dir . '/' . $file)) { + $zip->addFile($dir . '/' . $file, $internalDir . $file); + } + } } - } - } - closedir($dirhandle); + closedir($dirhandle); } else { - error_log("Was not able to open directory: " . $dir); + OC_Log::write('admin_export',"Was not able to open directory: " . $dir,OC_Log::ERROR); } } diff --git a/apps/media/ajax/autoupdate.php b/apps/media/ajax/autoupdate.php index ff0923ca032..a78b5e25dd1 100644 --- a/apps/media/ajax/autoupdate.php +++ b/apps/media/ajax/autoupdate.php @@ -30,9 +30,7 @@ $RUNTIME_NOSETUPFS=true; require_once('../../../lib/base.php'); OC_JSON::checkAppEnabled('media'); -if(defined("DEBUG") && DEBUG) {error_log($_GET['autoupdate']);} $autoUpdate=(isset($_GET['autoupdate']) and $_GET['autoupdate']=='true'); -if(defined("DEBUG") && DEBUG) {error_log((integer)$autoUpdate);} OC_Preferences::setValue(OC_User::getUser(),'media','autoupdate',(integer)$autoUpdate); diff --git a/apps/media/lib_ampache.php b/apps/media/lib_ampache.php index 87291958af3..0ad84d66809 100644 --- a/apps/media/lib_ampache.php +++ b/apps/media/lib_ampache.php @@ -195,7 +195,6 @@ class OC_MEDIA_AMPACHE{ $filter=isset($params['filter'])?$params['filter']:''; $exact=isset($params['exact'])?($params['exact']=='true'):false; $artists=OC_MEDIA_COLLECTION::getArtists($filter,$exact); - if(defined("DEBUG") && DEBUG) {error_log('artists found: '.print_r($artists,true));} echo(''); foreach($artists as $artist){ self::printArtist($artist); diff --git a/apps/media/lib_media.php b/apps/media/lib_media.php index 7a666be8c27..485d616e1aa 100644 --- a/apps/media/lib_media.php +++ b/apps/media/lib_media.php @@ -40,7 +40,6 @@ class OC_MEDIA{ */ public static function loginListener($params){ if(isset($_POST['user']) and $_POST['password']){ - if(defined("DEBUG") && DEBUG) {error_log('postlogin');} $name=$_POST['user']; $query=OC_DB::prepare("SELECT user_id from *PREFIX*media_users WHERE user_id LIKE ?"); $uid=$query->execute(array($name))->fetchAll(); @@ -64,7 +63,6 @@ class OC_MEDIA{ $path=substr($path,1); } $path='/'.$path; - error_log("$path was updated"); OC_MEDIA_SCANNER::scanFile($path); } diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php index 9bf9397b19a..ef63cea45df 100644 --- a/apps/media/lib_scanner.php +++ b/apps/media/lib_scanner.php @@ -97,25 +97,25 @@ class OC_MEDIA_SCANNER{ $data=@self::$getID3->analyze($file); getid3_lib::CopyTagsToComments($data); if(!isset($data['comments'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading id3 tags in '$file'");} + OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN); return; } if(!isset($data['comments']['artist'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading artist tag in '$file'");} + OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN); $artist='unknown'; }else{ $artist=stripslashes($data['comments']['artist'][0]); $artist=utf8_encode($artist); } if(!isset($data['comments']['album'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading album tag in '$file'");} + OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN); $album='unknown'; }else{ $album=stripslashes($data['comments']['album'][0]); $album=utf8_encode($album); } if(!isset($data['comments']['title'])){ - if(defined("DEBUG") && DEBUG) {error_log("error reading title tag in '$file'");} + OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN); $title='unknown'; }else{ $title=stripslashes($data['comments']['title'][0]); diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 44a16793bf2..2d54c863c79 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -37,7 +37,7 @@ foreach($arguments as &$argument){ } ob_clean(); if(isset($arguments['action'])){ - if(defined("DEBUG") && DEBUG) {error_log($arguments['action']);} + OC_Log::write('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG); switch($arguments['action']){ case 'url_to_song': OC_MEDIA_AMPACHE::url_to_song($arguments); diff --git a/apps/remoteStorage/lib_remoteStorage.php b/apps/remoteStorage/lib_remoteStorage.php index 5677ab3c6e0..f10a72870a4 100644 --- a/apps/remoteStorage/lib_remoteStorage.php +++ b/apps/remoteStorage/lib_remoteStorage.php @@ -7,7 +7,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"
'; $entry .= 'Offending command was: '.$result->getDebugInfo().'
'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } $ret = array(); @@ -24,7 +24,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"
'; $entry .= 'Offending command was: '.$result->getDebugInfo().'
'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } $ret = array(); @@ -45,7 +45,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"
'; $entry .= 'Offending command was: '.$result->getDebugInfo().'
'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } } @@ -56,7 +56,7 @@ class OC_remoteStorage { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"
'; $entry .= 'Offending command was: '.$result->getDebugInfo().'
'; - if(defined("DEBUG") && DEBUG) {error_log( $entry );} + OC_Log::write('removeStorage',$entry,OC_Log::ERROR); die( $entry ); } } diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php index 546f9f4565a..912019a9700 100644 --- a/apps/user_openid/appinfo/app.php +++ b/apps/user_openid/appinfo/app.php @@ -26,14 +26,14 @@ OC_User::useBackend('openid'); //check for results from openid requests if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ - if(defined("DEBUG") && DEBUG) {error_log('openid retured');} + OC_Log::write('user_openid','openid retured',OC_Log::DEBUG); $openid = new SimpleOpenID; $openid->SetIdentity($_GET['openid_identity']); $openid_validation_result = $openid->ValidateWithServer(); if ($openid_validation_result == true){ // OK HERE KEY IS VALID - if(defined("DEBUG") && DEBUG) {error_log('auth sucessfull');} + OC_Log::write('user_openid','auth sucessfull',OC_Log::DEBUG); $identity=$openid->GetIdentity(); - if(defined("DEBUG") && DEBUG) {error_log("auth as $identity");} + OC_Log::write('user_openid','auth as '.$identity,OC_Log::DEBUG); $user=OC_USER_OPENID::findUserForIdentity($identity); if($user){ $_SESSION['user_id']=$user; @@ -41,13 +41,13 @@ if(isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'id_res'){ } }else if($openid->IsError() == true){ // ON THE WAY, WE GOT SOME ERROR $error = $openid->GetError(); - if(defined("DEBUG") && DEBUG) {error_log("ERROR CODE: " . $error['code']);} - if(defined("DEBUG") && DEBUG) {error_log("ERROR DESCRIPTION: " . $error['description']);} + OC_Log::write('user_openid','ERROR CODE: '. $error['code'],OC_Log::ERROR); + OC_Log::write('user_openid','ERROR DESCRIPTION: '. $error['description'],OC_Log::ERROR); }else{ // Signature Verification Failed - if(defined("DEBUG") && DEBUG) {error_log("INVALID AUTHORIZATION");} + OC_Log::write('user_openid','INVALID AUTHORIZATION',OC_Log::ERROR); } }else if (isset($_GET['openid_mode']) and $_GET['openid_mode'] == 'cancel'){ // User Canceled your Request - if(defined("DEBUG") && DEBUG) {error_log("USER CANCELED REQUEST");} + OC_Log::write('user_openid','USER CANCELED REQUEST',OC_Log::DEBUG); return false; } diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index 5009fa410aa..d8168c9a10d 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -1053,8 +1053,6 @@ function debug ($x, $m = null) { } else { $x .= "\n"; } - - if(defined("DEBUG") && DEBUG) {error_log($x . "\n", 3, $profile['logfile']);} } @@ -1513,7 +1511,6 @@ function wrap_html ( $message ) { '; - if(defined("DEBUG") && DEBUG) {error_log($html);} echo $html; exit(0); } @@ -1658,15 +1655,6 @@ $profile['req_url'] = sprintf("%s://%s%s", // $port,//host already includes the path $_SERVER["REQUEST_URI"]); -// $fullId='user.php/'.$USERNAME.'/'; -// $incompleteId='user.php/'; - -// if(!strpos($profile['req_url'],$fullId)){ -// $profile['req_url']=str_replace($incompleteId,$fullId,$profile['req_url']); -// } - -// if(defined("DEBUG") && DEBUG) {error_log('inc id: '.$fullId);} -// if(defined("DEBUG") && DEBUG) {error_log('req url: '.$profile['req_url']);} // Set the default allowance for testing if (! array_key_exists('allow_test', $profile)) diff --git a/apps/user_openid/user.php b/apps/user_openid/user.php index 3cbc38491ca..a267e020507 100644 --- a/apps/user_openid/user.php +++ b/apps/user_openid/user.php @@ -40,7 +40,7 @@ require_once '../../lib/base.php'; OC_Util::checkAppEnabled('user_openid'); if(!OC_User::userExists($USERNAME)){ - if(defined("DEBUG") && DEBUG) {error_log($USERNAME.' doesn\'t exist');} + OC_Log::write('user_openid',$USERNAME.' doesn\'t exist',OC_Log::WARN); $USERNAME=''; } $IDENTITY=OC_Helper::linkTo( "user_openid", "user.php", null, true ).'/'.$USERNAME; diff --git a/files/ajax/newfolder.php b/files/ajax/newfolder.php index 43d87461fc7..6966e912c56 100644 --- a/files/ajax/newfolder.php +++ b/files/ajax/newfolder.php @@ -13,7 +13,7 @@ if($foldername == '') { OC_JSON::error(array("data" => array( "message" => "Empty Foldername" ))); exit(); } -if(defined("DEBUG") && DEBUG) {error_log('try to create ' . $foldername . ' in ' . $dir);} + if(OC_Files::newFile($dir, $foldername, 'dir')) { OC_JSON::success(array("data" => array())); exit(); diff --git a/index.php b/index.php index 924e7394f7b..558733e1cda 100644 --- a/index.php +++ b/index.php @@ -31,7 +31,7 @@ if($not_installed) { // Check for autosetup: $autosetup_file = OC::$SERVERROOT."/config/autoconfig.php"; if( file_exists( $autosetup_file )){ - error_log("Autoconfig file found, setting up owncloud..."); + OC_Log::write('core','Autoconfig file found, setting up owncloud...',OC_Log::INFO); include( $autosetup_file ); $_POST['install'] = 'true'; $_POST = array_merge ($_POST, $AUTOCONFIG); @@ -68,7 +68,7 @@ else { // remember was checked after last login if(isset($_COOKIE["oc_remember_login"]) && isset($_COOKIE["oc_token"]) && isset($_COOKIE["oc_username"]) && $_COOKIE["oc_remember_login"]) { if(defined("DEBUG") && DEBUG) { - error_log("Trying to login from cookie"); + OC_Log::write('core','Trying to login from cookie',OC_Log::DEBUG); } // confirm credentials in cookie if(isset($_COOKIE['oc_token']) && OC_User::userExists($_COOKIE['oc_username']) && @@ -86,7 +86,7 @@ else { if(OC_User::login($_POST["user"], $_POST["password"])) { if(!empty($_POST["remember_login"])){ if(defined("DEBUG") && DEBUG) { - error_log("Setting remember login to cookie"); + OC_Log::write('core','Setting remember login to cookie',OC_Log::DEBUG); } $token = md5($_POST["user"].time()); OC_Preferences::setValue($_POST['user'], 'login', 'token', $token); diff --git a/lib/db.php b/lib/db.php index ef6d1dcc8b7..fa3995be125 100644 --- a/lib/db.php +++ b/lib/db.php @@ -161,9 +161,8 @@ class OC_DB { // Die if we could not connect if( PEAR::isError( self::$MDB2 )){ echo( 'can not connect to database, using '.$type.'. ('.self::$MDB2->getUserInfo().')'); - $error = self::$MDB2->getMessage(); - error_log( $error); - error_log( self::$MDB2->getUserInfo()); + OC_Log::write('core',self::$MDB2->getUserInfo(),OC_Log::FATAL); + OC_Log::write('core',self::$MDB2->getMessage(),OC_Log::FATAL); die( $error ); } @@ -195,7 +194,7 @@ class OC_DB { if( PEAR::isError($result)) { $entry = 'DB Error: "'.$result->getMessage().'"
'; $entry .= 'Offending command was: '.$query.'
'; - error_log( $entry ); + OC_Log::write('core',$entry,OC_Log::FATAL); die( $entry ); } }else{ @@ -204,7 +203,7 @@ class OC_DB { }catch(PDOException $e){ $entry = 'DB Error: "'.$e->getMessage().'"
'; $entry .= 'Offending command was: '.$query.'
'; - error_log( $entry ); + OC_Log::write('core',$entry,OC_Log::FATAL); die( $entry ); } $result=new PDOStatementWrapper($result); diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 180b056f344..8e0907f8d3b 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -195,7 +195,6 @@ class OC_Filestorage_Local extends OC_Filestorage{ } private function delTree($dir) { - if(defined("DEBUG") && DEBUG) {error_log('del'.$dir);} $dirRelative=$dir; $dir=$this->datadir.$dir; if (!file_exists($dir)) return true; diff --git a/lib/installer.php b/lib/installer.php index 0febb2cab46..242ca97934f 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -56,7 +56,7 @@ class OC_Installer{ */ public static function installApp( $data = array()){ if(!isset($data['source'])){ - if(defined("DEBUG") && DEBUG) {error_log("No source specified when installing app");} + OC_Log::write('core','No source specified when installing app',OC_Log::ERROR); return false; } @@ -64,13 +64,13 @@ class OC_Installer{ if($data['source']=='http'){ $path=tempnam(sys_get_temp_dir(),'oc_installer_'); if(!isset($data['href'])){ - if(defined("DEBUG") && DEBUG) {error_log("No href specified when installing app from http");} + OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR); return false; } copy($data['href'],$path); }else{ if(!isset($data['path'])){ - if(defined("DEBUG") && DEBUG) {error_log("No path specified when installing app from local file");} + OC_Log::write('core','No path specified when installing app from local file',OC_Log::ERROR); return false; } $path=$data['path']; @@ -85,7 +85,7 @@ class OC_Installer{ $zip->extractTo($extractDir); $zip->close(); } else { - if(defined("DEBUG") && DEBUG) {error_log("Failed to open archive when installing app");} + OC_Log::write('core','Failed to open archive when installing app',OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ unlink($path); @@ -95,7 +95,7 @@ class OC_Installer{ //load the info.xml file of the app if(!is_file($extractDir.'/appinfo/info.xml')){ - if(defined("DEBUG") && DEBUG) {error_log("App does not provide an info.xml file");} + OC_Log::write('core','App does not provide an info.xml file',OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ unlink($path); @@ -107,7 +107,7 @@ class OC_Installer{ //check if an app with the same id is already installed if(self::isInstalled( $info['id'] )){ - if(defined("DEBUG") && DEBUG) {error_log("App already installed");} + OC_Log::write('core','App already installed',OC_Log::WARN); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ unlink($path); @@ -117,7 +117,7 @@ class OC_Installer{ //check if the destination directory already exists if(is_dir($basedir)){ - if(defined("DEBUG") && DEBUG) {error_log("App's directory already exists");} + OC_Log::write('core','App directory already exists',OC_Log::WARN); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ unlink($path); @@ -131,7 +131,7 @@ class OC_Installer{ //copy the app to the correct place if(!mkdir($basedir)){ - if(defined("DEBUG") && DEBUG) {error_log('Can\'t create app folder ('.$basedir.')');} + OC_Log::write('core','Can\'t create app folder ('.$basedir.')',OC_Log::ERROR); OC_Helper::rmdirr($extractDir); if($data['source']=='http'){ unlink($path); diff --git a/lib/preferences.php b/lib/preferences.php index 6d8aa17afd5..75201f455ba 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -140,7 +140,6 @@ class OC_Preferences{ // Check if the key does exist $query = OC_DB::prepare( 'SELECT configvalue FROM *PREFIX*preferences WHERE userid = ? AND appid = ? AND configkey = ?' ); $values=$query->execute(array($user,$app,$key))->fetchAll(); - if(defined("DEBUG") && DEBUG) {error_log(print_r($values,true));} $exists=(count($values)>0); if( !$exists ){ From 1f6be857192bce5c6e33765bdebb424f74b3642d Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Sun, 16 Oct 2011 23:03:03 +0200 Subject: [PATCH 02/55] Fix bookmarks app to work with postgresql. Rework the bookmark app to manage postgresql. Add a fetchOne function into the PdoStmtWrapper Fix a tipo in comments. --- apps/bookmarks/ajax/addBookmark.php | 12 +++++- apps/bookmarks/ajax/editBookmark.php | 2 + apps/bookmarks/ajax/updateList.php | 55 ++++++++++++++++++---------- lib/db.php | 11 +++++- 4 files changed, 59 insertions(+), 21 deletions(-) diff --git a/apps/bookmarks/ajax/addBookmark.php b/apps/bookmarks/ajax/addBookmark.php index 0a7cdfc9be3..3975fd15f81 100644 --- a/apps/bookmarks/ajax/addBookmark.php +++ b/apps/bookmarks/ajax/addBookmark.php @@ -33,6 +33,8 @@ OC_JSON::checkAppEnabled('bookmarks'); $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ $_ut = "strftime('%s','now')"; +} elseif($CONFIG_DBTYPE == 'pgsql') { + $_ut = 'date_part(\'epoch\',now())::integer'; } else { $_ut = "UNIX_TIMESTAMP()"; } @@ -51,7 +53,15 @@ $params=array( OC_User::getUser() ); $query->execute($params); -$b_id = OC_DB::insertid(); + +if($CONFIG_DBTYPE == 'pgsql') +{ + $query = OC_DB::prepare("SELECT currval('*PREFIX*bookmarks_id_seq')"); + $b_id = $query->execute()->fetchOne(); +} else { + $b_id = OC_DB::insertid(); +} + if($b_id !== false) { $query = OC_DB::prepare(" diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php index e205f69bf5a..35f30ebcb7a 100644 --- a/apps/bookmarks/ajax/editBookmark.php +++ b/apps/bookmarks/ajax/editBookmark.php @@ -33,6 +33,8 @@ OC_JSON::checkAppEnabled('bookmarks'); $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ $_ut = "strftime('%s','now')"; +} elseif($CONFIG_DBTYPE == 'pgsql') { + $_ut = 'date_part(\'epoch\',now())::integer'; } else { $_ut = "UNIX_TIMESTAMP()"; } diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index f2c81256bb6..7a5c0476b43 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -38,6 +38,9 @@ $filterTag = isset($_GET['tag']) ? '%' . htmlspecialchars_decode($_GET['tag']) . if($filterTag){ $sqlFilterTag = 'HAVING tags LIKE ?'; $params[] = $filterTag; + if($CONFIG_DBTYPE == 'pgsql' ) { + $sqlFilterTag = 'HAVING array_to_string(array_agg(tag), \' \') LIKE ?'; + } } else { $sqlFilterTag = ''; } @@ -58,26 +61,40 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ $_gc_separator = 'SEPARATOR \' \''; } -$query = OC_DB::prepare(' - SELECT id, url, title, - CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id - THEN GROUP_CONCAT( tag ' .$_gc_separator. ' ) - ELSE \' \' - END - AS tags - FROM *PREFIX*bookmarks - LEFT JOIN *PREFIX*bookmarks_tags ON 1=1 - WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id - OR *PREFIX*bookmarks.id NOT IN ( - SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags +if($CONFIG_DBTYPE == 'pgsql' ){ + $query = OC_DB::prepare(' + SELECT id, url, title, array_to_string(array_agg(tag), \' \') as tags + FROM *PREFIX*bookmarks + LEFT JOIN *PREFIX*bookmarks_tags ON *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id + WHERE + *PREFIX*bookmarks.user_id = ? + GROUP BY id, url, title + '.$sqlFilterTag.' + ORDER BY *PREFIX*bookmarks.'.$sqlSort.' + LIMIT 10 + OFFSET ?'); +} else { + $query = OC_DB::prepare(' + SELECT id, url, title, + CASE WHEN *PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id + THEN GROUP_CONCAT( tag ' .$_gc_separator. ' ) + ELSE \' \' + END + AS tags + FROM *PREFIX*bookmarks + LEFT JOIN *PREFIX*bookmarks_tags ON 1=1 + WHERE (*PREFIX*bookmarks.id = *PREFIX*bookmarks_tags.bookmark_id + OR *PREFIX*bookmarks.id NOT IN ( + SELECT *PREFIX*bookmarks_tags.bookmark_id FROM *PREFIX*bookmarks_tags + ) ) - ) - AND *PREFIX*bookmarks.user_id = ? - GROUP BY url - '.$sqlFilterTag.' - ORDER BY *PREFIX*bookmarks.'.$sqlSort.' - LIMIT ?, 10'); - + AND *PREFIX*bookmarks.user_id = ? + GROUP BY url + '.$sqlFilterTag.' + ORDER BY *PREFIX*bookmarks.'.$sqlSort.' + LIMIT ?, 10'); +} + $bookmarks = $query->execute($params)->fetchAll(); OC_JSON::success(array('data' => $bookmarks)); diff --git a/lib/db.php b/lib/db.php index fa3995be125..78a4da10ce8 100644 --- a/lib/db.php +++ b/lib/db.php @@ -28,7 +28,7 @@ class OC_DB { const BACKEND_PDO=0; const BACKEND_MDB2=1; - static private $connection; //the prefered conenction to use, either PDO or MDB2 + static private $connection; //the prefered connection to use, either PDO or MDB2 static private $backend=null; static private $MDB2=false; static private $PDO=false; @@ -480,4 +480,13 @@ class PDOStatementWrapper{ public function __call($name,$arguments){ return call_user_func_array(array($this->statement,$name),$arguments); } + + /** + * Provide a simple fetchOne. + * fetch single column from the next row + * @param int $colnum the column number to fetch + */ + public function fetchOne($colnum = 0){ + return $this->statement->fetchColumn($colnum); + } } From 330c513015f835bc0f7f4cc19e3c49fd9053e735 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 17 Oct 2011 00:24:07 +0200 Subject: [PATCH 03/55] prevent error in media player ajax api --- apps/media/ajax/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/media/ajax/api.php b/apps/media/ajax/api.php index 29f61a2207f..93298c82c55 100644 --- a/apps/media/ajax/api.php +++ b/apps/media/ajax/api.php @@ -106,7 +106,7 @@ if($arguments['action']){ } break; case 'play': - ob_end_clean(); + @ob_end_clean(); $ftype=OC_Filesystem::getMimeType( $arguments['path'] ); From 77378fa1893267bbdd6ee2f7805a34c1d5b0977b Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 17 Oct 2011 00:24:42 +0200 Subject: [PATCH 04/55] fix now() function for sqlite3 --- lib/db.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/db.php b/lib/db.php index 78a4da10ce8..bcfda4592f2 100644 --- a/lib/db.php +++ b/lib/db.php @@ -350,7 +350,7 @@ class OC_DB { $prefix = OC_Config::getValue( "dbtableprefix", "oc_" ); // differences in escaping of table names ('`' for mysql) and getting the current timestamp - if( $type == 'sqlite' ){ + if( $type == 'sqlite' || $type == 'sqlite3' ){ $query = str_replace( '`', '\'', $query ); $query = str_replace( 'NOW()', 'datetime(\'now\')', $query ); $query = str_replace( 'now()', 'datetime(\'now\')', $query ); From 595b13f1e03a4300beee1396333a4b4337337df5 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 17 Oct 2011 01:18:02 +0200 Subject: [PATCH 05/55] prevent the remaining ob_clean related errors --- apps/admin_export/settings.php | 2 +- apps/media/getID3/getid3/extension.cache.dbm.php | 2 +- apps/media/getID3/getid3/module.graphic.jpg.php | 2 +- apps/media/getID3/getid3/write.id3v2.php | 8 ++++---- apps/media/getID3/getid3/write.real.php | 4 ++-- apps/media/server/xml.server.php | 2 +- files/download.php | 2 +- lib/template.php | 4 ++-- ocs/v1.php | 2 +- tests/index.php | 2 +- tests/lib/filesystem.php | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php index 1685e5c0ca1..cf1daa250f7 100644 --- a/apps/admin_export/settings.php +++ b/apps/admin_export/settings.php @@ -63,7 +63,7 @@ if (isset($_POST['admin_export'])) { header("Content-Type: application/zip"); header("Content-Disposition: attachment; filename=" . basename($filename)); header("Content-Length: " . filesize($filename)); - ob_end_clean(); + @ob_end_clean(); readfile($filename); unlink($filename); } else { diff --git a/apps/media/getID3/getid3/extension.cache.dbm.php b/apps/media/getID3/getid3/extension.cache.dbm.php index 051bb1f0d7a..c18b52d5dca 100644 --- a/apps/media/getID3/getid3/extension.cache.dbm.php +++ b/apps/media/getID3/getid3/extension.cache.dbm.php @@ -90,7 +90,7 @@ class getID3_cached_dbm extends getID3 ob_start(); // nasty, buy the only way to check... phpinfo(); $contents = ob_get_contents(); - ob_end_clean(); + @ob_end_clean(); if (!strstr($contents, $cache_type)) { die('PHP is not compiled --with '.$cache_type.' support, required to use DBM style cache.'); } diff --git a/apps/media/getID3/getid3/module.graphic.jpg.php b/apps/media/getID3/getid3/module.graphic.jpg.php index 0c2db92e636..cd5e986543c 100644 --- a/apps/media/getID3/getid3/module.graphic.jpg.php +++ b/apps/media/getID3/getid3/module.graphic.jpg.php @@ -62,7 +62,7 @@ class getid3_jpg $ThisFileInfo['warning'][] = strip_tags($errors); unset($ThisFileInfo['jpg']['exif']); } - ob_end_clean(); + @ob_end_clean(); } else { diff --git a/apps/media/getID3/getid3/write.id3v2.php b/apps/media/getID3/getid3/write.id3v2.php index 9447486e845..32546d18af9 100644 --- a/apps/media/getID3/getid3/write.id3v2.php +++ b/apps/media/getID3/getid3/write.id3v2.php @@ -68,7 +68,7 @@ class getid3_write_id3v2 } else { $this->errors[] = 'Could not open '.$this->filename.' mode "r+b" - '.strip_tags(ob_get_contents()); } - ob_end_clean(); + @ob_end_clean(); } else { @@ -80,7 +80,7 @@ class getid3_write_id3v2 } else { $this->errors[] = 'Could not open '.$this->filename.' mode "wb" - '.strip_tags(ob_get_contents()); } - ob_end_clean(); + @ob_end_clean(); } @@ -106,7 +106,7 @@ class getid3_write_id3v2 fclose($fp_source); copy($tempfilename, $this->filename); unlink($tempfilename); - ob_end_clean(); + @ob_end_clean(); return true; } else { @@ -121,7 +121,7 @@ class getid3_write_id3v2 $this->errors[] = 'Could not open '.$this->filename.' mode "rb" - '.strip_tags(ob_get_contents()); } - ob_end_clean(); + @ob_end_clean(); } return false; diff --git a/apps/media/getID3/getid3/write.real.php b/apps/media/getID3/getid3/write.real.php index 1e0240ccf32..14e775812fc 100644 --- a/apps/media/getID3/getid3/write.real.php +++ b/apps/media/getID3/getid3/write.real.php @@ -118,7 +118,7 @@ class getid3_write_real $this->errors[] = 'Could not open '.$tempfilename.' mode "wb" - '.strip_tags(ob_get_contents()); } - ob_end_clean(); + @ob_end_clean(); } fclose($fp_source); return false; @@ -275,7 +275,7 @@ class getid3_write_real $this->errors[] = 'Could not open '.$tempfilename.' mode "wb" - '.strip_tags(ob_get_contents()); } - ob_end_clean(); + @ob_end_clean(); } fclose($fp_source); return false; diff --git a/apps/media/server/xml.server.php b/apps/media/server/xml.server.php index 2d54c863c79..7e320a7f595 100644 --- a/apps/media/server/xml.server.php +++ b/apps/media/server/xml.server.php @@ -35,7 +35,7 @@ if(!isset($_POST['action']) and isset($_GET['action'])){ foreach($arguments as &$argument){ $argument=stripslashes($argument); } -ob_clean(); +@ob_clean(); if(isset($arguments['action'])){ OC_Log::write('media','ampache '.$arguments['action'].' request', OC_Log::DEBUG); switch($arguments['action']){ diff --git a/files/download.php b/files/download.php index c8a2692d015..71f91d352f7 100644 --- a/files/download.php +++ b/files/download.php @@ -46,6 +46,6 @@ header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.OC_Filesystem::filesize($filename)); -ob_end_clean(); +@ob_end_clean(); OC_Filesystem::readfile( $filename ); ?> diff --git a/lib/template.php b/lib/template.php index a293e63b437..440b62003e7 100644 --- a/lib/template.php +++ b/lib/template.php @@ -293,7 +293,7 @@ class OC_Template{ ob_start(); include( $this->template ); // <-- we have to use include because we pass $_! $data = ob_get_contents(); - ob_end_clean(); + @ob_end_clean(); // return the data return $data; @@ -319,7 +319,7 @@ class OC_Template{ ob_start(); include( $this->path.$file.'.php' ); $data = ob_get_contents(); - ob_end_clean(); + @ob_end_clean(); // Daten zurückgeben return $data; diff --git a/ocs/v1.php b/ocs/v1.php index b5eb460664c..f5ff6cb6054 100644 --- a/ocs/v1.php +++ b/ocs/v1.php @@ -22,7 +22,7 @@ */ require_once('../lib/base.php'); -ob_clean(); +@ob_clean(); OC_OCS::handle(); ?> diff --git a/tests/index.php b/tests/index.php index 08e53f1a575..34e1d4166ce 100644 --- a/tests/index.php +++ b/tests/index.php @@ -29,7 +29,7 @@ require_once('../lib/base.php'); OC_Util::checkAdminUser(); $testCases=loadFiles(__DIR__,array('index.php','templates')); -ob_end_clean(); +@ob_end_clean(); $testResults=array(); foreach($testCases as $testCaseClass){ $testCase=new $testCaseClass(); diff --git a/tests/lib/filesystem.php b/tests/lib/filesystem.php index 4bfa23884f4..43cf2e53f3f 100644 --- a/tests/lib/filesystem.php +++ b/tests/lib/filesystem.php @@ -87,7 +87,7 @@ class OC_FILEYSYSTEM_Test extends OC_TestCase ob_start(); OC_Filesystem::readfile('/dummy'); $this->assertEquals('foo', ob_get_contents(),'Unexpected output of readfile'); - ob_end_clean(); + @ob_end_clean(); } public function isReadable(){ From 4d1776faf959c71ac81ea1724e0d270e5414e953 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 17 Oct 2011 01:25:11 +0200 Subject: [PATCH 06/55] catch some edge cases in media player --- apps/media/js/collection.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/apps/media/js/collection.js b/apps/media/js/collection.js index 29ba45919cf..576f567faef 100644 --- a/apps/media/js/collection.js +++ b/apps/media/js/collection.js @@ -26,11 +26,17 @@ Collection={ } for(var i=0;i Date: Mon, 17 Oct 2011 13:49:33 +0200 Subject: [PATCH 07/55] Fix bookmark listing with mysql: limit is binded as string. --- apps/bookmarks/ajax/updateList.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/bookmarks/ajax/updateList.php b/apps/bookmarks/ajax/updateList.php index 7a5c0476b43..d2a5397452f 100644 --- a/apps/bookmarks/ajax/updateList.php +++ b/apps/bookmarks/ajax/updateList.php @@ -46,7 +46,6 @@ if($filterTag){ } $offset = isset($_GET['page']) ? intval($_GET['page']) * 10 : 0; -$params[] = $offset; $sort = isset($_GET['sort']) ? ($_GET['sort']) : 'bookmarks_sorting_recent'; if($sort == 'bookmarks_sorting_clicks') { @@ -62,6 +61,7 @@ if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){ } if($CONFIG_DBTYPE == 'pgsql' ){ + $params[] = $offset; $query = OC_DB::prepare(' SELECT id, url, title, array_to_string(array_agg(tag), \' \') as tags FROM *PREFIX*bookmarks @@ -92,7 +92,7 @@ if($CONFIG_DBTYPE == 'pgsql' ){ GROUP BY url '.$sqlFilterTag.' ORDER BY *PREFIX*bookmarks.'.$sqlSort.' - LIMIT ?, 10'); + LIMIT '.$offset.', 10'); } $bookmarks = $query->execute($params)->fetchAll(); From 3c5a6a356a6d07df4111444620b578f22951f939 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Mon, 17 Oct 2011 20:39:01 +0200 Subject: [PATCH 08/55] Use notification to inform about errors in file list. --- files/js/filelist.js | 17 +++++++++++------ files/js/files.js | 20 ++++++++++++++------ 2 files changed, 25 insertions(+), 12 deletions(-) diff --git a/files/js/filelist.js b/files/js/filelist.js index e6da922700d..3e85a35f6ef 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -173,6 +173,7 @@ FileList={ FileList.deleteCanceled=false; FileList.deleteFiles=files; $('#notification').text(t('files','undo deletion')); + $('#notification').data('deletefile',true); $('#notification').fadeIn(); }, finishDelete:function(ready,sync){ @@ -204,14 +205,18 @@ FileList={ $(document).ready(function(){ $('#notification').hide(); $('#notification').click(function(){ - FileList.deleteCanceled=true; - $('#notification').fadeOut(); - $.each(FileList.deleteFiles,function(index,file){ - $('tr[data-file="'+file+'"]').show(); + if($('#notification').data('deletefile')) + { + $.each(FileList.deleteFiles,function(index,file){ + $('tr[data-file="'+file+'"]').show(); // alert(file); - }); - FileList.deleteFiles=null; + }); + FileList.deleteCanceled=true; + FileList.deleteFiles=null; + } + $('#notification').fadeOut(); }); + $(window).bind('beforeunload', function (){ FileList.finishDelete(null,true); }); diff --git a/files/js/files.js b/files/js/files.js index 079646070d4..902c5e54934 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -182,13 +182,21 @@ $(document).ready(function() { var response=jQuery.parseJSON(target.contents().find('body').text()); //set mimetype and if needed filesize if(response){ - for(var i=0;i tr').not('[data-mime]').fadeOut(); + $('#fileList > tr').not('[data-mime]').remove(); } } }); From 7358d9ebb47027340ce97192eb6c86592117d3f3 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Mon, 17 Oct 2011 20:50:41 +0200 Subject: [PATCH 09/55] Fix quota onBlur In Settings, Take from right attribute --- settings/js/users.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/js/users.js b/settings/js/users.js index 64a132b427e..684fee21c64 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -111,7 +111,7 @@ $(document).ready(function(){ } }); input.blur(function(){ - var quota=$(this).parent().data('quota'); + var quota=$(this).parent().attr('data-quota'); $(this).replaceWith($(''+quota+'')); img.css('display',''); }); From ebd36d56caec3f665f750ac934a533df57074112 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Mon, 17 Oct 2011 21:42:38 +0200 Subject: [PATCH 10/55] Remove unnecessary exec for getting timezone and fix spacings --- lib/util.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/util.php b/lib/util.php index 0f8cc08fce6..6f3b7e3428a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -153,7 +153,7 @@ class OC_Util { */ public static function formatDate( $timestamp,$dateOnly=false){ if(isset($_SESSION['timezone'])){//adjust to clients timezone if we know it - $systemTimeZone = intval(exec('date +%z')); + $systemTimeZone = intval(date('O')); $systemTimeZone=(round($systemTimeZone/100,0)*60)+($systemTimeZone%100); $clientTimeZone=$_SESSION['timezone']*60; $offset=$clientTimeZone-$systemTimeZone; @@ -270,17 +270,17 @@ class OC_Util { /** * Try to get the username the httpd server runs on, used in hints */ - public static function checkWebserverUser(){ + public static function checkWebserverUser(){ if(is_callable('posix_getuid')){ $serverUser=posix_getpwuid(posix_getuid()); $serverUser='\''.$serverUser['name'].'\''; }elseif(exec('whoami')){ - $serverUser=exec('whoami'); - }else{ + $serverUser=exec('whoami'); + }else{ $serverUser='\'www-data\' for ubuntu/debian'; //TODO: try to detect the distro and give a guess based on that } - return $serverUser; - } + return $serverUser; + } /** From 2ac00b378a536b67a85bf5972952663ca432d115 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Mon, 17 Oct 2011 23:39:23 +0200 Subject: [PATCH 11/55] Fix file sharing : Don't give a unused param to execute --- apps/files_sharing/lib_share.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 978847f4a8f..0f1ddfee32f 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -60,7 +60,7 @@ class OC_Share { foreach ($uid_shared_with as $uid) { // Check if this item is already shared with the user $checkSource = OC_DB::prepare("SELECT source FROM *PREFIX*sharing WHERE source = ? AND uid_shared_with ".self::getUsersAndGroups($uid)); - $resultCheckSource = $checkSource->execute(array($source, $uid))->fetchAll(); + $resultCheckSource = $checkSource->execute(array($source))->fetchAll(); // TODO Check if the source is inside a folder if (count($resultCheckSource) > 0 && !isset($gid)) { throw new Exception("This item is already shared with ".$uid); From 59eac3bc29426b4871b03e9d173467e7b8059501 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 18 Oct 2011 20:10:17 +0200 Subject: [PATCH 12/55] Correct little typo/bug in log display and remove ending php tag --- apps/files_sharing/ajax/getitem.php | 2 -- settings/log.php | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/apps/files_sharing/ajax/getitem.php b/apps/files_sharing/ajax/getitem.php index 8d51c146523..075ec043eac 100644 --- a/apps/files_sharing/ajax/getitem.php +++ b/apps/files_sharing/ajax/getitem.php @@ -33,5 +33,3 @@ while ($source != "" && $source != "/" && $source != "." && $source != $userDire if (!empty($users)) { OC_JSON::encodedPrint($users); } - -?> diff --git a/settings/log.php b/settings/log.php index e181a5a4967..21303c2170f 100644 --- a/settings/log.php +++ b/settings/log.php @@ -31,7 +31,7 @@ OC_App::setActiveNavigationEntry( "core_log" ); $entries=OC_Log::getEntries(); function compareEntries($a,$b){ - return $b->time-$a>time; + return $b->time - $a->time; } usort($entries, 'compareEntries'); From 28ab39073a8ea942a7c299dc41ddf6023dd093de Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 18 Oct 2011 21:01:49 +0200 Subject: [PATCH 13/55] mount filesystems on demand --- lib/filesystem.php | 13 +++++++++---- lib/util.php | 31 +++---------------------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/lib/filesystem.php b/lib/filesystem.php index f84cda20eac..60fd051f303 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -44,6 +44,7 @@ */ class OC_Filesystem{ static private $storages=array(); + static private $mounts=array(); static private $fakeRoot=''; static private $storageTypes=array(); @@ -91,7 +92,7 @@ class OC_Filesystem{ * @param array arguments * @return OC_Filestorage */ - static public function createStorage($type,$arguments){ + static private function createStorage($type,$arguments){ if(!self::hasStorageType($type)){ return false; } @@ -163,11 +164,11 @@ class OC_Filesystem{ * @param OC_Filestorage storage * @param string mountpoint */ - static public function mount($storage,$mountpoint){ + static public function mount($type,$arguments,$mountpoint){ if(substr($mountpoint,0,1)!=='/'){ $mountpoint='/'.$mountpoint; } - self::$storages[self::$fakeRoot.$mountpoint]=$storage; + self::$mounts[self::$fakeRoot.$mountpoint]=array('type'=>$type,'arguments'=>$arguments); } /** @@ -178,6 +179,10 @@ class OC_Filesystem{ static public function getStorage($path){ $mountpoint=self::getMountPoint($path); if($mountpoint){ + if(!isset(self::$storages[$mountpoint])){ + $mount=self::$mounts[$mountpoint]; + self::$storages[$mountpoint]=self::createStorage($mount['type'],$mount['arguments']); + } return self::$storages[$mountpoint]; } } @@ -201,7 +206,7 @@ class OC_Filesystem{ } $path=self::$fakeRoot.$path; $foundMountPoint=''; - foreach(self::$storages as $mountpoint=>$storage){ + foreach(self::$mounts as $mountpoint=>$storage){ if(substr($mountpoint,-1)!=='/'){ $mountpoint=$mountpoint.'/'; } diff --git a/lib/util.php b/lib/util.php index 6f3b7e3428a..ec92a986008 100644 --- a/lib/util.php +++ b/lib/util.php @@ -36,42 +36,17 @@ class OC_Util { } if( $user != "" ){ //if we aren't logged in, there is no use to set up the filesystem - //first set up the local "root" storage and the backupstorage if needed - $rootStorage=OC_Filesystem::createStorage('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT)); -// if( OC_Config::getValue( "enablebackup", false )){ -// // This creates the Directorys recursively -// if(!is_dir( "$CONFIG_BACKUPDIRECTORY/$user/$root" )){ -// mkdir( "$CONFIG_BACKUPDIRECTORY/$user/$root", 0755, true ); -// } -// $backupStorage=OC_Filesystem::createStorage('local',array('datadir'=>$CONFIG_BACKUPDIRECTORY)); -// $backup=new OC_FILEOBSERVER_BACKUP(array('storage'=>$backupStorage)); -// $rootStorage->addObserver($backup); -// } - OC_Filesystem::mount($rootStorage,'/'); + //first set up the local "root" storage + OC_Filesystem::mount('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT),'/'); // TODO add this storage provider in a proper way - $sharedStorage = OC_Filesystem::createStorage('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared')); - OC_Filesystem::mount($sharedStorage,'/'.OC_User::getUser().'/files/Shared/'); + OC_Filesystem::mount('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/'); OC::$CONFIG_DATADIRECTORY = $CONFIG_DATADIRECTORY_ROOT."/$user/$root"; if( !is_dir( OC::$CONFIG_DATADIRECTORY )){ mkdir( OC::$CONFIG_DATADIRECTORY, 0755, true ); } -// TODO: find a cool way for doing this -// //set up the other storages according to the system settings -// foreach($CONFIG_FILESYSTEM as $storageConfig){ -// if(OC_Filesystem::hasStorageType($storageConfig['type'])){ -// $arguments=$storageConfig; -// unset($arguments['type']); -// unset($arguments['mountpoint']); -// $storage=OC_Filesystem::createStorage($storageConfig['type'],$arguments); -// if($storage){ -// OC_Filesystem::mount($storage,$storageConfig['mountpoint']); -// } -// } -// } - //jail the user into his "home" directory OC_Filesystem::chroot("/$user/$root"); $quotaProxy=new OC_FileProxy_Quota(); From b975f1151451785f8350a12bf63d8fd63f0d04b4 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Tue, 18 Oct 2011 21:19:13 +0200 Subject: [PATCH 14/55] make sharing work with the new mouting mechanism --- apps/files_sharing/sharedstorage.php | 12 +++++------- lib/base.php | 14 +++++++------- lib/filesystem.php | 2 +- lib/util.php | 3 --- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/apps/files_sharing/sharedstorage.php b/apps/files_sharing/sharedstorage.php index 53f25b60e91..faf4e68d9b1 100644 --- a/apps/files_sharing/sharedstorage.php +++ b/apps/files_sharing/sharedstorage.php @@ -22,6 +22,11 @@ require_once( 'lib_share.php' ); +if (!OC_Filesystem::is_dir('/Shared')) { + OC_Filesystem::mkdir('/Shared'); +} +OC_Filesystem::mount('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/'); + /** * Convert target path to source path and pass the function call to the correct storage provider */ @@ -32,13 +37,6 @@ class OC_Filestorage_Shared extends OC_Filestorage { public function __construct($arguments) { $this->datadir = $arguments['datadir']; - if (OC_Share::getItemsInFolder($this->datadir)) { - if (!OC_Filesystem::is_dir($this->datadir)) { - OC_Filesystem::mkdir($this->datadir); - } - } else if (OC_Filesystem::is_dir($this->datadir)) { - OC_Filesystem::rmdir($this->datadir); - } $this->datadir .= "/"; } diff --git a/lib/base.php b/lib/base.php index ade4d889631..8adb1cc9102 100644 --- a/lib/base.php +++ b/lib/base.php @@ -154,13 +154,6 @@ class OC{ OC_User::useBackend( OC_Config::getValue( "userbackend", "database" )); OC_Group::setBackend( OC_Config::getValue( "groupbackend", "database" )); - // Load Apps - // This includes plugins for users and filesystems as well - global $RUNTIME_NOAPPS; - if(!$RUNTIME_NOAPPS ){ - OC_App::loadApps(); - } - // Was in required file ... put it here OC_Filesystem::registerStorageType('local','OC_Filestorage_Local',array('datadir'=>'string')); @@ -170,6 +163,13 @@ class OC{ OC_Util::setupFS(); } + // Load Apps + // This includes plugins for users and filesystems as well + global $RUNTIME_NOAPPS; + if(!$RUNTIME_NOAPPS ){ + OC_App::loadApps(); + } + // Last part: connect some hooks OC_HOOK::connect('OC_User', 'post_createUser', 'OC_Connector_Sabre_Principal', 'addPrincipal'); OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Connector_Sabre_Principal', 'deletePrincipal'); diff --git a/lib/filesystem.php b/lib/filesystem.php index 60fd051f303..3497431f1ee 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -168,7 +168,7 @@ class OC_Filesystem{ if(substr($mountpoint,0,1)!=='/'){ $mountpoint='/'.$mountpoint; } - self::$mounts[self::$fakeRoot.$mountpoint]=array('type'=>$type,'arguments'=>$arguments); + self::$mounts[$mountpoint]=array('type'=>$type,'arguments'=>$arguments); } /** diff --git a/lib/util.php b/lib/util.php index ec92a986008..90cc1f6123a 100644 --- a/lib/util.php +++ b/lib/util.php @@ -39,9 +39,6 @@ class OC_Util { //first set up the local "root" storage OC_Filesystem::mount('local',array('datadir'=>$CONFIG_DATADIRECTORY_ROOT),'/'); - // TODO add this storage provider in a proper way - OC_Filesystem::mount('shared',array('datadir'=>'/'.OC_User::getUser().'/files/Shared'),'/'.OC_User::getUser().'/files/Shared/'); - OC::$CONFIG_DATADIRECTORY = $CONFIG_DATADIRECTORY_ROOT."/$user/$root"; if( !is_dir( OC::$CONFIG_DATADIRECTORY )){ mkdir( OC::$CONFIG_DATADIRECTORY, 0755, true ); From 29368d1c58d1c52420f46cf41a1b975a23751814 Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 18 Oct 2011 21:29:48 +0200 Subject: [PATCH 15/55] Add 3 More log writing in files sharing app --- apps/files_sharing/ajax/share.php | 2 ++ apps/files_sharing/lib_share.php | 1 + 2 files changed, 3 insertions(+) diff --git a/apps/files_sharing/ajax/share.php b/apps/files_sharing/ajax/share.php index 6a2b45b3a7d..d1f50994317 100644 --- a/apps/files_sharing/ajax/share.php +++ b/apps/files_sharing/ajax/share.php @@ -15,6 +15,7 @@ foreach ($sources as $source) { $source = $userDirectory.$source; // If the file doesn't exist, it may be shared with the current user } else if (!$source = OC_Share::getSource($userDirectory.$source)) { + OC_Log::write('files_sharing',"Shared file doesn't exists :".$source,OC_Log::ERROR); echo "false"; } try { @@ -23,6 +24,7 @@ foreach ($sources as $source) { echo $shared->getToken(); } } catch (Exception $exception) { + OC_Log::write('files_sharing',"Unexpected Error : ".$exception->getMessage(),OC_Log::ERROR); echo "false"; } } diff --git a/apps/files_sharing/lib_share.php b/apps/files_sharing/lib_share.php index 0f1ddfee32f..cde33fd1dc5 100644 --- a/apps/files_sharing/lib_share.php +++ b/apps/files_sharing/lib_share.php @@ -282,6 +282,7 @@ class OC_Share { return $result[0]['permissions']; } } else { + OC_Log::write('files_sharing',"Not existing parent folder : ".$target,OC_Log::ERROR); return false; } } From b15d8878b7f2084dc5bc441911a86799379a6cbd Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 18 Oct 2011 22:41:25 +0200 Subject: [PATCH 16/55] Correct use of null for not null columns in media scanner --- apps/media/lib_collection.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php index 82c4afedd0a..54e317df930 100644 --- a/apps/media/lib_collection.php +++ b/apps/media/lib_collection.php @@ -43,7 +43,7 @@ class OC_MEDIA_COLLECTION{ if(isset(self::$artistIdCache[$name])){ return self::$artistIdCache[$name]; }else{ - $query=OC_DB::prepare("SELECT artist_id FROM *PREFIX*media_artists WHERE artist_name LIKE ?"); + $query=OC_DB::prepare("SELECT artist_id FROM *PREFIX*media_artists WHERE lower(artist_name) LIKE ?"); $artists=$query->execute(array($name))->fetchAll(); if(is_array($artists) and isset($artists[0])){ self::$artistIdCache[$name]=$artists[0]['artist_id']; @@ -146,7 +146,7 @@ class OC_MEDIA_COLLECTION{ if($artistId!=0){ return $artistId; }else{ - $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_artists` (`artist_id` ,`artist_name`) VALUES (NULL , ?)"); + $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_artists` (`artist_name`) VALUES (?)"); $result=$query->execute(array($name)); return self::getArtistId($name);; } @@ -193,7 +193,7 @@ class OC_MEDIA_COLLECTION{ if($albumId!=0){ return $albumId; }else{ - $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_albums` (`album_id` ,`album_name` ,`album_artist`) VALUES (NULL , ?, ?)"); + $query=OC_DB::prepare("INSERT INTO `*PREFIX*media_albums` (`album_name` ,`album_artist`) VALUES ( ?, ?)"); $query->execute(array($name,$artist)); return self::getAlbumId($name,$artist); } From 9ea34250a0d2e6c058d8869e0259026c083fa41e Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 18 Oct 2011 23:15:47 +0200 Subject: [PATCH 17/55] Lower also the album name in media scanner... --- apps/media/lib_collection.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/media/lib_collection.php b/apps/media/lib_collection.php index 54e317df930..571cb7e6850 100644 --- a/apps/media/lib_collection.php +++ b/apps/media/lib_collection.php @@ -71,7 +71,7 @@ class OC_MEDIA_COLLECTION{ if(isset(self::$albumIdCache[$artistId][$name])){ return self::$albumIdCache[$artistId][$name]; }else{ - $query=OC_DB::prepare("SELECT album_id FROM *PREFIX*media_albums WHERE album_name LIKE ? AND album_artist=?"); + $query=OC_DB::prepare("SELECT album_id FROM *PREFIX*media_albums WHERE lower(album_name) LIKE ? AND album_artist=?"); $albums=$query->execute(array($name,$artistId))->fetchAll(); if(is_array($albums) and isset($albums[0])){ self::$albumIdCache[$artistId][$name]=$albums[0]['album_id']; From da8d32ae38acdab576a30ca56b30579f427c780d Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Tue, 18 Oct 2011 23:27:53 +0200 Subject: [PATCH 18/55] Tweak bookmarklet to not change the current page. Correct encoding when add bookmark --- apps/bookmarks/addBm.php | 4 ++-- apps/bookmarks/templates/settings.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/bookmarks/addBm.php b/apps/bookmarks/addBm.php index a7cdcee8faa..62ad5821dbf 100644 --- a/apps/bookmarks/addBm.php +++ b/apps/bookmarks/addBm.php @@ -39,7 +39,7 @@ $tmpl = new OC_Template( 'bookmarks', 'addBm', 'user' ); $url = isset($_GET['url']) ? urldecode($_GET['url']) : ''; $metadata = getURLMetadata($url); -$tmpl->assign('URL', htmlentities($metadata['url'])); -$tmpl->assign('TITLE', htmlentities($metadata['title'])); +$tmpl->assign('URL', htmlentities($metadata['url'],ENT_COMPAT,'utf-8')); +$tmpl->assign('TITLE', htmlentities($metadata['title'],ENT_COMPAT,'utf-8')); $tmpl->printPage(); diff --git a/apps/bookmarks/templates/settings.php b/apps/bookmarks/templates/settings.php index b7da441c2f8..97b6b256c09 100644 --- a/apps/bookmarks/templates/settings.php +++ b/apps/bookmarks/templates/settings.php @@ -8,7 +8,7 @@ ?>
- t('Bookmarklet:');?> t('Add page to ownCloud'); ?> + t('Bookmarklet:');?> t('Add page to ownCloud'); ?>
t('Drag this to your browser bookmarks and click it, when you want to bookmark a webpage.'); ?>
From 7e344527461194cc2cee9085648bfbd450ef1f7f Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Wed, 19 Oct 2011 22:42:44 +0200 Subject: [PATCH 19/55] Little trick to avoid editor loading twice on double click --- apps/files_texteditor/js/editor.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js index f7b924d494d..a0629aa8c4e 100644 --- a/apps/files_texteditor/js/editor.js +++ b/apps/files_texteditor/js/editor.js @@ -73,11 +73,7 @@ function bindControlEvents(){ function editorIsShown(){ // Not working as intended. Always returns true. - if(window.aceEditor){ - return true; - } else { - return false; - } + return is_editor_shown; } function updateSessionFileHash(path){ @@ -174,6 +170,7 @@ function showFileEditor(dir,filename){ } // End ajax }); + is_editor_shown = true; } } @@ -194,12 +191,13 @@ function hideFileEditor(){ $('.actions,#file_access_panel').fadeIn('slow'); $('table').fadeIn('slow'); }); + is_editor_shown = false; } $(window).resize(function() { setEditorSize(); }); - +var is_editor_shown = false; $(document).ready(function(){ if(typeof FileActions!=='undefined'){ FileActions.register('text','Edit','',function(filename){ From 466b41c36bf7093cdde9d2856eb520503f52640c Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Wed, 19 Oct 2011 23:38:35 +0200 Subject: [PATCH 20/55] Don't use sys_get_temp_dir(), as it reports the wrong path in restricted environments --- apps/admin_export/settings.php | 2 +- apps/user_openid/phpmyid.php | 48 ++++++++++++++++++++-------------- lib/base.php | 25 +++++++++--------- lib/db.php | 4 +-- lib/files.php | 6 ++--- lib/filestorage/local.php | 2 +- lib/filestorage/remote.php | 2 +- lib/installer.php | 4 +-- lib/remote/cloud.php | 8 +++--- 9 files changed, 55 insertions(+), 46 deletions(-) diff --git a/apps/admin_export/settings.php b/apps/admin_export/settings.php index cf1daa250f7..a33c872ccf4 100644 --- a/apps/admin_export/settings.php +++ b/apps/admin_export/settings.php @@ -25,7 +25,7 @@ OC_Util::checkAppEnabled('admin_export'); if (isset($_POST['admin_export'])) { $root = OC::$SERVERROOT . "/"; $zip = new ZipArchive(); - $filename = sys_get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; + $filename = get_temp_dir() . "/owncloud_export_" . date("y-m-d_H-i-s") . ".zip"; OC_Log::write('admin_export',"Creating export file at: " . $filename,OC_Log::INFO); if ($zip->open($filename, ZIPARCHIVE::CREATE) !== TRUE) { exit("Cannot open <$filename>\n"); diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index d8168c9a10d..c984dc8f5e6 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -603,7 +603,7 @@ function test_mode () { $res['gmp'] = 'pass - n/a'; } - // sys_get_temp_dir + // get_temp_dir $res['logfile'] = is_writable($profile['logfile']) ? 'pass' : "warn - log is not writable"; @@ -1374,30 +1374,38 @@ function str_diff_at ($a, $b) { } -if (! function_exists('sys_get_temp_dir') && ini_get('open_basedir') == false) { +if (! function_exists('get_temp_dir')) { /** * Create function if missing * @return string */ -function sys_get_temp_dir () { - $keys = array('TMP', 'TMPDIR', 'TEMP'); - foreach ($keys as $key) { - if (isset($_ENV[$key]) && is_dir($_ENV[$key]) && is_writable($_ENV[$key])) - return realpath($_ENV[$key]); - } + if (ini_get('open_basedir') == false) { + function get_temp_dir () { + $keys = array('TMP', 'TMPDIR', 'TEMP'); + foreach ($keys as $key) { + if (isset($_ENV[$key]) && is_dir($_ENV[$key]) && is_writable($_ENV[$key])) + return realpath($_ENV[$key]); + } - $tmp = tempnam(false, null); - if (file_exists($tmp)) { - $dir = realpath(dirname($tmp)); - unlink($tmp); - return realpath($dir); - } + $tmp = tempnam(false, null); + if (file_exists($tmp)) { + $dir = realpath(dirname($tmp)); + unlink($tmp); + return realpath($dir); + } - return realpath(dirname(__FILE__)); -}} elseif (! function_exists('sys_get_temp_dir')) { -function sys_get_temp_dir () { - return realpath(dirname(__FILE__)); -}} + return realpath(dirname(__FILE__)); + } + } + else { + function get_temp_dir () { + if (isset(ini_get('upload_tmp_dir')) && is_dir(ini_get('upload_tmp_dir')) && is_writable(ini_get('upload_tmp_dir'))) + return ini_get('upload_tmp_dir'); + else + return realpath(dirname(__FILE__)); + } + } +} /** @@ -1694,7 +1702,7 @@ if (! array_key_exists('lifetime', $profile)) { // Set a default log file if (! array_key_exists('logfile', $profile)) - $profile['logfile'] = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $profile['auth_realm'] . '.debug.log'; + $profile['logfile'] = get_temp_dir() . DIRECTORY_SEPARATOR . $profile['auth_realm'] . '.debug.log'; /* diff --git a/lib/base.php b/lib/base.php index 8adb1cc9102..d5fff1e0a74 100644 --- a/lib/base.php +++ b/lib/base.php @@ -186,18 +186,19 @@ if( !isset( $RUNTIME_NOAPPS )){ OC::init(); -if(!function_exists('sys_get_temp_dir')) { - function sys_get_temp_dir() { - if( $temp=getenv('TMP') ) return $temp; - if( $temp=getenv('TEMP') ) return $temp; - if( $temp=getenv('TMPDIR') ) return $temp; - $temp=tempnam(__FILE__,''); - if (file_exists($temp)) { - unlink($temp); - return dirname($temp); - } - return null; - } +if(!function_exists('get_temp_dir')) { + function get_temp_dir() { + if( $temp=ini_get('upload_tmp_dir') ) return $temp; + if( $temp=getenv('TMP') ) return $temp; + if( $temp=getenv('TEMP') ) return $temp; + if( $temp=getenv('TMPDIR') ) return $temp; + $temp=tempnam(__FILE__,''); + if (file_exists($temp)) { + unlink($temp); + return dirname($temp); + } + return null; + } } require_once('fakedirstream.php'); diff --git a/lib/db.php b/lib/db.php index bcfda4592f2..44be619fde1 100644 --- a/lib/db.php +++ b/lib/db.php @@ -285,7 +285,7 @@ class OC_DB { $content = file_get_contents( $file ); // Make changes and save them to a temporary file - $file2 = tempnam( sys_get_temp_dir(), 'oc_db_scheme_' ); + $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' ); $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content ); $content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content ); if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite don't @@ -392,7 +392,7 @@ class OC_DB { $content = file_get_contents( $file ); // Make changes and save them to a temporary file - $file2 = tempnam( sys_get_temp_dir(), 'oc_db_scheme_' ); + $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' ); $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content ); $content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content ); file_put_contents( $file2, $content ); diff --git a/lib/files.php b/lib/files.php index 631726bf9b5..88b559059f0 100644 --- a/lib/files.php +++ b/lib/files.php @@ -91,7 +91,7 @@ class OC_Files { if(is_array($files)){ $zip = new ZipArchive(); - $filename = sys_get_temp_dir()."/ownCloud.zip"; + $filename = get_temp_dir()."/ownCloud.zip"; if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) { exit("cannot open <$filename>\n"); } @@ -108,7 +108,7 @@ class OC_Files { $zip->close(); }elseif(OC_Filesystem::is_dir($dir.'/'.$files)){ $zip = new ZipArchive(); - $filename = sys_get_temp_dir()."/ownCloud.zip"; + $filename = get_temp_dir()."/ownCloud.zip"; if ($zip->open($filename, ZIPARCHIVE::CREATE)!==TRUE) { exit("cannot open <$filename>\n"); } @@ -271,7 +271,7 @@ class OC_Files { * @return string guessed mime type */ static function pull($source,$token,$dir,$file){ - $tmpfile=tempnam(sys_get_temp_dir(),'remoteCloudFile'); + $tmpfile=tempnam(get_temp_dir(),'remoteCloudFile'); $fp=fopen($tmpfile,'w+'); $url=$source.="/files/pull.php?token=$token"; $ch=curl_init(); diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 8e0907f8d3b..8db0ffead4e 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -161,7 +161,7 @@ class OC_Filestorage_Local extends OC_Filestorage{ } public function toTmpFile($path){ - $tmpFolder=sys_get_temp_dir(); + $tmpFolder=get_temp_dir(); $filename=tempnam($tmpFolder,'OC_TEMP_FILE_'.substr($path,strrpos($path,'.'))); $fileStats = stat($this->datadir.$path); if(copy($this->datadir.$path,$filename)){ diff --git a/lib/filestorage/remote.php b/lib/filestorage/remote.php index fb14c4121a2..88bdbca481c 100644 --- a/lib/filestorage/remote.php +++ b/lib/filestorage/remote.php @@ -211,7 +211,7 @@ class OC_Filestorage_Remote extends OC_Filestorage{ $parent=dirname($path); $name=substr($path,strlen($parent)+1); $file=$this->remote->getFile($parent,$name); - $file=tempnam(sys_get_temp_dir(),'oc_'); + $file=tempnam(get_temp_dir(),'oc_'); file_put_contents($file,$data); if($return=$this->remote->sendTmpFile($file,$parent,$name)){ $this->notifyObservers($path,OC_FILEACTION_WRITE); diff --git a/lib/installer.php b/lib/installer.php index 242ca97934f..9248f68e011 100644 --- a/lib/installer.php +++ b/lib/installer.php @@ -62,7 +62,7 @@ class OC_Installer{ //download the file if necesary if($data['source']=='http'){ - $path=tempnam(sys_get_temp_dir(),'oc_installer_'); + $path=tempnam(get_temp_dir(),'oc_installer_'); if(!isset($data['href'])){ OC_Log::write('core','No href specified when installing app from http',OC_Log::ERROR); return false; @@ -77,7 +77,7 @@ class OC_Installer{ } //extract the archive in a temporary folder - $extractDir=tempnam(sys_get_temp_dir(),'oc_installer_uncompressed_'); + $extractDir=tempnam(get_temp_dir(),'oc_installer_uncompressed_'); unlink($extractDir); mkdir($extractDir); $zip = new ZipArchive; diff --git a/lib/remote/cloud.php b/lib/remote/cloud.php index 75d60155d06..a9c74e8bf5f 100644 --- a/lib/remote/cloud.php +++ b/lib/remote/cloud.php @@ -17,7 +17,7 @@ class OC_REMOTE_CLOUD{ */ private function apiCall($action,$parameters=false,$assoc=false){ if(!$this->cookiefile){ - $this->cookiefile=sys_get_temp_dir().'/remoteCloudCookie'.uniqid(); + $this->cookiefile=get_temp_dir().'/remoteCloudCookie'.uniqid(); } $url=$this->path.='/files/api.php'; $fields_string="action=$action&"; @@ -168,9 +168,9 @@ class OC_REMOTE_CLOUD{ } $ch=curl_init(); if(!$this->cookiefile){ - $this->cookiefile=sys_get_temp_dir().'/remoteCloudCookie'.uniqid(); + $this->cookiefile=get_temp_dir().'/remoteCloudCookie'.uniqid(); } - $tmpfile=tempnam(sys_get_temp_dir(),'remoteCloudFile'); + $tmpfile=tempnam(get_temp_dir(),'remoteCloudFile'); $fp=fopen($tmpfile,'w+'); $url=$this->path.="/files/api.php?action=get&dir=$dir&file=$file"; curl_setopt($ch,CURLOPT_URL,$url); @@ -191,7 +191,7 @@ class OC_REMOTE_CLOUD{ public function sendTmpFile($tmp,$targetDir,$targetFile){ $token=sha1(uniqid().$tmp); - $file=sys_get_temp_dir().'/'.'remoteCloudFile'.$token; + $file=get_temp_dir().'/'.'remoteCloudFile'.$token; rename($tmp,$file); if( OC_Config::getValue( "forcessl", false ) or isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') { $url = "https://". $_SERVER['SERVER_NAME'] . OC::$WEBROOT; From 273972b75af17b228a57c7cf8258ea31f2e2e3bc Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2011 01:16:48 +0200 Subject: [PATCH 21/55] prevent sql error while initializing apps on sqlite2 --- lib/appconfig.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/appconfig.php b/lib/appconfig.php index f43ef141732..2b5cef59adc 100644 --- a/lib/appconfig.php +++ b/lib/appconfig.php @@ -47,7 +47,7 @@ class OC_Appconfig{ */ public static function getApps(){ // No magic in here! - $query = OC_DB::prepare( 'SELECT DISTINCT( appid ) FROM *PREFIX*appconfig' ); + $query = OC_DB::prepare( 'SELECT DISTINCT appid FROM *PREFIX*appconfig' ); $result = $query->execute(); $apps = array(); From e9b6a1018db89fb23d6e52e529f80ce11da09bd0 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2011 01:27:04 +0200 Subject: [PATCH 22/55] remove unneeded definiton of get_temp_dir --- apps/user_openid/phpmyid.php | 35 ----------------------------------- 1 file changed, 35 deletions(-) diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php index c984dc8f5e6..ef01e7a046d 100644 --- a/apps/user_openid/phpmyid.php +++ b/apps/user_openid/phpmyid.php @@ -1373,41 +1373,6 @@ function str_diff_at ($a, $b) { return $n; } - -if (! function_exists('get_temp_dir')) { -/** - * Create function if missing - * @return string - */ - if (ini_get('open_basedir') == false) { - function get_temp_dir () { - $keys = array('TMP', 'TMPDIR', 'TEMP'); - foreach ($keys as $key) { - if (isset($_ENV[$key]) && is_dir($_ENV[$key]) && is_writable($_ENV[$key])) - return realpath($_ENV[$key]); - } - - $tmp = tempnam(false, null); - if (file_exists($tmp)) { - $dir = realpath(dirname($tmp)); - unlink($tmp); - return realpath($dir); - } - - return realpath(dirname(__FILE__)); - } - } - else { - function get_temp_dir () { - if (isset(ini_get('upload_tmp_dir')) && is_dir(ini_get('upload_tmp_dir')) && is_writable(ini_get('upload_tmp_dir'))) - return ini_get('upload_tmp_dir'); - else - return realpath(dirname(__FILE__)); - } - } -} - - /** * Determine if a child URL actually decends from the parent, and that the * parent is a good URL. From 3a937f79f72117be16d905d1fa421d93130a48a3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Oct 2011 22:55:27 +0200 Subject: [PATCH 23/55] escape filenames for getMimeType --- lib/filestorage/local.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/filestorage/local.php b/lib/filestorage/local.php index 8db0ffead4e..58c34e972de 100644 --- a/lib/filestorage/local.php +++ b/lib/filestorage/local.php @@ -140,6 +140,7 @@ class OC_Filestorage_Local extends OC_Filestorage{ } else if (OC_Helper::canExecute("file")) { // it looks like we have a 'file' command, // lets see it it does have mime support + $fspath=str_replace("'","\'",$fspath); $fp = popen("file -i -b '{$this->datadir}$fspath' 2>/dev/null", "r"); $reply = fgets($fp); pclose($fp); From 2906ea3d78d2ff8ebfa3ceebe1c8cb5afa43225a Mon Sep 17 00:00:00 2001 From: Brice Maron Date: Thu, 20 Oct 2011 23:02:38 +0200 Subject: [PATCH 24/55] Add caching for filelist sharing icon status to avoid many http req. --- apps/files_sharing/js/share.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/files_sharing/js/share.js b/apps/files_sharing/js/share.js index aaffc3824ea..c0fc91e92ad 100644 --- a/apps/files_sharing/js/share.js +++ b/apps/files_sharing/js/share.js @@ -1,8 +1,11 @@ $(document).ready(function() { + var shared_status = {}; if (typeof FileActions !== 'undefined') { FileActions.register('all', 'Share', function(filename) { var icon; var file = $('#dir').val()+'/'+filename; + if(shared_status[file]) + return shared_status[file].icon; $.ajax({ type: 'GET', url: OC.linkTo('files_sharing', 'ajax/getitem.php'), @@ -20,6 +23,7 @@ $(document).ready(function() { } else { icon = OC.imagePath('core', 'actions/share'); } + shared_status[file]= { timestamp: new Date().getTime(), icon: icon }; } }); return icon; @@ -54,6 +58,7 @@ $(document).ready(function() { $(this).click(function(event) { if (!($(event.target).hasClass('drop')) && $(event.target).parents().index($('#dropdown')) == -1) { if ($('#dropdown').is(':visible')) { + delete shared_status[$('#dropdown').data('file')]; //Remove File from icon cache $('#dropdown').hide('blind', function() { $('#dropdown').remove(); $('tr').removeClass('mouseOver'); From f0565de900e3abd80557e2912d577a2002809d38 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sun, 16 Oct 2011 23:16:32 +0200 Subject: [PATCH 25/55] use fancybox instead of lightbox Signed-off-by: Florian Pritz --- apps/files_imageviewer/appinfo/app.php | 4 +- .../css/jquery.fancybox-1.3.4.css | 359 ++++++++++++++++++ apps/files_imageviewer/css/lightbox.css | 32 -- apps/files_imageviewer/img/blank.gif | Bin 0 -> 43 bytes apps/files_imageviewer/img/fancy_close.png | Bin 0 -> 1517 bytes apps/files_imageviewer/img/fancy_loading.png | Bin 0 -> 10195 bytes apps/files_imageviewer/img/fancy_nav_left.png | Bin 0 -> 1446 bytes .../files_imageviewer/img/fancy_nav_right.png | Bin 0 -> 1454 bytes apps/files_imageviewer/img/fancy_shadow_e.png | Bin 0 -> 107 bytes apps/files_imageviewer/img/fancy_shadow_n.png | Bin 0 -> 106 bytes .../files_imageviewer/img/fancy_shadow_ne.png | Bin 0 -> 347 bytes .../files_imageviewer/img/fancy_shadow_nw.png | Bin 0 -> 324 bytes apps/files_imageviewer/img/fancy_shadow_s.png | Bin 0 -> 111 bytes .../files_imageviewer/img/fancy_shadow_se.png | Bin 0 -> 352 bytes .../files_imageviewer/img/fancy_shadow_sw.png | Bin 0 -> 340 bytes apps/files_imageviewer/img/fancy_shadow_w.png | Bin 0 -> 103 bytes .../img/fancy_title_left.png | Bin 0 -> 503 bytes .../img/fancy_title_main.png | Bin 0 -> 96 bytes .../img/fancy_title_over.png | Bin 0 -> 70 bytes .../img/fancy_title_right.png | Bin 0 -> 506 bytes apps/files_imageviewer/img/fancybox-x.png | Bin 0 -> 203 bytes apps/files_imageviewer/img/fancybox-y.png | Bin 0 -> 176 bytes apps/files_imageviewer/img/fancybox.png | Bin 0 -> 15287 bytes .../js/jquery.fancybox-1.3.4.pack.js | 46 +++ .../js/jquery.mousewheel-3.0.4.pack.js | 14 + apps/files_imageviewer/js/lightbox.js | 68 +--- apps/gallery/templates/view_album.php | 14 +- 27 files changed, 439 insertions(+), 98 deletions(-) create mode 100644 apps/files_imageviewer/css/jquery.fancybox-1.3.4.css delete mode 100644 apps/files_imageviewer/css/lightbox.css create mode 100644 apps/files_imageviewer/img/blank.gif create mode 100644 apps/files_imageviewer/img/fancy_close.png create mode 100644 apps/files_imageviewer/img/fancy_loading.png create mode 100644 apps/files_imageviewer/img/fancy_nav_left.png create mode 100644 apps/files_imageviewer/img/fancy_nav_right.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_e.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_n.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_ne.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_nw.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_s.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_se.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_sw.png create mode 100644 apps/files_imageviewer/img/fancy_shadow_w.png create mode 100644 apps/files_imageviewer/img/fancy_title_left.png create mode 100644 apps/files_imageviewer/img/fancy_title_main.png create mode 100644 apps/files_imageviewer/img/fancy_title_over.png create mode 100644 apps/files_imageviewer/img/fancy_title_right.png create mode 100644 apps/files_imageviewer/img/fancybox-x.png create mode 100644 apps/files_imageviewer/img/fancybox-y.png create mode 100644 apps/files_imageviewer/img/fancybox.png create mode 100644 apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js create mode 100644 apps/files_imageviewer/js/jquery.mousewheel-3.0.4.pack.js diff --git a/apps/files_imageviewer/appinfo/app.php b/apps/files_imageviewer/appinfo/app.php index 3dfbb76ceb0..0f77076b79b 100644 --- a/apps/files_imageviewer/appinfo/app.php +++ b/apps/files_imageviewer/appinfo/app.php @@ -1,6 +1,8 @@ diff --git a/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css new file mode 100644 index 00000000000..030497750b2 --- /dev/null +++ b/apps/files_imageviewer/css/jquery.fancybox-1.3.4.css @@ -0,0 +1,359 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + width: 40px; + height: 40px; + margin-top: -20px; + margin-left: -20px; + cursor: pointer; + overflow: hidden; + z-index: 1104; + display: none; +} + +#fancybox-loading div { + position: absolute; + top: 0; + left: 0; + width: 40px; + height: 480px; + background-image: url('../img/fancybox/fancybox.png'); +} + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 1100; + display: none; +} + +#fancybox-tmp { + padding: 0; + margin: 0; + border: 0; + overflow: auto; + display: none; +} + +#fancybox-wrap { + position: absolute; + top: 0; + left: 0; + padding: 20px; + z-index: 1101; + outline: none; + display: none; +} + +#fancybox-outer { + position: relative; + width: 100%; + height: 100%; + background: #fff; +} + +#fancybox-content { + width: 0; + height: 0; + padding: 0; + outline: none; + position: relative; + overflow: hidden; + z-index: 1102; + border: 0px solid #fff; +} + +#fancybox-hide-sel-frame { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: transparent; + z-index: 1101; +} + +#fancybox-close { + position: absolute; + top: -15px; + right: -15px; + width: 30px; + height: 30px; + background: transparent url('../img/fancybox.png') -40px 0px; + cursor: pointer; + z-index: 1103; + display: none; +} + +#fancybox-error { + color: #444; + font: normal 12px/20px Arial; + padding: 14px; + margin: 0; +} + +#fancybox-img { + width: 100%; + height: 100%; + padding: 0; + margin: 0; + border: none; + outline: none; + line-height: 0; + vertical-align: top; +} + +#fancybox-frame { + width: 100%; + height: 100%; + border: none; + display: block; +} + +#fancybox-left, #fancybox-right { + position: absolute; + bottom: 0px; + height: 100%; + width: 35%; + cursor: pointer; + outline: none; + background: transparent url('../img/blank.gif'); + z-index: 1102; + display: none; +} + +#fancybox-left { + left: 0px; +} + +#fancybox-right { + right: 0px; +} + +#fancybox-left-ico, #fancybox-right-ico { + position: absolute; + top: 50%; + left: -9999px; + width: 30px; + height: 30px; + margin-top: -15px; + cursor: pointer; + z-index: 1102; + display: block; +} + +#fancybox-left-ico { + background-image: url('../img/fancybox.png'); + background-position: -40px -30px; +} + +#fancybox-right-ico { + background-image: url('../img/fancybox.png'); + background-position: -40px -60px; +} + +#fancybox-left:hover, #fancybox-right:hover { + visibility: visible; /* IE6 */ +} + +#fancybox-left:hover span { + left: 20px; +} + +#fancybox-right:hover span { + left: auto; + right: 20px; +} + +.fancybox-bg { + position: absolute; + padding: 0; + margin: 0; + border: 0; + width: 20px; + height: 20px; + z-index: 1001; +} + +#fancybox-bg-n { + top: -20px; + left: 0; + width: 100%; + background-image: url('../img/fancybox-x.png'); +} + +#fancybox-bg-ne { + top: -20px; + right: -20px; + background-image: url('../img/fancybox.png'); + background-position: -40px -162px; +} + +#fancybox-bg-e { + top: 0; + right: -20px; + height: 100%; + background-image: url('../img/fancybox-y.png'); + background-position: -20px 0px; +} + +#fancybox-bg-se { + bottom: -20px; + right: -20px; + background-image: url('../img/fancybox.png'); + background-position: -40px -182px; +} + +#fancybox-bg-s { + bottom: -20px; + left: 0; + width: 100%; + background-image: url('../img/fancybox-x.png'); + background-position: 0px -20px; +} + +#fancybox-bg-sw { + bottom: -20px; + left: -20px; + background-image: url('../img/fancybox.png'); + background-position: -40px -142px; +} + +#fancybox-bg-w { + top: 0; + left: -20px; + height: 100%; + background-image: url('../img/fancybox-y.png'); +} + +#fancybox-bg-nw { + top: -20px; + left: -20px; + background-image: url('../img/fancybox.png'); + background-position: -40px -122px; +} + +#fancybox-title { + font-family: Helvetica; + font-size: 12px; + z-index: 1102; +} + +.fancybox-title-inside { + padding-bottom: 10px; + text-align: center; + color: #333; + background: #fff; + position: relative; +} + +.fancybox-title-outside { + padding-top: 10px; + color: #fff; +} + +.fancybox-title-over { + position: absolute; + bottom: 0; + left: 0; + color: #FFF; + text-align: left; +} + +#fancybox-title-over { + padding: 10px; + background-image: url('../img/fancybox/fancy_title_over.png'); + display: block; +} + +.fancybox-title-float { + position: absolute; + left: 0; + bottom: -20px; + height: 32px; +} + +#fancybox-title-float-wrap { + border: none; + border-collapse: collapse; + width: auto; +} + +#fancybox-title-float-wrap td { + border: none; + white-space: nowrap; +} + +#fancybox-title-float-left { + padding: 0 0 0 15px; + background: url('../img/fancybox/fancybox.png') -40px -90px no-repeat; +} + +#fancybox-title-float-main { + color: #FFF; + line-height: 29px; + font-weight: bold; + padding: 0 0 3px 0; + background: url('../img/fancybox/fancybox-x.png') 0px -40px; +} + +#fancybox-title-float-right { + padding: 0 0 0 15px; + background: url('../img/fancybox/fancybox.png') -55px -90px no-repeat; +} + +/* IE6 */ + +.fancybox-ie6 #fancybox-close { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_close.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-left-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-right-ico { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_nav_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-title-over { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_over.png', sizingMethod='scale'); zoom: 1; } +.fancybox-ie6 #fancybox-title-float-left { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_left.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-main { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_main.png', sizingMethod='scale'); } +.fancybox-ie6 #fancybox-title-float-right { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_title_right.png', sizingMethod='scale'); } + +.fancybox-ie6 #fancybox-bg-w, .fancybox-ie6 #fancybox-bg-e, .fancybox-ie6 #fancybox-left, .fancybox-ie6 #fancybox-right, #fancybox-hide-sel-frame { + height: expression(this.parentNode.clientHeight + "px"); +} + +#fancybox-loading.fancybox-ie6 { + position: absolute; margin-top: 0; + top: expression( (-20 + (document.documentElement.clientHeight ? document.documentElement.clientHeight/2 : document.body.clientHeight/2 ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop )) + 'px'); +} + +#fancybox-loading.fancybox-ie6 div { background: transparent; filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_loading.png', sizingMethod='scale'); } + +/* IE6, IE7, IE8 */ + +.fancybox-ie .fancybox-bg { background: transparent !important; } + +.fancybox-ie #fancybox-bg-n { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_n.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-ne { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_ne.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-e { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_e.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-se { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_se.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-s { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_s.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-sw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_sw.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-w { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_w.png', sizingMethod='scale'); } +.fancybox-ie #fancybox-bg-nw { filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='fancybox/fancy_shadow_nw.png', sizingMethod='scale'); } diff --git a/apps/files_imageviewer/css/lightbox.css b/apps/files_imageviewer/css/lightbox.css deleted file mode 100644 index d96dd051b1e..00000000000 --- a/apps/files_imageviewer/css/lightbox.css +++ /dev/null @@ -1,32 +0,0 @@ -#lightbox_overlay{ - position:fixed; - display:none; - height:100%; - width:100%; - top:0px; - left:0px; - opacity:0.5; - filter: alpha(opacity = 50); - background-color:black; - z-index:9999; -} - -#lightbox{ - position:fixed; - display:none; - max-height:90%; - max-width:90%; - top:10px; - margin-left:auto; - margin-right:auto; - z-index:9999; -} - -#lightbox_loader{ - text-align:center; - position:fixed; - top: 40%; - left: 50%; - color:white; -} -#lightbox_loader img { margin-right: 1em;} \ No newline at end of file diff --git a/apps/files_imageviewer/img/blank.gif b/apps/files_imageviewer/img/blank.gif new file mode 100644 index 0000000000000000000000000000000000000000..35d42e808f0a8017b8d52a06be2f8fec0b466a66 GIT binary patch literal 43 scmZ?wbhEHbWMp7uXkcLY|NlP&1B2pE7Dgb&paUX6G7L;iE{qJ;0LZEa`2YX_ literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_close.png b/apps/files_imageviewer/img/fancy_close.png new file mode 100644 index 0000000000000000000000000000000000000000..07035307ad435f8f2f8eedf0bce50f7ec8a858c2 GIT binary patch literal 1517 zcmV1To%f)hA(E>uTT$~N#GA0orBqo9-jKM;POccZrXJjTzge4|Sa0ca~7y<+{ z2m7~>41(Jqf9L`mBM6zAjf4;hkjP@@B~d6Xz385|dB5iCM=Ro&JZZmk-uHdZd2i=@ zK0a@Md;u9DFE7t8BO^nxckf<*yC?SckUFGmX^jwM@NV80+eiP zQ*s##s^a3}Ldwd@cHO*r^T5i=%Fj}=Cr_R@78e&C((#usU;YFS>C)2Dw4tG)YO=*P zWt;6ZfL46;=u!R1$jGM-hhvcpVyCa+S}Q!T2ALHx;BHe#M~BsHHos=s2iW})#C?}q ztqvud-gYjKsG$zHm2XhmYPB(Bn>kzw z=gS!w6cG`jJ$?H00VK+=!cMnBDn?IFkCkj7KmNq~hrkZvU@n=EP}|7Gxw*M}1_lPI zNx@_?IS^|%_ok<(o3gXBH^f+@(X7_g)K~%n0$gMM{{Ab=%gZ*hH99)_Eo>!VJd8_C zE)WMoNsBB#u&}W3BMEnPby>y64F-cra9>kX)4DJoA0KZ5fitNn`NTT4wY3%+fA;Lz zZ+K4ucJi+Mg!m%<>Ug8kSg^LX_JD-5va;NEM#+V_H)8UHgaj8UJ?LiZVx92t@KxlB zb1oz#Bo|{kAO!IDVfOII$VfwRad8C+y?XV^;VEu~g@tQka>%(zhlYl1p7P=0!-vj9 zYiMYw3l0uW##jWq+eZ-;6r@4F%{+PXGcz;xx78|Q_F7Eb+}ynGO@4TI*h!27r4#SzfR=K~ zhtpe&%-o-olT$}R&!0cHdm}}wbdd`2lO~)PlarHXnm>2$+(ng2^$EtJ+=vwl#Xg-* zSA%x<9|=lJ3CXuACMEY46&1O~{LGm%7HKm8lhZ|+Pv?nF1LcJswy+L%zshO4HzpR4skij zxq<8a{QPpl!oq4$R(*n7$-q`gsjcF2;NWZ?##l9wBW)lu_Bpk)RJgGO&Ey+2dDr3J z*x2~aJFl#)G^5U)q~qh`_b^ru6q9Xf%arlfse$W(T#z5f?cqE0>k)x`c6QcMUS4jN z#$B996B84z1O(|{7{3S{Bb#j7?T~OCi+pq$fP9eGqJ%Evk~i}B@#8tcAnk_QAg)9f z!qn81MJO5W0n6>}?Q|$y25QL`+uU$0x?KbSI<(UOBavf=wCW!^J3Ie)^yty-8!yk& z($YLG4fjwT{k&5mHL@*_7Xi1c4?x$HT^y5qc2zyPPCG3CUKl!f@Zj&~&!7K?fD>&z zDk^G(=74sN=`q$#Wm{gaK5myi7K~vRQ8s=CoB+NC8j<}iKpXzI(SMmt*2r@wST=`s zW7t-}X4hPqXy3W00000NkvXXu0mjftFGKG literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_loading.png b/apps/files_imageviewer/img/fancy_loading.png new file mode 100644 index 0000000000000000000000000000000000000000..2503017960b3972499d3aa92f89953935ae40934 GIT binary patch literal 10195 zcmZvCRa6{Z)GRK+A-I#l3GNJT8Egn7KyZS)ySwY)GC**5cXtm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h3BqQW$1UJ=iHVKX z!>q&nVn}oCqRUI42H5o?zjm^4 zhTv#NSZ?tF^7J6}Ds4Id@g55ZMz$AERk7!_lo<;SCuZW33@e=0gl8*tD>!a0k^q_ViXjTmlOQizar{@TPjZ$e(u*)b zl&+l8$FXO3_IyDUh_4-QR3im{;hkU zv{vzd6YBp_9?y3`R?m*xel6XQdQ-D~W%obNJ?_u(^o)Wn2nbCAm5RjF3^UlDjNKOR z{-zm);7^zU^uJ~aeK0&5K7A zk!1|bDtR`F7u}LdQL>XuAiOL)$^!>_q!Rx_qE{et)MEwb@S{@W`+Z4Aw2az8N7*;j z28~WHm*L2qk_1^vZ{qCssnc0&vsCg(7oWohyP@9E!SL}lGkp5Mol&OL@SQWG!*9BR z0qAh(zMth9KCDMQT!@!?YhIMqNDF_IM(>}Gi}a7@vu~0@GO=V5?Pk#Sqt{UE%}PuM{~;(=J78A zSrs-=fTfW`08-7aQ5oi{Ll4And$a}6a7%A+l1f{j62K2!xMxo-1)`o$Id8iOER0N* zxIDeb$xtGU)+USD=qHDg(Y`X~J68tf`TqIO_Tn$%1NaeiYTKadL_2eajT1&)NB+^q2@D9b{MUY_>TNQpZi%SO_bqXjyXHB;Ui$Sf9@s+j;Wb z{id0A9C(t~>E@^vPF(@ScmscJxOc7zNXd^Oh>_aW(3u(xR)buk9$q9y|pmKaV!1QFxCztuHO}!PY}!G@y49mJ z0cZk6!rr+O$%3(;B?-}K84!e8{>9v~L;P_$0eQ4}M1oXBfsT{~ZTR)Ko%2eWMnbKn zb5q1ekkgw_RUy#!uXEEL9eB2&?El4NCZmw3r1hMX#a}lk-dBMCPR4OgqRj$-M;-^< hjOQhwL*8E5RB0mfPrR|R-jC_QfTWeADkby-{tw&r+hqU% literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_nav_left.png b/apps/files_imageviewer/img/fancy_nav_left.png new file mode 100644 index 0000000000000000000000000000000000000000..ebaa6a4fd34e51575a01da366312c20618985cbc GIT binary patch literal 1446 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arfE9ks%*_0?uCDGc0&cYN@bK_KngiO{r&oDx0_$@6^x5~= zW5Gx^5k=$2z;)mYpdQiR47B2ZEBzOVMD;v(on_N_Z6xdRarMj=Ped`)=n zv4Dh?$k=SYcJSdjDa(58`F?t%ZzxBbaRs;9zaA#)un(S!5dZ)H07*qoM6N<$g4RXF AD*ylh literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_nav_right.png b/apps/files_imageviewer/img/fancy_nav_right.png new file mode 100644 index 0000000000000000000000000000000000000000..873294e969db9160f5ddd4e1ab498ff60b080e3f GIT binary patch literal 1454 zcmV;f1yTBmP)Wa6`&Z+!IVkxf`V#(j>y7#5eg z5*PD+C=wGBwT+F9xi*_^fd=>X_FBba@wz8b0c3ma+OG#c&LYnSBp_4S(*6BG8m#QpsI))yBSw}|WBy?ft)>pk?VIMu|0u-xC@UxO$< zHa9o-0~vR8bXeVyB61x;@W6T@vgyO$TgWvPslhu zJ>BGvFeN3$D2UT9wO!c-2M2E;RvddB6cm(&J}nRg`1!DUaA;_#J})n?kc`&W*6f~w z$XoI8@o`6>)z;Ql1O^7iqc4Qr?IQ^Y2vDQmrd_^#`AagIo}RXO6Tw=o)=2K&OZ?8A zJDVKcH{^2p2j~ms)bf#Ff5Y^8{ZZ7~8Zw%koV0nHJ||9`FbS!%u(0sL`TfAafI}Du zN;}#qfQDkqhr?T=R;!O@W@c89(aOq-SHe5pO)Do4INRL6f8R{+tE;Q)Wir`E=nLN^ zERjf#VBjT`yZ^}0T`IW~brs!I17PDwDHNtJpz(@u7&_Ci&*x`nXGh4eva-_hHlhTo z>wKX6jrLg})!Ef*2q(qH#unh5y~V~`*!#E25W2>+0$@y%jAkE;d^% z7KiBQ=;#CV)c|?K?OZZNymTtyIv@+;=i$b0QLhID@u{gPOF=<_+1^cd)FbceJt|Pr3Z2#UW)pC9hbbpr%#_w3xu>9DucKZSqKjwKC}oa!!=;B zxw)ARh3h~maWUsB$KtMw06>R!GGHKatdM5?eS3TRA2TyEQ!m{-s9LkQG(13d^zuqc z)WBRWF9N%+J^)=)qIgeo*i|*CI?Xfzc;V-hCr|!<<;s9veooizpgD1ug<#0dV!Z literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_shadow_e.png b/apps/files_imageviewer/img/fancy_shadow_e.png new file mode 100644 index 0000000000000000000000000000000000000000..2eda0893649371f8d92b92976d8542cdd1b601ed GIT binary patch literal 107 zcmeAS@N?(olHy`uVBq!ia0vp^B0$W@!3HGnP3ltxQbwLGjv*Y^lSRZuwe#}JO|p{EaWGAM`~zK|Yh zF7SQ+m+Ig>B0@o-N8?trihfzZ+Vp1~`{zf0o*#X0$hUAi%N$P)W1wCJ22WQ%mvv4F FO#q)zAp-ya literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_shadow_ne.png b/apps/files_imageviewer/img/fancy_shadow_ne.png new file mode 100644 index 0000000000000000000000000000000000000000..79f6980a3ba5c43de120d963dbba2516b8f27ac7 GIT binary patch literal 347 zcmV-h0i^zkP)dR9Yb&V8f!h)aDezHAsc|y@|hdQ zYJb}?8~~zFbQ)ku!Ey)KSukutuvdZ@MKMX|x|A3tPyx?YVhN^6z!Mi4Mj2f#%<;nh z2{>?YAzu|{u^;Oq!;f7Z4tPBpJEmZ+^GZ#$=9nz(K+UmK7}|u&EPi%aRt_C3qOFB_ zHc`~N>51%{?ijG?xsHt>MwRChgk=x_z0gh3O2xSL)-6?+2LKZL74~Q>MZjWtwukkA tvjRC=&j+0R$&bLyT7MhBcTXDISHC&xXU0&5CWHV0002ovPDHLkV1fX+la~Mh literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_shadow_nw.png b/apps/files_imageviewer/img/fancy_shadow_nw.png new file mode 100644 index 0000000000000000000000000000000000000000..7182cd938ae98e7e28c65a0bc55df576042ff9f5 GIT binary patch literal 324 zcmV-K0lWT*P)2-&4CO{qhKP$XKD&mgeXEM77>~`RA}h@U^Z##eQZVtM>a-K?QT4 z&(8BFf(rD5V61)2I__wHYuRwoaDIqw5Vdr_JSDVr){#J@r;{vbDL|tRyCiirf~4OF zX-l=Ecm>@yR)1nSMt~dy90Zb`^`)TQbhf8jR@fA!l6V$musRyB9Y{p$SCW}!$3==V zk)fW)Xo{s^ez$t+XhmZj;ts)!kTokvmM>z)zt70000 literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_shadow_se.png b/apps/files_imageviewer/img/fancy_shadow_se.png new file mode 100644 index 0000000000000000000000000000000000000000..541e3ffd3e88224b34a4d2097c66a780e6060aeb GIT binary patch literal 352 zcmV-m0iXVfP){pM9=`y8<_IvWD02WY@RZ<9dgjNmAB|sYF}Xw>7Sq@O0000eMf9z;FC21=)67q_`W0*0KnS4AR00W2`RGn3i8UfsEegLO@ zPhds?2e1Tm)FK3=bymIAx?X=YFo3Mdh7W?@I#8s#svp!&PB> zwah@Ngd|l0N4SCfzvjtQnd$dZ0yM)N$X+lqdtN!Pt{Wn*_`0U}m1^#r1 mwpaW{;a?9KKt^WrpTAEd?0j1W(3L*`0000P{ho=rRL|66mGO)=r*Hk83F#~lnc)I$ztaD0e0sy?& B8X5oq literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_title_left.png b/apps/files_imageviewer/img/fancy_title_left.png new file mode 100644 index 0000000000000000000000000000000000000000..6049223d1ec6af46e100499c01f6489c9e2c6240 GIT binary patch literal 503 zcmV+)0005LNklqcp9&~$uJw{{rUub~E?-XJ#Upm4Fe%-Gl z!u%tb0N102a|s5;SPlQvJlFCTBbvYaK@wIW6Gjx@?i20AlVDJcHNfh25WRlbF6CIq zv9_ZnqOH`}ppaUR0@%ZcM9zpDt2uQM>f+Z#wIMmyuui3DeoYXWE|hQ{D$te=Yhgkq zIvyj+$t8T|S1wITzUftNOe(E+Qjn$kDotY;I5}1lRgwi=?K26ke)djLR5W2|!7CVH zJ-`tuAq|`lK978y+CnqGNCkUke_%Gig ukvFM-ftpWh!il7Wg7kz7Y?7xB@G*olNlgoj4E_Yv!rmdKI;Vst0Ha3^zyJUM literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancy_title_right.png b/apps/files_imageviewer/img/fancy_title_right.png new file mode 100644 index 0000000000000000000000000000000000000000..e36d9db2a7c6e570aec993d3665cbc13620115e2 GIT binary patch literal 506 zcmV+)0005ONklxjQB-g>5=x46nGBwseihc$zfzvTFh(=tCRj6cJ4M&ASrCAq-HbokPnRBAHVa2(-|l wYU(UxfYLN;KDSr z1<%~X^wgl##FWaylc_d9MY*0Xjv*Ddw)7kFH5l+P-xcE$W)3=fYI&uMKVzWNT*W|n zhqlRY)q0r(8Mg&Fu_zpISivgz+b7g)c6G&O{~njE??Y{u-MM!p^=9_W+X-j8mhfK? zj`H2Yy;kp%)!V-M3;EVThyB(Z@o88wpMja-vy^g)SgE!<&|(HpS3j3^P6|6H_V+Po~-c6$N>^IEGZ*^681?Yf#{6Zf~e!I`r4y-J+3m*Ue*gH=cNZ zzpU%p61aCO%jt%FHUKW&bEWLcUAGzK?;SYE)E{9#W9O8@uj{O@89qzNU(dkI YVCW(7-@(*!CeU;SPgg&ebxsLQ07`N|KL7v# literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/img/fancybox.png b/apps/files_imageviewer/img/fancybox.png new file mode 100644 index 0000000000000000000000000000000000000000..65e14f68fd83b87f75c22c0c074e7b20bf20a133 GIT binary patch literal 15287 zcmaKTWn3G5&@B{~;%>#=DG;={yF10TIJA^Ni@Q6dxD|J62@u>uaf*A8(n3=TLErSb z_x;^(_f!7a-E4NVIcLtyoQc=dQGJd}gNuTK@?2d_$pHDPf`Wp&gN=z?QPI&3p`b{G zsVm7Fy<0o~g!9hI>FTLkeXUCSdR`&CQ|`OGxubq*0?(JYNfXC5{*R2zWF6(Xx-T>T2>J&K|Eil&n6Lix zEi`275C{!+X!)7CS*e}=H>=RA%jh4XH)T6XDeap>QZ zuCvB3f1j3`!i;@?^<5L}xzP0QOB^9?Eo@W0)j~`y+S=c{by#*Uoo$DiKIL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F8H#!%uK!9%Sr-IZP?*+33*8(p3BHHv%9#C06jvGqkfob46X?zh8#~j zPJ7k1&cfrel5#z{5%T=s%-E-Z#5|L?qmmUG0d=2Ak^=?b&vnK`{Xu_3_vk^E?4$xx z*;D$%(M|j94SX0STo#sIR+rpJ*tY&@s71E=mkubfnYXRVwX8VB+&7aaX zDkYYB08*`-r~k?r|BEg|>3>NVQXVe+TgCDnY4`*WEFO2#&}dCIr(efKj#%hFlb5GZw{&Grpn$HOUs!iagffg< zUOr3@Dmwyx;;e{LUpr{gNl~)W zX@2n$J5io08JiWmLC#GBrIG(1`lzs(%$$xv4*B5(677_}0DvK1{DsG-&*K_EoMlrU z1r9}lAnTooE-E#wQ+?v#McpTvQxiAkk)126n3!C*p}Ki}-pxM`r2ez?TgTl*eVEkx*hsQ4AG1Scb@M1?Bo z64>{l#I7SqZM5$0m$gw!#s{=|bGn1d3YpvS_JPXsv{T^2Xvc)HkNba5@(>xrwNvD3 zSJGWRM!%K`GJiBn_W_SS%OI7~BQ#W!$zg(OccJ37cp#jKUfwUV>yVMqNf$*9P>0_X zQ3XzOz@}VP-r7gmFGi5ST<-NsaScbte+`6jy-v##`Q86b z6jG|SjsPcT{TA5e7iAKdP`-O5snH$Fp#~DWi2dP+tDEgGywPnPkgPeJ+9QTdTzE{X z88~L0W4K4`f9Q5Q<}Oh(JfaAvN+0-dgE;%?(P*qXNwpB_)-Zzm*mP zcex|GZO8(LWj!(h`(I@JpSU%%%+bka+4p#^=Li0xSy-m?t6ws8mE^qtzmeB(XQ@wU ZMt7F5hocMxav&E)U0Fw|QQ>vO{{ZOG+C=~W literal 0 HcmV?d00001 diff --git a/apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js b/apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js new file mode 100644 index 00000000000..1373ed0838b --- /dev/null +++ b/apps/files_imageviewer/js/jquery.fancybox-1.3.4.pack.js @@ -0,0 +1,46 @@ +/* + * FancyBox - jQuery Plugin + * Simple and fancy lightbox alternative + * + * Examples and documentation at: http://fancybox.net + * + * Copyright (c) 2008 - 2010 Janis Skarnelis + * That said, it is hardly a one-person project. Many people have submitted bugs, code, and offered their advice freely. Their support is greatly appreciated. + * + * Version: 1.3.4 (11/11/2010) + * Requires: jQuery v1.3+ + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + +;(function(b){var m,t,u,f,D,j,E,n,z,A,q=0,e={},o=[],p=0,d={},l=[],G=null,v=new Image,J=/\.(jpg|gif|png|bmp|jpeg)(.*)?$/i,W=/[^\.]\.(swf)\s*$/i,K,L=1,y=0,s="",r,i,h=false,B=b.extend(b("
")[0],{prop:0}),M=b.browser.msie&&b.browser.version<7&&!window.XMLHttpRequest,N=function(){t.hide();v.onerror=v.onload=null;G&&G.abort();m.empty()},O=function(){if(false===e.onError(o,q,e)){t.hide();h=false}else{e.titleShow=false;e.width="auto";e.height="auto";m.html('

The requested content cannot be loaded.
Please try again later.

'); +F()}},I=function(){var a=o[q],c,g,k,C,P,w;N();e=b.extend({},b.fn.fancybox.defaults,typeof b(a).data("fancybox")=="undefined"?e:b(a).data("fancybox"));w=e.onStart(o,q,e);if(w===false)h=false;else{if(typeof w=="object")e=b.extend(e,w);k=e.title||(a.nodeName?b(a).attr("title"):a.title)||"";if(a.nodeName&&!e.orig)e.orig=b(a).children("img:first").length?b(a).children("img:first"):b(a);if(k===""&&e.orig&&e.titleFromAlt)k=e.orig.attr("alt");c=e.href||(a.nodeName?b(a).attr("href"):a.href)||null;if(/^(?:javascript)/i.test(c)|| +c=="#")c=null;if(e.type){g=e.type;if(!c)c=e.content}else if(e.content)g="html";else if(c)g=c.match(J)?"image":c.match(W)?"swf":b(a).hasClass("iframe")?"iframe":c.indexOf("#")===0?"inline":"ajax";if(g){if(g=="inline"){a=c.substr(c.indexOf("#"));g=b(a).length>0?"inline":"ajax"}e.type=g;e.href=c;e.title=k;if(e.autoDimensions)if(e.type=="html"||e.type=="inline"||e.type=="ajax"){e.width="auto";e.height="auto"}else e.autoDimensions=false;if(e.modal){e.overlayShow=true;e.hideOnOverlayClick=false;e.hideOnContentClick= +false;e.enableEscapeButton=false;e.showCloseButton=false}e.padding=parseInt(e.padding,10);e.margin=parseInt(e.margin,10);m.css("padding",e.padding+e.margin);b(".fancybox-inline-tmp").unbind("fancybox-cancel").bind("fancybox-change",function(){b(this).replaceWith(j.children())});switch(g){case "html":m.html(e.content);F();break;case "inline":if(b(a).parent().is("#fancybox-content")===true){h=false;break}b('
').hide().insertBefore(b(a)).bind("fancybox-cleanup",function(){b(this).replaceWith(j.children())}).bind("fancybox-cancel", +function(){b(this).replaceWith(m.children())});b(a).appendTo(m);F();break;case "image":h=false;b.fancybox.showActivity();v=new Image;v.onerror=function(){O()};v.onload=function(){h=true;v.onerror=v.onload=null;e.width=v.width;e.height=v.height;b("").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);Q()};v.src=c;break;case "swf":e.scrolling="no";C='';P="";b.each(e.swf,function(x,H){C+='';P+=" "+x+'="'+H+'"'});C+='";m.html(C);F();break;case "ajax":h=false;b.fancybox.showActivity();e.ajax.win=e.ajax.success;G=b.ajax(b.extend({},e.ajax,{url:c,data:e.ajax.data||{},error:function(x){x.status>0&&O()},success:function(x,H,R){if((typeof R=="object"?R:G).status==200){if(typeof e.ajax.win== +"function"){w=e.ajax.win(c,x,H,R);if(w===false){t.hide();return}else if(typeof w=="string"||typeof w=="object")x=w}m.html(x);F()}}}));break;case "iframe":Q()}}else O()}},F=function(){var a=e.width,c=e.height;a=a.toString().indexOf("%")>-1?parseInt((b(window).width()-e.margin*2)*parseFloat(a)/100,10)+"px":a=="auto"?"auto":a+"px";c=c.toString().indexOf("%")>-1?parseInt((b(window).height()-e.margin*2)*parseFloat(c)/100,10)+"px":c=="auto"?"auto":c+"px";m.wrapInner('
');e.width=m.width();e.height=m.height();Q()},Q=function(){var a,c;t.hide();if(f.is(":visible")&&false===d.onCleanup(l,p,d)){b.event.trigger("fancybox-cancel");h=false}else{h=true;b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");f.is(":visible")&&d.titlePosition!=="outside"&&f.css("height",f.height());l=o;p=q;d=e;if(d.overlayShow){u.css({"background-color":d.overlayColor, +opacity:d.overlayOpacity,cursor:d.hideOnOverlayClick?"pointer":"auto",height:b(document).height()});if(!u.is(":visible")){M&&b("select:not(#fancybox-tmp select)").filter(function(){return this.style.visibility!=="hidden"}).css({visibility:"hidden"}).one("fancybox-cleanup",function(){this.style.visibility="inherit"});u.show()}}else u.hide();i=X();s=d.title||"";y=0;n.empty().removeAttr("style").removeClass();if(d.titleShow!==false){if(b.isFunction(d.titleFormat))a=d.titleFormat(s,l,p,d);else a=s&&s.length? +d.titlePosition=="float"?'
'+s+'
':'
'+s+"
":false;s=a;if(!(!s||s==="")){n.addClass("fancybox-title-"+d.titlePosition).html(s).appendTo("body").show();switch(d.titlePosition){case "inside":n.css({width:i.width-d.padding*2,marginLeft:d.padding,marginRight:d.padding}); +y=n.outerHeight(true);n.appendTo(D);i.height+=y;break;case "over":n.css({marginLeft:d.padding,width:i.width-d.padding*2,bottom:d.padding}).appendTo(D);break;case "float":n.css("left",parseInt((n.width()-i.width-40)/2,10)*-1).appendTo(f);break;default:n.css({width:i.width-d.padding*2,paddingLeft:d.padding,paddingRight:d.padding}).appendTo(f)}}}n.hide();if(f.is(":visible")){b(E.add(z).add(A)).hide();a=f.position();r={top:a.top,left:a.left,width:f.width(),height:f.height()};c=r.width==i.width&&r.height== +i.height;j.fadeTo(d.changeFade,0.3,function(){var g=function(){j.html(m.contents()).fadeTo(d.changeFade,1,S)};b.event.trigger("fancybox-change");j.empty().removeAttr("filter").css({"border-width":d.padding,width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2});if(c)g();else{B.prop=0;b(B).animate({prop:1},{duration:d.changeSpeed,easing:d.easingChange,step:T,complete:g})}})}else{f.removeAttr("style");j.css("border-width",d.padding);if(d.transitionIn=="elastic"){r=V();j.html(m.contents()); +f.show();if(d.opacity)i.opacity=0;B.prop=0;b(B).animate({prop:1},{duration:d.speedIn,easing:d.easingIn,step:T,complete:S})}else{d.titlePosition=="inside"&&y>0&&n.show();j.css({width:i.width-d.padding*2,height:e.autoDimensions?"auto":i.height-y-d.padding*2}).html(m.contents());f.css(i).fadeIn(d.transitionIn=="none"?0:d.speedIn,S)}}}},Y=function(){if(d.enableEscapeButton||d.enableKeyboardNav)b(document).bind("keydown.fb",function(a){if(a.keyCode==27&&d.enableEscapeButton){a.preventDefault();b.fancybox.close()}else if((a.keyCode== +37||a.keyCode==39)&&d.enableKeyboardNav&&a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.target.tagName!=="SELECT"){a.preventDefault();b.fancybox[a.keyCode==37?"prev":"next"]()}});if(d.showNavArrows){if(d.cyclic&&l.length>1||p!==0)z.show();if(d.cyclic&&l.length>1||p!=l.length-1)A.show()}else{z.hide();A.hide()}},S=function(){if(!b.support.opacity){j.get(0).style.removeAttribute("filter");f.get(0).style.removeAttribute("filter")}e.autoDimensions&&j.css("height","auto");f.css("height","auto"); +s&&s.length&&n.show();d.showCloseButton&&E.show();Y();d.hideOnContentClick&&j.bind("click",b.fancybox.close);d.hideOnOverlayClick&&u.bind("click",b.fancybox.close);b(window).bind("resize.fb",b.fancybox.resize);d.centerOnScroll&&b(window).bind("scroll.fb",b.fancybox.center);if(d.type=="iframe")b('').appendTo(j); +f.show();h=false;b.fancybox.center();d.onComplete(l,p,d);var a,c;if(l.length-1>p){a=l[p+1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}if(p>0){a=l[p-1].href;if(typeof a!=="undefined"&&a.match(J)){c=new Image;c.src=a}}},T=function(a){var c={width:parseInt(r.width+(i.width-r.width)*a,10),height:parseInt(r.height+(i.height-r.height)*a,10),top:parseInt(r.top+(i.top-r.top)*a,10),left:parseInt(r.left+(i.left-r.left)*a,10)};if(typeof i.opacity!=="undefined")c.opacity=a<0.5?0.5:a;f.css(c); +j.css({width:c.width-d.padding*2,height:c.height-y*a-d.padding*2})},U=function(){return[b(window).width()-d.margin*2,b(window).height()-d.margin*2,b(document).scrollLeft()+d.margin,b(document).scrollTop()+d.margin]},X=function(){var a=U(),c={},g=d.autoScale,k=d.padding*2;c.width=d.width.toString().indexOf("%")>-1?parseInt(a[0]*parseFloat(d.width)/100,10):d.width+k;c.height=d.height.toString().indexOf("%")>-1?parseInt(a[1]*parseFloat(d.height)/100,10):d.height+k;if(g&&(c.width>a[0]||c.height>a[1]))if(e.type== +"image"||e.type=="swf"){g=d.width/d.height;if(c.width>a[0]){c.width=a[0];c.height=parseInt((c.width-k)/g+k,10)}if(c.height>a[1]){c.height=a[1];c.width=parseInt((c.height-k)*g+k,10)}}else{c.width=Math.min(c.width,a[0]);c.height=Math.min(c.height,a[1])}c.top=parseInt(Math.max(a[3]-20,a[3]+(a[1]-c.height-40)*0.5),10);c.left=parseInt(Math.max(a[2]-20,a[2]+(a[0]-c.width-40)*0.5),10);return c},V=function(){var a=e.orig?b(e.orig):false,c={};if(a&&a.length){c=a.offset();c.top+=parseInt(a.css("paddingTop"), +10)||0;c.left+=parseInt(a.css("paddingLeft"),10)||0;c.top+=parseInt(a.css("border-top-width"),10)||0;c.left+=parseInt(a.css("border-left-width"),10)||0;c.width=a.width();c.height=a.height();c={width:c.width+d.padding*2,height:c.height+d.padding*2,top:c.top-d.padding-20,left:c.left-d.padding-20}}else{a=U();c={width:d.padding*2,height:d.padding*2,top:parseInt(a[3]+a[1]*0.5,10),left:parseInt(a[2]+a[0]*0.5,10)}}return c},Z=function(){if(t.is(":visible")){b("div",t).css("top",L*-40+"px");L=(L+1)%12}else clearInterval(K)}; +b.fn.fancybox=function(a){if(!b(this).length)return this;b(this).data("fancybox",b.extend({},a,b.metadata?b(this).metadata():{})).unbind("click.fb").bind("click.fb",function(c){c.preventDefault();if(!h){h=true;b(this).blur();o=[];q=0;c=b(this).attr("rel")||"";if(!c||c==""||c==="nofollow")o.push(this);else{o=b("a[rel="+c+"], area[rel="+c+"]");q=o.index(this)}I()}});return this};b.fancybox=function(a,c){var g;if(!h){h=true;g=typeof c!=="undefined"?c:{};o=[];q=parseInt(g.index,10)||0;if(b.isArray(a)){for(var k= +0,C=a.length;ko.length||q<0)q=0;I()}};b.fancybox.showActivity=function(){clearInterval(K);t.show();K=setInterval(Z,66)};b.fancybox.hideActivity=function(){t.hide()};b.fancybox.next=function(){return b.fancybox.pos(p+ +1)};b.fancybox.prev=function(){return b.fancybox.pos(p-1)};b.fancybox.pos=function(a){if(!h){a=parseInt(a);o=l;if(a>-1&&a1){q=a>=l.length?0:l.length-1;I()}}};b.fancybox.cancel=function(){if(!h){h=true;b.event.trigger("fancybox-cancel");N();e.onCancel(o,q,e);h=false}};b.fancybox.close=function(){function a(){u.fadeOut("fast");n.empty().hide();f.hide();b.event.trigger("fancybox-cleanup");j.empty();d.onClosed(l,p,d);l=e=[];p=q=0;d=e={};h=false}if(!(h||f.is(":hidden"))){h= +true;if(d&&false===d.onCleanup(l,p,d))h=false;else{N();b(E.add(z).add(A)).hide();b(j.add(u)).unbind();b(window).unbind("resize.fb scroll.fb");b(document).unbind("keydown.fb");j.find("iframe").attr("src",M&&/^https/i.test(window.location.href||"")?"javascript:void(false)":"about:blank");d.titlePosition!=="inside"&&n.empty();f.stop();if(d.transitionOut=="elastic"){r=V();var c=f.position();i={top:c.top,left:c.left,width:f.width(),height:f.height()};if(d.opacity)i.opacity=1;n.empty().hide();B.prop=1; +b(B).animate({prop:0},{duration:d.speedOut,easing:d.easingOut,step:T,complete:a})}else f.fadeOut(d.transitionOut=="none"?0:d.speedOut,a)}}};b.fancybox.resize=function(){u.is(":visible")&&u.css("height",b(document).height());b.fancybox.center(true)};b.fancybox.center=function(a){var c,g;if(!h){g=a===true?1:0;c=U();!g&&(f.width()>c[0]||f.height()>c[1])||f.stop().animate({top:parseInt(Math.max(c[3]-20,c[3]+(c[1]-j.height()-40)*0.5-d.padding)),left:parseInt(Math.max(c[2]-20,c[2]+(c[0]-j.width()-40)*0.5- +d.padding))},typeof a=="number"?a:200)}};b.fancybox.init=function(){if(!b("#fancybox-wrap").length){b("body").append(m=b('
'),t=b('
'),u=b('
'),f=b('
'));D=b('
').append('
').appendTo(f); +D.append(j=b('
'),E=b(''),n=b('
'),z=b(''),A=b(''));E.click(b.fancybox.close);t.click(b.fancybox.cancel);z.click(function(a){a.preventDefault();b.fancybox.prev()});A.click(function(a){a.preventDefault();b.fancybox.next()}); +b.fn.mousewheel&&f.bind("mousewheel.fb",function(a,c){if(h)a.preventDefault();else if(b(a.target).get(0).clientHeight==0||b(a.target).get(0).scrollHeight===b(a.target).get(0).clientHeight){a.preventDefault();b.fancybox[c>0?"prev":"next"]()}});b.support.opacity||f.addClass("fancybox-ie");if(M){t.addClass("fancybox-ie6");f.addClass("fancybox-ie6");b('').prependTo(D)}}}; +b.fn.fancybox.defaults={padding:10,margin:40,opacity:false,modal:false,cyclic:false,scrolling:"auto",width:560,height:340,autoScale:true,autoDimensions:true,centerOnScroll:false,ajax:{},swf:{wmode:"transparent"},hideOnOverlayClick:true,hideOnContentClick:false,overlayShow:true,overlayOpacity:0.7,overlayColor:"#777",titleShow:true,titlePosition:"float",titleFormat:null,titleFromAlt:false,transitionIn:"fade",transitionOut:"fade",speedIn:300,speedOut:300,changeSpeed:300,changeFade:"fast",easingIn:"swing", +easingOut:"swing",showCloseButton:true,showNavArrows:true,enableEscapeButton:true,enableKeyboardNav:true,onStart:function(){},onCancel:function(){},onComplete:function(){},onCleanup:function(){},onClosed:function(){},onError:function(){}};b(document).ready(function(){b.fancybox.init()})})(jQuery); \ No newline at end of file diff --git a/apps/files_imageviewer/js/jquery.mousewheel-3.0.4.pack.js b/apps/files_imageviewer/js/jquery.mousewheel-3.0.4.pack.js new file mode 100644 index 00000000000..cb66588e29c --- /dev/null +++ b/apps/files_imageviewer/js/jquery.mousewheel-3.0.4.pack.js @@ -0,0 +1,14 @@ +/*! Copyright (c) 2010 Brandon Aaron (http://brandonaaron.net) +* Licensed under the MIT License (LICENSE.txt). +* +* Thanks to: http://adomas.org/javascript-mouse-wheel/ for some pointers. +* Thanks to: Mathias Bank(http://www.mathias-bank.de) for a scope bug fix. +* Thanks to: Seamus Leahy for adding deltaX and deltaY +* +* Version: 3.0.4 +* +* Requires: 1.2.2+ +*/ + +(function(d){function g(a){var b=a||window.event,i=[].slice.call(arguments,1),c=0,h=0,e=0;a=d.event.fix(b);a.type="mousewheel";if(a.wheelDelta)c=a.wheelDelta/120;if(a.detail)c=-a.detail/3;e=c;if(b.axis!==undefined&&b.axis===b.HORIZONTAL_AXIS){e=0;h=-1*c}if(b.wheelDeltaY!==undefined)e=b.wheelDeltaY/120;if(b.wheelDeltaX!==undefined)h=-1*b.wheelDeltaX/120;i.unshift(a,c,h,e);return d.event.handle.apply(this,i)}var f=["DOMMouseScroll","mousewheel"];d.event.special.mousewheel={setup:function(){if(this.addEventListener)for(var a= +f.length;a;)this.addEventListener(f[--a],g,false);else this.onmousewheel=g},teardown:function(){if(this.removeEventListener)for(var a=f.length;a;)this.removeEventListener(f[--a],g,false);else this.onmousewheel=null}};d.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})})(jQuery); \ No newline at end of file diff --git a/apps/files_imageviewer/js/lightbox.js b/apps/files_imageviewer/js/lightbox.js index 4f079b6d8af..94743aa85e0 100644 --- a/apps/files_imageviewer/js/lightbox.js +++ b/apps/files_imageviewer/js/lightbox.js @@ -1,18 +1,4 @@ - -var lightBoxShown=false; $(document).ready(function() { - images={};//image cache - loading_str = t('files_imageviewer','Loading'); - var overlay=$(''); - overlay.find('#lightbox_loader img') - .attr('src',OC.imagePath('core', 'loading-dark.gif')) - .attr('alt',loading_str) - .after(loading_str); - $( 'body' ).append(overlay); - var container=$('