Compare commits

...

41 Commits

Author SHA1 Message Date
Frank Karlitschek 4d50fe5f12 ownCloud 6 RC3 2013-12-05 12:02:53 +01:00
Vincent Petry f24aca61a9 Merge pull request #6180 from owncloud/fix_6143
fixes checkboxes in Advanced Tab don't save unchecked state anymore, #6143
2013-12-04 08:33:12 -08:00
Bjoern Schiessle d3e2226b38 config switch to disable auto expire for the trash bin 2013-12-04 16:55:07 +01:00
Arthur Schiwon 73fa6259be LDAP Wizard: avoid a manually deactivated LDAP configuration is enabled by just opening the admin page 2013-12-04 14:01:31 +01:00
Morris Jobke dffc2a8b1c Revert "Adjust files_encryption requirements to the new core requirement (PHP 5.3.8)."
This reverts commit efbf18652c.
2013-12-04 13:26:59 +01:00
Vincent Petry fd634fdec8 Added unit test for the test() method
This is to make sure that method isn't broken
2013-12-04 13:22:25 +01:00
Arthur Schiwon 328ebaefde LDAP: make unsetting checkboxes from Advanced tab work again, fixes #6143 2013-12-04 13:15:17 +01:00
Thomas Müller 4de8c4e5db Merge pull request #6175 from owncloud/fix_6142
LDAP Wizard: make sure auto-detected suggestions are really applied initially, fixes #6142
2013-12-04 02:54:07 -08:00
Frank Karlitschek 8dc3cb2ffb lower required php version to 5.3.3 2013-12-04 10:51:12 +01:00
Arthur Schiwon c67ece0f6b LDAP Wizard: don't generate filter when not allowed 2013-12-03 20:50:46 +01:00
Arthur Schiwon 6640e120b7 some equals are more equal than other equals 2013-12-03 20:45:05 +01:00
Thomas Mueller 6f7b394d99 fixing PHPDoc and spelling 2013-12-03 17:49:37 +01:00
Andreas Fischer 91f47645b0 Use getLastError() everywhere. 2013-12-03 17:49:37 +01:00
Andreas Fischer 18903cc8f7 Add getLastError() 2013-12-03 17:49:37 +01:00
Andreas Fischer 7e467484a8 No function as oci_last_error. It's oci_error. 2013-12-03 17:49:37 +01:00
Andreas Fischer 21bf6abd41 There is no property such as dbusername. It's 'dbuser'. 2013-12-03 17:49:37 +01:00
Andreas Fischer 401728b2a2 Correct property name. It's 'dbpassword', with the 'db' prefix. 2013-12-03 17:49:37 +01:00
Andreas Fischer bfd0dc3314 Correct property name. It's just 'tableprefix', without the 'db' prefix. 2013-12-03 17:49:37 +01:00
Jan-Christoph Borchardt ad92b12559 fix time input field properly, details 2013-12-03 17:42:03 +01:00
Morris Jobke 4391992b8c fix public page - gallery view issues 2013-12-03 17:20:29 +01:00
Morris Jobke 728e6d735a fix trashbin and pbulic page controls 2013-12-03 17:20:23 +01:00
Morris Jobke 66df8c3bb3 fix and cleanup CSS for public page 2013-12-03 17:20:17 +01:00
Jan-Christoph Borchardt ca08d21da0 change different shades of grey for public share page to white 2013-12-03 17:20:08 +01:00
Jan-Christoph Borchardt 7d0f458f11 remove app specific code 2013-12-03 17:20:00 +01:00
Jan-Christoph Borchardt f15aeb3bbc fix details for buttons in header and controls bar 2013-12-03 17:19:53 +01:00
Jan-Christoph Borchardt 9333244925 account for shift of controls bar due to app navigation, do not shift on public page 2013-12-03 17:19:38 +01:00
Vincent Petry 50f5ab8515 Merge pull request #6173 from owncloud/stable6-extstorage-s3fixes
Backport of S3 ext storage fixes to stable6
2013-12-03 08:16:10 -08:00
Arthur Schiwon 4df0d2e7e8 LDAP Wizard: return correct var 2013-12-03 16:37:11 +01:00
Vincent Petry f2e17a0b68 Fixed placeholder after page reload
The placeholder somehow had too many characters stripping from it...
2013-12-03 15:55:24 +01:00
Vincent Petry e372971f2b Fixed test function for S3
Fixes #5752
2013-12-03 15:55:15 +01:00
Vincent Petry 3bf30377b8 Fixed Amazon S3 ext storage config UI
Optional parameters are now really optional

Fixes #5861
2013-12-03 15:55:08 +01:00
Arthur Schiwon 67b67b6d66 LDAP Wizard: make sure auto-detected suggestions are really applied initially. Also make initial filter compilation and user counting robust against race conditions. 2013-12-03 13:27:45 +01:00
Arthur Schiwon b8390f15d4 LDAP: on testing configuration, set active property to true, otherwise inactive connections cannot be tested properly 2013-12-03 13:21:55 +01:00
Robin Appelman 5ac3f9bfa5 check if a directory exists before we try to remove it 2013-12-03 12:45:41 +01:00
Arthur Schiwon 02fe013d2f LDAP: set default value for login filter to empty, otherwise the wizard signals completed configuration too early when it might be not correct, i.e. login won't work 2013-12-03 12:11:43 +01:00
Bjoern Schiessle 5e5e4fe3a4 make it possible to select folders 2013-12-02 22:23:51 +01:00
Arthur Schiwon d49e4e53fd LDAP Wizard: don't send ldap_tls change back to the interface as the element was removed, for it is detected fully automatically. Resolves an JS error and thus an ever-spinning spinner 2013-12-02 21:11:20 +01:00
Bjoern Schiessle 2d11290121 check explicitely all possible dir values 2013-12-02 16:06:51 +01:00
Bjoern Schiessle 1a197292da set delete all to true if a complete folder was deleted 2013-12-02 16:06:36 +01:00
Bjoern Schiessle 3b59979746 fix delete files from trash bin 2013-12-02 16:06:24 +01:00
Bjoern Schiessle 259d619af3 fix restore from files in sub-folders 2013-12-02 16:06:14 +01:00
29 changed files with 291 additions and 124 deletions
+8 -1
View File
@@ -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;
}
/**
+7 -5
View File
@@ -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;
+4 -3
View File
@@ -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;
}
}
+1 -1
View File
@@ -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); ?>"
+18 -11
View File
@@ -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 {
+18 -14
View File
@@ -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;
+1
View File
@@ -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);
+3
View File
@@ -0,0 +1,3 @@
#fileList td a.file, #fileList td a.file span {
cursor: default;
}
+1
View File
@@ -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');
+11 -39
View File
@@ -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')
+2
View File
@@ -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'];
+21 -1
View File
@@ -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;
+8 -5
View File
@@ -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">
+12
View File
@@ -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()) {
+66 -6
View File
@@ -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) {
+1 -1
View File
@@ -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,
+1 -2
View File
@@ -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,
+5 -2
View File
@@ -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
View File
@@ -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();
}
}
+6 -2
View File
@@ -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 . '/');
+4
View File
@@ -3,6 +3,10 @@
namespace OC\Setup;
abstract class AbstractDatabase {
/**
* @var \OC_L10N
*/
protected $trans;
protected $dbDefinitionFile;
protected $dbuser;
+39 -24
View File
@@ -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
View File
@@ -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
+1
View File
@@ -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'));
+14
View File
@@ -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']) {
?>
+7
View File
@@ -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
View File
@@ -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='';