Vergleich inc/functions_user.php - 1.8.19 - 1.8.38

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 62Zeile 62

$user = get_user_by_username($username, $options);



$user = get_user_by_username($username, $options);


	if(!$user['uid'])

	if(!$user)

	{
return false;
}

	{
return false;
}

Zeile 88Zeile 88
	if(!$user['password'])
{
$user = get_user($uid);

	if(!$user['password'])
{
$user = get_user($uid);

	}
if(!$user['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password
$password_fields = create_password($user['password'], false, $user);
$db->update_query("users", $password_fields, "uid='".$user['uid']."'");

 
	}

if(!$user['loginkey'])

	}

if(!$user['loginkey'])

Zeile 257Zeile 251
function generate_salt()
{
return random_str(8);

function generate_salt()
{
return random_str(8);

}


}


/**
* Generates a 50 character random login key.
*

/**
* Generates a 50 character random login key.
*

Zeile 333Zeile 327

$query = $db->simple_select("threadsubscriptions", "*", "tid='".(int)$tid."' AND uid='".(int)$uid."'");
$subscription = $db->fetch_array($query);


$query = $db->simple_select("threadsubscriptions", "*", "tid='".(int)$tid."' AND uid='".(int)$uid."'");
$subscription = $db->fetch_array($query);

	if(!$subscription['tid'])

	if(!$subscription)

	{
$insert_array = array(
'uid' => (int)$uid,

	{
$insert_array = array(
'uid' => (int)$uid,

Zeile 407Zeile 401

$query = $db->simple_select("forumsubscriptions", "*", "fid='".$fid."' AND uid='{$uid}'", array('limit' => 1));
$fsubscription = $db->fetch_array($query);


$query = $db->simple_select("forumsubscriptions", "*", "fid='".$fid."' AND uid='{$uid}'", array('limit' => 1));
$fsubscription = $db->fetch_array($query);

	if(!$fsubscription['fid'])

	if(!$fsubscription)

	{
$insert_array = array(
'fid' => $fid,

	{
$insert_array = array(
'fid' => $fid,

Zeile 489Zeile 483
{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


	$expaltext = (in_array("usercppms", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercppms", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

	$usercp_nav_messenger = $templates->get("usercp_nav_messenger");
// Hide tracking link if no permission
$tracking = '';

	$usercp_nav_messenger = $templates->get("usercp_nav_messenger");
// Hide tracking link if no permission
$tracking = '';

Zeile 509Zeile 503
	$folderlinks = $folder_id = $folder_name = '';
$foldersexploded = explode("$%%$", $mybb->user['pmfolders']);
foreach($foldersexploded as $key => $folders)

	$folderlinks = $folder_id = $folder_name = '';
$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 577Zeile 571
		$collapsed['usercpprofile_e'] = '';
}


		$collapsed['usercpprofile_e'] = '';
}


	$expaltext = (in_array("usercpprofile", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercpprofile", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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


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


Zeile 589Zeile 583
{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


{
global $db, $mybb, $templates, $theme, $usercpmenu, $lang, $collapse, $collapsed, $collapsedimg;


	$draftstart = $draftend = '';

	$draftstart = $draftend = $attachmentop = '';

	$draftcount = $lang->ucp_nav_drafts;

$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible = '-2' AND uid = '{$mybb->user['uid']}'");

	$draftcount = $lang->ucp_nav_drafts;

$query = $db->simple_select("posts", "COUNT(pid) AS draftcount", "visible = '-2' AND uid = '{$mybb->user['uid']}'");

Zeile 616Zeile 610
	}

$profile_link = get_profile_link($mybb->user['uid']);

	}

$profile_link = get_profile_link($mybb->user['uid']);

	$expaltext = (in_array("usercpmisc", $collapse)) ? "[+]" : "[-]";

	$expaltext = (in_array("usercpmisc", $collapse)) ? $lang->expcol_expand : $lang->expcol_collapse;

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


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


Zeile 725Zeile 719

switch($fid)
{


switch($fid)
{

		case 1:

		case 0:

			return $lang->folder_inbox;

			return $lang->folder_inbox;

 
			break;
case 1:
return $lang->folder_unread;

			break;
case 2:
return $lang->folder_sent_items;
break;
case 3:
return $lang->folder_drafts;

			break;
case 2:
return $lang->folder_sent_items;
break;
case 3:
return $lang->folder_drafts;

			break;

			break;

		case 4:
return $lang->folder_trash;
break;

		case 4:
return $lang->folder_trash;
break;

Zeile 751Zeile 748
function generate_question($old_qid=0)
{
global $db;

function generate_question($old_qid=0)
{
global $db;





	if($db->type == 'pgsql' || $db->type == 'sqlite')
{
$order_by = 'RANDOM()';

	if($db->type == 'pgsql' || $db->type == 'sqlite')
{
$order_by = 'RANDOM()';

	}

	}

	else
{
$order_by = 'RAND()';
}

	else
{
$order_by = 'RAND()';
}

	



$excl_old = '';

	if($old_qid)
{
$excl_old = ' AND qid != '.(int)$old_qid;

	if($old_qid)
{
$excl_old = ' AND qid != '.(int)$old_qid;