Revision [8020]

This is an old revision of WikkaWithphpBB made by OfficeRabbit on 2005-05-11 13:34:46.

 

This is a very simple hack to get Wikka to read from the users table of a phpBB database rather than its own.

Wikka.php
Find:
 { return $this->LoadSingle("select * from ".$this->config['table_prefix']."users where name = '".mysql_real_escape_string($name)."' ".($password === 0 ? "" : "and password = '".mysql_real_escape_string($password)."'")." limit 1"); }


Replace with:
 { return $this->LoadSingle("select * from ".phpbb_."users where username = '".mysql_real_escape_string($name)."' ".($password === 0 ? "" : "and user_password = '".mysql_real_escape_string($password)."'")." limit 1"); }


Find:
 { return $this->LoadAll("select * from ".$this->config['table_prefix']."users order by name"); }


Replace with:
 { return $this->LoadAll("select * from ".phpbb_."users order by username"); }


Find:
 { if ($user = $this->GetUser()) $name = $user["name"]; else if (!$name = gethostbyaddr($_SERVER["REMOTE_ADDR"])) $name = $_SERVER["REMOTE_ADDR"]; return $name; }


Replace with:
 { if ($user = $this->GetUser()) $name = $user["username"]; else if (!$name = gethostbyaddr($_SERVER["REMOTE_ADDR"])) $name = $_SERVER["REMOTE_ADDR"]; return $name; }


Find:
 { $_SESSION["user"] = $user; $this->SetPersistentCookie("wikka_user_name", $user["name"]); $this->SetPersistentCookie("wikka_pass", $user["password"]); }


Replace with:
 { $_SESSION["user"] = $user; $this->SetPersistentCookie("wikka_user_name", $user["username"]); $this->SetPersistentCookie("wikka_pass", $user["user_password"]); }



There are 30 comments on this page. [Show comments]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki