Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: functions_user.php 5616 2011-09-20 13:24:59Z Tomm $
| * $Id$
|
*/
/**
| */
/**
|
Zeile 40 | Zeile 40 |
---|
{ global $db;
|
{ global $db;
|
$query = $db->simple_select("users", "COUNT(*) as user", "LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));
| $username = $db->escape_string(my_strtolower($username)); $query = $db->simple_select("users", "COUNT(*) as user", "LOWER(username)='".$username."' OR LOWER(email)='".$username."'", array('limit' => 1));
|
if($db->fetch_field($query, 'user') == 1) {
| if($db->fetch_field($query, 'user') == 1) {
|
Zeile 61 | Zeile 62 |
---|
*/ function validate_password_from_username($username, $password) {
|
*/ function validate_password_from_username($username, $password) {
|
global $db;
| global $db, $mybb;
|
|
|
$query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='".$db->escape_string(my_strtolower($username))."'", array('limit' => 1));
| $username = $db->escape_string(my_strtolower($username)); switch($mybb->settings['username_method']) { case 0: $query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='".$username."'", array('limit' => 1)); break; case 1: $query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(email)='".$username."'", array('limit' => 1)); break; case 2: $query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='".$username."' OR LOWER(email)='".$username."'", array('limit' => 1)); break; default: $query = $db->simple_select("users", "uid,username,password,salt,loginkey,coppauser,usergroup", "LOWER(username)='".$username."'", array('limit' => 1)); break; }
|
$user = $db->fetch_array($query); if(!$user['uid'])
| $user = $db->fetch_array($query); if(!$user['uid'])
|
Zeile 87 | Zeile 103 |
---|
function validate_password_from_uid($uid, $password, $user = array()) { global $db, $mybb;
|
function validate_password_from_uid($uid, $password, $user = array()) { global $db, $mybb;
|
if($mybb->user['uid'] == $uid)
| if(isset($mybb->user['uid']) && $mybb->user['uid'] == $uid)
|
{ $user = $mybb->user; }
| { $user = $mybb->user; }
|
Zeile 367 | Zeile 383 |
---|
function remove_subscribed_forum($fid, $uid="") { global $mybb, $db;
|
function remove_subscribed_forum($fid, $uid="") { global $mybb, $db;
|
if(!$uid) {
| if(!$uid) {
|
$uid = $mybb->user['uid']; } if(!$uid) { return;
|
$uid = $mybb->user['uid']; } if(!$uid) { return;
|
}
| }
|
$db->delete_query("forumsubscriptions", "fid='".$fid."' AND uid='{$uid}'"); return true;
|
$db->delete_query("forumsubscriptions", "fid='".$fid."' AND uid='{$uid}'"); return true;
|
}
/**
| }
/**
|
* Constructs the usercp navigation menu. * */ function usercp_menu() { global $mybb, $templates, $theme, $plugins, $lang, $usercpnav, $usercpmenu;
|
* Constructs the usercp navigation menu. * */ function usercp_menu() { global $mybb, $templates, $theme, $plugins, $lang, $usercpnav, $usercpmenu;
|
|
|
$lang->load("usercpnav");
// Add the default items as plugins with separated priorities of 10
| $lang->load("usercpnav");
// Add the default items as plugins with separated priorities of 10
|
Zeile 418 | Zeile 434 |
---|
{ global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
|
{ global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
|
| $usercp_nav_messenger = $templates->get("usercp_nav_messenger"); // Hide tracking link if no permission $tracking = ''; if($mybb->usergroup['cantrackpms']) { $tracking = $templates->get("usercp_nav_messenger_tracking"); } eval("\$ucp_nav_tracking = \"". $tracking ."\";");
$folderlinks = '';
|
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']); foreach($foldersexploded as $key => $folders)
|
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']); foreach($foldersexploded as $key => $folders)
|
{
| {
|
$folderinfo = explode("**", $folders, 2); $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); if($folderinfo[0] == 4)
| $folderinfo = explode("**", $folders, 2); $folderinfo[1] = get_pm_folder_name($folderinfo[0], $folderinfo[1]); if($folderinfo[0] == 4)
|
Zeile 439 | Zeile 465 |
---|
$folderlinks .= "<div><a href=\"private.php?fid=$folderinfo[0]\" class=\"usercp_nav_item {$class}\">$folderinfo[1]</a></div>\n"; }
|
$folderlinks .= "<div><a href=\"private.php?fid=$folderinfo[0]\" class=\"usercp_nav_item {$class}\">$folderinfo[1]</a></div>\n"; }
|
eval("\$usercpmenu .= \"".$templates->get("usercp_nav_messenger")."\";"); }
| eval("\$usercpmenu .= \"".$usercp_nav_messenger."\";"); }
|
/** * Constructs the usercp profile menu. * */ function usercp_menu_profile()
|
/** * Constructs the usercp profile menu. * */ function usercp_menu_profile()
|
{
| {
|
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
if($mybb->usergroup['canchangename'] != 0) { eval("\$changenameop = \"".$templates->get("usercp_nav_changename")."\";");
|
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
if($mybb->usergroup['canchangename'] != 0) { eval("\$changenameop = \"".$templates->get("usercp_nav_changename")."\";");
|
}
| }
|
if($mybb->usergroup['canusesig'] == 1 && ($mybb->usergroup['canusesigxposts'] == 0 || $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] > $mybb->usergroup['canusesigxposts'])) {
| if($mybb->usergroup['canusesig'] == 1 && ($mybb->usergroup['canusesigxposts'] == 0 || $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] > $mybb->usergroup['canusesigxposts'])) {
|
Zeile 473 | Zeile 499 |
---|
function usercp_menu_misc() { global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
|
function usercp_menu_misc() { global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapsed, $collapsedimg;
|
| $draftstart = $draftend = $draftcount = '';
|
$query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'"); $count = $db->fetch_array($query);
| $query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'"); $count = $db->fetch_array($query);
|