X-Git-Url: http://git.pjr.cc/?p=gwvp-mini.git;a=blobdiff_plain;f=gwvpmini%2Fgwvpmini_admin.php;h=e19a2684b5d4c558d44adc477d40ade6c015273d;hp=e588e97dfc1fbe4fd18287b9868c62753b0481bd;hb=979dc6190296b0c7ffdfe17031f2d32318da7e2b;hpb=529c11c6cfff0c2d8b857eed0b5ace7f3be054da diff --git a/gwvpmini/gwvpmini_admin.php b/gwvpmini/gwvpmini_admin.php index e588e97..e19a268 100644 --- a/gwvpmini/gwvpmini_admin.php +++ b/gwvpmini/gwvpmini_admin.php @@ -1,17 +1,20 @@ Disable)"; @@ -91,10 +103,24 @@ function gwvpmini_AdminMainPageBody() } else { $regconfirm = "Registration Doesnt Require Confirmation (Enable)"; } + + if($use_gravatar) { + $usegrav = "Gravatars are enabled (Disable)"; + } else { + $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 ""; + + if($st == 1) { + $stat = 0; + $cstat = "Enable"; + } else { + $stat = 1; + $cstat = "Disable"; + } + + echo ""; + } echo "
"; echo "

Users - $totalusers

"; - echo "$register
$regconfirm
"; + echo "$register
$regconfirm
$usegrav
$forcessl
"; echo "
"; echo "Address emails are sent from
"; echo "
"; @@ -166,13 +192,24 @@ function gwvpmini_AdminMainPageBody() $rn = $val["name"]; $ds = $val["desc"]; $ow = $val["owner"]; + $st = $val["status"]; $udet = gwvpmini_getUser(null, null, $ow); if(!$udet) { $owl = "Orphaned"; } else { $owl = $udet["username"]." (".$udet["id"].") - ".$udet["fullname"]." (".$udet["email"].") - Email Owner"; } - echo "
$rn$ds$owlRemove Disable
$rn$ds$owlRemove $cstat
"; } @@ -425,4 +462,73 @@ function gwvpmini_SwitchEnableUser() header("Location: $BASE_URL/admin"); } + +function gwvpmini_SwitchEnableRepo() +{ + global $BASE_URL; + + $rid = -1; + $newst = -1; + if(isset($_REQUEST["q"])) { + $query = $_REQUEST["q"]; + $qspl = explode("/", $query); + if(isset($qspl[2])) { + $newst = $qspl[2]; + } + if(isset($qspl[3])) { + $rid = $qspl[3]; + } + } + + if($newst == 1) $stat = "disabled"; + else $stat = "enabled"; + + if($rid > 0 && ($newst == 1 || $newst == 0)) { + $details = gwvpmini_getRepo(null, null, $rid); + if($newst == 1) gwvpmini_DisableRepo($rid); + if($newst == 0) gwvpmini_EnableRepo($rid); + gwvpmini_SendMessage("info", "Repo $uname ($rid) has been $stat"); + } else { + gwvpmini_SendMessage("info", "Problem disabling repo with rid $rid"); + } + + header("Location: $BASE_URL/admin"); +} + +function gwvpmini_SwitchGravatars() +{ + global $BASE_URL, $use_gravatar; + + if($newst == 1) $stat = "disabled"; + else $stat = "enabled"; + + if($use_gravatar) { + gwvpmini_setConfigVal("gravatarenabled", "0"); + } else { + gwvpmini_setConfigVal("gravatarenabled", "1"); + } + + gwvpmini_SendMessage("info", "Gravatars $stat"); + + 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