Zeile 88 | Zeile 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 257 | Zeile 251 |
---|
function generate_salt() { return random_str(8);
|
function generate_salt() { return random_str(8);
|
}
/**
| }
/**
|
* Generates a 50 character random login key. * * @return string The login key.
| * Generates a 50 character random login key. * * @return string The login key.
|
Zeile 267 | Zeile 261 |
---|
function generate_loginkey() { return random_str(50);
|
function generate_loginkey() { return random_str(50);
|
}
/**
| }
/**
|
* Updates a user's salt in the database (does not update a password). * * @param int $uid The uid of the user to update.
| * Updates a user's salt in the database (does not update a password). * * @param int $uid The uid of the user to update.
|
Zeile 290 | Zeile 284 |
---|
/** * Generates a new login key for a user.
|
/** * Generates a new login key for a user.
|
*
| *
|
* @param int $uid The uid of the user to update. * @return string The new login key. */
| * @param int $uid The uid of the user to update. * @return string The new login key. */
|
Zeile 320 | Zeile 314 |
---|
function add_subscribed_thread($tid, $notification=1, $uid=0) { global $mybb, $db;
|
function add_subscribed_thread($tid, $notification=1, $uid=0) { global $mybb, $db;
|
if(!$uid)
| if(!$uid)
|
{ $uid = $mybb->user['uid']; }
| { $uid = $mybb->user['uid']; }
|
Zeile 333 | Zeile 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(empty($subscription) || !$subscription['tid'])
|
{ $insert_array = array( 'uid' => (int)$uid,
| { $insert_array = array( 'uid' => (int)$uid,
|
Zeile 342 | Zeile 336 |
---|
'dateline' => TIME_NOW ); $db->insert_query("threadsubscriptions", $insert_array);
|
'dateline' => TIME_NOW ); $db->insert_query("threadsubscriptions", $insert_array);
|
}
| }
|
else { // Subscription exists - simply update notification
| else { // Subscription exists - simply update notification
|
Zeile 407 | Zeile 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(empty($fsubscription) || !$fsubscription['fid'])
|
{ $insert_array = array( 'fid' => $fid,
| { $insert_array = array( 'fid' => $fid,
|
Zeile 489 | Zeile 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 509 | Zeile 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 577 | Zeile 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 616 | Zeile 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 725 | Zeile 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 751 | Zeile 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;
|