check_logfiles: 3.7.5.1
[omd.git] / packages / dokuwiki / DOKUWIKI_AUTH.hook
blobb48ea2553c7e366e877b46507d2de4492690de10
1 #!/bin/bash
3 # Alias: Use Dokuwiki for user management
4 # Menu: Web GUI
5 # Description:
6 # Dokuwiki - on OMD available on the URL /$OMD_SITE/wiki - is not only
7 # a useful Wiki, but also implements a user management.
8 # If you enable this option, you will have Nagios, NagVis, Multisite and
9 # other web applications access the user database of Dokuwiki for authentication.
10 # Otherwise users are managed via the file ~/etc/passwd.
12 case "$1" in
13 default)
14 echo "off"
16 choices)
17 echo "on: enable - use Dokuwiki for user management"
18 echo "off: disable - edit etc/htpasswd manually"
20 set)
21 if [ "$2" == "on" ]
22 then
23 if [ ! -h ${OMD_ROOT}/etc/htpasswd ] || [ ! $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
24 then
25 mv ${OMD_ROOT}/etc/htpasswd ${OMD_ROOT}/etc/htpasswd.omd
26 ln -s dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
27 else
28 ln -sf dokuwiki/users.auth.php ${OMD_ROOT}/etc/htpasswd
30 else
31 # Prevent destroying links showing anywhere else
32 if [ -h ${OMD_ROOT}/etc/htpasswd ] && [ $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ]
33 then
34 ln -sf htpasswd.omd ${OMD_ROOT}/etc/htpasswd
38 esac