Commit e8779169 authored by Robert Ricci's avatar Robert Ricci

Support the Magic Admin Environment Variable from the web. If the

person logged in is an admin, and doesn't have adminoff set, set it.
(We have to prepend an HTTP_ so that it will make it through suexec.)

This is needed by, for example Mac's/Kirk's idlecheck/slothd stuff.
parent d3ef76bc
......@@ -473,8 +473,10 @@ sub TBAdmin(;$)
# No one is considered an admin unless they have the magic environment
# variable set (so that you have to be a bit more explict about wanting
# admin privs.) Use the withadminprivs script to get this variable set.
# Also check with HTTP_ at the front of the name, since this is required
# to get it through suexec from the web scripts.
#
if (!$ENV{WITH_TB_ADMIN_PRIVS}) {
if (!($ENV{WITH_TB_ADMIN_PRIVS} || $ENV{HTTP_WITH_TB_ADMIN_PRIVS})) {
return 0;
}
......
......@@ -222,6 +222,15 @@ function CHECKLOGIN($uid) {
if (strcmp($status, TBDB_USERSTATUS_ACTIVE) == 0)
$CHECKLOGIN_STATUS |= CHECKLOGIN_ACTIVE;
#
# Set the magic enviroment variable, if appropriate, for the sake of
# any processes we might spawn. We prepend an HTTP_ on the front of
# the variable name, so that it'll get through suexec.
#
if ($admin && !$adminoff) {
putenv("HTTP_WITH_TB_ADMIN_PRIVS=1");
}
return $CHECKLOGIN_STATUS;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment