Merge pull request #8189 from Xenopathic/misc_fixes

Various fixes
This commit is contained in:
Robin McCorkell 2014-04-17 11:56:51 +01:00
commit 13b463cc17
3 changed files with 20 additions and 16 deletions

View file

@ -824,13 +824,15 @@ class Trashbin {
$matches = glob($escapedVersionsName . '*');
}
foreach ($matches as $ma) {
if ($timestamp) {
$parts = explode('.v', substr($ma, 0, $offset));
$versions[] = (end($parts));
} else {
$parts = explode('.v', $ma);
$versions[] = (end($parts));
if (is_array($matches)) {
foreach ($matches as $ma) {
if ($timestamp) {
$parts = explode('.v', substr($ma, 0, $offset));
$versions[] = (end($parts));
} else {
$parts = explode('.v', $ma);
$versions[] = (end($parts));
}
}
}
return $versions;
@ -921,13 +923,11 @@ class Trashbin {
public static function isEmpty($user) {
$view = new \OC\Files\View('/' . $user . '/files_trashbin');
$dh = $view->opendir('/files');
if (!$dh) {
return false;
}
while ($file = readdir($dh)) {
if ($file !== '.' and $file !== '..') {
return false;
if ($view->is_dir('/files') && $dh = $view->opendir('/files')) {
while ($file = readdir($dh)) {
if ($file !== '.' and $file !== '..') {
return false;
}
}
}
return true;

View file

@ -37,7 +37,7 @@
<p><label for="ldap_attributes_for_group_search"><?php p($l->t('Group Search Attributes'));?></label><textarea id="ldap_attributes_for_group_search" name="ldap_attributes_for_group_search" placeholder="<?php p($l->t('Optional; one attribute per line'));?>" data-default="<?php p($_['ldap_attributes_for_group_search_default']); ?>" title="<?php p($l->t('Group Search Attributes'));?>"></textarea></p>
<p><label for="ldap_group_member_assoc_attribute"><?php p($l->t('Group-Member association'));?></label><select id="ldap_group_member_assoc_attribute" name="ldap_group_member_assoc_attribute" data-default="<?php p($_['ldap_group_member_assoc_attribute_default']); ?>" ><option value="uniqueMember"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'uniqueMember')) p(' selected'); ?>>uniqueMember</option><option value="memberUid"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'memberUid')) p(' selected'); ?>>memberUid</option><option value="member"<?php if (isset($_['ldap_group_member_assoc_attribute']) && ($_['ldap_group_member_assoc_attribute'] === 'member')) p(' selected'); ?>>member (AD)</option></select></p>
<p><label for="ldap_nested_groups"><?php p($l->t('Nested Groups'));?></label><input type="checkbox" id="ldap_nested_groups" name="ldap_nested_groups" value="1" data-default="<?php p($_['ldap_nested_groups_default']); ?>" title="<?php p($l->t('When switched on, groups that contain groups are supported. (Only works if the group member attribute contains DNs.)'));?>" /></p>
<p><label for="ldap_paging_size"><?php p($l->t('Paging chunksize'));?></label><input type="number" id="ldap_paging_size" name="ldap_paging_size" title="<?php p($l->t('Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)'));?>" data-default="<?php p($_['ldap_paging_size']); ?>" /></p>
<p><label for="ldap_paging_size"><?php p($l->t('Paging chunksize'));?></label><input type="number" id="ldap_paging_size" name="ldap_paging_size" title="<?php p($l->t('Chunksize used for paged LDAP searches that may return bulky results like user or group enumeration. (Setting it 0 disables paged LDAP searches in those situations.)'));?>" data-default="<?php p($_['ldap_paging_size_default']); ?>" /></p>
</div>
<h3><?php p($l->t('Special Attributes'));?></h3>
<div>

View file

@ -305,7 +305,11 @@ if (\OC_Util::runningOnWindows()) {
* @return bool
*/
public function hasUpdated($path, $time) {
return $this->filemtime($path) > $time;
if ($this->file_exists($path)) {
return $this->filemtime($path) > $time;
} else {
return true;
}
}
/**