#!/bin/bash

# Alias: Deprecated - Use Dokuwiki for user management
# Menu: Web GUI
# Description:
#  In previous versions the Dokuwiki user database could be used as user database
#  for all OMD components. This was never working correctly and was rarely used.
#  It has been dropped now. The hook is kept for compatiblity reasons.

case "$1" in
   default)
       echo "off"
   ;;
   choices)
       echo "off: disabled"
       echo "on: deprecated (not effective anymore)"
   ;;
   set)
       if [ -h ${OMD_ROOT}/etc/htpasswd ] && [ $(readlink ${OMD_ROOT}/etc/htpasswd) = "dokuwiki/users.auth.php" ] && [ -e ${OMD_ROOT}/etc/htpasswd ]
       then
           rm -f ${OMD_ROOT}/etc/htpasswd
           mv ${OMD_ROOT}/etc/htpasswd.omd ${OMD_ROOT}/etc/htpasswd
       fi
   ;;
esac
