All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

gotowiki.php3 1.3 KB
Newer Older
1 2 3
<?php
#
# EMULAB-COPYRIGHT
4
# Copyright (c) 2000-2007 University of Utah and the Flux Group.
5 6 7 8 9 10 11 12 13 14
# All rights reserved.
#
include("defs.php3");

if (!$WIKISUPPORT) {
    header("Location: index.php3");
    return;
}

# No Pageheader since we spit out a redirection below.
15 16 17
$this_user = CheckLoginOrDie(CHECKLOGIN_USERSTATUS|
			     CHECKLOGIN_WEBONLY|CHECKLOGIN_WIKIONLY);
$uid       = $this_user->uid();
18 19

#
20
# Verify page arguments. project_title is the project to zap to.
21
#
22
$optargs = OptionalPageArguments("redurl", PAGEARG_STRING);
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47

#
# Look for our wikicookie. If the browser has it, then there is nothing
# more to do; just redirect the user over to the wiki.
#
if (isset($_COOKIE[$WIKICOOKIENAME])) {
    $wikihash = $_COOKIE[$WIKICOOKIENAME];
    
    header("Location: ${WIKIURL}?username=${uid}&bosscred=${wikihash}" .
	   (isset($redurl) ? "&redurl=${redurl}" : ""));
    return;
}

#
# Generate a cookie. Send it over to the wiki server and stash it into
# the users browser for subsequent requests (until logout).
# 
$wikihash = GENHASH();

SUEXEC("nobody", "nobody", "wikixlogin $uid $wikihash", SUEXEC_ACTION_DIE);

setcookie($WIKICOOKIENAME, $wikihash, 0, "/", $TBAUTHDOMAIN, $TBSECURECOOKIES);
header("Location: ${WIKIURL}?username=${uid}&bosscred=${wikihash}" .
	   (isset($redurl) ? "&redurl=${redurl}" : ""));
?>