X-Git-Url: http://git.pjr.cc/?a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_admin.php;h=26cb82e004a773aa50f316633805acdd538abc82;hb=26a8a9033c1f6f3f801fd2be4b82134df1258dc1;hp=b4f9db6d65c69ad1a4a8ee6c94704446e1e11997;hpb=b26baaa1fd812e3c01646323119ca2b97ccdbd1d;p=gwvp-mini.git diff --git a/gwvpmini/gwvpmini_admin.php b/gwvpmini/gwvpmini_admin.php index b4f9db6..26cb82e 100644 --- a/gwvpmini/gwvpmini_admin.php +++ b/gwvpmini/gwvpmini_admin.php @@ -1,24 +1,15 @@ Disable)"; @@ -116,10 +113,17 @@ function gwvpmini_AdminMainPageBody() $usegrav = "Gravatars are disabled (Enable)"; } + if($force_ssl) { + $forcessl = "Force SSL is enabled (Disable)"; + } else { + $forcessl = "Force SSL is disabled (Enable)"; + } + + $totalusers = gwvpmini_GetNUsers(); echo ""; - else echo ""; + echo ""; + if($id != $_SESSION["id"]) { + echo ""; + else echo ""; + } else { + echo ""; + } } @@ -462,6 +471,37 @@ function gwvpmini_SwitchEnableUser() } +function gwvpmini_SwitchAdmin() +{ + global $BASE_URL; + + $uid = -1; + $newst = -1; + if(isset($_REQUEST["q"])) { + $query = $_REQUEST["q"]; + $qspl = explode("/", $query); + if(isset($qspl[2])) { + $newst = $qspl[2]; + } + if(isset($qspl[3])) { + $uid = $qspl[3]; + } + } + + + if($uid > 0 && $newst >= 0) { + gwvpmini_SetUserStatusAdmin($uid, $newst); + if($newst == 0) { + gwvpmini_SendMessage("info", "User is no longer an admin"); + } else { + gwvpmini_SendMessage("info", "User is now an admin"); + } + } else gwvpmini_SendMessage("error", "Invalid user id"); + + + header("Location: $BASE_URL/admin"); +} + function gwvpmini_SwitchEnableRepo() { global $BASE_URL; @@ -511,4 +551,23 @@ function gwvpmini_SwitchGravatars() header("Location: $BASE_URL/admin"); } + +function gwvpmini_SwitchForceSSL() +{ + global $BASE_URL, $force_ssl; + + if($newst == 1) $stat = "disabled"; + else $stat = "enabled"; + + if($force_ssl) { + gwvpmini_setConfigVal("forcessl", "0"); + } else { + gwvpmini_setConfigVal("forcessl", "1"); + } + + gwvpmini_SendMessage("info", "forcessl $stat"); + + header("Location: $BASE_URL/admin"); + +} ?> \ No newline at end of file
"; + echo "$register
$regconfirm
$usegrav
$forcessl
"; echo "

Users - $totalusers

"; - echo "$register
$regconfirm
$usegrav
"; echo "
"; echo "Address emails are sent from
"; echo "
"; @@ -138,12 +142,12 @@ function gwvpmini_AdminMainPageBody() $astat = "0"; $cstat = "WTF"; $level = "WTF"; - if($st_l == 0) $level = "User"; - if($st_l == 1) $level = "Admin"; + if($st_l == 0) $level = "User"; + if($st_l == 1) $level = "Admin"; $status = ""; if($st_t[0] == "1") { - $status = ", disabled"; + $status = ", Disabled"; $astat = 0; $cstat = "Enable"; } else if ($st_t[0] == "0") { @@ -158,9 +162,14 @@ function gwvpmini_AdminMainPageBody() $st = "$level$status"; $unlval = "$un"; - echo "
$unlval$em$fn$ds$stRemove "; - if ($st_t[0] == "0"||$st_t[0] == "1") echo "$cstat
$unlval$em$fn$ds$stRemove "; + if ($st_t[0] == "0"||$st_t[0] == "1") echo "$cstat
--