Adding and removing dokuwiki users
This commit is contained in:
parent
232cb7fbf0
commit
51eeef0630
|
@ -77,6 +77,23 @@ function change_password_dokuwiki {
|
|||
fi
|
||||
}
|
||||
|
||||
function add_user_dokuwiki {
|
||||
new_username="$1"
|
||||
new_user_password="$2"
|
||||
|
||||
HASHED_DOKUWIKI_PASSWORD=$(echo -n "$new_user_password" | md5sum | awk -F ' ' '{print $1}')
|
||||
echo "$new_username:$HASHED_DOKUWIKI_PASSWORD:$new_username:$new_username@$HOSTNAME:user,upload" >> /var/lib/dokuwiki/acl/users.auth.php
|
||||
chmod 640 /var/lib/dokuwiki/acl/users.auth.php
|
||||
}
|
||||
|
||||
function remove_user_dokuwiki {
|
||||
remove_username="$1"
|
||||
|
||||
if grep "$remove_username:" /var/lib/dokuwiki/acl/users.auth.php; then
|
||||
sed -i "/$remove_username:/d" /var/lib/dokuwiki/acl/users.auth.php
|
||||
fi
|
||||
}
|
||||
|
||||
function reconfigure_dokuwiki {
|
||||
echo -n ''
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue