diff options
-rw-r--r-- | apps/theming/lib/Settings/Admin.php | 2 | ||||
-rw-r--r-- | apps/theming/tests/Settings/AdminTest.php | 6 | ||||
-rw-r--r-- | core/css/multiselect.css | 2 | ||||
-rw-r--r-- | core/css/styles.css | 3 | ||||
-rw-r--r-- | core/js/multiselect.js | 52 | ||||
-rw-r--r-- | core/js/oc-dialogs.js | 14 | ||||
-rw-r--r-- | core/js/sharedialoglinkshareview.js | 2 | ||||
-rw-r--r-- | lib/base.php | 2 | ||||
-rw-r--r-- | lib/private/Files/Cache/Storage.php | 8 | ||||
-rw-r--r-- | lib/private/legacy/image.php | 26 | ||||
-rw-r--r-- | settings/css/settings.css | 9 | ||||
-rw-r--r-- | settings/js/users/groups.js | 4 | ||||
-rw-r--r-- | settings/js/users/users.js | 174 | ||||
-rw-r--r-- | settings/templates/users/main.php | 4 | ||||
-rw-r--r-- | settings/templates/users/part.createuser.php | 11 | ||||
-rw-r--r-- | settings/templates/users/part.userlist.php | 8 | ||||
-rw-r--r-- | tests/lib/Repair/RepairLegacyStoragesTest.php | 44 |
17 files changed, 197 insertions, 174 deletions
diff --git a/apps/theming/lib/Settings/Admin.php b/apps/theming/lib/Settings/Admin.php index afd74ced217..22ab5650e5b 100644 --- a/apps/theming/lib/Settings/Admin.php +++ b/apps/theming/lib/Settings/Admin.php @@ -61,7 +61,7 @@ class Admin implements ISettings { $theme = $this->config->getSystemValue('theme', ''); if ($theme !== '') { $themable = false; - $errorMessage = $this->l->t('You already use a custom theme'); + $errorMessage = $this->l->t('You are already using a custom theme'); } $parameters = [ diff --git a/apps/theming/tests/Settings/AdminTest.php b/apps/theming/tests/Settings/AdminTest.php index 73339cf86b7..d4f5490d352 100644 --- a/apps/theming/tests/Settings/AdminTest.php +++ b/apps/theming/tests/Settings/AdminTest.php @@ -112,8 +112,8 @@ class AdminTest extends TestCase { $this->l10n ->expects($this->once()) ->method('t') - ->with('You already use a custom theme') - ->willReturn('You already use a custom theme'); + ->with('You are already using a custom theme') + ->willReturn('You are already using a custom theme'); $this->themingDefaults ->expects($this->once()) ->method('getEntity') @@ -137,7 +137,7 @@ class AdminTest extends TestCase { ->willReturn('/my/route'); $params = [ 'themable' => false, - 'errorMessage' => 'You already use a custom theme', + 'errorMessage' => 'You are already using a custom theme', 'name' => 'MyEntity', 'url' => 'https://example.com', 'slogan' => 'MySlogan', diff --git a/core/css/multiselect.css b/core/css/multiselect.css index ef56044fd05..cc1d6a3b468 100644 --- a/core/css/multiselect.css +++ b/core/css/multiselect.css @@ -42,6 +42,8 @@ ul.multiselectoptions > li input[type='checkbox']+label { width: 100%; padding: 5px 27px; margin-left: -27px; /* to have area around checkbox clickable as well */ + text-overflow: ellipsis; + overflow: hidden; } ul.multiselectoptions > li input[type='checkbox']:checked+label { font-weight: bold; diff --git a/core/css/styles.css b/core/css/styles.css index c2b883e4a36..25bc2d086d5 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -301,7 +301,8 @@ body { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=70)"; opacity: .7; } -#body-login input[type="password"] { +#body-login input[type="password"], +#body-login input[name="adminpass-clone"] { padding-right: 40px; box-sizing: border-box; min-width: 269px; diff --git a/core/js/multiselect.js b/core/js/multiselect.js index 71cf3e10a69..bdf420a2f7f 100644 --- a/core/js/multiselect.js +++ b/core/js/multiselect.js @@ -32,7 +32,7 @@ 'onuncheck':false, 'minWidth': 'default;' }; - var slideDuration = 200; + var slideDuration = 0; $(this).attr('data-msid', multiSelectId); $.extend(settings,options); $.each(this.children(),function(i,option) { @@ -75,6 +75,26 @@ var self = this; self.menuDirection = 'down'; + + function closeDropDown() { + if(!button.parent().data('preventHide')) { + // How can I save the effect in a var? + if(self.menuDirection === 'down') { + button.parent().children('ul').slideUp(slideDuration,function() { + button.parent().children('ul').remove(); + button.removeClass('active down'); + $(self).trigger($.Event('dropdownclosed', settings)); + }); + } else { + button.parent().children('ul').fadeOut(slideDuration,function() { + button.parent().children('ul').remove(); + button.removeClass('active up'); + $(self).trigger($.Event('dropdownclosed', settings)); + }); + } + } + } + button.click(function(event){ var button=$(this); @@ -83,21 +103,20 @@ button.parent().children('ul').slideUp(slideDuration,function() { button.parent().children('ul').remove(); button.removeClass('active down'); + $(self).trigger($.Event('dropdownclosed', settings)); }); } else { button.parent().children('ul').fadeOut(slideDuration,function() { button.parent().children('ul').remove(); button.removeClass('active up'); + $(self).trigger($.Event('dropdownclosed', settings)); }); } return; } + // tell other lists to shut themselves var lists=$('ul.multiselectoptions'); - lists.slideUp(slideDuration,function(){ - lists.remove(); - $('div.multiselect').removeClass('active'); - button.addClass('active'); - }); + lists.trigger($.Event('shut')); button.addClass('active'); event.stopPropagation(); var options=$(this).parent().next().children(); @@ -309,29 +328,16 @@ list.detach().insertBefore($(this)); list.addClass('up'); button.addClass('up'); - list.fadeIn(); + list.show(); self.menuDirection = 'up'; } list.click(function(event) { event.stopPropagation(); }); + list.one('shut', closeDropDown); }); - $(window).click(function() { - if(!button.parent().data('preventHide')) { - // How can I save the effect in a var? - if(self.menuDirection === 'down') { - button.parent().children('ul').slideUp(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active down'); - }); - } else { - button.parent().children('ul').fadeOut(slideDuration,function() { - button.parent().children('ul').remove(); - button.removeClass('active up'); - }); - } - } - }); + + $(window).click(closeDropDown); return span; }; diff --git a/core/js/oc-dialogs.js b/core/js/oc-dialogs.js index b77063a9eae..75c8ef9020e 100644 --- a/core/js/oc-dialogs.js +++ b/core/js/oc-dialogs.js @@ -218,6 +218,13 @@ var OCdialogs = { self.$filePicker = null; } }); + + // We can access primary class only from oc-dialog. + // Hence this is one of the approach to get the choose button. + var getOcDialog = self.$filePicker.closest('.oc-dialog'); + var buttonEnableDisable = getOcDialog.find('.primary'); + buttonEnableDisable.prop("disabled", "true"); + if (!OC.Util.hasSVGSupport()) { OC.Util.replaceSVG(self.$filePicker.parent()); } @@ -812,18 +819,25 @@ var OCdialogs = { var self = event.data; var dir = $(event.target).data('dir'); self._fillFilePicker(dir); + var getOcDialog = this.closest('.oc-dialog'); + var buttonEnableDisable = $('.primary', getOcDialog); + buttonEnableDisable.prop("disabled", true); }, /** * handle clicks made in the filepicker */ _handlePickerClick:function(event, $element) { + var getOcDialog = this.$filePicker.closest('.oc-dialog'); + var buttonEnableDisable = getOcDialog.find('.primary'); if ($element.data('type') === 'file') { if (this.$filePicker.data('multiselect') !== true || !event.ctrlKey) { this.$filelist.find('.filepicker_element_selected').removeClass('filepicker_element_selected'); } $element.toggleClass('filepicker_element_selected'); + buttonEnableDisable.prop("disabled", false); } else if ( $element.data('type') === 'dir' ) { this._fillFilePicker(this.$filePicker.data('path') + '/' + $element.data('entryname')); + buttonEnableDisable.prop("disabled", true); } } }; diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js index 83bf7979000..1d6a0f03d4d 100644 --- a/core/js/sharedialoglinkshareview.js +++ b/core/js/sharedialoglinkshareview.js @@ -330,7 +330,7 @@ publicUpload: publicUpload && isLinkShare, publicUploadChecked: publicUploadChecked, hideFileListChecked: hideFileListChecked, - publicUploadLabel: t('core', 'Allow editing'), + publicUploadLabel: t('core', 'Allow upload and editing'), hideFileListLabel: t('core', 'Hide file listing'), mailPublicNotificationEnabled: isLinkShare && this.configModel.isMailPublicNotificationEnabled(), mailPrivatePlaceholder: t('core', 'Email link to person'), diff --git a/lib/base.php b/lib/base.php index a69a4dffef8..68eab7c4acf 100644 --- a/lib/base.php +++ b/lib/base.php @@ -268,7 +268,7 @@ class OC { if (OC::$CLI) { throw new Exception('Not installed'); } else { - $url = 'http://' . $_SERVER['SERVER_NAME'] . OC::$WEBROOT . '/index.php'; + $url = OC::$WEBROOT . '/index.php'; header('Location: ' . $url); } exit(); diff --git a/lib/private/Files/Cache/Storage.php b/lib/private/Files/Cache/Storage.php index 99b127ab220..8a076084ac5 100644 --- a/lib/private/Files/Cache/Storage.php +++ b/lib/private/Files/Cache/Storage.php @@ -57,15 +57,15 @@ class Storage { $this->storageId = self::adjustStorageId($this->storageId); if ($row = self::getStorageById($this->storageId)) { - $this->numericId = $row['numeric_id']; + $this->numericId = (int)$row['numeric_id']; } else { $connection = \OC::$server->getDatabaseConnection(); $available = $isAvailable ? 1 : 0; if ($connection->insertIfNotExist('*PREFIX*storages', ['id' => $this->storageId, 'available' => $available])) { - $this->numericId = $connection->lastInsertId('*PREFIX*storages'); + $this->numericId = (int)$connection->lastInsertId('*PREFIX*storages'); } else { if ($row = self::getStorageById($this->storageId)) { - $this->numericId = $row['numeric_id']; + $this->numericId = (int)$row['numeric_id']; } else { throw new \RuntimeException('Storage could neither be inserted nor be selected from the database'); } @@ -132,7 +132,7 @@ class Storage { $storageId = self::adjustStorageId($storageId); if ($row = self::getStorageById($storageId)) { - return $row['numeric_id']; + return (int)$row['numeric_id']; } else { return null; } diff --git a/lib/private/legacy/image.php b/lib/private/legacy/image.php index 2c20daf5d44..fee1a805c40 100644 --- a/lib/private/legacy/image.php +++ b/lib/private/legacy/image.php @@ -84,11 +84,6 @@ class OC_Image implements \OCP\IImage { $this->logger = \OC::$server->getLogger(); } - if (!extension_loaded('gd') || !function_exists('gd_info')) { - $this->logger->error(__METHOD__ . '(): GD module not installed', array('app' => 'core')); - return false; - } - if (\OC_Util::fileInfoLoaded()) { $this->fileInfo = new finfo(FILEINFO_MIME_TYPE); } @@ -802,8 +797,8 @@ class OC_Image implements \OCP\IImage { $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); return false; } - $widthOrig = imageSX($this->resource); - $heightOrig = imageSY($this->resource); + $widthOrig = imagesx($this->resource); + $heightOrig = imagesy($this->resource); $ratioOrig = $widthOrig / $heightOrig; if ($ratioOrig > 1) { @@ -828,8 +823,8 @@ class OC_Image implements \OCP\IImage { $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); return false; } - $widthOrig = imageSX($this->resource); - $heightOrig = imageSY($this->resource); + $widthOrig = imagesx($this->resource); + $heightOrig = imagesy($this->resource); $process = imagecreatetruecolor($width, $height); if ($process == false) { @@ -867,8 +862,8 @@ class OC_Image implements \OCP\IImage { $this->logger->error('OC_Image->centerCrop, No image loaded', array('app' => 'core')); return false; } - $widthOrig = imageSX($this->resource); - $heightOrig = imageSY($this->resource); + $widthOrig = imagesx($this->resource); + $heightOrig = imagesy($this->resource); if ($widthOrig === $heightOrig and $size == 0) { return true; } @@ -967,8 +962,8 @@ class OC_Image implements \OCP\IImage { $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); return false; } - $widthOrig = imageSX($this->resource); - $heightOrig = imageSY($this->resource); + $widthOrig = imagesx($this->resource); + $heightOrig = imagesy($this->resource); $ratio = $widthOrig / $heightOrig; $newWidth = min($maxWidth, $ratio * $maxHeight); @@ -990,8 +985,8 @@ class OC_Image implements \OCP\IImage { $this->logger->error(__METHOD__ . '(): No image loaded', array('app' => 'core')); return false; } - $widthOrig = imageSX($this->resource); - $heightOrig = imageSY($this->resource); + $widthOrig = imagesx($this->resource); + $heightOrig = imagesy($this->resource); if ($widthOrig > $maxWidth || $heightOrig > $maxHeight) { return $this->fitIn($maxWidth, $maxHeight); @@ -1024,6 +1019,7 @@ if (!function_exists('imagebmp')) { * @link http://www.programmierer-forum.de/imagebmp-gute-funktion-gefunden-t143716.htm * @author mgutt <marc@gutt.it> * @version 1.00 + * @param resource $im * @param string $fileName [optional] <p>The path to save the file to.</p> * @param int $bit [optional] <p>Bit depth, (default is 24).</p> * @param int $compression [optional] diff --git a/settings/css/settings.css b/settings/css/settings.css index d3fd395747e..6ed707f7c45 100644 --- a/settings/css/settings.css +++ b/settings/css/settings.css @@ -267,6 +267,15 @@ span.usersLastLoginTooltip { white-space: nowrap; } top: 3px; } +#newuser .groups { + display: inline; +} + +#newuser .groupsListContainer.hidden, +#userlist .groupsListContainer.hidden { + display: none; +} + tr:hover>td.password>span, tr:hover>td.displayName>span { margin:0; cursor:pointer; } tr:hover>td.remove>a, tr:hover>td.password>img,tr:hover>td.displayName>img, tr:hover>td.quota>img { visibility:visible; cursor:pointer; } td.remove { diff --git a/settings/js/users/groups.js b/settings/js/users/groups.js index e83f00970c2..8f4d95432a8 100644 --- a/settings/js/users/groups.js +++ b/settings/js/users/groups.js @@ -138,10 +138,6 @@ GroupList = { var addedGroup = result.groupname; UserList.availableGroups = $.unique($.merge(UserList.availableGroups, [addedGroup])); GroupList.addGroup(result.groupname); - - $('.groupsselect, .subadminsselect') - .append($('<option>', { value: result.groupname }) - .text(result.groupname)); } GroupList.toggleAddGroup(); }).fail(function(result) { diff --git a/settings/js/users/users.js b/settings/js/users/users.js index 4ce77648826..f24bf82209b 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -59,9 +59,6 @@ var UserList = { var $tr = $userListBody.find('tr:first-child').clone(); // this removes just the `display:none` of the template row $tr.removeAttr('style'); - var subAdminsEl; - var subAdminSelect; - var groupsSelect; /** * Avatar or placeholder @@ -88,32 +85,17 @@ var UserList = { $tr.find('td.mailAddress > .action').tooltip({placement: 'top'}); $tr.find('td.password > .action').tooltip({placement: 'top'}); + /** * groups and subadmins */ - // make them look like the multiselect buttons - // until they get time to really get initialized - groupsSelect = $('<select multiple="multiple" class="groupsselect multiselect button" data-placehoder="Groups" title="' + t('settings', 'No group') + '"></select>') - .data('username', user.name) - .data('user-groups', user.groups); - if ($tr.find('td.subadmins').length > 0) { - subAdminSelect = $('<select multiple="multiple" class="subadminsselect multiselect button" data-placehoder="subadmins" title="' + t('settings', 'No group') + '">') - .data('username', user.name) - .data('user-groups', user.groups) - .data('subadmin', user.subadmin); - $tr.find('td.subadmins').empty(); - } - $.each(this.availableGroups, function (i, group) { - groupsSelect.append($('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>')); - if (typeof subAdminSelect !== 'undefined' && group !== 'admin') { - subAdminSelect.append($('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>')); - } - }); - $tr.find('td.groups').empty().append(groupsSelect); - subAdminsEl = $tr.find('td.subadmins'); - if (subAdminsEl.length > 0) { - subAdminsEl.append(subAdminSelect); - } + var $tdGroups = $tr.find('td.groups'); + this._updateGroupListLabel($tdGroups, user.groups); + $tdGroups.find('.action').tooltip({placement: 'top'}); + + var $tdSubadmins = $tr.find('td.subadmins'); + this._updateGroupListLabel($tdSubadmins, user.subadmin); + $tdSubadmins.find('.action').tooltip({placement: 'top'}); /** * remove action @@ -200,10 +182,6 @@ var UserList = { // defer init so the user first sees the list appear more quickly window.setTimeout(function(){ $quotaSelect.singleSelect(); - UserList.applyGroupSelect(groupsSelect); - if (subAdminSelect) { - UserList.applySubadminSelect(subAdminSelect); - } }, 0); return $tr; }, @@ -324,7 +302,7 @@ var UserList = { }, markRemove: function(uid) { var $tr = UserList.getRow(uid); - var groups = $tr.find('.groups .groupsselect').val(); + var groups = $tr.find('.groups').data('groups'); for(var i in groups) { var gid = groups[i]; var $li = GroupList.getGroupLI(gid); @@ -339,7 +317,7 @@ var UserList = { }, undoRemove: function(uid) { var $tr = UserList.getRow(uid); - var groups = $tr.find('.groups .groupsselect').val(); + var groups = $tr.find('.groups').data('groups'); for(var i in groups) { var gid = groups[i]; var $li = GroupList.getGroupLI(gid); @@ -440,19 +418,9 @@ var UserList = { }); }, - applyGroupSelect: function (element) { - var checked = []; + applyGroupSelect: function (element, user, checked) { var $element = $(element); - var user = UserList.getUID($element); - if ($element.data('user-groups')) { - if (typeof $element.data('user-groups') === 'string') { - checked = $element.data('user-groups').split(", "); - } - else { - checked = $element.data('user-groups'); - } - } var checkHandler = null; if(user) { // Only if in a user row, and not the #newusergroups select checkHandler = function (group) { @@ -492,13 +460,6 @@ var UserList = { }; } var addGroup = function (select, group) { - $('select[multiple]').each(function (index, element) { - $element = $(element); - if ($element.find('option').filterAttr('value', group).length === 0 && - select.data('msid') !== $element.data('msid')) { - $element.append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>'); - } - }); GroupList.addGroup(escapeHTML(group)); }; var label; @@ -519,19 +480,8 @@ var UserList = { }); }, - applySubadminSelect: function (element) { - var checked = []; + applySubadminSelect: function (element, user, checked) { var $element = $(element); - var user = UserList.getUID($element); - - if ($element.data('subadmin')) { - if (typeof $element.data('subadmin') === 'string') { - checked = $element.data('subadmin').split(", "); - } - else { - checked = $element.data('subadmin'); - } - } var checkHandler = function (group) { if (group === 'admin') { return false; @@ -547,15 +497,7 @@ var UserList = { ); }; - var addSubAdmin = function (group) { - $('select[multiple]').each(function (index, element) { - if ($(element).find('option').filterAttr('value', group).length === 0) { - $(element).append('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>'); - } - }); - }; $element.multiSelect({ - createCallback: addSubAdmin, createText: null, checked: checked, oncheck: checkHandler, @@ -613,6 +555,76 @@ var UserList = { } } ); + }, + + /** + * Creates a temporary jquery.multiselect selector on the given group field + */ + _triggerGroupEdit: function($td, isSubadminSelect) { + var $groupsListContainer = $td.find('.groupsListContainer'); + var placeholder = $groupsListContainer.attr('data-placeholder') || t('settings', 'no group'); + var user = UserList.getUID($td); + var checked = $td.data('groups') || []; + var extraGroups = [].concat(checked); + + $td.find('.multiselectoptions').remove(); + + // jquery.multiselect can only work with select+options in DOM ? We'll give jquery.multiselect what it wants... + var $groupsSelect; + if (isSubadminSelect) { + $groupsSelect = $('<select multiple="multiple" class="groupsselect multiselect button" title="' + placeholder + '"></select>'); + } else { + $groupsSelect = $('<select multiple="multiple" class="subadminsselect multiselect button" title="' + placeholder + '"></select>') + } + + function createItem(group) { + if (isSubadminSelect && group === 'admin') { + // can't become subadmin of "admin" group + return; + } + $groupsSelect.append($('<option value="' + escapeHTML(group) + '">' + escapeHTML(group) + '</option>')); + } + + $.each(this.availableGroups, function (i, group) { + // some new groups might be selected but not in the available groups list yet + var extraIndex = extraGroups.indexOf(group); + if (extraIndex >= 0) { + // remove extra group as it was found + extraGroups.splice(extraIndex, 1); + } + createItem(group); + }); + $.each(extraGroups, function (i, group) { + createItem(group); + }); + + $td.append($groupsSelect); + + if (isSubadminSelect) { + UserList.applySubadminSelect($groupsSelect, user, checked); + } else { + UserList.applyGroupSelect($groupsSelect, user, checked); + } + + $groupsListContainer.addClass('hidden'); + $td.find('.multiselect:not(.groupsListContainer):first').click(); + $groupsSelect.on('dropdownclosed', function(e) { + $groupsSelect.remove(); + $td.find('.multiselect:not(.groupsListContainer)').parent().remove(); + $td.find('.multiselectoptions').remove(); + $groupsListContainer.removeClass('hidden'); + UserList._updateGroupListLabel($td, e.checked); + }); + }, + + /** + * Updates the groups list td with the given groups selection + */ + _updateGroupListLabel: function($td, groups) { + var placeholder = $td.find('.groupsListContainer').attr('data-placeholder'); + var $groupsEl = $td.find('.groupsList'); + $groupsEl.text(groups.join(', ') || placeholder || t('settings', 'no group')); + $td.data('groups', groups); } }; @@ -637,13 +649,6 @@ $(document).ready(function () { // TODO: move other init calls inside of initialize UserList.initialize($('#userlist')); - $('.groupsselect').each(function (index, element) { - UserList.applyGroupSelect(element); - }); - $('.subadminsselect').each(function (index, element) { - UserList.applySubadminSelect(element); - }); - $userListBody.on('click', '.password', function (event) { event.stopPropagation(); @@ -787,11 +792,24 @@ $(document).ready(function () { }); }); + $('#newuser .groupsListContainer').on('click', function (event) { + event.stopPropagation(); + var $div = $(this).closest('.groups'); + UserList._triggerGroupEdit($div); + }); + $userListBody.on('click', '.groups .groupsListContainer, .subadmins .groupsListContainer', function (event) { + event.stopPropagation(); + var $td = $(this).closest('td'); + var isSubadminSelect = $td.hasClass('subadmins'); + UserList._triggerGroupEdit($td, isSubadminSelect); + }); + // init the quota field select box after it is shown the first time $('#app-settings').one('show', function() { $(this).find('#default_quota').singleSelect().on('change', UserList.onQuotaSelect); }); + UserList._updateGroupListLabel($('#newuser .groups'), []); $('#newuser').submit(function (event) { event.preventDefault(); var username = $('#newusername').val(); @@ -827,7 +845,7 @@ $(document).ready(function () { } promise.then(function() { - var groups = $('#newusergroups').val() || []; + var groups = $('#newuser .groups').data('groups') || []; $.post( OC.generateUrl('/settings/users/users'), { diff --git a/settings/templates/users/main.php b/settings/templates/users/main.php index f50f83b38b3..b363a4c4da8 100644 --- a/settings/templates/users/main.php +++ b/settings/templates/users/main.php @@ -19,10 +19,10 @@ style('settings', 'settings'); $userlistParams = array(); $allGroups=array(); -foreach($_["groups"] as $group) { +foreach($_["adminGroup"] as $group) { $allGroups[] = $group['name']; } -foreach($_["adminGroup"] as $group) { +foreach($_["groups"] as $group) { $allGroups[] = $group['name']; } $userlistParams['subadmingroups'] = $allGroups; diff --git a/settings/templates/users/part.createuser.php b/settings/templates/users/part.createuser.php index 0fc5a2bdeaa..6f23d06cfa3 100644 --- a/settings/templates/users/part.createuser.php +++ b/settings/templates/users/part.createuser.php @@ -10,16 +10,7 @@ <input id="newemail" type="text" style="display:none" placeholder="<?php p($l->t('E-Mail'))?>" autocomplete="off" autocapitalize="off" autocorrect="off" /> - <select - class="groupsselect" id="newusergroups" data-placeholder="groups" - title="<?php p($l->t('Groups'))?>" multiple="multiple"> - <?php foreach($_["adminGroup"] as $adminGroup): ?> - <option value="<?php p($adminGroup['name']);?>"><?php p($adminGroup['name']); ?></option> - <?php endforeach; ?> - <?php foreach($_["groups"] as $group): ?> - <option value="<?php p($group['name']);?>"><?php p($group['name']);?></option> - <?php endforeach;?> - </select> + <div class="groups"><div class="groupsListContainer multiselect button" data-placeholder="<?php p($l->t('Groups'))?>"><span class="title groupsList"></span><span class="icon-triangle-s"></span></div></div> <input type="submit" class="button" value="<?php p($l->t('Create'))?>" /> </form> <?php if((bool)$_['recoveryAdminEnabled']): ?> diff --git a/settings/templates/users/part.userlist.php b/settings/templates/users/part.userlist.php index 2bdd0714a3c..bab68e5a765 100644 --- a/settings/templates/users/part.userlist.php +++ b/settings/templates/users/part.userlist.php @@ -38,9 +38,13 @@ src="<?php p(image_path('core', 'actions/rename.svg'))?>" alt="<?php p($l->t('change email address'))?>" title="<?php p($l->t('change email address'))?>"/> </td> - <td class="groups"></td> + <td class="groups"><div class="groupsListContainer multiselect button" + ><span class="title groupsList"></span><span class="icon-triangle-s"></span></div> + </td> <?php if(is_array($_['subadmins']) || $_['subadmins']): ?> - <td class="subadmins"></td> + <td class="subadmins"><div class="groupsListContainer multiselect button" + ><span class="title groupsList"></span><span class="icon-triangle-s"></span></div> + </td> <?php endif;?> <td class="quota"> <select class="quota-user" data-inputtitle="<?php p($l->t('Please enter storage quota (ex: "512 MB" or "12 GB")')) ?>"> diff --git a/tests/lib/Repair/RepairLegacyStoragesTest.php b/tests/lib/Repair/RepairLegacyStoragesTest.php index aa51fe06a35..8d8366dde06 100644 --- a/tests/lib/Repair/RepairLegacyStoragesTest.php +++ b/tests/lib/Repair/RepairLegacyStoragesTest.php @@ -98,23 +98,9 @@ class RepairLegacyStoragesTest extends TestCase { $storageId = Storage::adjustStorageId($storageId); $numRows = $this->connection->executeUpdate($sql, array($storageId)); - $this->assertEquals(1, $numRows); + $this->assertSame(1, $numRows); - return \OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*storages'); - } - - /** - * Returns the storage id based on the numeric id - * - * @param int $storageId numeric id of the storage - * @return string storage id or null if not found - */ - private function getStorageId($storageId) { - $numericId = Storage::getNumericStorageId($storageId); - if (!is_null($numericId)) { - return (int)$numericId; - } - return null; + return (int)\OC::$server->getDatabaseConnection()->lastInsertId('*PREFIX*storages'); } /** @@ -144,8 +130,8 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertNull($this->getStorageId($this->legacyStorageId)); - $this->assertEquals($newStorageNumId, $this->getStorageId($this->newStorageId)); + $this->assertNull(Storage::getNumericStorageId($this->legacyStorageId)); + $this->assertSame($newStorageNumId, Storage::getNumericStorageId($this->newStorageId)); } /** @@ -163,8 +149,8 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertNull($this->getStorageId($this->legacyStorageId)); - $this->assertEquals($legacyStorageNumId, $this->getStorageId($this->newStorageId)); + $this->assertNull(Storage::getNumericStorageId($this->legacyStorageId)); + $this->assertSame($legacyStorageNumId, Storage::getNumericStorageId($this->newStorageId)); } /** @@ -185,8 +171,8 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertNull($this->getStorageId($this->legacyStorageId)); - $this->assertEquals($legacyStorageNumId, $this->getStorageId($this->newStorageId)); + $this->assertNull(Storage::getNumericStorageId($this->legacyStorageId)); + $this->assertSame($legacyStorageNumId, Storage::getNumericStorageId($this->newStorageId)); } /** @@ -208,8 +194,8 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertNull($this->getStorageId($this->legacyStorageId)); - $this->assertEquals($newStorageNumId, $this->getStorageId($this->newStorageId)); + $this->assertNull(Storage::getNumericStorageId($this->legacyStorageId)); + $this->assertSame($newStorageNumId, Storage::getNumericStorageId($this->newStorageId)); } /** @@ -233,8 +219,8 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); // storages left alone - $this->assertEquals($legacyStorageNumId, $this->getStorageId($this->legacyStorageId)); - $this->assertEquals($newStorageNumId, $this->getStorageId($this->newStorageId)); + $this->assertSame($legacyStorageNumId, Storage::getNumericStorageId($this->legacyStorageId)); + $this->assertSame($newStorageNumId, Storage::getNumericStorageId($this->newStorageId)); // do not set the done flag $this->assertNotEquals('yes', $this->config->getAppValue('core', 'repairlegacystoragesdone')); @@ -255,7 +241,7 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertEquals($numId, $this->getStorageId($storageId)); + $this->assertSame($numId, Storage::getNumericStorageId($storageId)); } /** @@ -273,7 +259,7 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertEquals($numId, $this->getStorageId($storageId)); + $this->assertSame($numId, Storage::getNumericStorageId($storageId)); } /** @@ -291,7 +277,7 @@ class RepairLegacyStoragesTest extends TestCase { $this->repair->run($this->outputMock); - $this->assertEquals($numId, $this->getStorageId($storageId)); + $this->assertSame($numId, Storage::getNumericStorageId($storageId)); } /** |