@@ -63,4 +63,3 @@ $tmpl->assign( 'maxPossibleUploadSize', $maxUploadFilesizePossible); | |||
$tmpl->assign( 'allowZipDownload', $allowZipDownload); | |||
$tmpl->assign( 'maxZipInputSize', $maxZipInputSize); | |||
return $tmpl->fetchPage(); | |||
@@ -89,4 +89,3 @@ a.action>img { max-height:16px; max-width:16px; vertical-align:text-bottom; } | |||
#scanning-message{ top:40%; left:40%; position:absolute; display:none; } | |||
div.crumb a{ padding: 0.9em 0 0.7em 0; } | |||
@@ -150,7 +150,7 @@ var FileList={ | |||
if (newname != name) { | |||
if (FileList.checkName(name, newname, false)) { | |||
newname = name; | |||
} else { | |||
} else { | |||
$.get(OC.filePath('files','ajax','rename.php'), { dir : $('#dir').val(), newname: newname, file: name },function(result) { | |||
if (!result || result.status == 'error') { | |||
OC.dialogs.alert(result.data.message, 'Error moving file'); | |||
@@ -158,7 +158,7 @@ var FileList={ | |||
} | |||
tr.data('renaming',false); | |||
}); | |||
} | |||
} | |||
tr.attr('data-file', newname); | |||
@@ -264,9 +264,9 @@ var FileList={ | |||
if (FileList.lastAction) { | |||
FileList.lastAction(); | |||
} | |||
FileList.prepareDeletion(files); | |||
if (!FileList.useUndo) { | |||
FileList.lastAction(); | |||
} else { |
@@ -199,7 +199,7 @@ $(document).ready(function() { | |||
$(document).bind('drop dragover', function (e) { | |||
e.preventDefault(); // prevent browser from doing anything, if file isn't dropped in dropZone | |||
}); | |||
if ( document.getElementById("data-upload-form") ) { | |||
$(function() { | |||
$('.file_upload_start').fileupload({ |
@@ -6,7 +6,7 @@ | |||
} | |||
?> | |||
</script> | |||
<?php foreach($_['files'] as $file): | |||
$simple_file_size = OCP\simple_file_size($file['size']); | |||
$simple_size_color = intval(200-$file['size']/(1024*1024)*2); // the bigger the file, the darker the shade of grey; megabytes*2 |
@@ -3,23 +3,23 @@ | |||
OCP\JSON::checkAppEnabled('files_external'); | |||
if ( !($filename = $_FILES['rootcert_import']['name']) ) { | |||
header("Location: settings/personal.php"); | |||
header("Location: settings/personal.php"); | |||
exit; | |||
} | |||
$fh = fopen($_FILES['rootcert_import']['tmp_name'], 'r'); | |||
$data = fread($fh, filesize($_FILES['rootcert_import']['tmp_name'])); | |||
$fh = fopen($_FILES['rootcert_import']['tmp_name'], 'r'); | |||
$data = fread($fh, filesize($_FILES['rootcert_import']['tmp_name'])); | |||
fclose($fh); | |||
$filename = $_FILES['rootcert_import']['name']; | |||
$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_external/uploads'); | |||
$view = new \OC_FilesystemView('/'.\OCP\User::getUser().'/files_external/uploads'); | |||
if (!$view->file_exists('')) $view->mkdir(''); | |||
$isValid = openssl_pkey_get_public($data); | |||
//maybe it was just the wrong file format, try to convert it... | |||
if ($isValid == false) { | |||
$data = chunk_split(base64_encode($data), 64, "\n"); | |||
$data = chunk_split(base64_encode($data), 64, "\n"); | |||
$data = "-----BEGIN CERTIFICATE-----\n".$data."-----END CERTIFICATE-----\n"; | |||
$isValid = openssl_pkey_get_public($data); | |||
} |
@@ -11,4 +11,3 @@ if ( $view->file_exists($file) ) { | |||
$view->unlink($file); | |||
OC_Mount_Config::createCertificateBundle(); | |||
} | |||
@@ -120,10 +120,10 @@ class OC_Mount_Config { | |||
$dir = $dir.'/'.$pathPart; | |||
if ( !$view->file_exists($dir)) { | |||
$view->mkdir($dir); | |||
} | |||
} | |||
} | |||
} | |||
/** | |||
* Add a mount point to the filesystem | |||
@@ -160,7 +160,7 @@ class OC_Mount_Config { | |||
self::addMountPointDirectory($view, $path); | |||
} | |||
break; | |||
case 'group' : | |||
case 'group' : | |||
$groupMembers = OC_Group::usersInGroups(array($applicable)); | |||
foreach ( $groupMembers as $user ) { | |||
$path = $user.'/files/'.ltrim($mountPoint, '/'); |
@@ -59,7 +59,7 @@ class OC_Share_Backend_Folder extends OC_Share_Backend_File implements OCP\Share | |||
$parents = array(); | |||
while ($file = $result->fetchRow()) { | |||
$children[] = array('source' => $file['id'], 'file_path' => $file['name']); | |||
// If a child folder is found look inside it | |||
// If a child folder is found look inside it | |||
if ($file['mimetype'] == 'httpd/unix-directory') { | |||
$parents[] = $file['id']; | |||
} |
@@ -45,10 +45,10 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { | |||
} | |||
if (isset($linkItem['share_with'])) { | |||
// Check password | |||
if (isset($_GET['file'])) { | |||
$url = OCP\Util::linkToPublic('files').'&file='.$_GET['file']; | |||
} else { | |||
$url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir']; | |||
if (isset($_GET['file'])) { | |||
$url = OCP\Util::linkToPublic('files').'&file='.$_GET['file']; | |||
} else { | |||
$url = OCP\Util::linkToPublic('files').'&dir='.$_GET['dir']; | |||
} | |||
if (isset($_POST['password'])) { | |||
$password = $_POST['password']; | |||
@@ -98,7 +98,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { | |||
} else { // download a single shared file | |||
OC_Files::get("", $path, $_SERVER['REQUEST_METHOD'] == 'HEAD' ? true : false); | |||
} | |||
} else { | |||
OCP\Util::addStyle('files_sharing', 'public'); | |||
OCP\Util::addScript('files_sharing', 'public'); | |||
@@ -134,7 +134,7 @@ if (isset($_GET['file']) || isset($_GET['dir'])) { | |||
if ($i != '') { | |||
if ($i != $baseDir) { | |||
$pathtohere .= '/'.$i; | |||
} | |||
} | |||
if ( strlen($pathtohere) < strlen($_GET['dir'])) { | |||
continue; | |||
} |
@@ -68,7 +68,7 @@ function createVersionsDropdown(filename, files) { | |||
data: { source: files }, | |||
async: false, | |||
success: function( versions ) { | |||
if (versions) { | |||
$.each( versions, function(index, row ) { | |||
addVersion( row ); | |||
@@ -128,7 +128,7 @@ function createVersionsDropdown(filename, files) { | |||
version.appendTo('#found_versions'); | |||
} | |||
$('tr').filterAttr('data-file',filename).addClass('mouseOver'); | |||
$('#dropdown').show('blind'); | |||
@@ -144,6 +144,6 @@ $(this).click( | |||
}); | |||
} | |||
} | |||
); |
@@ -106,7 +106,7 @@ class Storage { | |||
// create all parent folders | |||
$info=pathinfo($filename); | |||
$info=pathinfo($filename); | |||
if(!file_exists($versionsFolderName.'/'.$info['dirname'])) { | |||
mkdir($versionsFolderName.'/'.$info['dirname'],0750,true); | |||
} |
@@ -63,7 +63,7 @@ class OC_App{ | |||
if (!defined('DEBUG') || !DEBUG) { | |||
if (is_null($types) | |||
&& empty(OC_Util::$core_scripts) | |||
&& empty(OC_Util::$core_scripts) | |||
&& empty(OC_Util::$core_styles)) { | |||
OC_Util::$core_scripts = OC_Util::$scripts; | |||
OC_Util::$scripts = array(); | |||
@@ -458,7 +458,7 @@ class OC_App{ | |||
} | |||
} | |||
self::$appInfo[$appid]=$data; | |||
return $data; | |||
} | |||
@@ -545,34 +545,34 @@ class OC_App{ | |||
* @todo: change the name of this method to getInstalledApps, which is more accurate | |||
*/ | |||
public static function getAllApps() { | |||
$apps=array(); | |||
foreach ( OC::$APPSROOTS as $apps_dir ) { | |||
if(! is_readable($apps_dir['path'])) { | |||
OC_Log::write('core', 'unable to read app folder : ' .$apps_dir['path'] , OC_Log::WARN); | |||
continue; | |||
} | |||
$dh = opendir( $apps_dir['path'] ); | |||
while( $file = readdir( $dh ) ) { | |||
if ( | |||
$file[0] != '.' | |||
and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php' ) | |||
if ( | |||
$file[0] != '.' | |||
and is_file($apps_dir['path'].'/'.$file.'/appinfo/app.php' ) | |||
) { | |||
$apps[] = $file; | |||
} | |||
} | |||
} | |||
return $apps; | |||
} | |||
/** | |||
* @brief: get a list of all apps on apps.owncloud.com | |||
* @return array, multi-dimensional array of apps. Keys: id, name, type, typename, personid, license, detailpage, preview, changed, description | |||
@@ -584,7 +584,7 @@ class OC_App{ | |||
if ( ! $categories = array_keys( $catagoryNames ) ) { | |||
return false; | |||
} | |||
$page = 0; | |||
$remoteApps = OC_OCSClient::getApplications( $categories, $page, $filter ); | |||
$app1 = array(); | |||
@@ -659,7 +659,7 @@ class OC_App{ | |||
$version = OC_Util::getVersion(); | |||
foreach($apps as $app) { | |||
// check if the app is compatible with this version of ownCloud | |||
$info = OC_App::getAppInfo($app); | |||
$info = OC_App::getAppInfo($app); | |||
if(!isset($info['require']) or (($version[0].'.'.$version[1])>$info['require'])) { | |||
OC_Log::write('core', 'App "'.$info['name'].'" ('.$app.') can\'t be used because it is not compatible with this version of ownCloud', OC_Log::ERROR); | |||
OC_App::disable( $app ); |
@@ -200,7 +200,7 @@ class OC_Connector_Sabre_Directory extends OC_Connector_Sabre_Node implements Sa | |||
public function getProperties($properties) { | |||
$props = parent::getProperties($properties); | |||
if (in_array(self::GETETAG_PROPERTYNAME, $properties) && !isset($props[self::GETETAG_PROPERTYNAME])) { | |||
$props[self::GETETAG_PROPERTYNAME] | |||
$props[self::GETETAG_PROPERTYNAME] | |||
= OC_Connector_Sabre_Node::getETagPropertyForPath($this->path); | |||
} | |||
return $props; |
@@ -115,11 +115,11 @@ class OC_Connector_Sabre_Principal implements Sabre_DAVACL_IPrincipalBackend { | |||
public function setGroupMemberSet($principal, array $members) { | |||
throw new Sabre_DAV_Exception('Setting members of the group is not supported yet'); | |||
} | |||
function updatePrincipal($path, $mutations) { | |||
return 0; | |||
} | |||
function searchPrincipals($prefixPath, array $searchProperties) { | |||
return 0; | |||
} |
@@ -476,7 +476,7 @@ class OC_DB { | |||
public static function updateDbFromStructure($file) { | |||
$CONFIG_DBTABLEPREFIX = OC_Config::getValue( "dbtableprefix", "oc_" ); | |||
$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" ); | |||
self::connectScheme(); | |||
// read file | |||
@@ -683,7 +683,7 @@ class OC_DB { | |||
return false; | |||
} | |||
} | |||
/** | |||
* returns the error code and message as a string for logging | |||
* works with MDB2 and PDOException |
@@ -1,37 +1,37 @@ | |||
<?php | |||
/** | |||
* ownCloud | |||
* | |||
* @author Bjoern Schiessle | |||
* @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com> | |||
* | |||
* This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or any later version. | |||
* | |||
* This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | |||
* | |||
* You should have received a copy of the GNU Affero General Public | |||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | |||
* | |||
*/ | |||
/** | |||
* check if standard file operations | |||
/** | |||
* ownCloud | |||
* | |||
* @author Bjoern Schiessle | |||
* @copyright 2012 Bjoern Schiessle <schiessle@owncloud.com> | |||
* | |||
* This library is free software; you can redistribute it and/or | |||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE | |||
* License as published by the Free Software Foundation; either | |||
* version 3 of the License, or any later version. | |||
* | |||
* This library is distributed in the hope that it will be useful, | |||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details. | |||
* | |||
* You should have received a copy of the GNU Affero General Public | |||
* License along with this library. If not, see <http://www.gnu.org/licenses/>. | |||
* | |||
*/ | |||
class OC_FileProxy_FileOperations extends OC_FileProxy{ | |||
static $rootView; | |||
public function premkdir($path) { | |||
if(!self::$rootView){ | |||
self::$rootView = new OC_FilesystemView(''); | |||
/** | |||
* check if standard file operations | |||
*/ | |||
class OC_FileProxy_FileOperations extends OC_FileProxy{ | |||
static $rootView; | |||
public function premkdir($path) { | |||
if(!self::$rootView){ | |||
self::$rootView = new OC_FilesystemView(''); | |||
} | |||
return !self::$rootView->file_exists($path); | |||
return !self::$rootView->file_exists($path); | |||
} | |||
} |
@@ -669,7 +669,7 @@ class OC_Image { | |||
$newWidth = min($maxWidth, $ratio*$maxHeight); | |||
$newHeight = min($maxHeight, $maxWidth/$ratio); | |||
$this->preciseResize(round($newWidth), round($newHeight)); | |||
return true; | |||
} |
@@ -48,7 +48,7 @@ class OC_Migration_Content{ | |||
// @brief prepares the db | |||
// @param $query the sql query to prepare | |||
public function prepare( $query ) { | |||
// Only add database to tmpfiles if actually used | |||
if( !is_null( $this->db ) ) { | |||
// Get db path | |||
@@ -57,7 +57,7 @@ class OC_Migration_Content{ | |||
$this->tmpfiles[] = $db; | |||
} | |||
} | |||
// Optimize the query | |||
$query = $this->processQuery( $query ); | |||
@@ -62,7 +62,7 @@ class OC_OCSClient{ | |||
'timeout' => 10 | |||
) | |||
) | |||
); | |||
); | |||
$data=@file_get_contents($url, 0, $ctx); | |||
return($data); | |||
} |
@@ -45,12 +45,12 @@ class OC_Updater{ | |||
// set a sensible timeout of 10 sec to stay responsive even if the update server is down. | |||
$ctx = stream_context_create( | |||
array( | |||
'http' => array( | |||
'timeout' => 10 | |||
) | |||
) | |||
); | |||
array( | |||
'http' => array( | |||
'timeout' => 10 | |||
) | |||
) | |||
); | |||
$xml=@file_get_contents($url, 0, $ctx); | |||
if($xml==FALSE) { | |||
return array(); |
@@ -426,7 +426,7 @@ class OC_Util { | |||
* @description | |||
* Also required for the client side to compute the piont in time when to | |||
* request a fresh token. The client will do so when nearly 97% of the | |||
* timespan coded here has expired. | |||
* timespan coded here has expired. | |||
*/ | |||
public static $callLifespan = 3600; // 3600 secs = 1 hour | |||
@@ -564,7 +564,7 @@ class OC_Util { | |||
public static function generate_random_bytes($length = 30) { | |||
// Try to use openssl_random_pseudo_bytes | |||
if(function_exists('openssl_random_pseudo_bytes')) { | |||
if(function_exists('openssl_random_pseudo_bytes')) { | |||
$pseudo_byte = bin2hex(openssl_random_pseudo_bytes($length, $strong)); | |||
if($strong == TRUE) { | |||
return substr($pseudo_byte, 0, $length); // Truncate it to match the length | |||
@@ -574,31 +574,31 @@ class OC_Util { | |||
// Try to use /dev/random | |||
$fp = @file_get_contents('/dev/random', false, null, 0, $length); | |||
if ($fp !== FALSE) { | |||
$string = substr(bin2hex($fp), 0, $length); | |||
$string = substr(bin2hex($fp), 0, $length); | |||
return $string; | |||
} | |||
// Fallback to mt_rand() | |||
// Fallback to mt_rand() | |||
$characters = '0123456789'; | |||
$characters .= 'abcdefghijklmnopqrstuvwxyz'; | |||
$characters .= 'abcdefghijklmnopqrstuvwxyz'; | |||
$charactersLength = strlen($characters)-1; | |||
$pseudo_byte = ""; | |||
// Select some random characters | |||
for ($i = 0; $i < $length; $i++) { | |||
$pseudo_byte .= $characters[mt_rand(0, $charactersLength)]; | |||
} | |||
} | |||
return $pseudo_byte; | |||
} | |||
/* | |||
* @brief Checks if a secure random number generator is available | |||
* @return bool | |||
* @return bool | |||
*/ | |||
public static function secureRNG_available() { | |||
// Check openssl_random_pseudo_bytes | |||
if(function_exists('openssl_random_pseudo_bytes')) { | |||
if(function_exists('openssl_random_pseudo_bytes')) { | |||
openssl_random_pseudo_bytes(1, $strong); | |||
if($strong == TRUE) { | |||
return true; | |||
@@ -612,5 +612,5 @@ class OC_Util { | |||
} | |||
return false; | |||
} | |||
} | |||
} |