[omd-commits] OMD Git: omd: Fixed multisite auth for dokuwiki

git version control git at mathias-kettner.de
Mon Oct 21 14:08:24 CEST 2013


Module:   omd
Branch:   master
Commit:   96e01fe8b479d44ce134bc3970179180c34a3f85
URL:      http://omdistro.org/projects/omd/repository/revisions/96e01fe8b479d44ce134bc3970179180c34a3f85

Author:   Bastian Kuhn <bk at mathias-kettner.de>
Date:     Mon Oct 21 14:06:45 2013 +0200
Commiter: Bastian Kuhn <bk at mathias-kettner.de>
Date:     Mon Oct 21 14:06:45 2013 +0200

Fixed multisite auth for dokuwiki

---

 packages/check_mk/MULTISITE_COOKIE_AUTH.hook     |   18 +++++++++++++++++-
 packages/dokuwiki/skel/etc/dokuwiki/dokuwiki.php |    2 ++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/packages/check_mk/MULTISITE_COOKIE_AUTH.hook b/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
index ed2e806..eb985c5 100755
--- a/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
+++ b/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
@@ -21,9 +21,10 @@ case "$1" in
        APACHE_CFG=${OMD_ROOT}/etc/apache/conf.d/cookie_auth.conf
        NAGVIS_CFG=${OMD_ROOT}/etc/nagvis/conf.d/cookie_auth.ini.php
        PNP_CFG=${OMD_ROOT}/etc/pnp4nagios/config.d/cookie_auth.php
+       WIKI_CFG=${OMD_ROOT}/etc/dokuwiki/cookie_auth.php
        if [ "$2" == "on" ]; then
            cat > $APACHE_CFG <<EOF
-<LocationMatch ^/${OMD_SITE}/(omd|nagvis|check_mk|pnp4nagios)>
+<LocationMatch ^/${OMD_SITE}/(omd|wiki|nagvis|check_mk|pnp4nagios)>
     Order allow,deny
     Allow from all
     Satisfy any
@@ -38,6 +39,20 @@ logon_multisite_secret="/omd/sites/$OMD_SITE/etc/auth.secret"
 logon_multisite_serials="/omd/sites/$OMD_SITE/etc/auth.serials"
 EOF
 
+          cat > $WIKI_CFG <<EOF
+<?php
+// Created by OMD hook MULTISITE_COOKIE_AUTH
+//
+$conf['useacl'] = 1;
+$conf['authtype'] = 'multisite';
+$conf['superuser'] = '@admin';
+$conf['multisite']['authfile'] = '/omd/sites/$OMD_SITE/var/check_mk/wato/auth/auth.php';
+$conf['multisite']['auth_secret'] = '/omd/sites/$OMD_SITE/etc/auth.secret';
+$conf['multisite']['auth_serials'] = '/omd/sites/$OMD_SITE/etc/auth.serials';
+$conf['multisite']['htpasswd'] = '/omd/sites/$OMD_SITE/etc/htpasswd';
+?>
+EOF
+
           cat > $PNP_CFG <<EOF
 <?php
 // Created by OMD hook MULTISITE_COOKIE_AUTH
@@ -56,6 +71,7 @@ EOF
           [ -f $APACHE_CFG ] && rm $APACHE_CFG
           [ -f $NAGVIS_CFG ] && rm $NAGVIS_CFG
           [ -f $PNP_CFG ] && rm $PNP_CFG
+          [ -f $WIKI_CFG ] && rm $WIKI_CFG
        fi
    ;;
 esac
diff --git a/packages/dokuwiki/skel/etc/dokuwiki/dokuwiki.php b/packages/dokuwiki/skel/etc/dokuwiki/dokuwiki.php
index 41f0fd5..0de95fe 100644
--- a/packages/dokuwiki/skel/etc/dokuwiki/dokuwiki.php
+++ b/packages/dokuwiki/skel/etc/dokuwiki/dokuwiki.php
@@ -163,3 +163,5 @@ $conf['ftp']['pass'] = 'password';
 $conf['ftp']['root'] = '/home/user/htdocs';
 
 $conf['readdircache'] = 0;               //time cache in second for the readdir opération, 0 to deactivate.
+
+ at include('cookie_auth.php');



More information about the omd-commits mailing list