Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d50fe5f12 | |||
| f24aca61a9 | |||
| d3e2226b38 | |||
| 73fa6259be | |||
| dffc2a8b1c | |||
| fd634fdec8 | |||
| 328ebaefde | |||
| 4de8c4e5db | |||
| 8dc3cb2ffb | |||
| c67ece0f6b | |||
| 6640e120b7 | |||
| 6f7b394d99 | |||
| 91f47645b0 | |||
| 18903cc8f7 | |||
| 7e467484a8 | |||
| 21bf6abd41 | |||
| 401728b2a2 | |||
| bfd0dc3314 | |||
| ad92b12559 | |||
| 4391992b8c | |||
| 728e6d735a | |||
| 66df8c3bb3 | |||
| ca08d21da0 | |||
| 7d0f458f11 | |||
| f15aeb3bbc | |||
| 9333244925 | |||
| 50f5ab8515 | |||
| 4df0d2e7e8 | |||
| f2e17a0b68 | |||
| e372971f2b | |||
| 3bf30377b8 | |||
| 67b67b6d66 | |||
| b8390f15d4 | |||
| 5ac3f9bfa5 | |||
| 02fe013d2f | |||
| 5e5e4fe3a4 | |||
| d49e4e53fd | |||
| 2d11290121 | |||
| 1a197292da | |||
| 3b59979746 | |||
| 259d619af3 |
@@ -370,7 +370,14 @@ class Helper {
|
||||
* @return bool true if requirements are met
|
||||
*/
|
||||
public static function checkRequirements() {
|
||||
return extension_loaded('openssl');
|
||||
$result = true;
|
||||
|
||||
//openssl extension needs to be loaded
|
||||
$result &= extension_loaded("openssl");
|
||||
// we need php >= 5.3.3
|
||||
$result &= version_compare(phpversion(), '5.3.3', '>=');
|
||||
|
||||
return (bool) $result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -81,9 +81,9 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||
$scheme = ($params['use_ssl'] === 'false') ? 'http' : 'https';
|
||||
$this->test = isset($params['test']);
|
||||
$this->timeout = ( ! isset($params['timeout'])) ? 15 : $params['timeout'];
|
||||
$params['region'] = ( ! isset($params['region'])) ? 'eu-west-1' : $params['region'];
|
||||
$params['hostname'] = ( !isset($params['hostname'])) ? 's3.amazonaws.com' : $params['hostname'];
|
||||
if (!isset($params['port'])) {
|
||||
$params['region'] = ( ! isset($params['region']) || $params['region'] === '' ) ? 'eu-west-1' : $params['region'];
|
||||
$params['hostname'] = ( !isset($params['hostname']) || $params['hostname'] === '' ) ? 's3.amazonaws.com' : $params['hostname'];
|
||||
if (!isset($params['port']) || $params['port'] === '') {
|
||||
$params['port'] = ($params['use_ssl'] === 'false') ? 80 : 443;
|
||||
}
|
||||
$base_url = $scheme.'://'.$params['hostname'].':'.$params['port'].'/';
|
||||
@@ -507,8 +507,10 @@ class AmazonS3 extends \OC\Files\Storage\Common {
|
||||
}
|
||||
|
||||
public function test() {
|
||||
$test = $this->s3->get_canonical_user_id();
|
||||
if (isset($test['id']) && $test['id'] != '') {
|
||||
$test = $this->connection->getBucketAcl(array(
|
||||
'Bucket' => $this->bucket,
|
||||
));
|
||||
if (isset($test) && !is_null($test->getPath('Owner/ID'))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -50,9 +50,9 @@ class OC_Mount_Config {
|
||||
'key' => 'Access Key',
|
||||
'secret' => '*Secret Key',
|
||||
'bucket' => 'Bucket',
|
||||
'hostname' => 'Hostname (optional)',
|
||||
'port' => 'Port (optional)',
|
||||
'region' => 'Region (optional)',
|
||||
'hostname' => '&Hostname (optional)',
|
||||
'port' => '&Port (optional)',
|
||||
'region' => '&Region (optional)',
|
||||
'use_ssl' => '!Enable SSL',
|
||||
'use_path_style' => '!Enable Path Style'));
|
||||
|
||||
@@ -244,6 +244,7 @@ class OC_Mount_Config {
|
||||
$storage = new $class($options);
|
||||
return $storage->test();
|
||||
} catch (Exception $exception) {
|
||||
\OCP\Util::logException('files_external', $exception);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
class="optional"
|
||||
data-parameter="<?php p($parameter); ?>"
|
||||
value="<?php p($value); ?>"
|
||||
placeholder="<?php p(substr($placeholder, 5)); ?>" />
|
||||
placeholder="<?php p(substr($placeholder, 1)); ?>" />
|
||||
<?php elseif (strpos($placeholder, '#') !== false): ?>
|
||||
<input type="hidden"
|
||||
data-parameter="<?php p($parameter); ?>"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
body {
|
||||
background:#ddd;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
#header {
|
||||
@@ -22,7 +22,7 @@ body {
|
||||
#public_upload,
|
||||
#download {
|
||||
font-weight:700;
|
||||
margin: 0 0.4em 0 0;
|
||||
margin: 0 0 0 .4em;
|
||||
padding: 0 5px;
|
||||
height: 32px;
|
||||
float: left;
|
||||
@@ -49,12 +49,14 @@ body {
|
||||
vertical-align:text-bottom;
|
||||
}
|
||||
|
||||
#controls {
|
||||
left: 0;
|
||||
}
|
||||
|
||||
#preview {
|
||||
background:#eee;
|
||||
border-bottom:1px solid #f8f8f8;
|
||||
min-height:30em;
|
||||
text-align:center;
|
||||
margin:45px auto;
|
||||
background: #fff;
|
||||
text-align: center;
|
||||
margin: 45px auto 0;
|
||||
}
|
||||
|
||||
#noPreview {
|
||||
@@ -62,11 +64,16 @@ body {
|
||||
padding-top:5em;
|
||||
}
|
||||
|
||||
footer {
|
||||
margin-top: 45px;
|
||||
}
|
||||
|
||||
p.info {
|
||||
color:#777;
|
||||
text-align:center;
|
||||
width:22em;
|
||||
margin:2em auto;
|
||||
color: #777;
|
||||
text-align: center;
|
||||
width: 22em;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
p.info a {
|
||||
|
||||
@@ -4,14 +4,24 @@ OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
// "empty trash" command
|
||||
$deleteAll = false;
|
||||
if (isset($_POST['allfiles']) and $_POST['allfiles'] === 'true'){
|
||||
$user = \OCP\User::getUser();
|
||||
$list = OCA\Files_Trashbin\Helper::getTrashFiles('/');
|
||||
$deleteAll = true;
|
||||
$dirlisting = '0';
|
||||
$folder = isset($_POST['dir']) ? $_POST['dir'] : '/';
|
||||
if ($folder === '/' || $folder === '') {
|
||||
OCA\Files_Trashbin\Trashbin::deleteAll();
|
||||
$list = array();
|
||||
} else {
|
||||
$dirname = dirname($folder);
|
||||
if ( $dirname !== '/' && $dirname !== '.' ) {
|
||||
$dirlisting = '1';
|
||||
} else {
|
||||
$dirlisting = '0';
|
||||
}
|
||||
$list[] = $folder;
|
||||
}
|
||||
}
|
||||
else {
|
||||
$deleteAll = false;
|
||||
$files = $_POST['files'];
|
||||
$dirlisting = $_POST['dirlisting'];
|
||||
$list = json_decode($files);
|
||||
@@ -19,19 +29,13 @@ else {
|
||||
$error = array();
|
||||
$success = array();
|
||||
|
||||
|
||||
$i = 0;
|
||||
foreach ($list as $file) {
|
||||
if ( $dirlisting === '0') {
|
||||
if ($deleteAll) {
|
||||
$filename = $file['name'];
|
||||
$timestamp = $file['timestamp'];
|
||||
}
|
||||
else {
|
||||
$delimiter = strrpos($file, '.d');
|
||||
$filename = substr($file, 0, $delimiter);
|
||||
$timestamp = substr($file, $delimiter+2);
|
||||
}
|
||||
$file = ltrim($file, '/');
|
||||
$delimiter = strrpos($file, '.d');
|
||||
$filename = substr($file, 0, $delimiter);
|
||||
$timestamp = substr($file, $delimiter+2);
|
||||
} else {
|
||||
$filename = $file;
|
||||
$timestamp = null;
|
||||
|
||||
@@ -13,6 +13,7 @@ $success = array();
|
||||
$i = 0;
|
||||
foreach ($list as $file) {
|
||||
if ( $dirlisting === '0') {
|
||||
$file = ltrim($file, '/');
|
||||
$delimiter = strrpos($file, '.d');
|
||||
$filename = substr($file, 0, $delimiter);
|
||||
$timestamp = substr($file, $delimiter+2);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
#fileList td a.file, #fileList td a.file span {
|
||||
cursor: default;
|
||||
}
|
||||
@@ -10,6 +10,7 @@ OCP\Util::addScript('files', 'fileactions');
|
||||
$tmpl = new OCP\Template('files_trashbin', 'index', 'user');
|
||||
|
||||
OCP\Util::addStyle('files', 'files');
|
||||
OCP\Util::addStyle('files_trashbin', 'trash');
|
||||
OCP\Util::addScript('files', 'filelist');
|
||||
// filelist overrides
|
||||
OCP\Util::addScript('files_trashbin', 'filelist');
|
||||
|
||||
@@ -8,7 +8,7 @@ $(document).ready(function() {
|
||||
deleteAction.removeClass('delete-icon').addClass('progress-icon');
|
||||
disableActions();
|
||||
$.post(OC.filePath('files_trashbin', 'ajax', 'undelete.php'),
|
||||
{files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')},
|
||||
{files: JSON.stringify([$('#dir').val() + '/' + filename]), dirlisting: tr.attr('data-dirlisting')},
|
||||
function(result) {
|
||||
for (var i = 0; i < result.data.success.length; i++) {
|
||||
var row = document.getElementById(result.data.success[i].filename);
|
||||
@@ -35,7 +35,7 @@ $(document).ready(function() {
|
||||
deleteAction.removeClass('delete-icon').addClass('progress-icon');
|
||||
disableActions();
|
||||
$.post(OC.filePath('files_trashbin', 'ajax', 'delete.php'),
|
||||
{files: JSON.stringify([filename]), dirlisting: tr.attr('data-dirlisting')},
|
||||
{files: JSON.stringify([$('#dir').val() + '/' +filename]), dirlisting: tr.attr('data-dirlisting')},
|
||||
function(result) {
|
||||
for (var i = 0; i < result.data.success.length; i++) {
|
||||
var row = document.getElementById(result.data.success[i].filename);
|
||||
@@ -66,41 +66,6 @@ $(document).ready(function() {
|
||||
procesSelection();
|
||||
});
|
||||
|
||||
$('#fileList').on('click', 'td.filename a', function(event) {
|
||||
if (event.shiftKey) {
|
||||
event.preventDefault();
|
||||
var last = $(lastChecked).parent().parent().prevAll().length;
|
||||
var first = $(this).parent().parent().prevAll().length;
|
||||
var start = Math.min(first, last);
|
||||
var end = Math.max(first, last);
|
||||
var rows = $(this).parent().parent().parent().children('tr');
|
||||
for (var i = start; i < end; i++) {
|
||||
$(rows).each(function(index) {
|
||||
if (index == i) {
|
||||
var checkbox = $(this).children().children('input:checkbox');
|
||||
$(checkbox).attr('checked', 'checked');
|
||||
$(checkbox).parent().parent().addClass('selected');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
var checkbox = $(this).parent().children('input:checkbox');
|
||||
lastChecked = checkbox;
|
||||
if ($(checkbox).attr('checked')) {
|
||||
$(checkbox).removeAttr('checked');
|
||||
$(checkbox).parent().parent().removeClass('selected');
|
||||
$('#select_all').removeAttr('checked');
|
||||
} else {
|
||||
$(checkbox).attr('checked', 'checked');
|
||||
$(checkbox).parent().parent().toggleClass('selected');
|
||||
var selectedCount = $('td.filename input:checkbox:checked').length;
|
||||
if (selectedCount == $('td.filename input:checkbox').length) {
|
||||
$('#select_all').attr('checked', 'checked');
|
||||
}
|
||||
}
|
||||
procesSelection();
|
||||
});
|
||||
|
||||
$('.undelete').click('click', function(event) {
|
||||
event.preventDefault();
|
||||
var files = getSelectedFiles('file');
|
||||
@@ -136,7 +101,8 @@ $(document).ready(function() {
|
||||
var params = {};
|
||||
if (allFiles) {
|
||||
params = {
|
||||
allfiles: true
|
||||
allfiles: true,
|
||||
dir: $('#dir').val()
|
||||
};
|
||||
}
|
||||
else {
|
||||
@@ -183,6 +149,12 @@ $(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
$('#fileList').on('click', 'td.filename input', function() {
|
||||
var checkbox = $(this).parent().children('input:checkbox');
|
||||
$(checkbox).parent().parent().toggleClass('selected');
|
||||
procesSelection();
|
||||
});
|
||||
|
||||
$('#fileList').on('click', 'td.filename a', function(event) {
|
||||
var mime = $(this).parent().parent().data('mime');
|
||||
if (mime !== 'httpd/unix-directory') {
|
||||
@@ -229,7 +201,7 @@ function getSelectedFiles(property){
|
||||
elements.each(function(i,element){
|
||||
var file={
|
||||
name:$(element).attr('data-filename'),
|
||||
file:$(element).attr('data-file'),
|
||||
file:$('#dir').val() + "/" + $(element).attr('data-file'),
|
||||
timestamp:$(element).attr('data-timestamp'),
|
||||
type:$(element).attr('data-type'),
|
||||
dirlisting:$(element).attr('data-dirlisting')
|
||||
|
||||
@@ -44,8 +44,10 @@ class Helper
|
||||
}
|
||||
|
||||
$files = array();
|
||||
$id = 0;
|
||||
foreach ($result as $r) {
|
||||
$i = array();
|
||||
$i['id'] = $id++;
|
||||
$i['name'] = $r['id'];
|
||||
$i['date'] = \OCP\Util::formatDate($r['timestamp']);
|
||||
$i['timestamp'] = $r['timestamp'];
|
||||
|
||||
@@ -564,6 +564,21 @@ class Trashbin {
|
||||
return $size;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief delete all files from the trash
|
||||
*/
|
||||
public static function deleteAll() {
|
||||
$user = \OCP\User::getUser();
|
||||
$view = new \OC\Files\View('/' . $user);
|
||||
$view->deleteAll('files_trashbin');
|
||||
self::setTrashbinSize($user, 0);
|
||||
$query = \OC_DB::prepare('DELETE FROM `*PREFIX*files_trash` WHERE `user`=?');
|
||||
$query->execute(array($user));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief delete file from trash bin permanently
|
||||
*
|
||||
@@ -763,8 +778,13 @@ class Trashbin {
|
||||
*/
|
||||
private static function expire($trashbinSize, $user) {
|
||||
|
||||
// let the admin disable auto expire
|
||||
$autoExpire = \OC_Config::getValue('trashbin_auto_expire', true);
|
||||
if ($autoExpire === false) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
$user = \OCP\User::getUser();
|
||||
$view = new \OC\Files\View('/' . $user);
|
||||
$availableSpace = self::calculateFreeSpace($trashbinSize);
|
||||
$size = 0;
|
||||
|
||||
|
||||
@@ -35,18 +35,21 @@
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
>
|
||||
<?php if(!isset($_['readonly']) || !$_['readonly']): ?><input type="checkbox" /><?php endif; ?>
|
||||
<?php if(!isset($_['readonly']) || !$_['readonly']): ?>
|
||||
<input id="select-<?php p($file['id']); ?>" type="checkbox" />
|
||||
<label for="select-<?php p($file['id']); ?>"></label>
|
||||
<?php endif; ?>
|
||||
<?php if($file['type'] === 'dir'): ?>
|
||||
<?php if( $_['dirlisting'] ): ?>
|
||||
<a class="name" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
|
||||
<a class="name dir" href="<?php p($_['baseURL'].'/'.$name); ?>" title="">
|
||||
<?php else: ?>
|
||||
<a class="name" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
|
||||
<a class="name dir" href="<?php p($_['baseURL'].'/'.$name.'.d'.$file['timestamp']); ?>" title="">
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php if( $_['dirlisting'] ): ?>
|
||||
<a class="name" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
|
||||
<a class="name file" href="<?php p($_['downloadURL'].'/'.$name); ?>" title="">
|
||||
<?php else: ?>
|
||||
<a class="name" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
|
||||
<a class="name file" href="<?php p($_['downloadURL'].'/'.$name.'.d'.$file['timestamp']);?>" title="">
|
||||
<?php endif; ?>
|
||||
<?php endif; ?>
|
||||
<span class="nametext">
|
||||
|
||||
@@ -27,6 +27,18 @@ OCP\JSON::checkAppEnabled('user_ldap');
|
||||
OCP\JSON::callCheck();
|
||||
|
||||
$prefix = $_POST['ldap_serverconfig_chooser'];
|
||||
|
||||
// Checkboxes are not submitted, when they are unchecked. Set them manually.
|
||||
// only legacy checkboxes (Advanced and Expert tab) need to be handled here,
|
||||
// the Wizard-like tabs handle it on their own
|
||||
$chkboxes = array('ldap_configuration_active', 'ldap_override_main_server',
|
||||
'ldap_nocase', 'ldap_turn_off_cert_check');
|
||||
foreach($chkboxes as $boxid) {
|
||||
if(!isset($_POST[$boxid])) {
|
||||
$_POST[$boxid] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
|
||||
$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, $prefix);
|
||||
$connection->setConfiguration($_POST);
|
||||
|
||||
@@ -30,6 +30,8 @@ $l=OC_L10N::get('user_ldap');
|
||||
|
||||
$ldapWrapper = new OCA\user_ldap\lib\LDAP();
|
||||
$connection = new \OCA\user_ldap\lib\Connection($ldapWrapper, '', null);
|
||||
//needs to be true, otherwise it will also fail with an irritating message
|
||||
$_POST['ldap_configuration_active'] = 1;
|
||||
if($connection->setConfiguration($_POST)) {
|
||||
//Configuration is okay
|
||||
if($connection->bind()) {
|
||||
|
||||
@@ -407,6 +407,7 @@ var LdapWizard = {
|
||||
if($('#rawLoginFilterContainer').hasClass('invisible')) {
|
||||
$('#ldap_loginfilter_attributes').multiselect('enable');
|
||||
}
|
||||
LdapWizard.postInitLoginFilter();
|
||||
},
|
||||
function (result) {
|
||||
//deactivate if no attributes found
|
||||
@@ -443,10 +444,24 @@ var LdapWizard = {
|
||||
//enable only when raw filter editing is not turned on
|
||||
$('#'+multisel).multiselect('enable');
|
||||
}
|
||||
if(type === 'Users') {
|
||||
//required for initial save
|
||||
filter = $('#ldap_userlist_filter').val();
|
||||
if(!filter) {
|
||||
LdapWizard.saveMultiSelect(multisel,
|
||||
$('#'+multisel).multiselect("getChecked"));
|
||||
}
|
||||
LdapWizard.userFilterAvailableGroupsHasRun = true;
|
||||
LdapWizard.postInitUserFilter();
|
||||
}
|
||||
},
|
||||
function (result) {
|
||||
LdapWizard.hideSpinner('#'+multisel);
|
||||
$('#'+multisel).multiselect('disable');
|
||||
if(type == 'Users') {
|
||||
LdapWizard.userFilterAvailableGroupsHasRun = true;
|
||||
LdapWizard.postInitUserFilter();
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
@@ -471,9 +486,23 @@ var LdapWizard = {
|
||||
LdapWizard.hideSpinner('#'+multisel);
|
||||
LdapWizard.applyChanges(result);
|
||||
$('#'+multisel).multiselect('refresh');
|
||||
if(type === 'User') {
|
||||
//required for initial save
|
||||
filter = $('#ldap_userlist_filter').val();
|
||||
if(!filter) {
|
||||
LdapWizard.saveMultiSelect(multisel,
|
||||
$('#'+multisel).multiselect("getChecked"));
|
||||
}
|
||||
LdapWizard.userFilterObjectClassesHasRun = true;
|
||||
LdapWizard.postInitUserFilter();
|
||||
}
|
||||
},
|
||||
function (result) {
|
||||
LdapWizard.hideSpinner('#'+multisel);
|
||||
if(type == 'User') {
|
||||
LdapWizard.userFilterObjectClassesHasRun = true;
|
||||
LdapWizard.postInitUserFilter();
|
||||
}
|
||||
//TODO: error handling
|
||||
}
|
||||
);
|
||||
@@ -489,13 +518,17 @@ var LdapWizard = {
|
||||
loginfilter = $('#ldap_login_filter').val();
|
||||
|
||||
//FIXME: activates a manually deactivated configuration.
|
||||
if(host && port && base && userfilter && loginfilter) {
|
||||
if(host && port && base && userfilter && loginfilter) {
|
||||
LdapWizard.updateStatusIndicator(true);
|
||||
if($('#ldap_configuration_active').is(':checked')) {
|
||||
return;
|
||||
}
|
||||
$('#ldap_configuration_active').prop('checked', true);
|
||||
LdapWizard.save($('#ldap_configuration_active')[0]);
|
||||
if(!LdapWizard.isConfigurationActiveControlLocked) {
|
||||
//avoids a manually deactivated connection will be activated
|
||||
//upon opening the admin page
|
||||
$('#ldap_configuration_active').prop('checked', true);
|
||||
LdapWizard.save($('#ldap_configuration_active')[0]);
|
||||
}
|
||||
} else {
|
||||
if($('#ldap_configuration_active').is(':checked')) {
|
||||
$('#ldap_configuration_active').prop('checked', false);
|
||||
@@ -517,9 +550,12 @@ var LdapWizard = {
|
||||
$(id + " + button").css('display', 'inline');
|
||||
},
|
||||
|
||||
isConfigurationActiveControlLocked: true,
|
||||
|
||||
init: function() {
|
||||
LdapWizard.basicStatusCheck();
|
||||
LdapWizard.functionalityCheck();
|
||||
LdapWizard.isConfigurationActiveControlLocked = false;
|
||||
},
|
||||
|
||||
initGroupFilter: function() {
|
||||
@@ -529,11 +565,21 @@ var LdapWizard = {
|
||||
LdapWizard.countGroups();
|
||||
},
|
||||
|
||||
/** init login filter tab section **/
|
||||
|
||||
initLoginFilter: function() {
|
||||
LdapWizard.regardFilterMode('Login');
|
||||
LdapWizard.findAttributes();
|
||||
},
|
||||
|
||||
postInitLoginFilter: function() {
|
||||
if($('#rawLoginFilterContainer').hasClass('invisible')) {
|
||||
LdapWizard.composeFilter('login');
|
||||
}
|
||||
},
|
||||
|
||||
/** end of init user filter tab section **/
|
||||
|
||||
initMultiSelect: function(object, id, caption) {
|
||||
object.multiselect({
|
||||
header: false,
|
||||
@@ -546,13 +592,29 @@ var LdapWizard = {
|
||||
});
|
||||
},
|
||||
|
||||
/** init user filter tab section **/
|
||||
|
||||
userFilterObjectClassesHasRun: false,
|
||||
userFilterAvailableGroupsHasRun: false,
|
||||
|
||||
initUserFilter: function() {
|
||||
LdapWizard.userFilterObjectClassesHasRun = false;
|
||||
LdapWizard.userFilterAvailableGroupsHasRun = false;
|
||||
LdapWizard.regardFilterMode('User');
|
||||
LdapWizard.findObjectClasses('ldap_userfilter_objectclass', 'User');
|
||||
LdapWizard.findAvailableGroups('ldap_userfilter_groups', 'Users');
|
||||
LdapWizard.countUsers();
|
||||
},
|
||||
|
||||
postInitUserFilter: function() {
|
||||
if(LdapWizard.userFilterObjectClassesHasRun
|
||||
&& LdapWizard.userFilterAvailableGroupsHasRun) {
|
||||
LdapWizard.composeFilter('user');
|
||||
LdapWizard.countUsers();
|
||||
}
|
||||
},
|
||||
|
||||
/** end of init user filter tab section **/
|
||||
|
||||
onTabChange: function(event, ui) {
|
||||
newTabIndex = 0;
|
||||
if(ui.newTab[0].id === '#ldapWizard2') {
|
||||
@@ -619,8 +681,6 @@ var LdapWizard = {
|
||||
} else if(mode == LdapWizard.filterModeAssisted
|
||||
&& !$('#raw'+subject+'FilterContainer').hasClass('invisible')) {
|
||||
LdapWizard['toggleRaw'+subject+'Filter']();
|
||||
} else {
|
||||
c = $('#raw'+subject+'FilterContainer').hasClass('invisible');
|
||||
}
|
||||
},
|
||||
function (result) {
|
||||
|
||||
@@ -308,7 +308,7 @@ class Configuration {
|
||||
'ldap_user_filter_mode' => 0,
|
||||
'ldap_userfilter_objectclass' => '',
|
||||
'ldap_userfilter_groups' => '',
|
||||
'ldap_login_filter' => 'uid=%uid',
|
||||
'ldap_login_filter' => '',
|
||||
'ldap_login_filter_mode' => 0,
|
||||
'ldap_loginfilter_email' => 0,
|
||||
'ldap_loginfilter_username' => 1,
|
||||
|
||||
@@ -432,7 +432,6 @@ class Wizard extends LDAPUtility {
|
||||
$this->configuration->setConfiguration($config);
|
||||
\OCP\Util::writeLog('user_ldap', 'Wiz: detected Port '. $p, \OCP\Util::DEBUG);
|
||||
$this->result->addChange('ldap_port', $p);
|
||||
$this->result->addChange('ldap_tls', intval($t));
|
||||
return $this->result;
|
||||
}
|
||||
}
|
||||
@@ -1001,7 +1000,7 @@ class Wizard extends LDAPUtility {
|
||||
|
||||
private function getConnection() {
|
||||
if(!is_null($this->cr)) {
|
||||
return $cr;
|
||||
return $this->cr;
|
||||
}
|
||||
$cr = $this->ldap->connect(
|
||||
$this->configuration->ldapHost.':'.$this->configuration->ldapPort,
|
||||
|
||||
@@ -117,6 +117,9 @@ $CONFIG = array(
|
||||
/* How long should ownCloud keep deleted files in the trash bin, default value: 30 days */
|
||||
'trashbin_retention_obligation' => 30,
|
||||
|
||||
/* Disable/Enable auto expire for the trash bin, by default auto expire is enabled */
|
||||
'trashbin_auto_expire' => true,
|
||||
|
||||
/* allow user to change his display name, if it is supported by the back-end */
|
||||
'allow_user_to_change_display_name' => true,
|
||||
|
||||
@@ -185,8 +188,8 @@ $CONFIG = array(
|
||||
// "datadirectory" => "",
|
||||
|
||||
/* Enable maintenance mode to disable ownCloud
|
||||
If you want to prevent users to login to ownCloud before you start doing some maintenance work,
|
||||
you need to set the value of the maintenance parameter to true.
|
||||
If you want to prevent users to login to ownCloud before you start doing some maintenance work,
|
||||
you need to set the value of the maintenance parameter to true.
|
||||
Please keep in mind that users who are already logged-in are kicked out of ownCloud instantly.
|
||||
*/
|
||||
"maintenance" => false,
|
||||
|
||||
+10
-3
@@ -105,8 +105,8 @@ textarea:hover, textarea:focus, textarea:active {
|
||||
input[type="checkbox"] { margin:0; padding:0; height:auto; width:auto; }
|
||||
input[type="checkbox"]:hover+label, input[type="checkbox"]:focus+label { color:#111 !important; }
|
||||
input[type="time"] {
|
||||
width: 110px;
|
||||
height: 30px;
|
||||
width: initial;
|
||||
height: 31px;
|
||||
-moz-box-sizing: border-box; box-sizing: border-box;
|
||||
}
|
||||
#quota {
|
||||
@@ -202,13 +202,20 @@ input[type="submit"].enabled {
|
||||
box-sizing: border-box;
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: 80px;
|
||||
left: 0;
|
||||
height: 44px;
|
||||
width: 100%;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: #eee;
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
z-index: 50;
|
||||
}
|
||||
/* account for shift of controls bar due to app navigation */
|
||||
#body-user #controls,
|
||||
#body-settings #controls {
|
||||
padding-left: 80px;
|
||||
}
|
||||
#controls .button,
|
||||
#controls button,
|
||||
#controls input[type='submit'],
|
||||
|
||||
@@ -424,4 +424,12 @@ class Wrapper implements \OC\Files\Storage\Storage {
|
||||
public function getETag($path) {
|
||||
return $this->storage->getETag($path);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true
|
||||
* @return true
|
||||
*/
|
||||
public function test() {
|
||||
return $this->storage->test();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -159,7 +159,11 @@ class View {
|
||||
}
|
||||
|
||||
public function rmdir($path) {
|
||||
return $this->basicOperation('rmdir', $path, array('delete'));
|
||||
if ($this->is_dir($path)) {
|
||||
return $this->basicOperation('rmdir', $path, array('delete'));
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function opendir($path) {
|
||||
@@ -712,7 +716,7 @@ class View {
|
||||
return false;
|
||||
}
|
||||
$defaultRoot = Filesystem::getRoot();
|
||||
if($this->fakeRoot === $defaultRoot){
|
||||
if ($this->fakeRoot === $defaultRoot) {
|
||||
return true;
|
||||
}
|
||||
return (strlen($this->fakeRoot) > strlen($defaultRoot)) && (substr($this->fakeRoot, 0, strlen($defaultRoot) + 1) === $defaultRoot . '/');
|
||||
|
||||
@@ -3,6 +3,10 @@
|
||||
namespace OC\Setup;
|
||||
|
||||
abstract class AbstractDatabase {
|
||||
|
||||
/**
|
||||
* @var \OC_L10N
|
||||
*/
|
||||
protected $trans;
|
||||
protected $dbDefinitionFile;
|
||||
protected $dbuser;
|
||||
|
||||
+39
-24
@@ -29,10 +29,10 @@ class OCI extends AbstractDatabase {
|
||||
\OC_Log::write('setup oracle', 'connect string: ' . $easy_connect_string, \OC_Log::DEBUG);
|
||||
$connection = @oci_connect($this->dbuser, $this->dbpassword, $easy_connect_string);
|
||||
if(!$connection) {
|
||||
$e = oci_error();
|
||||
if (is_array ($e) && isset ($e['message'])) {
|
||||
$errorMessage = $this->getLastError();
|
||||
if ($errorMessage) {
|
||||
throw new \DatabaseSetupException($this->trans->t('Oracle connection could not be established'),
|
||||
$e['message'].' Check environment: ORACLE_HOME='.getenv('ORACLE_HOME')
|
||||
$errorMessage.' Check environment: ORACLE_HOME='.getenv('ORACLE_HOME')
|
||||
.' ORACLE_SID='.getenv('ORACLE_SID')
|
||||
.' LD_LIBRARY_PATH='.getenv('LD_LIBRARY_PATH')
|
||||
.' NLS_LANG='.getenv('NLS_LANG')
|
||||
@@ -51,7 +51,7 @@ class OCI extends AbstractDatabase {
|
||||
." WHERE user_role_privs.granted_role = role_sys_privs.role AND privilege = 'CREATE ROLE'";
|
||||
$stmt = oci_parse($connection, $query);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_last_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
@@ -68,25 +68,25 @@ class OCI extends AbstractDatabase {
|
||||
$this->dbpassword=\OC_Util::generateRandomBytes(30);
|
||||
|
||||
//oracle passwords are treated as identifiers:
|
||||
// must start with aphanumeric char
|
||||
// must start with alphanumeric char
|
||||
// needs to be shortened to 30 bytes, as the two " needed to escape the identifier count towards the identifier length.
|
||||
$this->dbpassword=substr($this->dbpassword, 0, 30);
|
||||
|
||||
$this->createDBUser($connection);
|
||||
|
||||
\OC_Config::setValue('dbuser', $this->dbusername);
|
||||
\OC_Config::setValue('dbname', $this->dbusername);
|
||||
\OC_Config::setValue('dbuser', $this->dbuser);
|
||||
\OC_Config::setValue('dbname', $this->dbuser);
|
||||
\OC_Config::setValue('dbpassword', $this->dbpassword);
|
||||
|
||||
//create the database not neccessary, oracle implies user = schema
|
||||
//$this->createDatabase($this->dbname, $this->dbusername, $connection);
|
||||
//create the database not necessary, oracle implies user = schema
|
||||
//$this->createDatabase($this->dbname, $this->dbuser, $connection);
|
||||
} else {
|
||||
|
||||
\OC_Config::setValue('dbuser', $this->dbuser);
|
||||
\OC_Config::setValue('dbname', $this->dbname);
|
||||
\OC_Config::setValue('dbpassword', $this->dbpassword);
|
||||
|
||||
//create the database not neccessary, oracle implies user = schema
|
||||
//create the database not necessary, oracle implies user = schema
|
||||
//$this->createDatabase($this->dbname, $this->dbuser, $connection);
|
||||
}
|
||||
|
||||
@@ -115,10 +115,10 @@ class OCI extends AbstractDatabase {
|
||||
}
|
||||
$query = "SELECT count(*) FROM user_tables WHERE table_name = :un";
|
||||
$stmt = oci_parse($connection, $query);
|
||||
$un = $this->dbtableprefix.'users';
|
||||
$un = $this->tableprefix.'users';
|
||||
oci_bind_by_name($stmt, ':un', $un);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
@@ -133,25 +133,22 @@ class OCI extends AbstractDatabase {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param String $name
|
||||
* @param String $password
|
||||
* @param resource $connection
|
||||
*/
|
||||
private function createDBUser($connection) {
|
||||
$name = $this->dbuser;
|
||||
$password = $this->password;
|
||||
$password = $this->dbpassword;
|
||||
$query = "SELECT * FROM all_users WHERE USERNAME = :un";
|
||||
$stmt = oci_parse($connection, $query);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
oci_bind_by_name($stmt, ':un', $name);
|
||||
$result = oci_execute($stmt);
|
||||
if(!$result) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
@@ -162,14 +159,14 @@ class OCI extends AbstractDatabase {
|
||||
$query = 'CREATE USER '.$name.' IDENTIFIED BY "'.$password.'" DEFAULT TABLESPACE '.$this->dbtablespace;
|
||||
$stmt = oci_parse($connection, $query);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
//oci_bind_by_name($stmt, ':un', $name);
|
||||
$result = oci_execute($stmt);
|
||||
if(!$result) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s',
|
||||
array($query, $name, $password)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
@@ -178,7 +175,7 @@ class OCI extends AbstractDatabase {
|
||||
$query = "ALTER USER :un IDENTIFIED BY :pw";
|
||||
$stmt = oci_parse($connection, $query);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
@@ -186,7 +183,7 @@ class OCI extends AbstractDatabase {
|
||||
oci_bind_by_name($stmt, ':pw', $password);
|
||||
$result = oci_execute($stmt);
|
||||
if(!$result) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
@@ -195,16 +192,34 @@ class OCI extends AbstractDatabase {
|
||||
$query = 'GRANT CREATE SESSION, CREATE TABLE, CREATE SEQUENCE, CREATE TRIGGER, UNLIMITED TABLESPACE TO '.$name;
|
||||
$stmt = oci_parse($connection, $query);
|
||||
if (!$stmt) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s"', array($query)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
$result = oci_execute($stmt);
|
||||
if(!$result) {
|
||||
$entry = $this->trans->t('DB Error: "%s"', array(oci_error($connection))) . '<br />';
|
||||
$entry = $this->trans->t('DB Error: "%s"', array($this->getLastError($connection))) . '<br />';
|
||||
$entry .= $this->trans->t('Offending command was: "%s", name: %s, password: %s',
|
||||
array($query, $name, $password)) . '<br />';
|
||||
\OC_Log::write('setup.oci', $entry, \OC_Log::WARN);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param resource $connection
|
||||
* @return string
|
||||
*/
|
||||
protected function getLastError($connection = null) {
|
||||
if ($connection) {
|
||||
$error = oci_error($connection);
|
||||
} else {
|
||||
$error = oci_error();
|
||||
}
|
||||
foreach (array('message', 'code') as $key) {
|
||||
if (isset($error[$key])) {
|
||||
return $error[$key];
|
||||
}
|
||||
}
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
||||
+10
-2
@@ -437,9 +437,9 @@ class OC_Util {
|
||||
);
|
||||
$webServerRestart = true;
|
||||
}
|
||||
if(version_compare(phpversion(), '5.3.8', '<')) {
|
||||
if(version_compare(phpversion(), '5.3.3', '<')) {
|
||||
$errors[] = array(
|
||||
'error'=>'PHP 5.3.8 or higher is required.',
|
||||
'error'=>'PHP 5.3.3 or higher is required.',
|
||||
'hint'=>'Please ask your server administrator to update PHP to the latest version.'
|
||||
.' Your PHP version is no longer supported by ownCloud and the PHP community.'
|
||||
);
|
||||
@@ -874,6 +874,14 @@ class OC_Util {
|
||||
return function_exists('finfo_open');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if a PHP version older then 5.3.8 is installed.
|
||||
* @return bool
|
||||
*/
|
||||
public static function isPHPoutdated() {
|
||||
return version_compare(phpversion(), '5.3.8', '<');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the ownCloud server can connect to the internet
|
||||
* @return bool
|
||||
|
||||
@@ -28,6 +28,7 @@ $tmpl->assign('internetconnectionworking', OC_Util::isInternetConnectionEnabled(
|
||||
$tmpl->assign('isLocaleWorking', OC_Util::isSetLocaleWorking());
|
||||
$tmpl->assign('isWebDavWorking', OC_Util::isWebDAVWorking());
|
||||
$tmpl->assign('has_fileinfo', OC_Util::fileInfoLoaded());
|
||||
$tmpl->assign('old_php', OC_Util::isPHPoutdated());
|
||||
$tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax'));
|
||||
$tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes'));
|
||||
|
||||
|
||||
@@ -72,6 +72,20 @@ if (!$_['has_fileinfo']) {
|
||||
<?php
|
||||
}
|
||||
|
||||
// is PHP at least at 5.3.8?
|
||||
if ($_['old_php']) {
|
||||
?>
|
||||
<fieldset class="personalblock">
|
||||
<h2><?php p($l->t('Your PHP version is outdated'));?></h2>
|
||||
|
||||
<span class="connectionwarning">
|
||||
<?php p($l->t('Your PHP version is outdated. We strongly recommend to update to 5.3.8 or newer because older versions are known to be broken. It is possible that this installation is not working correctly.')); ?>
|
||||
</span>
|
||||
|
||||
</fieldset>
|
||||
<?php
|
||||
}
|
||||
|
||||
// is locale working ?
|
||||
if (!$_['isLocaleWorking']) {
|
||||
?>
|
||||
|
||||
@@ -42,6 +42,13 @@ abstract class Storage extends \PHPUnit_Framework_TestCase {
|
||||
$this->assertTrue($this->instance->isUpdatable('/'), 'Root folder is not writable');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check that the test() function works
|
||||
*/
|
||||
public function testTestFunction() {
|
||||
$this->assertTrue($this->instance->test());
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider directoryProvider
|
||||
*/
|
||||
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
// We only can count up. The 4. digit is only for the internal patchlevel to trigger DB upgrades between betas, final and RCs. This is _not_ the public version number. Reset minor/patchlevel when updating major/minor version number.
|
||||
$OC_Version=array(6, 00, 0, 10);
|
||||
$OC_Version=array(6, 00, 0, 11);
|
||||
|
||||
// The human readable string
|
||||
$OC_VersionString='6.0 RC2';
|
||||
$OC_VersionString='6.0 RC3';
|
||||
|
||||
// The ownCloud edition
|
||||
$OC_Edition='';
|
||||
|
||||
Reference in New Issue
Block a user