Merge branch 'master' into calendar
This commit is contained in:
commit
a01d10e57d
|
@ -4,4 +4,8 @@ php_value upload_max_filesize 512M
|
||||||
php_value post_max_size 512M
|
php_value post_max_size 512M
|
||||||
SetEnv htaccessWorking true
|
SetEnv htaccessWorking true
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
<IfModule !mod_php5.c>
|
||||||
|
RewriteEngine on
|
||||||
|
RewriteRule .* - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization},last]
|
||||||
|
</IfModule>
|
||||||
Options -Indexes
|
Options -Indexes
|
||||||
|
|
|
@ -101,7 +101,7 @@ if(count($pathParts) >= 8 && $pathParts[0] == '' && $pathParts[2] == 'remoteStor
|
||||||
$token=OC_remoteStorage::createDataScope($appUrl, $userAddress, $dataScope);
|
$token=OC_remoteStorage::createDataScope($appUrl, $userAddress, $dataScope);
|
||||||
header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=remoteStorage');
|
header('Location: '.$_GET['redirect_uri'].'#access_token='.$token.'&token_type=remoteStorage');
|
||||||
} else {
|
} else {
|
||||||
if($_SERVER['HTTPS']){
|
if((isset($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'])) {
|
||||||
$url = "https://";
|
$url = "https://";
|
||||||
} else {
|
} else {
|
||||||
$url = "http://";
|
$url = "http://";
|
||||||
|
|
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 859 B |
Before Width: | Height: | Size: 538 B After Width: | Height: | Size: 538 B |
|
@ -0,0 +1,8 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
// Init owncloud
|
||||||
|
require_once('../../lib/base.php');
|
||||||
|
|
||||||
|
print OC_Helper::mimetypeIcon($_GET['mime']);
|
||||||
|
|
||||||
|
?>
|
|
@ -101,10 +101,14 @@ FileList={
|
||||||
$('.file_upload_filename').removeClass('highlight');
|
$('.file_upload_filename').removeClass('highlight');
|
||||||
},
|
},
|
||||||
loadingDone:function(name){
|
loadingDone:function(name){
|
||||||
$('tr[data-file="'+name+'"]').data('loading',false);
|
var tr=$('tr[data-file="'+name+'"]');
|
||||||
var mime=$('tr[data-file="'+name+'"]').data('mime');
|
tr.data('loading',false);
|
||||||
$('tr[data-file="'+name+'"] td.filename').attr('style','background-image:url('+getMimeIcon(mime)+')');
|
var mime=tr.data('mime');
|
||||||
$('tr[data-file="'+name+'"] td.filename').draggable(dragOptions);
|
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){
|
isLoading:function(name){
|
||||||
return $('tr[data-file="'+name+'"]').data('loading');
|
return $('tr[data-file="'+name+'"]').data('loading');
|
||||||
|
|
|
@ -473,11 +473,14 @@ function relative_modified_date(timestamp) {
|
||||||
else { return diffyears+' '+t('files','years ago'); }
|
else { return diffyears+' '+t('files','years ago'); }
|
||||||
}
|
}
|
||||||
|
|
||||||
function getMimeIcon(mime){
|
function getMimeIcon(mime, ready){
|
||||||
mime=mime.substr(0,mime.indexOf('/'));
|
if(getMimeIcon.cache[mime]){
|
||||||
var knownMimes=['image','audio'];
|
ready(getMimeIcon.cache[mime]);
|
||||||
if(knownMimes.indexOf(mime)==-1){
|
}else{
|
||||||
mime='file';
|
$.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={};
|
||||||
|
|
|
@ -81,6 +81,14 @@ class OC{
|
||||||
date_default_timezone_set('Europe/Berlin');
|
date_default_timezone_set('Europe/Berlin');
|
||||||
ini_set('arg_separator.output','&');
|
ini_set('arg_separator.output','&');
|
||||||
|
|
||||||
|
//set http auth headers for apache+php-cgi work around
|
||||||
|
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);
|
||||||
|
$_SERVER['PHP_AUTH_PW'] = strip_tags($password);
|
||||||
|
}
|
||||||
|
|
||||||
// calculate the documentroot
|
// calculate the documentroot
|
||||||
OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
|
OC::$DOCUMENTROOT=realpath($_SERVER['DOCUMENT_ROOT']);
|
||||||
OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));
|
OC::$SERVERROOT=str_replace("\\",'/',substr(__FILE__,0,-13));
|
||||||
|
|
|
@ -96,6 +96,12 @@ class OC_Helper {
|
||||||
* Returns the path to the image of this file type.
|
* Returns the path to the image of this file type.
|
||||||
*/
|
*/
|
||||||
public static function mimetypeIcon( $mimetype ){
|
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
|
// Replace slash with a minus
|
||||||
$mimetype = str_replace( "/", "-", $mimetype );
|
$mimetype = str_replace( "/", "-", $mimetype );
|
||||||
|
|
||||||
|
|
|
@ -273,6 +273,10 @@ class OC_Setup {
|
||||||
$content.= "php_value post_max_size 512M\n";
|
$content.= "php_value post_max_size 512M\n";
|
||||||
$content.= "SetEnv htaccessWorking true\n";
|
$content.= "SetEnv htaccessWorking true\n";
|
||||||
$content.= "</IfModule>\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";
|
$content.= "Options -Indexes\n";
|
||||||
@file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
|
@file_put_contents(OC::$SERVERROOT.'/.htaccess', $content); //supress errors in case we don't have permissions for it
|
||||||
|
|
||||||
|
|
|
@ -271,9 +271,8 @@ class OC_Util {
|
||||||
* Try to get the username the httpd server runs on, used in hints
|
* Try to get the username the httpd server runs on, used in hints
|
||||||
*/
|
*/
|
||||||
public static function checkWebserverUser(){
|
public static function checkWebserverUser(){
|
||||||
$stat=stat($_SERVER['DOCUMENT_ROOT']);
|
if(is_callable('posix_getuid')){
|
||||||
if(is_callable('posix_getpwuid')){
|
$serverUser=posix_getpwuid(posix_getuid());
|
||||||
$serverUser=posix_getpwuid($stat['uid']);
|
|
||||||
$serverUser='\''.$serverUser['name'].'\'';
|
$serverUser='\''.$serverUser['name'].'\'';
|
||||||
}elseif(exec('whoami')){
|
}elseif(exec('whoami')){
|
||||||
$serverUser=exec('whoami');
|
$serverUser=exec('whoami');
|
||||||
|
|
Loading…
Reference in New Issue