Commit 33bb7946 authored by Leigh B. Stoller's avatar Leigh B. Stoller

Allow admins to login into the Protogeni trac wiki.

parent 83ec1515
...@@ -14,6 +14,7 @@ if (!$TRACSUPPORT) { ...@@ -14,6 +14,7 @@ if (!$TRACSUPPORT) {
# No Pageheader since we spit out a redirection below. # No Pageheader since we spit out a redirection below.
$this_user = CheckLoginOrDie(); $this_user = CheckLoginOrDie();
$uid = $this_user->uid(); $uid = $this_user->uid();
$isadmin = ISADMIN();
# The user has to be approved, real account. # The user has to be approved, real account.
if (!HASREALACCOUNT($uid)) { if (!HASREALACCOUNT($uid)) {
...@@ -45,9 +46,12 @@ elseif ($wiki == "emulab-priv") { ...@@ -45,9 +46,12 @@ elseif ($wiki == "emulab-priv") {
if ($wiki == "geni" || $wiki == "protogeni") { if ($wiki == "geni" || $wiki == "protogeni") {
$geniproject = Project::Lookup("geni"); $geniproject = Project::Lookup("geni");
if (!$geniproject) {
USERERROR("There is no such Trac wiki!", 1);
}
$approved = 0; $approved = 0;
if (! ($geniproject && if (! ($isadmin ||
$geniproject->IsMember($this_user, $approved) && $approved)) { ($geniproject->IsMember($this_user, $approved) && $approved))) {
USERERROR("You do not have permission to access the Trac wiki!", 1); USERERROR("You do not have permission to access the Trac wiki!", 1);
} }
$priv = 1; $priv = 1;
......
...@@ -689,7 +689,9 @@ function WRITESIDEBAR() { ...@@ -689,7 +689,9 @@ function WRITESIDEBAR() {
$approved = 0; $approved = 0;
if ($geniproject && if ($geniproject &&
$geniproject->IsMember($login_user, $approved) && $approved) { (ISADMIN() ||
($geniproject->IsMember($login_user, $approved) &&
$approved))) {
NavMenuButton("ProtoGENI Trac Wiki", NavMenuButton("ProtoGENI Trac Wiki",
"$TBBASE/" . CreateURL("gototrac", $login_user, "$TBBASE/" . CreateURL("gototrac", $login_user,
"wiki", "geni")); "wiki", "geni"));
......
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