I am trying to connect QuizShock with joomla 1.5.
Till now i get all the user from joomla to quiz, the problem is validate the login from quiz, let mje say that i am working based in a bridge that came with quiz but is for bbforum.
This is the code:
Code: Select all
function validate()
{
global $db, $jos_users_table, $jos_session_table;
// if we have the username (they are logging in)
if( $this->username )
{
$result = $db->query("SELECT id,usertype,username
FROM $jos_users_table
WHERE username='$this->username'
AND password='$this->password'
AND block=0");
}
// else validate from id (cookie)
elseif( $this->id )
{
$result = $db->query("SELECT id,username,usertype
FROM $jos_users_table
WHERE id='$this->id'
AND password='$this->password'
AND block=0");
}
else
{
return false;
}
if( $db->num_rows($result) )
{
$row = $db->fetch_array($result);
$this->validated = 1;
$this->id = $row['id'];
$this->username = $row['username'];
$this->level = $row['usertype'];