Merge branch 'master' into calendar

This commit is contained in:
Georg Ehrke 2011-10-10 21:08:11 +02:00
commit 4cbae823eb
11 changed files with 70 additions and 27 deletions

View file

@ -1,5 +1,52 @@
<?php
// Source: http://www.php.net/manual/de/function.curl-setopt.php#102121
// This works around a safe_mode/open_basedir restriction
function curl_exec_follow(/*resource*/ $ch, /*int*/ &$maxredirect = null) {
$mr = $maxredirect === null ? 5 : intval($maxredirect);
if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) {
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, $mr > 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,13 +59,11 @@ 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>(.*)<\/title>/si", $page, $match );
$metadata['title'] = htmlspecialchars_decode(@$match[1]);
$meta = get_meta_tags($url);
return $metadata;
}

View file

@ -200,6 +200,7 @@ Calendar={
});
}
});
window.setTimeout("Calendar.UI.loadEvents(" + year + ")", 120000);
},
getEventsForDate:function(date){
var day = date.getDate();

View file

@ -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;}

View file

@ -1,11 +1,4 @@
$(document).ready(function(){
/*-------------------------------------------------------------------------
* Actions for startup
*-----------------------------------------------------------------------*/
if( $('#leftcontent li').length > 0 ){
$('#leftcontent li').first().addClass('active');
}
/*-------------------------------------------------------------------------
* Event handlers
*-----------------------------------------------------------------------*/

View file

@ -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>

View file

@ -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; ?>

View file

@ -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: *');
}

View file

@ -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";
}

View file

@ -0,0 +1,6 @@
<?php
$appInfoDir = __DIR__;
$thisAppDir = dirname($appInfoDir);
$appsDir = dirname($thisAppDir);
$ownCloudDir = dirname($appsDir);
symlink($thisAppDir, $ownCloudDir.'/.well-known');

View file

@ -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();

View file

@ -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';
}
/**