[omd-commits] OMD Git: omd: Check_MK: Added pnp config file to login dialog hook

git version control git at mathias-kettner.de
Mon May 7 10:17:03 CEST 2012


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

Author:   Lars Michelsen <lm at mathias-kettner.de>
Date:     Mon May  7 10:05:01 2012 +0200
Commiter: Lars Michelsen <lm at mathias-kettner.de>
Date:     Mon May  7 10:05:01 2012 +0200

Check_MK: Added pnp config file to login dialog hook

---

 packages/check_mk/MULTISITE_COOKIE_AUTH.hook |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/packages/check_mk/MULTISITE_COOKIE_AUTH.hook b/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
index efe25e3..da14647 100755
--- a/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
+++ b/packages/check_mk/MULTISITE_COOKIE_AUTH.hook
@@ -20,6 +20,7 @@ case "$1" in
    set)
        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
        if [ "$2" == "on" ]; then
            cat > $APACHE_CFG <<EOF
 <LocationMatch ^/${OMD_SITE}/(omd|nagvis|check_mk|pnp4nagios)>
@@ -35,9 +36,23 @@ logonmodule="LogonMultisite"
 logon_multisite_secret="/omd/sites/$OMD_SITE/etc/auth.secret"
 logon_multisite_htpasswd="/omd/sites/$OMD_SITE/etc/htpasswd"
 EOF
+
+          cat > $PNP_CFG <<EOF
+<?php
+// Created by OMD hook MULTISITE_COOKIE_AUTH
+//
+// Using the multisite cookie based authentication when no
+// REMOTE_USER available.
+//
+\$conf['auth_multisite_enabled']  = TRUE;
+\$conf['auth_multisite_htpasswd'] = '/omd/sites/$OMD_SITE/etc/htpasswd';
+\$conf['auth_multisite_secret']   = '/omd/sites/$OMD_SITE/etc/auth.secret';
+?>
+EOF
        else
           [ -f $APACHE_CFG ] && rm $APACHE_CFG
           [ -f $NAGVIS_CFG ] && rm $NAGVIS_CFG
+          [ -f $PNP_CFG ] && rm $PNP_CFG
        fi
    ;;
 esac



More information about the omd-commits mailing list