Location: PHPKode > projects > H-tracker > backend/TTBridge.php
<?

// --------------------------------------------------------------------
// ------------------------ Update TT password ------------------------
// --------------------------------------------------------------------

function update_TTpassword ($username, $newMD5password)
{
	global $share_phpbb2_users_with_TT,$activate_phpbb2_forum;
	if(($share_phpbb2_users_with_TT!=true)||($activate_phpbb2_forum!=true)) return;
	if ((!isset($newMD5password))||(!isset($username))) return;
	
	dbconn(true);
	$res = mysql_query("SELECT id, secret FROM users WHERE username = '$username'");
	$row = mysql_fetch_array($res);
	mysql_query("UPDATE users SET password='" . $newMD5password . "' WHERE id=".$row["id"]);
	logincookie($row["id"], $newMD5password, hash_pad($row["secret"], 20));
}

// --------------------------------------------------------------------
// ------------------------ Update TT email ------------------------
// --------------------------------------------------------------------

function update_TTemail ($username, $newemail)
{
	global $share_phpbb2_users_with_TT,$activate_phpbb2_forum;
	if(($share_phpbb2_users_with_TT!=true)||($activate_phpbb2_forum!=true)) return;
	if ((!isset($newemail))||(!isset($username))) return;
	
	dbconn(true);
	$res = mysql_query("SELECT id FROM users WHERE username = '$username'");
	$row = mysql_fetch_array($res);
	mysql_query("UPDATE users SET email='" . $newemail . "' WHERE id=".$row["id"]);
}


// --------------------------------------------------------------------
// ------------------------ Update TT style ------------------------
// --------------------------------------------------------------------

function update_TTstyle ($username, $newstyle)
{
	global $share_phpbb2_users_with_TT,$activate_phpbb2_forum;
	if(($share_phpbb2_users_with_TT!=true)||($activate_phpbb2_forum!=true)) return;
	if ((!isset($newstyle))||(!isset($username))) return;
	
	dbconn(true);
	$res = mysql_query("SELECT id FROM stylesheets WHERE phpbb_style = '$newstyle'");
	if ($row = mysql_fetch_array($res))
	{
		mysql_query("UPDATE users SET stylesheet=" . $row["id"] . " WHERE username='".$username."'");
	}
}


?>
Return current item: H-tracker