<?PHP

/*
 *	W-AGORA 4.1
 *	-----------
 *	$Id: register_globals.php,v 1.4 2003/02/17 16:46:05 mdruilhe Exp $
 *	Usage:		handle PHP configs that have REGISTER_GLOBALS turned off.
 */

	if (isset($HTTP_GET_VARS)) {
		reset($HTTP_GET_VARS);
		while ( list($var, $val) = each($HTTP_GET_VARS) ) {
			$$var=$val;
		}
	}

	if (isset($HTTP_POST_VARS)) {
		reset($HTTP_POST_VARS);
		while ( list($var, $val) = each($HTTP_POST_VARS) ) {
			$$var=$val;
		}
	}

	if (isset($HTTP_POST_FILES)) {
		reset($HTTP_POST_FILES);
		while ( list($var, $val) = each($HTTP_POST_FILES) ) {
			extract ($val, EXTR_PREFIX_ALL, "$var");
			$$var = $val["tmp_name"];
		}
	}

	if (isset($HTTP_COOKIE_VARS)) {
		reset($HTTP_COOKIE_VARS);
		while ( list($var, $val) = each($HTTP_COOKIE_VARS) ) {
			$$var=$val;
		}
	}

	$PHP_SELF = $HTTP_SERVER_VARS["PHP_SELF"];

	$HTTP_HOST = isset($HTTP_SERVER_VARS["HTTP_HOST"]) ? $HTTP_SERVER_VARS["HTTP_HOST"] : $HTTP_ENV_VARS["HTTP_HOST"];
	$HTTP_USER_AGENT = isset($HTTP_SERVER_VARS["HTTP_USER_AGENT"]) ? $HTTP_SERVER_VARS["HTTP_USER_AGENT"] : $HTTP_ENV_VARS["HTTP_USER_AGENT"];
	$QUERY_STRING = isset($HTTP_SERVER_VARS["QUERY_STRING"]) ? $HTTP_SERVER_VARS["QUERY_STRING"] : ( isset($HTTP_ENV_VARS["QUERY_STRING"]) ? $HTTP_ENV_VARS["QUERY_STRING"] : '');
	$REMOTE_ADDR = isset($HTTP_SERVER_VARS["REMOTE_ADDR"]) ? $HTTP_SERVER_VARS["REMOTE_ADDR"] : $HTTP_ENV_VARS["REMOTE_ADDR"];
	$SERVER_NAME = isset($HTTP_SERVER_VARS["SERVER_NAME"]) ? $HTTP_SERVER_VARS["SERVER_NAME"] : $HTTP_ENV_VARS["SERVER_NAME"];

?>