Vergleich inc/functions_user.php - 1.8.9 - 1.8.18

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 92Zeile 92
	if(!$user['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password

	if(!$user['salt'])
{
// Generate a salt for this user and assume the password stored in db is a plain md5 password

		$user['salt'] = generate_salt();
$user['password'] = create_password_hash($user['password'], $user['salt'], $user);
$sql_array = array(
"salt" => $user['salt'],
"password" => $user['password']
);
$db->update_query("users", $sql_array, "uid='".$user['uid']."'");

		$password_fields = create_password($user['password'], false, $user);
$db->update_query("users", $password_fields, "uid='".$user['uid']."'");






	}

if(!$user['loginkey'])

	}

if(!$user['loginkey'])

Zeile 148Zeile 143
			$salt = generate_salt();
}
$newpassword['salt'] = $salt;

			$salt = generate_salt();
}
$newpassword['salt'] = $salt;

	}

	}


// Create new password based on salt
$saltedpw = salt_password($password, $salt);


// Create new password based on salt
$saltedpw = salt_password($password, $salt);

Zeile 183Zeile 178
 * Salts a password based on a supplied salt.
*
* @param string $password The input password.

 * Salts a password based on a supplied salt.
*
* @param string $password The input password.

 * @param string $salt The salt used by the MyBB algorithm.

 * @param string $salt (Optional) The salt used by the MyBB algorithm.

 * @param string $user (Optional) An array containing password-related data.

 * @param string $user (Optional) An array containing password-related data.

 * @return string The password hash.

 * @return array Password-related fields.

 */

 */

function create_password_hash($password, $salt, $user = false)

function create_password($password, $salt = false, $user = false)

{
global $plugins;


{
global $plugins;


	$hash = null;

	$fields = null;





	$parameters = compact('password', 'salt', 'user', 'hash');

	$parameters = compact('password', 'salt', 'user', 'fields');


if(!defined('IN_INSTALL') && !defined('IN_UPGRADE'))
{


if(!defined('IN_INSTALL') && !defined('IN_UPGRADE'))
{

		$plugins->run_hooks('create_password_hash', $parameters);

		$plugins->run_hooks('create_password', $parameters);

	}


	}


	if(!is_null($parameters['hash']))

	if(!is_null($parameters['fields']))

	{

	{

		return $parameters['hash'];

		$fields = $parameters['fields'];

	}
else
{

	}
else
{

		return md5(md5($salt).md5($password));











		if(!$salt)
{
$salt = generate_salt();
}

$hash = md5(md5($salt).md5($password));

$fields = array(
'salt' => $salt,
'password' => $hash,
);

	}

	}

 

return $fields;

}

/**

}

/**

Zeile 236Zeile 243
	}
else
{

	}
else
{

		$hashed_password = create_password_hash($password, $user['salt'], $user);

		$password_fields = create_password($password, $user['salt'], $user);





		return my_hash_equals($user['password'], $hashed_password);

		return my_hash_equals($user['password'], $password_fields['password']);

	}
}


	}
}


Zeile 514Zeile 521
 */
function usercp_menu_messenger()
{

 */
function usercp_menu_messenger()
{

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

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





 
	$expaltext = (in_array("usercppms", $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 576Zeile 584
 */
function usercp_menu_profile()
{

 */
function usercp_menu_profile()
{

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

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


$changenameop = '';
if($mybb->usergroup['canchangename'] != 0)


$changenameop = '';
if($mybb->usergroup['canchangename'] != 0)

Zeile 603Zeile 611
		$collapsed['usercpprofile_e'] = '';
}


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


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

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


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


Zeile 612Zeile 621
 */
function usercp_menu_misc()
{

 */
function usercp_menu_misc()
{

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

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


$draftstart = $draftend = '';
$draftcount = $lang->ucp_nav_drafts;


$draftstart = $draftend = '';
$draftcount = $lang->ucp_nav_drafts;

Zeile 641Zeile 650
	}

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

	}

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

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

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


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