From 4a4e6eb0712bc2f7f188325d2ac87b8aa4927cd8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 8 Oct 2011 19:42:09 +0200 Subject: [PATCH 01/20] apps/bookmarks: follow redirects when fetching title This solves a problem where hitting a redirect page would lead to a "302 Found" title. Signed-off-by: Florian Pritz --- apps/bookmarks/bookmarksHelper.php | 49 +++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php index f66d98a8cc..b445154f52 100644 --- a/apps/bookmarks/bookmarksHelper.php +++ b/apps/bookmarks/bookmarksHelper.php @@ -1,5 +1,52 @@ 0); + curl_setopt($ch, CURLOPT_MAXREDIRS, $mr); + } else { + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); + if ($mr > 0) { + $newurl = curl_getinfo($ch, CURLINFO_EFFECTIVE_URL); + + $rch = curl_copy_handle($ch); + curl_setopt($rch, CURLOPT_HEADER, true); + curl_setopt($rch, CURLOPT_NOBODY, true); + curl_setopt($rch, CURLOPT_FORBID_REUSE, false); + curl_setopt($rch, CURLOPT_RETURNTRANSFER, true); + do { + curl_setopt($rch, CURLOPT_URL, $newurl); + $header = curl_exec($rch); + if (curl_errno($rch)) { + $code = 0; + } else { + $code = curl_getinfo($rch, CURLINFO_HTTP_CODE); + if ($code == 301 || $code == 302) { + preg_match('/Location:(.*?)\n/', $header, $matches); + $newurl = trim(array_pop($matches)); + } else { + $code = 0; + } + } + } while ($code && --$mr); + curl_close($rch); + if (!$mr) { + if ($maxredirect === null) { + trigger_error('Too many redirects. When following redirects, libcurl hit the maximum amount.', E_USER_WARNING); + } else { + $maxredirect = 0; + } + return false; + } + curl_setopt($ch, CURLOPT_URL, $newurl); + } + } + return curl_exec($ch); +} + function getURLMetadata($url) { //allow only http(s) and (s)ftp $protocols = '/^[hs]{0,1}[tf]{0,1}tp[s]{0,1}\:\/\//i'; @@ -12,7 +59,7 @@ function getURLMetadata($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); - $page = curl_exec($ch); + $page = curl_exec_follow($ch); curl_close($ch); @preg_match( "/(.*)<\/title>/si", $page, $match ); From 19d4e6e1d56e9e2c0476ff178083b4c35a9fb6d1 Mon Sep 17 00:00:00 2001 From: Florian Pritz <bluewind@xinu.at> Date: Sat, 8 Oct 2011 21:06:39 +0200 Subject: [PATCH 02/20] apps/bookmarks: remove unused variable This is not needed anymore since commit 6b64aa3faf1e94a2fc2a1e98b35418d35b73ab22. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- apps/bookmarks/bookmarksHelper.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php index b445154f52..44d4235b9b 100644 --- a/apps/bookmarks/bookmarksHelper.php +++ b/apps/bookmarks/bookmarksHelper.php @@ -65,7 +65,5 @@ function getURLMetadata($url) { @preg_match( "/<title>(.*)<\/title>/si", $page, $match ); $metadata['title'] = htmlspecialchars_decode(@$match[1]); - $meta = get_meta_tags($url); - return $metadata; } \ No newline at end of file From 88aa40e6ace17b105aa9355e0e389377775ea3e4 Mon Sep 17 00:00:00 2001 From: Bart Visscher <bartv@thisnet.nl> Date: Sat, 8 Oct 2011 00:00:49 +0200 Subject: [PATCH 03/20] Show add contact form on opening contacts page --- apps/contacts/js/interface.js | 7 ------- apps/contacts/templates/index.php | 2 +- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/apps/contacts/js/interface.js b/apps/contacts/js/interface.js index 0fcfdeaab5..2f4a736f55 100644 --- a/apps/contacts/js/interface.js +++ b/apps/contacts/js/interface.js @@ -1,11 +1,4 @@ $(document).ready(function(){ - /*------------------------------------------------------------------------- - * Actions for startup - *-----------------------------------------------------------------------*/ - if( $('#leftcontent li').length > 0 ){ - $('#leftcontent li').first().addClass('active'); - } - /*------------------------------------------------------------------------- * Event handlers *-----------------------------------------------------------------------*/ diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 6d67584b29..98ebc1b0b3 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -14,5 +14,5 @@ OC_Util::addStyle('contacts','styles'); </ul> </div> <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>"> - <?php echo $this->inc("part.details"); ?> + <?php echo $this->inc("part.addcardform"); ?> </div> From 203f7a3a870964310060d82bdd61d14eb1613791 Mon Sep 17 00:00:00 2001 From: Bart Visscher <bartv@thisnet.nl> Date: Sat, 8 Oct 2011 00:13:39 +0200 Subject: [PATCH 04/20] Move contact delete button to top right corner --- apps/contacts/css/styles.css | 1 + apps/contacts/templates/part.details.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/contacts/css/styles.css b/apps/contacts/css/styles.css index 1f95fdb2ad..c1abd0efb6 100644 --- a/apps/contacts/css/styles.css +++ b/apps/contacts/css/styles.css @@ -1,2 +1,3 @@ .contacts_details_left {text-align:right;vertical-align:top;padding:2px;} .contacts_details_right {text-align:left;vertical-align:top;padding:2px;} +#contacts_deletecard {position:absolute;top:15px;right:0;} diff --git a/apps/contacts/templates/part.details.php b/apps/contacts/templates/part.details.php index 26a33739ac..438f84d45d 100644 --- a/apps/contacts/templates/part.details.php +++ b/apps/contacts/templates/part.details.php @@ -28,7 +28,7 @@ <?php endforeach; ?> </table> <form> - <input type="button" id="contacts_deletecard" value="<?php echo $l->t('Delete');?>"> + <img class="svg action" id="contacts_deletecard" src="<?php echo image_path('', 'actions/delete.svg'); ?>" title="<?php echo $l->t('Delete contact');?>" /> <input type="button" id="contacts_addproperty" value="<?php echo $l->t('Add Property');?>"> </form> <?php endif; ?> From f4fb6356cd5d9143f59ad41425d74fb35bbe68fd Mon Sep 17 00:00:00 2001 From: "Michiel@unhosted" <michiel@unhosted.org> Date: Sun, 9 Oct 2011 17:12:16 +0200 Subject: [PATCH 05/20] use install.php properly --- apps/remoteStorage/compat.php | 2 +- apps/user_webfinger/activate.php | 11 ----------- apps/user_webfinger/appinfo/install.php | 5 +++++ 3 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 apps/user_webfinger/activate.php create mode 100644 apps/user_webfinger/appinfo/install.php diff --git a/apps/remoteStorage/compat.php b/apps/remoteStorage/compat.php index d383e87951..35a133c43c 100644 --- a/apps/remoteStorage/compat.php +++ b/apps/remoteStorage/compat.php @@ -44,7 +44,7 @@ if(isset($_SERVER['HTTP_ORIGIN'])) { header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); header('Access-Control-Max-Age: 3600'); header('Access-Control-Allow-Methods: OPTIONS, GET, PUT, DELETE, PROPFIND'); - header('Access-Control-Allow-Headers: Authorization'); + header('Access-Control-Allow-Headers: Authorization, Content-Type'); } else { header('Access-Control-Allow-Origin: *'); } diff --git a/apps/user_webfinger/activate.php b/apps/user_webfinger/activate.php deleted file mode 100644 index 50257232ae..0000000000 --- a/apps/user_webfinger/activate.php +++ /dev/null @@ -1,11 +0,0 @@ -<?php -$ownCloudBaseUri = substr($_SERVER['REQUEST_URI'],0, -(strlen('/apps/user_webfinger/activate.php'))); -$thisAppDir = __DIR__; -$appsDir = dirname($thisAppDir); -$ownCloudDir = dirname($appsDir); -try{ - symlink($thisAppDir, $ownCloudDir.'/.well-known'); - echo "Webfinger should now work.\n"; -} catch(Exception $e) { - echo "Please create a file called '.well-known in the ownCloud root, give the web server user permission to change it, and retry.\n"; -} diff --git a/apps/user_webfinger/appinfo/install.php b/apps/user_webfinger/appinfo/install.php new file mode 100644 index 0000000000..d23ba53539 --- /dev/null +++ b/apps/user_webfinger/appinfo/install.php @@ -0,0 +1,5 @@ +<?php +$thisAppDir = __DIR__; +$appsDir = dirname($thisAppDir); +$ownCloudDir = dirname($appsDir); +symlink($thisAppDir, $ownCloudDir.'/.well-known'); From e2468c4343c9b0939916bb20acae57aba1e62f95 Mon Sep 17 00:00:00 2001 From: "Michiel@unhosted" <michiel@unhosted.org> Date: Sun, 9 Oct 2011 17:24:18 +0200 Subject: [PATCH 06/20] fix webfinger install script --- apps/user_webfinger/appinfo/install.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/user_webfinger/appinfo/install.php b/apps/user_webfinger/appinfo/install.php index d23ba53539..079043cd10 100644 --- a/apps/user_webfinger/appinfo/install.php +++ b/apps/user_webfinger/appinfo/install.php @@ -1,5 +1,6 @@ <?php -$thisAppDir = __DIR__; +$appInfoDir = __DIR__; +$thisAppDir = dirname($appInfoDir); $appsDir = dirname($thisAppDir); $ownCloudDir = dirname($appsDir); symlink($thisAppDir, $ownCloudDir.'/.well-known'); From e710bcb6d329a67f4e73b2cb05a78aabf50a8755 Mon Sep 17 00:00:00 2001 From: Thomas Schmidt <tschmidt@suse.de> Date: Mon, 10 Oct 2011 11:48:58 +0200 Subject: [PATCH 07/20] add owncloud autosetup option --- index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 2e55827a62..4e1f5bcc8d 100644 --- a/index.php +++ b/index.php @@ -27,8 +27,16 @@ require_once('lib/base.php'); // Setup required : $not_installed = !OC_Config::getValue('installed', false); -$install_called = (isset($_POST['install']) AND $_POST['install']=='true'); 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..."); + include( $autosetup_file ); + $_POST['install'] = 'true'; + $_POST = array_merge ($_POST, $AUTOCONFIG); + unlink($autosetup_file); + } OC_Util::addScript('setup'); require_once('setup.php'); exit(); From f49ecee24ccd6d607a2d9945bb1bd765d965793b Mon Sep 17 00:00:00 2001 From: Georg Ehrke <georg.stefan.germany@googlemail.com> Date: Mon, 10 Oct 2011 12:03:30 +0200 Subject: [PATCH 08/20] reload calendar automatically --- apps/calendar/js/calendar.js | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js index 87954b7aac..efddac4042 100644 --- a/apps/calendar/js/calendar.js +++ b/apps/calendar/js/calendar.js @@ -200,6 +200,7 @@ Calendar={ }); } }); + window.setTimeout("Calendar.UI.loadEvents(" + year + ")", 120000); }, getEventsForDate:function(date){ var day = date.getDate(); From 6163351ea234cca9ee09d4f040c5cb45e1caf481 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek <karlitschek@kde.org> Date: Mon, 10 Oct 2011 18:48:40 +0200 Subject: [PATCH 09/20] master is now on the way to ownCloud 3 --- lib/util.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.php b/lib/util.php index f8748e868c..4920d13914 100644 --- a/lib/util.php +++ b/lib/util.php @@ -90,7 +90,7 @@ class OC_Util { * @return array */ public static function getVersion(){ - return array(1,92,0); + return array(2,90,0); } /** @@ -98,7 +98,7 @@ class OC_Util { * @return string */ public static function getVersionString(){ - return '2 beta 3'; + return '3 alpha 1'; } /** From 9d3c7badb5fd1b9319b35be74e3757702b499d9b Mon Sep 17 00:00:00 2001 From: Joar Wandborg <git@wandborg.com> Date: Tue, 11 Oct 2011 21:26:35 +0200 Subject: [PATCH 10/20] Fixed a bug in checkWebserverUser checkWebserverUser would return the owner of the document root instead of the owner of the web server process. Signed-off-by: Florian Pritz <bluewind@xinu.at> --- lib/util.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/util.php b/lib/util.php index 4920d13914..0f8cc08fce 100644 --- a/lib/util.php +++ b/lib/util.php @@ -271,9 +271,8 @@ class OC_Util { * Try to get the username the httpd server runs on, used in hints */ public static function checkWebserverUser(){ - $stat=stat($_SERVER['DOCUMENT_ROOT']); - if(is_callable('posix_getpwuid')){ - $serverUser=posix_getpwuid($stat['uid']); + if(is_callable('posix_getuid')){ + $serverUser=posix_getpwuid(posix_getuid()); $serverUser='\''.$serverUser['name'].'\''; }elseif(exec('whoami')){ $serverUser=exec('whoami'); From ef8826ac2d8438870e1bc42bf51cf28221461cb7 Mon Sep 17 00:00:00 2001 From: John Kristensen <John.Kristensen@dpipwe.tas.gov.au> Date: Wed, 12 Oct 2011 15:10:59 +1100 Subject: [PATCH 11/20] remove 'description' from OC_Connector_Sabre_CalDAV propertyMap * the description field was removed in commit: f3f5d775b519c12e56f4c6db8ca8ccf87c68f19d but the field was still trying to be mapped - causing errors with CalDAV --- apps/calendar/lib/connector_sabre.php | 1 - 1 file changed, 1 deletion(-) diff --git a/apps/calendar/lib/connector_sabre.php b/apps/calendar/lib/connector_sabre.php index 13a542fcca..263fb7ffde 100644 --- a/apps/calendar/lib/connector_sabre.php +++ b/apps/calendar/lib/connector_sabre.php @@ -10,7 +10,6 @@ class OC_Connector_Sabre_CalDAV extends Sabre_CalDAV_Backend_Abstract { */ public $propertyMap = array( '{DAV:}displayname' => 'displayname', - '{urn:ietf:params:xml:ns:caldav}calendar-description' => 'description', '{urn:ietf:params:xml:ns:caldav}calendar-timezone' => 'timezone', '{http://apple.com/ns/ical/}calendar-order' => 'calendarorder', '{http://apple.com/ns/ical/}calendar-color' => 'calendarcolor', From c86d1824fef70766f1f04a7f3ce2c118c411e037 Mon Sep 17 00:00:00 2001 From: John Kristensen <John.Kristensen@dpipwe.tas.gov.au> Date: Wed, 12 Oct 2011 15:23:39 +1100 Subject: [PATCH 12/20] Improve handling of calendar export $_GET params * a notice would be reported if either of the 'cal' or 'event' $_GET params where not supplied, which would result in 'Cannot modify header information' warnings --- apps/calendar/export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/calendar/export.php b/apps/calendar/export.php index b3e5ecd683..3e93a1ad61 100644 --- a/apps/calendar/export.php +++ b/apps/calendar/export.php @@ -9,8 +9,8 @@ require_once ("../../lib/base.php"); OC_Util::checkLoggedIn(); OC_Util::checkAppEnabled('calendar'); -$cal = $_GET["calid"]; -$event = $_GET["eventid"]; +$cal = isset($_GET["calid"]) ? $_GET["calid"] : NULL; +$event = isset($_GET["eventid"]) ? $_GET["eventid"] : NULL; if(isset($cal)){ $calendar = OC_Calendar_Calendar::findCalendar($cal); if($calendar["userid"] != OC_User::getUser()){ From 2cc5f5e19eb1039165564940a5a8e150dc2a5cf1 Mon Sep 17 00:00:00 2001 From: Patrick Stricker <stricker@hera.dev.iks-hagen.de> Date: Thu, 13 Oct 2011 10:04:39 +0200 Subject: [PATCH 13/20] made work with http authentication kind of sso login --- index.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 4e1f5bcc8d..937784694c 100644 --- a/index.php +++ b/index.php @@ -100,6 +100,18 @@ else { $error = true; } } - + // The user is already authenticated using Apaches AuthType Basic... very usable in combination with LDAP + elseif(isset($_SERVER["PHP_AUTH_USER"]) && isset($_SERVER["PHP_AUTH_PW"])) + { + if (OC_User::login($_SERVER["PHP_AUTH_USER"],$_SERVER["PHP_AUTH_PW"])) + { + OC_User::unsetMagicInCookie(); + OC_Util::redirectToDefaultPage(); + } + else + { + $error = true; + } + } OC_Template::printGuestPage('', 'login', array('error' => $error, 'redirect' => isset($_REQUEST['redirect_url'])?$_REQUEST['redirect_url']:'' )); } From 8da00e2d9aef5b77832a8d05a87c6b7cfbc5940a Mon Sep 17 00:00:00 2001 From: "Michiel@unhosted" <michiel@unhosted.org> Date: Thu, 13 Oct 2011 15:49:53 +0200 Subject: [PATCH 14/20] avoiding notice if ['HTTPS'] is not set --- apps/remoteStorage/compat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/remoteStorage/compat.php b/apps/remoteStorage/compat.php index 35a133c43c..445257320c 100644 --- a/apps/remoteStorage/compat.php +++ b/apps/remoteStorage/compat.php @@ -101,7 +101,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'remoteStor $token=OC_remoteStorage::createDataScope($appUrl, $userAddress, $dataScope); header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=remoteStorage'); } else { - if($_SERVER['HTTPS']){ + if((isset($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'])) { $url = "https://"; } else { $url = "http://"; From d7fa2a0f7770acb36c49ea60348bb583e53b04e7 Mon Sep 17 00:00:00 2001 From: Robin Appelman <icewind1991@gmail.com> Date: Sat, 8 Oct 2011 21:18:47 +0200 Subject: [PATCH 15/20] mimetype icon improvements --- .../filetypes/{script.png => code-script.png} | Bin core/img/filetypes/{php.png => text-x-php.png} | Bin files/ajax/mimeicon.php | 8 ++++++++ files/js/filelist.js | 12 ++++++++---- files/js/files.js | 15 +++++++++------ lib/helper.php | 6 ++++++ 6 files changed, 31 insertions(+), 10 deletions(-) rename core/img/filetypes/{script.png => code-script.png} (100%) rename core/img/filetypes/{php.png => text-x-php.png} (100%) create mode 100644 files/ajax/mimeicon.php diff --git a/core/img/filetypes/script.png b/core/img/filetypes/code-script.png similarity index 100% rename from core/img/filetypes/script.png rename to core/img/filetypes/code-script.png diff --git a/core/img/filetypes/php.png b/core/img/filetypes/text-x-php.png similarity index 100% rename from core/img/filetypes/php.png rename to core/img/filetypes/text-x-php.png diff --git a/files/ajax/mimeicon.php b/files/ajax/mimeicon.php new file mode 100644 index 0000000000..8724016b3a --- /dev/null +++ b/files/ajax/mimeicon.php @@ -0,0 +1,8 @@ +<?php + +// Init owncloud +require_once('../../lib/base.php'); + +print OC_Helper::mimetypeIcon($_GET['mime']); + +?> diff --git a/files/js/filelist.js b/files/js/filelist.js index 84762bb561..e6da922700 100644 --- a/files/js/filelist.js +++ b/files/js/filelist.js @@ -101,10 +101,14 @@ FileList={ $('.file_upload_filename').removeClass('highlight'); }, loadingDone:function(name){ - $('tr[data-file="'+name+'"]').data('loading',false); - var mime=$('tr[data-file="'+name+'"]').data('mime'); - $('tr[data-file="'+name+'"] td.filename').attr('style','background-image:url('+getMimeIcon(mime)+')'); - $('tr[data-file="'+name+'"] td.filename').draggable(dragOptions); + var tr=$('tr[data-file="'+name+'"]'); + tr.data('loading',false); + var mime=tr.data('mime'); + tr.attr('data-mime',mime); + getMimeIcon(mime,function(path){ + tr.find('td.filename').attr('style','background-image:url('+path+')'); + }); + tr.find('td.filename').draggable(dragOptions); }, isLoading:function(name){ return $('tr[data-file="'+name+'"]').data('loading'); diff --git a/files/js/files.js b/files/js/files.js index 9342642b4f..079646070d 100644 --- a/files/js/files.js +++ b/files/js/files.js @@ -473,11 +473,14 @@ function relative_modified_date(timestamp) { else { return diffyears+' '+t('files','years ago'); } } -function getMimeIcon(mime){ - mime=mime.substr(0,mime.indexOf('/')); - var knownMimes=['image','audio']; - if(knownMimes.indexOf(mime)==-1){ - mime='file'; +function getMimeIcon(mime, ready){ + if(getMimeIcon.cache[mime]){ + ready(getMimeIcon.cache[mime]); + }else{ + $.get( OC.filePath('files','ajax','mimeicon.php')+'?mime='+mime, function(path){ + getMimeIcon.cache[mime]=path; + ready(getMimeIcon.cache[mime]); + }); } - return OC.imagePath('core','filetypes/'+mime); } +getMimeIcon.cache={}; diff --git a/lib/helper.php b/lib/helper.php index c2a81ba330..5b3e394caf 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -96,6 +96,12 @@ class OC_Helper { * Returns the path to the image of this file type. */ public static function mimetypeIcon( $mimetype ){ + $alias=array('application/xml'=>'code/xml'); +// echo $mimetype; + if(isset($alias[$mimetype])){ + $mimetype=$alias[$mimetype]; +// echo $mimetype; + } // Replace slash with a minus $mimetype = str_replace( "/", "-", $mimetype ); From f1fd374a6f078031e231c89c9fb8ca4b33feba20 Mon Sep 17 00:00:00 2001 From: Robin Appelman <icewind1991@gmail.com> Date: Thu, 13 Oct 2011 16:31:01 +0200 Subject: [PATCH 16/20] webdav workaround for apache+php-cgi --- .htaccess | 4 ++++ lib/base.php | 8 ++++++++ lib/setup.php | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/.htaccess b/.htaccess index 8763a8bcde..dd49442e37 100644 --- a/.htaccess +++ b/.htaccess @@ -5,4 +5,8 @@ php_value post_max_size 512M php_value memory_limit 128M SetEnv htaccessWorking true </IfModule> +<IfModule !mod_php5.c> +RewriteEngine on +RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last] +</IfModule> Options -Indexes diff --git a/lib/base.php b/lib/base.php index 0156febe23..57a3ae8669 100644 --- a/lib/base.php +++ b/lib/base.php @@ -81,6 +81,14 @@ class OC{ date_default_timezone_set('Europe/Berlin'); ini_set('arg_separator.output','&'); + //set http auth headers for apache+php-cgi work around + if (preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches)) + { + list($name, $password) = explode(':', base64_decode($matches[1])); + $_SERVER['PHP_AUTH_USER'] = strip_tags($name); + $_SERVER['PHP_AUTH_PW'] = strip_tags($password); + } + // calculate the documentroot OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']); OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13)); diff --git a/lib/setup.php b/lib/setup.php index 355d979dc6..252eaaeea1 100644 --- a/lib/setup.php +++ b/lib/setup.php @@ -273,6 +273,10 @@ class OC_Setup { $content.= "php_value post_max_size 512M\n"; $content.= "SetEnv htaccessWorking true\n"; $content.= "</IfModule>\n"; + $content.= "<IfModule !mod_php5.c>\n"; + $content.= "RewriteEngine on\n"; + $content.= "RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]\n"; + $content.= "</IfModule>\n"; $content.= "Options -Indexes\n"; @file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it From db2fb38746bb9d89b402c3a768a247945d813989 Mon Sep 17 00:00:00 2001 From: Robin Appelman <icewind1991@gmail.com> Date: Thu, 13 Oct 2011 21:55:02 +0200 Subject: [PATCH 17/20] prevent error involving webdav workaround --- lib/base.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/base.php b/lib/base.php index 57a3ae8669..ade4d88963 100644 --- a/lib/base.php +++ b/lib/base.php @@ -82,7 +82,7 @@ class OC{ ini_set('arg_separator.output','&'); //set http auth headers for apache+php-cgi work around - if (preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches)) + if (isset($_SERVER['HTTP_AUTHORIZATION']) && preg_match('/Basic\s+(.*)$/i', $_SERVER['HTTP_AUTHORIZATION'], $matches)) { list($name, $password) = explode(':', base64_decode($matches[1])); $_SERVER['PHP_AUTH_USER'] = strip_tags($name); From c0b011e71427ac25b13ac44d34eb3a747d17832b Mon Sep 17 00:00:00 2001 From: Brice Maron <brice@bmaron.net> Date: Fri, 14 Oct 2011 18:04:50 +0200 Subject: [PATCH 18/20] Initialise hasOtherDB var when not true in installation --- core/templates/installation.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/templates/installation.php b/core/templates/installation.php index 70a545d66c..f1cde6b390 100644 --- a/core/templates/installation.php +++ b/core/templates/installation.php @@ -37,7 +37,7 @@ </fieldset> <fieldset id='databaseField'> - <?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; //other than SQLite ?> + <?php if($_['hasMySQL'] or $_['hasPostgreSQL']) $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite ?> <legend><?php echo $l->t( 'Configure the database' ); ?></legend> <div id="selectDbType"> <?php if($_['hasSQLite']): ?> From 169dd7da770672efbbf49adaf32255a96fb01a9d Mon Sep 17 00:00:00 2001 From: Brice Maron <brice@bmaron.net> Date: Fri, 14 Oct 2011 19:09:07 +0200 Subject: [PATCH 19/20] Prevent category in jquery-ui on cal. to overflow --- core/css/styles.css | 1 + 1 file changed, 1 insertion(+) diff --git a/core/css/styles.css b/core/css/styles.css index 46b340be96..539ae580aa 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -122,3 +122,4 @@ div.jp-play-bar, div.jp-seek-bar { padding:0; } .pager li { display:inline-block; } li.error { width:640px; margin:4em auto; padding:1em 1em 1em 4em; background:#ffe .8em .8em no-repeat; border:1px solid #ccc; -moz-border-radius:10px; -webkit-border-radius:10px; border-radius:10px; } +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { overflow: hidden; text-overflow: ellipsis; } \ No newline at end of file From f29dc0c0fbc7dd360066e5f47ec3b87927381c1b Mon Sep 17 00:00:00 2001 From: Robin Appelman <icewind1991@gmail.com> Date: Fri, 14 Oct 2011 20:50:55 +0200 Subject: [PATCH 20/20] correct language name --- settings/languageCodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/settings/languageCodes.php b/settings/languageCodes.php index 3e2cea50ac..81177e0a25 100644 --- a/settings/languageCodes.php +++ b/settings/languageCodes.php @@ -21,7 +21,7 @@ return array( 'ms_MY'=>'Bahasa Melayu', 'nb_NO'=>'Norwegian Bokmål', 'nl'=>'Nederlands', -'pl'=>'język polski', +'pl'=>'Polski', 'pt_BR'=>'Português brasileiro', 'pt_PT'=>'Português', 'ro'=>'română',