From 4a4e6eb0712bc2f7f188325d2ac87b8aa4927cd8 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 8 Oct 2011 19:42:09 +0200 Subject: [PATCH 1/9] 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 f66d98a8ccb..b445154f526 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 2/9] 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 b445154f526..44d4235b9b3 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 3/9] 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 0fcfdeaab5d..2f4a736f553 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 6d67584b29e..98ebc1b0b36 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 4/9] 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 1f95fdb2ad4..c1abd0efb62 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 26a33739acb..438f84d45d4 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 5/9] 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 d383e879510..35a133c43c7 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 50257232ae4..00000000000 --- 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 00000000000..d23ba535394 --- /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 6/9] 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 d23ba535394..079043cd102 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 7/9] add owncloud autosetup option --- index.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 2e55827a62a..4e1f5bcc8d6 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 8/9] 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 87954b7aac6..efddac40426 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 9/9] 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 f8748e868c1..4920d13914d 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'; } /**