Loading modules/shares/shares.cpp +12 −1 Changes for modules/shares/shares.cpp: 12 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -343,14 +343,25 @@ json_object *browse(json_object *a) { } json_object_object_add(out, "entries", entries); // who can own things: every account and group of the user database // who can own things: every account and group of the user database, // UUID/GUID ones and those of the other sources (adconnect) too -- AD // only lists them when it enumerates; any other name can be typed in json_object *users = json_object_new_array(), *groups = json_object_new_array(); #if __has_include(<sys/uid_r.h>) setpwent_id_r(); while (struct passwd_id_r *pw = getpwent_id_r()) json_object_array_add(users, jstr(pw->pw_name)); endpwent_id_r(); setgrent_id_r(); while (struct group_id_r *gr = getgrent_id_r()) json_object_array_add(groups, jstr(gr->gr_name)); endgrent_id_r(); #else setpwent(); while (struct passwd *pw = getpwent()) json_object_array_add(users, jstr(pw->pw_name)); endpwent(); setgrent(); while (struct group *gr = getgrent()) json_object_array_add(groups, jstr(gr->gr_name)); endgrent(); #endif json_object *accounts = json_object_new_object(); json_object_object_add(accounts, "users", users); json_object_object_add(accounts, "groups", groups); Loading www/modules/shares.js +10 −8 Changes for www/modules/shares.js: 10 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ 'Files': 'Dateien', 'Files of {0}': 'Dateien von {0}', 'Back to shares': 'Zurück zu den Freigaben', 'New folder': 'Neuer Ordner', 'New file': 'Neue Datei', 'Permissions': 'Rechte', 'Permissions of this folder': 'Rechte dieses Ordners', 'Size': 'Größe', 'Modified': 'Geändert', 'Owner': 'Besitzer', 'Group': 'Gruppe', 'This folder is empty.': 'Dieser Ordner ist leer.', 'name or user@domain': 'Name oder benutzer@domain', 'Owner': 'Besitzer', 'Group': 'Gruppe', 'This folder is empty.': 'Dieser Ordner ist leer.', 'Folder {0} created.': 'Ordner {0} angelegt.', 'File {0} created.': 'Datei {0} angelegt.', 'Delete {0}?': '{0} löschen?', 'The folder {0} and everything in it will be deleted.': 'Der Ordner {0} und alles darin wird gelöscht.', 'The file {0} will be deleted.': 'Die Datei {0} wird gelöscht.', Loading Loading @@ -370,18 +370,20 @@ const isDir = e.type === 'dir'; const m = parseInt(e.mode, 8); const label = path || b.share; const options = (list, value) => { const all = list.includes(value) ? list : [value, ...list]; return all.map(n => h('option', {value: n, selected: n === value}, n)); }; // free text with suggestions: Active Directory users (user@domain) are // only listed when adconnect enumerates them const account = (name, list, value, id) => [ h('input', {name, value: value || '', list: id, autocomplete: 'off', required: true, placeholder: t('name or user@domain')}), h('datalist', {id}, list.map(n => h('option', {value: n})))]; const box = (bit, title) => h('td', {}, h('input', {type: 'checkbox', name: 'm' + bit.toString(8), checked: !!(m & bit), title, 'aria-label': title})); dialog({ title: t('Permissions of {0}', label), fields: () => [ h('div', {class: 'row'}, h('label', {}, t('Owner'), h('select', {name: 'owner'}, options(b.accounts.users, e.owner))), h('label', {}, t('Group'), h('select', {name: 'group'}, options(b.accounts.groups, e.group)))), h('label', {}, t('Owner'), account('owner', b.accounts.users, e.owner, 'perm-users')), h('label', {}, t('Group'), account('group', b.accounts.groups, e.group, 'perm-groups'))), h('table', {class: 'perm-grid'}, h('thead', {}, h('tr', {}, h('th', {}), h('th', {}, t('read')), h('th', {}, t('write')), h('th', {}, isDir ? t('open') : t('execute')))), Loading @@ -400,7 +402,7 @@ let mode = 0; for (const bit of [0o400, 0o200, 0o100, 0o40, 0o20, 0o10, 0o4, 0o2, 0o1, 0o2000, 0o1000]) if (d['m' + bit.toString(8)]) mode |= bit; await call('shares', 'setPermissions', {share: b.share, path, owner: d.owner, group: d.group, await call('shares', 'setPermissions', {share: b.share, path, owner: d.owner.trim(), group: d.group.trim(), mode: mode.toString(8).padStart(4, '0'), recursive: !!d.recursive}); toast(t('Permissions of {0} saved.', label)); browse(b.share, b.path); Loading Loading
modules/shares/shares.cpp +12 −1 Changes for modules/shares/shares.cpp: 12 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -343,14 +343,25 @@ json_object *browse(json_object *a) { } json_object_object_add(out, "entries", entries); // who can own things: every account and group of the user database // who can own things: every account and group of the user database, // UUID/GUID ones and those of the other sources (adconnect) too -- AD // only lists them when it enumerates; any other name can be typed in json_object *users = json_object_new_array(), *groups = json_object_new_array(); #if __has_include(<sys/uid_r.h>) setpwent_id_r(); while (struct passwd_id_r *pw = getpwent_id_r()) json_object_array_add(users, jstr(pw->pw_name)); endpwent_id_r(); setgrent_id_r(); while (struct group_id_r *gr = getgrent_id_r()) json_object_array_add(groups, jstr(gr->gr_name)); endgrent_id_r(); #else setpwent(); while (struct passwd *pw = getpwent()) json_object_array_add(users, jstr(pw->pw_name)); endpwent(); setgrent(); while (struct group *gr = getgrent()) json_object_array_add(groups, jstr(gr->gr_name)); endgrent(); #endif json_object *accounts = json_object_new_object(); json_object_object_add(accounts, "users", users); json_object_object_add(accounts, "groups", groups); Loading
www/modules/shares.js +10 −8 Changes for www/modules/shares.js: 10 added lines, 8 removed lines. Original line number Diff line number Diff line Loading @@ -59,7 +59,7 @@ 'Files': 'Dateien', 'Files of {0}': 'Dateien von {0}', 'Back to shares': 'Zurück zu den Freigaben', 'New folder': 'Neuer Ordner', 'New file': 'Neue Datei', 'Permissions': 'Rechte', 'Permissions of this folder': 'Rechte dieses Ordners', 'Size': 'Größe', 'Modified': 'Geändert', 'Owner': 'Besitzer', 'Group': 'Gruppe', 'This folder is empty.': 'Dieser Ordner ist leer.', 'name or user@domain': 'Name oder benutzer@domain', 'Owner': 'Besitzer', 'Group': 'Gruppe', 'This folder is empty.': 'Dieser Ordner ist leer.', 'Folder {0} created.': 'Ordner {0} angelegt.', 'File {0} created.': 'Datei {0} angelegt.', 'Delete {0}?': '{0} löschen?', 'The folder {0} and everything in it will be deleted.': 'Der Ordner {0} und alles darin wird gelöscht.', 'The file {0} will be deleted.': 'Die Datei {0} wird gelöscht.', Loading Loading @@ -370,18 +370,20 @@ const isDir = e.type === 'dir'; const m = parseInt(e.mode, 8); const label = path || b.share; const options = (list, value) => { const all = list.includes(value) ? list : [value, ...list]; return all.map(n => h('option', {value: n, selected: n === value}, n)); }; // free text with suggestions: Active Directory users (user@domain) are // only listed when adconnect enumerates them const account = (name, list, value, id) => [ h('input', {name, value: value || '', list: id, autocomplete: 'off', required: true, placeholder: t('name or user@domain')}), h('datalist', {id}, list.map(n => h('option', {value: n})))]; const box = (bit, title) => h('td', {}, h('input', {type: 'checkbox', name: 'm' + bit.toString(8), checked: !!(m & bit), title, 'aria-label': title})); dialog({ title: t('Permissions of {0}', label), fields: () => [ h('div', {class: 'row'}, h('label', {}, t('Owner'), h('select', {name: 'owner'}, options(b.accounts.users, e.owner))), h('label', {}, t('Group'), h('select', {name: 'group'}, options(b.accounts.groups, e.group)))), h('label', {}, t('Owner'), account('owner', b.accounts.users, e.owner, 'perm-users')), h('label', {}, t('Group'), account('group', b.accounts.groups, e.group, 'perm-groups'))), h('table', {class: 'perm-grid'}, h('thead', {}, h('tr', {}, h('th', {}), h('th', {}, t('read')), h('th', {}, t('write')), h('th', {}, isDir ? t('open') : t('execute')))), Loading @@ -400,7 +402,7 @@ let mode = 0; for (const bit of [0o400, 0o200, 0o100, 0o40, 0o20, 0o10, 0o4, 0o2, 0o1, 0o2000, 0o1000]) if (d['m' + bit.toString(8)]) mode |= bit; await call('shares', 'setPermissions', {share: b.share, path, owner: d.owner, group: d.group, await call('shares', 'setPermissions', {share: b.share, path, owner: d.owner.trim(), group: d.group.trim(), mode: mode.toString(8).padStart(4, '0'), recursive: !!d.recursive}); toast(t('Permissions of {0} saved.', label)); browse(b.share, b.path); Loading