<?
########## Confixx(R) 3.0 Professional ############
####### Copyright SWsoft, Inc. 2004-2005 ##########
#### http://www.sw-soft.com - info@sw-soft.com ####

include('auth.php');
if($PHP_AUTH_USER == 'res0')
{
	db_connect($db_host, $db_user, $db_pass);
	$id = db_query('SELECT login FROM admin');
	$res = db_fetch_array($id);
	deleteSUser($PHP_AUTH_USER);
	$pw = $PHP_AUTH_PW;
	if(!$PHP_AUTH_PW)
	{
		$pw = '';
	}
	addSUser($res['login'], $pw, USERTYPE_ADMIN);	
	db_close();
}

header('Location: /admin/');

?>
