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