mirror of
https://dev.iopsys.eu/feed/iopsys.git
synced 2025-12-10 07:44:50 +01:00
usermngr: Added full_access and Untrusted role
This commit is contained in:
parent
c1a8c1aa86
commit
af3cf465bc
3 changed files with 13 additions and 4 deletions
|
|
@ -5,7 +5,7 @@
|
||||||
include $(TOPDIR)/rules.mk
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
PKG_NAME:=usermngr
|
PKG_NAME:=usermngr
|
||||||
PKG_VERSION:=1.3.3
|
PKG_VERSION:=1.3.4
|
||||||
|
|
||||||
LOCAL_DEV:=0
|
LOCAL_DEV:=0
|
||||||
ifneq ($(LOCAL_DEV),1)
|
ifneq ($(LOCAL_DEV),1)
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,13 @@ config user 'admin'
|
||||||
config user 'user'
|
config user 'user'
|
||||||
option enabled '1'
|
option enabled '1'
|
||||||
option remote_access '1'
|
option remote_access '1'
|
||||||
|
|
||||||
|
config role 'full_access'
|
||||||
|
option enabled '1'
|
||||||
|
option role_id '1'
|
||||||
|
option name 'full_access'
|
||||||
|
|
||||||
|
config role 'untrusted'
|
||||||
|
option enabled '1'
|
||||||
|
option role_id '2'
|
||||||
|
option name 'Untrusted'
|
||||||
|
|
|
||||||
|
|
@ -10,10 +10,10 @@ add_system_shells() {
|
||||||
# Add the shell in UCI if not exists
|
# Add the shell in UCI if not exists
|
||||||
sec=$(uci -q show users | grep -E "^users\.@shell\[[0-9]+\]\.name=\'$shell_name\'$")
|
sec=$(uci -q show users | grep -E "^users\.@shell\[[0-9]+\]\.name=\'$shell_name\'$")
|
||||||
if [ -z "${sec}" ]; then
|
if [ -z "${sec}" ]; then
|
||||||
sec=$(uci -q add users shell)
|
sec="shell_${shell_name}"
|
||||||
|
uci -q set users."${sec}"=shell
|
||||||
uci -q set users."${sec}".name="${shell_name}"
|
uci -q set users."${sec}".name="${shell_name}"
|
||||||
uci -q set users."${sec}.enabled=1"
|
uci -q set users."${sec}.enabled=1"
|
||||||
uci commit users
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
@ -60,4 +60,3 @@ remove_shell() {
|
||||||
config_load users
|
config_load users
|
||||||
add_system_shells
|
add_system_shells
|
||||||
config_foreach remove_shell shell
|
config_foreach remove_shell shell
|
||||||
uci commit users
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue