Vergleich inc/functions_user.php - 1.2.2 - 1.2.12

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 44Zeile 44
 * Checks a password with a supplied username.
*
* @param string The username of the user.

 * Checks a password with a supplied username.
*
* @param string The username of the user.

 * @param string The md5()'ed password.

 * @param string The plain-text password.

 * @return boolean|array False when no match, array with user info when match.
*/
function validate_password_from_username($username, $password)

 * @return boolean|array False when no match, array with user info when match.
*/
function validate_password_from_username($username, $password)

Zeile 66Zeile 66
 * Checks a password with a supplied uid.
*
* @param int The user id.

 * Checks a password with a supplied uid.
*
* @param int The user id.

 * @param string The md5()'ed password.

 * @param string The plain-text password.

 * @param string An optional user data array.
* @return boolean|array False when not valid, user data array when valid.
*/

 * @param string An optional user data array.
* @return boolean|array False when not valid, user data array when valid.
*/

Zeile 101Zeile 101
			"loginkey" => $user['loginkey']
);
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$user['uid'], 1);

			"loginkey" => $user['loginkey']
);
$db->update_query(TABLE_PREFIX."users", $sql_array, "uid = ".$user['uid'], 1);

	}

	}

	if(salt_password(md5($password), $user['salt']) == $user['password'])

	if(salt_password(md5($password), $user['salt']) == $user['password'])

	{

	{

		return $user;

		return $user;

	}

	}

	else
{
return false;

	else
{
return false;

	}

	}

}

/**

}

/**

Zeile 235Zeile 235

/**
* Adds a thread to a user's favorite thread list.


/**
* Adds a thread to a user's favorite thread list.

 * If no uid is supplied, the currently logged in user's id will be used.
*
* @param int The tid of the thread to add to the list.

 * If no uid is supplied, the currently logged in user's id will be used.
*
* @param int The tid of the thread to add to the list.

 * @param int (Optional) The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.
*/
function add_favorite_thread($tid, $uid="")

 * @param int (Optional) The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.
*/
function add_favorite_thread($tid, $uid="")

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{

		return;
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='f' AND uid='".intval($uid)."' LIMIT 1");
$favorite = $db->fetch_array($query);

		return;
}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='f' AND uid='".intval($uid)."' LIMIT 1");
$favorite = $db->fetch_array($query);

	if(!$favorite['tid'])
{
$db->query("INSERT INTO ".TABLE_PREFIX."favorites (uid,tid,type) VALUES ('".intval($uid)."','".intval($tid)."','f')");

	if(!$favorite['tid'])
{
$db->query("INSERT INTO ".TABLE_PREFIX."favorites (uid,tid,type) VALUES ('".intval($uid)."','".intval($tid)."','f')");

	}
return true;
}

/**
* Removes a thread from a user's favorite thread list.

	}
return true;
}

/**
* Removes a thread from a user's favorite thread list.

 * If no uid is supplied, the currently logged in user's id will be used.

 * If no uid is supplied, the currently logged in user's id will be used.

 *
* @param int The tid of the thread to remove from the list.
* @param int (Optional)The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.
*/
function remove_favorite_thread($tid, $uid="")

 *
* @param int The tid of the thread to remove from the list.
* @param int (Optional)The uid of the user who's list to update.
* @return boolean True when success, false when otherwise.
*/
function remove_favorite_thread($tid, $uid="")

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{
return;

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{
return;

	}
$db->query("DELETE FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='f' AND uid='".intval($uid)."'");
return true;

	}
$db->query("DELETE FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='f' AND uid='".intval($uid)."'");
return true;

Zeile 293Zeile 293
 * @return boolean True when success, false when otherwise.
*/
function add_subscribed_thread($tid, $uid="")

 * @return boolean True when success, false when otherwise.
*/
function add_subscribed_thread($tid, $uid="")

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{
return;

{
global $mybb, $db;
if(!$uid)
{
$uid = $mybb->user['uid'];
}
if(!$uid)
{
return;

	}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='s' AND uid='".intval($uid)."' LIMIT 1");
$favorite = $db->fetch_array($query);

	}
$query = $db->query("SELECT * FROM ".TABLE_PREFIX."favorites WHERE tid='".intval($tid)."' AND type='s' AND uid='".intval($uid)."' LIMIT 1");
$favorite = $db->fetch_array($query);

Zeile 429Zeile 429
		$folderinfo = explode("**", $folders, 2);
$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$folderlinks .= "<li class=\"pmfolders\"><a href=\"private.php?fid=$folderinfo[0]\">$folderinfo[1]</a></li>\n";

		$folderinfo = explode("**", $folders, 2);
$folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]);
$folderlinks .= "<li class=\"pmfolders\"><a href=\"private.php?fid=$folderinfo[0]\">$folderinfo[1]</a></li>\n";

	}

	}

	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_messenger")."\";");
}


	eval("\$usercpmenu .= \"".$templates->get("usercp_nav_messenger")."\";");
}


Zeile 517Zeile 517
		$uid = $mybb->user['uid'];
}


		$uid = $mybb->user['uid'];
}


	// If using logged in user, use the last visit

	// If using current user, use the last visit

	if($uid == $mybb->user['uid'])
{
$lastvisit = $mybb->user['lastvisit'];

	if($uid == $mybb->user['uid'])
{
$lastvisit = $mybb->user['lastvisit'];

Zeile 559Zeile 559
		$db->update_query(TABLE_PREFIX."users", $pmcount, "uid='".$uid."'");
}
return $pmcount;

		$db->update_query(TABLE_PREFIX."users", $pmcount, "uid='".$uid."'");
}
return $pmcount;

}

/**
* Return a list of banned usernames.
*
* @return array The array of banned usernames.
*/
function get_banned_usernames()
{
$bannedusernames = explode(",", $mybb->settings['bannedusernames']);
return $bannedusernames;

 
}

/**

}

/**