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: member.php 5616 2011-09-20 13:24:59Z Tomm $
| * $Id$
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 14 | Zeile 14 |
---|
define("ALLOWABLE_PAGE", "register,do_register,login,do_login,logout,lostpw,do_lostpw,activate,resendactivation,do_resendactivation,resetpassword");
$nosession['avatar'] = 1;
|
define("ALLOWABLE_PAGE", "register,do_register,login,do_login,logout,lostpw,do_lostpw,activate,resendactivation,do_resendactivation,resetpassword");
$nosession['avatar'] = 1;
|
$templatelist = "member_register,error_nousername,error_nopassword,error_passwordmismatch,error_invalidemail,error_usernametaken,error_emailmismatch,error_noemail,redirect_registered,member_register_hiddencaptcha"; $templatelist .= ",redirect_loggedout,login,redirect_loggedin,error_invalidusername,error_invalidpassword,member_profile_email,member_profile_offline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_customfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,member_profile_online,member_profile_modoptions,member_profile_signature,member_profile_groupimage,member_profile_referrals";
| $templatelist = "member_register,member_register_hiddencaptcha,member_coppa_form,member_register_coppa,member_register_agreement_coppa,member_register_agreement,usercp_options_tppselect,usercp_options_pppselect,member_register_referrer,member_register_customfield,member_register_requiredfields,member_register_password,member_activate,member_resendactivation,member_lostpw"; $templatelist .= ",member_resetpassword,member_loggedin_notice,member_profile_away,member_emailuser,member_register_regimage,member_register_regimage_recaptcha,post_captcha_hidden,post_captcha,post_captcha_recaptcha"; $templatelist .= ",member_profile_email,member_profile_offline,member_profile_reputation,member_profile_warn,member_profile_warninglevel,member_profile_customfields_field,member_profile_customfields,member_profile_adminoptions,member_profile,member_login,member_profile_online,member_profile_modoptions,member_profile_signature,member_profile_groupimage,member_profile_referrals";
|
require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php";
require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 126 | Zeile 127 |
---|
"regip" => $session->ipaddress, "longregip" => my_ip2long($session->ipaddress), "coppa_user" => intval($mybb->cookies['coppauser']),
|
"regip" => $session->ipaddress, "longregip" => my_ip2long($session->ipaddress), "coppa_user" => intval($mybb->cookies['coppauser']),
|
| "regcheck1" => $mybb->input['regcheck1'], "regcheck2" => $mybb->input['regcheck2']
|
);
|
);
|
if(isset($mybb->input['regcheck1']) && isset($mybb->input['regcheck2'])) { $user['regcheck1'] = $mybb->input['regcheck1']; $user['regcheck2'] = $mybb->input['regcheck2']; }
| |
// Do we have a saved COPPA DOB? if($mybb->cookies['coppadob'])
| // Do we have a saved COPPA DOB? if($mybb->cookies['coppadob'])
|
Zeile 144 | Zeile 141 |
---|
"year" => $dob_year ); }
|
"year" => $dob_year ); }
|
|
|
$user['options'] = array( "allownotices" => $mybb->input['allownotices'], "hideemail" => $mybb->input['hideemail'],
| $user['options'] = array( "allownotices" => $mybb->input['allownotices'], "hideemail" => $mybb->input['hideemail'],
|
Zeile 157 | Zeile 154 |
---|
);
$userhandler->set_data($user);
|
);
$userhandler->set_data($user);
|
|
|
$errors = "";
if(!$userhandler->validate_user())
| $errors = "";
if(!$userhandler->validate_user())
|
Zeile 277 | Zeile 274 |
---|
); $db->insert_query("awaitingactivation", $activationarray); $emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
|
); $db->insert_query("awaitingactivation", $activationarray); $emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
|
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode);
| switch($mybb->settings['username_method']) { case 0: $emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode); break; case 1: $emailmessage = $lang->sprintf($lang->email_activateaccount1, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode); break; case 2: $emailmessage = $lang->sprintf($lang->email_activateaccount2, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode); break; default: $emailmessage = $lang->sprintf($lang->email_activateaccount, $user_info['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user_info['uid'], $activationcode); break; }
|
my_mail($user_info['email'], $emailsubject, $emailmessage); $lang->redirect_registered_activation = $lang->sprintf($lang->redirect_registered_activation, $mybb->settings['bbname'], $user_info['username']);
|
my_mail($user_info['email'], $emailsubject, $emailmessage); $lang->redirect_registered_activation = $lang->sprintf($lang->redirect_registered_activation, $mybb->settings['bbname'], $user_info['username']);
|
$plugins->run_hooks("member_do_register_end");
| $plugins->run_hooks("member_do_register_end");
|
error($lang->redirect_registered_activation);
|
error($lang->redirect_registered_activation);
|
}
| }
|
else if($mybb->settings['regtype'] == "randompass") { $emailsubject = $lang->sprintf($lang->emailsubject_randompassword, $mybb->settings['bbname']);
|
else if($mybb->settings['regtype'] == "randompass") { $emailsubject = $lang->sprintf($lang->emailsubject_randompassword, $mybb->settings['bbname']);
|
$emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']);
| switch($mybb->settings['username_method']) { case 0: $emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']); break; case 1: $emailmessage = $lang->sprintf($lang->email_randompassword1, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']); break; case 2: $emailmessage = $lang->sprintf($lang->email_randompassword2, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']); break; default: $emailmessage = $lang->sprintf($lang->email_randompassword, $user['username'], $mybb->settings['bbname'], $user_info['username'], $user_info['password']); break; }
|
my_mail($user_info['email'], $emailsubject, $emailmessage);
$plugins->run_hooks("member_do_register_end");
| my_mail($user_info['email'], $emailsubject, $emailmessage);
$plugins->run_hooks("member_do_register_end");
|
Zeile 297 | Zeile 322 |
---|
error($lang->redirect_registered_passwordsent); } else if($mybb->settings['regtype'] == "admin")
|
error($lang->redirect_registered_passwordsent); } else if($mybb->settings['regtype'] == "admin")
|
{
| {
|
$lang->redirect_registered_admin_activate = $lang->sprintf($lang->redirect_registered_admin_activate, $mybb->settings['bbname'], $user_info['username']);
|
$lang->redirect_registered_admin_activate = $lang->sprintf($lang->redirect_registered_admin_activate, $mybb->settings['bbname'], $user_info['username']);
|
$plugins->run_hooks("member_do_register_end");
| $plugins->run_hooks("member_do_register_end");
|
error($lang->redirect_registered_admin_activate); } else
| error($lang->redirect_registered_admin_activate); } else
|
Zeile 325 | Zeile 350 |
---|
eval("\$coppa_form = \"".$templates->get("member_coppa_form")."\";"); output_page($coppa_form); }
|
eval("\$coppa_form = \"".$templates->get("member_coppa_form")."\";"); output_page($coppa_form); }
|
|
|
if($mybb->input['action'] == "register") { $bdaysel = ''; if($mybb->settings['coppa'] == "disabled") { $bdaysel = $bday2blank = "<option value=\"\"> </option>";
|
if($mybb->input['action'] == "register") { $bdaysel = ''; if($mybb->settings['coppa'] == "disabled") { $bdaysel = $bday2blank = "<option value=\"\"> </option>";
|
}
| }
|
for($i = 1; $i <= 31; ++$i) { if($mybb->input['bday1'] == $i)
|
for($i = 1; $i <= 31; ++$i) { if($mybb->input['bday1'] == $i)
|
{
| {
|
$bdaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else
| $bdaysel .= "<option value=\"$i\" selected=\"selected\">$i</option>\n"; } else
|
Zeile 352 | Zeile 377 |
---|
// Is COPPA checking enabled? if($mybb->settings['coppa'] != "disabled" && !$mybb->input['step'])
|
// Is COPPA checking enabled? if($mybb->settings['coppa'] != "disabled" && !$mybb->input['step'])
|
{
| {
|
// Just selected DOB, we check if($mybb->input['bday1'] && $mybb->input['bday2'] && $mybb->input['bday3']) {
| // Just selected DOB, we check if($mybb->input['bday1'] && $mybb->input['bday2'] && $mybb->input['bday3']) {
|
Zeile 435 | Zeile 460 |
---|
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";"); } if($mybb->settings['userpppoptions'])
|
eval("\$tppselect = \"".$templates->get("usercp_options_tppselect")."\";"); } if($mybb->settings['userpppoptions'])
|
{
| {
|
$pppoptions = ''; $explodedppp = explode(",", $mybb->settings['userpppoptions']); if(is_array($explodedppp))
|
$pppoptions = ''; $explodedppp = explode(",", $mybb->settings['userpppoptions']); if(is_array($explodedppp))
|
{
| {
|
foreach($explodedppp as $val) { $val = trim($val);
| foreach($explodedppp as $val) { $val = trim($val);
|
Zeile 453 | Zeile 478 |
---|
if($mybb->cookies['mybb']['referrer']) { $query = $db->simple_select("users", "uid,username", "uid='".$db->escape_string($mybb->cookies['mybb']['referrer'])."'");
|
if($mybb->cookies['mybb']['referrer']) { $query = $db->simple_select("users", "uid,username", "uid='".$db->escape_string($mybb->cookies['mybb']['referrer'])."'");
|
$ref = $db->fetch_array($query);
| $ref = $db->fetch_array($query);
|
$referrername = $ref['username']; } elseif($referrer)
| $referrername = $ref['username']; } elseif($referrer)
|
Zeile 463 | Zeile 488 |
---|
$referrername = $ref['username']; } elseif($referrername)
|
$referrername = $ref['username']; } elseif($referrername)
|
{
| {
|
$query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string(my_strtolower($referrername))."'"); $ref = $db->fetch_array($query); if(!$ref['uid'])
| $query = $db->simple_select("users", "uid", "LOWER(username)='".$db->escape_string(my_strtolower($referrername))."'"); $ref = $db->fetch_array($query); if(!$ref['uid'])
|
Zeile 573 | Zeile 598 |
---|
{ $expoptions = explode("\n", $options); if(is_array($expoptions))
|
{ $expoptions = explode("\n", $options); if(is_array($expoptions))
|
{
| {
|
foreach($expoptions as $key => $val) { $checked = "";
| foreach($expoptions as $key => $val) { $checked = "";
|
Zeile 582 | Zeile 607 |
---|
$checked = "checked=\"checked\""; } $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" id=\"{$field}{$key}\" value=\"$val\" $checked /> <span class=\"smalltext\">$val</span><br />";
|
$checked = "checked=\"checked\""; } $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" id=\"{$field}{$key}\" value=\"$val\" $checked /> <span class=\"smalltext\">$val</span><br />";
|
} }
| } }
|
} elseif($type == "checkbox") {
| } elseif($type == "checkbox") {
|
Zeile 600 | Zeile 625 |
---|
foreach($useropts as $key => $val) { $seloptions[$val] = $val;
|
foreach($useropts as $key => $val) { $seloptions[$val] = $val;
|
} }
| } }
|
$expoptions = explode("\n", $options); if(is_array($expoptions)) {
| $expoptions = explode("\n", $options); if(is_array($expoptions)) {
|
Zeile 712 | Zeile 737 |
---|
$validator_extra .= "\tregValidator.register('password2', 'matches', {match_field:'password', status_field:'password_status', failure_message:'{$lang->js_validator_password_matches}'});\n";
eval("\$passboxes = \"".$templates->get("member_register_password")."\";");
|
$validator_extra .= "\tregValidator.register('password2', 'matches', {match_field:'password', status_field:'password_status', failure_message:'{$lang->js_validator_password_matches}'});\n";
eval("\$passboxes = \"".$templates->get("member_register_password")."\";");
|
}
| }
|
// JS validator extra if($mybb->settings['maxnamelength'] > 0 && $mybb->settings['minnamelength'] > 0)
| // JS validator extra if($mybb->settings['maxnamelength'] > 0 && $mybb->settings['minnamelength'] > 0)
|
Zeile 749 | Zeile 774 |
---|
if($mybb->input['username']) {
|
if($mybb->input['username']) {
|
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1));
| switch($mybb->settings['username']) { case 0: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); break; case 1: $query = $db->simple_select("users", "*", "LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); break; case 2: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); break; default: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); break; }
|
$user = $db->fetch_array($query); if(!$user['username']) {
|
$user = $db->fetch_array($query); if(!$user['username']) {
|
error($lang->error_invalidpworusername);
| switch($mybb->settings['username_method']) { case 0: error($lang->error_invalidpworusername); break; case 1: error($lang->error_invalidpworusername1); break; case 2: error($lang->error_invalidpworusername2); break; default: error($lang->error_invalidpworusername); break; }
|
} $uid = $user['uid']; }
| } $uid = $user['uid']; }
|
Zeile 795 | Zeile 848 |
---|
$plugins->run_hooks("member_activate_accountactivated");
redirect("index.php", $lang->redirect_accountactivated);
|
$plugins->run_hooks("member_activate_accountactivated");
redirect("index.php", $lang->redirect_accountactivated);
|
} }
| } }
|
else { $plugins->run_hooks("member_activate_form");
|
else { $plugins->run_hooks("member_activate_form");
|
|
|
eval("\$activate = \"".$templates->get("member_activate")."\";"); output_page($activate);
|
eval("\$activate = \"".$templates->get("member_activate")."\";"); output_page($activate);
|
}
| }
|
}
if($mybb->input['action'] == "resendactivation")
| }
if($mybb->input['action'] == "resendactivation")
|
Zeile 824 | Zeile 877 |
---|
}
if($mybb->input['action'] == "do_resendactivation" && $mybb->request_method == "post")
|
}
if($mybb->input['action'] == "do_resendactivation" && $mybb->request_method == "post")
|
{
| {
|
$plugins->run_hooks("member_do_resendactivation_start");
if($mybb->settings['regtype'] == "admin")
| $plugins->run_hooks("member_do_resendactivation_start");
if($mybb->settings['regtype'] == "admin")
|
Zeile 866 | Zeile 919 |
---|
$email = $user['email']; $activationcode = $user['code']; $emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
|
$email = $user['email']; $activationcode = $user['code']; $emailsubject = $lang->sprintf($lang->emailsubject_activateaccount, $mybb->settings['bbname']);
|
$emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode);
| switch($mybb->settings['username_method']) { case 0: $emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode); break; case 1: $emailmessage = $lang->sprintf($lang->email_activateaccount1, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode); break; case 2: $emailmessage = $lang->sprintf($lang->email_activateaccount2, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode); break; default: $emailmessage = $lang->sprintf($lang->email_activateaccount, $user['username'], $mybb->settings['bbname'], $mybb->settings['bburl'], $user['uid'], $activationcode); break; }
|
my_mail($email, $emailsubject, $emailmessage); } }
| my_mail($email, $emailsubject, $emailmessage); } }
|
Zeile 914 | Zeile 981 |
---|
$email = $user['email']; $activationcode = $user['activationcode']; $emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']);
|
$email = $user['email']; $activationcode = $user['activationcode']; $emailsubject = $lang->sprintf($lang->emailsubject_lostpw, $mybb->settings['bbname']);
|
$emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode);
| switch($mybb->settings['username_method']) { case 0: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 1: $emailmessage = $lang->sprintf($lang->email_lostpw1, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; case 2: $emailmessage = $lang->sprintf($lang->email_lostpw2, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; default: $emailmessage = $lang->sprintf($lang->email_lostpw, $username, $mybb->settings['bbname'], $mybb->settings['bburl'], $uid, $activationcode); break; }
|
my_mail($email, $emailsubject, $emailmessage);
|
my_mail($email, $emailsubject, $emailmessage);
|
} }
| } }
|
$plugins->run_hooks("member_do_lostpw_end");
redirect("index.php", $lang->redirect_lostpwsent);
| $plugins->run_hooks("member_do_lostpw_end");
redirect("index.php", $lang->redirect_lostpwsent);
|
Zeile 929 | Zeile 1010 |
---|
if($mybb->input['username']) {
|
if($mybb->input['username']) {
|
$query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'");
| switch($mybb->settings['username_method']) { case 0: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'"); break; case 1: $query = $db->simple_select("users", "*", "LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'"); break; case 2: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'"); break; default: $query = $db->simple_select("users", "*", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'"); break; }
|
$user = $db->fetch_array($query); if(!$user['uid']) {
|
$user = $db->fetch_array($query); if(!$user['uid']) {
|
error($lang->error_invalidpworusername);
| switch($mybb->settings['username_method']) { case 0: error($lang->error_invalidpworusername); break; case 1: error($lang->error_invalidpworusername1); break; case 2: error($lang->error_invalidpworusername2); break; default: error($lang->error_invalidpworusername); break; }
|
} } else { $query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
|
} } else { $query = $db->simple_select("users", "*", "uid='".intval($mybb->input['uid'])."'");
|
$user = $db->fetch_array($query);
| $user = $db->fetch_array($query);
|
} if($mybb->input['code'] && $user['uid']) {
| } if($mybb->input['code'] && $user['uid']) {
|
Zeile 979 | Zeile 1088 |
---|
else { $plugins->run_hooks("member_resetpassword_form");
|
else { $plugins->run_hooks("member_resetpassword_form");
|
| switch($mybb->settings['username_method']) { case 0: $lang_username = $lang->username; break; case 1: $lang_username = $lang->username1; break; case 2: $lang_username = $lang->username2; break; default: $lang_username = $lang->username; break; }
|
eval("\$activate = \"".$templates->get("member_resetpassword")."\";"); output_page($activate); } }
|
eval("\$activate = \"".$templates->get("member_resetpassword")."\";"); output_page($activate); } }
|
$do_captcha = $correct = false; $inline_errors = "";
| $correct = false; $inline_errors = '';
|
if($mybb->input['action'] == "do_login" && $mybb->request_method == "post") { $plugins->run_hooks("member_do_login_start");
|
if($mybb->input['action'] == "do_login" && $mybb->request_method == "post") { $plugins->run_hooks("member_do_login_start");
|
|
|
// Checks to make sure the user can login; they haven't had too many tries at logging in. // Is a fatal call if user has had too many tries $logins = login_attempt_check(); $login_text = '';
|
// Checks to make sure the user can login; they haven't had too many tries at logging in. // Is a fatal call if user has had too many tries $logins = login_attempt_check(); $login_text = '';
|
|
|
// Did we come from the quick login form if($mybb->input['quick_login'] == "1" && $mybb->input['quick_password'] && $mybb->input['quick_username']) {
| // Did we come from the quick login form if($mybb->input['quick_login'] == "1" && $mybb->input['quick_password'] && $mybb->input['quick_username']) {
|
Zeile 1007 | Zeile 1132 |
---|
if(!username_exists($mybb->input['username'])) { my_setcookie('loginattempts', $logins + 1);
|
if(!username_exists($mybb->input['username'])) { my_setcookie('loginattempts', $logins + 1);
|
error($lang->error_invalidpworusername.$login_text); } $query = $db->simple_select("users", "loginattempts", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); $loginattempts = $db->fetch_field($query, "loginattempts"); $errors = array(); $user = validate_password_from_username($mybb->input['username'], $mybb->input['password']); if(!$user['uid']) { my_setcookie('loginattempts', $logins + 1); $db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true); $mybb->input['action'] = "login"; $mybb->input['request_method'] = "get"; if($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1)
| switch($mybb->settings['username_method'])
|
{
|
{
|
$login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins);
| case 0: error($lang->error_invalidpworusername.$login_text); break; case 1: error($lang->error_invalidpworusername1.$login_text); break; case 2: error($lang->error_invalidpworusername2.$login_text); break; default: error($lang->error_invalidpworusername.$login_text); break;
|
}
|
}
|
$errors[] = $lang->error_invalidpworusername.$login_text;
| |
}
|
}
|
else { $correct = true; }
| $query = $db->simple_select("users", "loginattempts", "LOWER(username)='".$db->escape_string(my_strtolower($mybb->input['username']))."' OR LOWER(email)='".$db->escape_string(my_strtolower($mybb->input['username']))."'", array('limit' => 1)); $loginattempts = $db->fetch_field($query, "loginattempts");
$errors = array();
|
if($mybb->settings['failedcaptchalogincount'] > 0 && ($loginattempts > $mybb->settings['failedcaptchalogincount'] || intval($mybb->cookies['loginattempts']) > $mybb->settings['failedcaptchalogincount']))
|
if($mybb->settings['failedcaptchalogincount'] > 0 && ($loginattempts > $mybb->settings['failedcaptchalogincount'] || intval($mybb->cookies['loginattempts']) > $mybb->settings['failedcaptchalogincount']))
|
{
| {
|
// Show captcha image if enabled
|
// Show captcha image if enabled
|
if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng")) {
| if($mybb->settings['captchaimage']) { $do_captcha = false;
|
// Check their current captcha input - if correct, hide the captcha input area
|
// Check their current captcha input - if correct, hide the captcha input area
|
if($mybb->input['imagestring'])
| require_once MYBB_ROOT.'inc/class_captcha.php'; $login_captcha = new captcha;
if($login_captcha->validate_captcha() == false)
|
{
|
{
|
$imagehash = $db->escape_string($mybb->input['imagehash']); $imagestring = $db->escape_string($mybb->input['imagestring']); $query = $db->simple_select("captcha", "*", "imagehash='{$imagehash}' AND imagestring='{$imagestring}'"); $imgcheck = $db->fetch_array($query); if($imgcheck['dateline'] > 0)
| $correct = true; $do_captcha = true; // CAPTCHA validation failed foreach($login_captcha->get_errors() as $error)
|
{
|
{
|
$correct = true; } else { $db->delete_query("captcha", "imagehash='{$imagehash}'"); $errors[] = $lang->error_regimageinvalid;
| $errors[] = $error;
|
} }
|
} }
|
else if($mybb->input['quick_login'] == 1 && $mybb->input['quick_password'] && $mybb->input['quick_username'])
| } }
// Don't check password when captcha isn't solved if(empty($errors)) { $user = validate_password_from_username($mybb->input['username'], $mybb->input['password']); if(!$user['uid']) { my_setcookie('loginattempts', $logins + 1); $db->update_query("users", array('loginattempts' => 'loginattempts+1'), "LOWER(username) = '".$db->escape_string(my_strtolower($mybb->input['username']))."'", 1, true);
$mybb->input['action'] = "login"; $mybb->input['request_method'] = "get";
if($mybb->settings['failedlogincount'] != 0 && $mybb->settings['failedlogintext'] == 1) { $login_text = $lang->sprintf($lang->failed_login_again, $mybb->settings['failedlogincount'] - $logins); }
switch($mybb->settings['username_method'])
|
{
|
{
|
$errors[] = $lang->error_regimagerequired; } else { $errors[] = $lang->error_regimagerequired;
| case 0: $errors[] = $lang->error_invalidpworusername.$login_text; break; case 1: $errors[] = $lang->error_invalidpworusername1.$login_text; break; case 2: $errors[] = $lang->error_invalidpworusername2.$login_text; break; default: $errors[] = $lang->error_invalidpworusername.$login_text; break;
|
} }
|
} }
|
$do_captcha = true;
| else { $correct = true; }
|
}
|
}
|
|
|
if(!empty($errors))
|
if(!empty($errors))
|
{ $mybb->input['action'] = "login"; $mybb->input['request_method'] = "get";
| { $mybb->input['action'] = "login"; $mybb->input['request_method'] = "get";
|
$inline_errors = inline_error($errors); }
| $inline_errors = inline_error($errors); }
|
Zeile 1104 | Zeile 1251 |
---|
} my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], $remember, true); my_setcookie("sid", $session->sid, -1, true);
|
} my_setcookie("mybbuser", $user['uid']."_".$user['loginkey'], $remember, true); my_setcookie("sid", $session->sid, -1, true);
|
|
|
$plugins->run_hooks("member_do_login_end");
|
$plugins->run_hooks("member_do_login_end");
|
|
|
if($mybb->input['url'] != "" && my_strpos(basename($mybb->input['url']), 'member.php') === false) { if((my_strpos(basename($mybb->input['url']), 'newthread.php') !== false || my_strpos(basename($mybb->input['url']), 'newreply.php') !== false) && my_strpos($mybb->input['url'], '&processed=1') !== false)
| if($mybb->input['url'] != "" && my_strpos(basename($mybb->input['url']), 'member.php') === false) { if((my_strpos(basename($mybb->input['url']), 'newthread.php') !== false || my_strpos(basename($mybb->input['url']), 'newreply.php') !== false) && my_strpos($mybb->input['url'], '&processed=1') !== false)
|
Zeile 1118 | Zeile 1265 |
---|
// Redirect to the URL if it is not member.php redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);
|
// Redirect to the URL if it is not member.php redirect(htmlentities($mybb->input['url']), $lang->redirect_loggedin);
|
}
| }
|
else { redirect("index.php", $lang->redirect_loggedin);
| else { redirect("index.php", $lang->redirect_loggedin);
|
Zeile 1128 | Zeile 1275 |
---|
{ $mybb->input['action'] = "login"; $mybb->input['request_method'] = "get";
|
{ $mybb->input['action'] = "login"; $mybb->input['request_method'] = "get";
|
}
| }
|
$plugins->run_hooks("member_do_login_end"); }
if($mybb->input['action'] == "login") { $plugins->run_hooks("member_login");
|
$plugins->run_hooks("member_do_login_end"); }
if($mybb->input['action'] == "login") { $plugins->run_hooks("member_login");
|
|
|
$member_loggedin_notice = ""; if($mybb->user['uid'] != 0)
|
$member_loggedin_notice = ""; if($mybb->user['uid'] != 0)
|
{
| {
|
$lang->already_logged_in = $lang->sprintf($lang->already_logged_in, build_profile_link($mybb->user['username'], $mybb->user['uid'])); eval("\$member_loggedin_notice = \"".$templates->get("member_loggedin_notice")."\";");
|
$lang->already_logged_in = $lang->sprintf($lang->already_logged_in, build_profile_link($mybb->user['username'], $mybb->user['uid'])); eval("\$member_loggedin_notice = \"".$templates->get("member_loggedin_notice")."\";");
|
}
| }
|
// Checks to make sure the user can login; they haven't had too many tries at logging in. // Is a fatal call if user has had too many tries login_attempt_check();
// Redirect to the page where the user came from, but not if that was the login page.
|
// Checks to make sure the user can login; they haven't had too many tries at logging in. // Is a fatal call if user has had too many tries login_attempt_check();
// Redirect to the page where the user came from, but not if that was the login page.
|
| $redirect_url = '';
|
if($_SERVER['HTTP_REFERER'] && strpos($_SERVER['HTTP_REFERER'], "action=login") === false) { $redirect_url = htmlentities($_SERVER['HTTP_REFERER']); }
|
if($_SERVER['HTTP_REFERER'] && strpos($_SERVER['HTTP_REFERER'], "action=login") === false) { $redirect_url = htmlentities($_SERVER['HTTP_REFERER']); }
|
else { $redirect_url = ''; }
$captcha = ""; // Show captcha image for guests if enabled if($mybb->settings['captchaimage'] == 1 && function_exists("imagepng") && $do_captcha == true) { $randomstr = random_str(5); $imagehash = md5(random_str(12)); $imagearray = array( "imagehash" => $imagehash, "imagestring" => $randomstr, "dateline" => TIME_NOW ); $db->insert_query("captcha", $imagearray); eval("\$captcha = \"".$templates->get("post_captcha")."\";"); }
| $captcha = ''; // Show captcha image for guests if enabled and only if we have to do if($mybb->settings['captchaimage'] && isset($do_captcha)) { $correct = false; require_once MYBB_ROOT.'inc/class_captcha.php'; $login_captcha = new captcha(false, "post_captcha");
if($do_captcha == false && $login_captcha->type == 1) { if($login_captcha->validate_captcha() == true) { $correct = true; $captcha = $login_captcha->build_hidden_captcha(); } }
if(!$correct) { if($login_captcha->type == 1) { $login_captcha->build_captcha(); } elseif($login_captcha->type == 2) { $login_captcha->build_recaptcha(); }
if($login_captcha->html) { $captcha = $login_captcha->html; } } elseif($correct && $login_captcha->type == 2) { $login_captcha->build_recaptcha();
if($login_captcha->html) { $captcha = $login_captcha->html; } } }
|
$username = ""; $password = ""; if($mybb->input['username'] && $mybb->request_method == "post")
|
$username = ""; $password = ""; if($mybb->input['username'] && $mybb->request_method == "post")
|
{
| {
|
$username = htmlspecialchars_uni($mybb->input['username']); }
| $username = htmlspecialchars_uni($mybb->input['username']); }
|
Zeile 1184 | Zeile 1357 |
---|
{ $password = htmlspecialchars_uni($mybb->input['password']); }
|
{ $password = htmlspecialchars_uni($mybb->input['password']); }
|
| switch($mybb->settings['username_method']) { case 1: $lang->username = $lang->username1; break; case 2: $lang->username = $lang->username2; break; default: break; }
|
eval("\$login = \"".$templates->get("member_login")."\";"); output_page($login); }
| eval("\$login = \"".$templates->get("member_login")."\";"); output_page($login); }
|
Zeile 1196 | Zeile 1380 |
---|
if(!$mybb->user['uid']) { redirect("index.php", $lang->redirect_alreadyloggedout);
|
if(!$mybb->user['uid']) { redirect("index.php", $lang->redirect_alreadyloggedout);
|
}
| }
|
// Check session ID if we have one if($mybb->input['sid'] && $mybb->input['sid'] != $session->sid)
|
// Check session ID if we have one if($mybb->input['sid'] && $mybb->input['sid'] != $session->sid)
|
{ error($lang->error_notloggedout);
| { error($lang->error_notloggedout);
|
} // Otherwise, check logoutkey else if(!$mybb->input['sid'] && $mybb->input['logoutkey'] != $mybb->user['logoutkey'])
| } // Otherwise, check logoutkey else if(!$mybb->input['sid'] && $mybb->input['logoutkey'] != $mybb->user['logoutkey'])
|
Zeile 1224 | Zeile 1408 |
---|
$plugins->run_hooks("member_logout_end"); redirect("index.php", $lang->redirect_loggedout); }
|
$plugins->run_hooks("member_logout_end"); redirect("index.php", $lang->redirect_loggedout); }
|
|
|
if($mybb->input['action'] == "profile") { $plugins->run_hooks("member_profile_start");
| if($mybb->input['action'] == "profile") { $plugins->run_hooks("member_profile_start");
|
Zeile 1252 | Zeile 1436 |
---|
break; default: $query = $db->simple_select("forums", "fid", "INSTR(CONCAT(',',parentlist,','),',".intval($mybb->input['fid']).",') > 0");
|
break; default: $query = $db->simple_select("forums", "fid", "INSTR(CONCAT(',',parentlist,','),',".intval($mybb->input['fid']).",') > 0");
|
}
| }
|
while($forum = $db->fetch_array($query)) {
| while($forum = $db->fetch_array($query)) {
|
Zeile 1273 | Zeile 1457 |
---|
else { if($mybb->input['uid'])
|
else { if($mybb->input['uid'])
|
{
| {
|
$uid = intval($mybb->input['uid']); } else { $uid = $mybb->user['uid'];
|
$uid = intval($mybb->input['uid']); } else { $uid = $mybb->user['uid'];
|
}
| }
|
} if($mybb->user['uid'] != $uid)
|
} if($mybb->user['uid'] != $uid)
|
{
| {
|
$memprofile = get_user($uid); } else { $memprofile = $mybb->user;
|
$memprofile = get_user($uid); } else { $memprofile = $mybb->user;
|
}
| }
|
$lang->profile = $lang->sprintf($lang->profile, $memprofile['username']);
|
$lang->profile = $lang->sprintf($lang->profile, $memprofile['username']);
|
|
|
if(!$memprofile['uid']) { error($lang->error_nomember);
| if(!$memprofile['uid']) { error($lang->error_nomember);
|
Zeile 1306 | Zeile 1490 |
---|
$lang->users_forum_info = $lang->sprintf($lang->users_forum_info, $memprofile['username']); $lang->users_contact_details = $lang->sprintf($lang->users_contact_details, $memprofile['username']);
|
$lang->users_forum_info = $lang->sprintf($lang->users_forum_info, $memprofile['username']); $lang->users_contact_details = $lang->sprintf($lang->users_contact_details, $memprofile['username']);
|
if($mybb->settings['enablepms'] != 0 && $memprofile['receivepms'] != 0 && $memperms['canusepms'] != 0 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false)
| if($mybb->settings['enablepms'] != 0 && (($memprofile['receivepms'] != 0 && $memperms['canusepms'] != 0 && my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false) || $mybb->usergroup['canoverridepm'] == 1))
|
{ $lang->send_pm = $lang->sprintf($lang->send_pm, $memprofile['username']);
|
{ $lang->send_pm = $lang->sprintf($lang->send_pm, $memprofile['username']);
|
}
| }
|
else { $lang->send_pm = '';
| else { $lang->send_pm = '';
|
Zeile 1319 | Zeile 1503 |
---|
$lang->users_additional_info = $lang->sprintf($lang->users_additional_info, $memprofile['username']); $lang->users_signature = $lang->sprintf($lang->users_signature, $memprofile['username']); $lang->send_user_email = $lang->sprintf($lang->send_user_email, $memprofile['username']);
|
$lang->users_additional_info = $lang->sprintf($lang->users_additional_info, $memprofile['username']); $lang->users_signature = $lang->sprintf($lang->users_signature, $memprofile['username']); $lang->send_user_email = $lang->sprintf($lang->send_user_email, $memprofile['username']);
|
|
|
if($memprofile['avatar']) { $memprofile['avatar'] = htmlspecialchars_uni($memprofile['avatar']);
| if($memprofile['avatar']) { $memprofile['avatar'] = htmlspecialchars_uni($memprofile['avatar']);
|
Zeile 1329 | Zeile 1513 |
---|
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\""; } $avatar = "<img src=\"{$memprofile['avatar']}\" alt=\"\" $avatar_width_height />";
|
$avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\""; } $avatar = "<img src=\"{$memprofile['avatar']}\" alt=\"\" $avatar_width_height />";
|
}
| }
|
else { $avatar = '';
|
else { $avatar = '';
|
}
if($memprofile['hideemail'] != 1)
| }
if($memprofile['hideemail'] != 1 && (my_strpos(",".$memprofile['ignorelist'].",", ",".$mybb->user['uid'].",") === false || $mybb->usergroup['cansendemailoverride'] != 0))
|
{ eval("\$sendemail = \"".$templates->get("member_profile_email")."\";"); }
| { eval("\$sendemail = \"".$templates->get("member_profile_email")."\";"); }
|
Zeile 1360 | Zeile 1544 |
---|
$bgcolors[$cat] = alt_trow(); }
|
$bgcolors[$cat] = alt_trow(); }
|
| $website = '';
|
if($memprofile['website']) { $memprofile['website'] = htmlspecialchars_uni($memprofile['website']); $website = "<a href=\"{$memprofile['website']}\" target=\"_blank\">{$memprofile['website']}</a>";
|
if($memprofile['website']) { $memprofile['website'] = htmlspecialchars_uni($memprofile['website']); $website = "<a href=\"{$memprofile['website']}\" target=\"_blank\">{$memprofile['website']}</a>";
|
} else { $website = '';
| |
}
|
}
|
| $signature = '';
|
if($memprofile['signature'] && ($memprofile['suspendsignature'] == 0 || $memprofile['suspendsigtime'] < TIME_NOW)) { $sig_parser = array(
| if($memprofile['signature'] && ($memprofile['suspendsignature'] == 0 || $memprofile['suspendsigtime'] < TIME_NOW)) { $sig_parser = array(
|
Zeile 1377 | Zeile 1559 |
---|
"allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'],
|
"allow_mycode" => $mybb->settings['sigmycode'], "allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'],
|
"me_username" => $memprofile['username']
| "me_username" => $memprofile['username'], "filter_badwords" => 1
|
);
|
);
|
|
|
$memprofile['signature'] = $parser->parse_message($memprofile['signature'], $sig_parser); eval("\$signature = \"".$templates->get("member_profile_signature")."\";");
|
$memprofile['signature'] = $parser->parse_message($memprofile['signature'], $sig_parser); eval("\$signature = \"".$templates->get("member_profile_signature")."\";");
|
}
| }
|
$daysreg = (TIME_NOW - $memprofile['regdate']) / (24*3600);
| $daysreg = (TIME_NOW - $memprofile['regdate']) / (24*3600);
|
Zeile 1394 | Zeile 1577 |
---|
$ppd = $memprofile['postnum'] / $daysreg; $ppd = round($ppd, 2); if($ppd > $memprofile['postnum'])
|
$ppd = $memprofile['postnum'] / $daysreg; $ppd = round($ppd, 2); if($ppd > $memprofile['postnum'])
|
{
| {
|
$ppd = $memprofile['postnum']; } $stats = $cache->read("stats"); $numposts = $stats['numposts']; if($numposts == 0)
|
$ppd = $memprofile['postnum']; } $stats = $cache->read("stats"); $numposts = $stats['numposts']; if($numposts == 0)
|
{
| {
|
$percent = "0";
|
$percent = "0";
|
} else {
| } else {
|
$percent = $memprofile['postnum']*100/$numposts; $percent = round($percent, 2);
|
$percent = $memprofile['postnum']*100/$numposts; $percent = round($percent, 2);
|
}
| }
|
if($percent > 100)
|
if($percent > 100)
|
{
| {
|
$percent = 100; }
if(!empty($memprofile['icq'])) { $memprofile['icq'] = intval($memprofile['icq']);
|
$percent = 100; }
if(!empty($memprofile['icq'])) { $memprofile['icq'] = intval($memprofile['icq']);
|
}
| }
|
else { $memprofile['icq'] = '';
|
else { $memprofile['icq'] = '';
|
}
| }
$awaybit = '';
|
if($memprofile['away'] == 1 && $mybb->settings['allowaway'] != 0) { $lang->away_note = $lang->sprintf($lang->away_note, $memprofile['username']); $awaydate = my_date($mybb->settings['dateformat'], $memprofile['awaydate']); if(!empty($memprofile['awayreason']))
|
if($memprofile['away'] == 1 && $mybb->settings['allowaway'] != 0) { $lang->away_note = $lang->sprintf($lang->away_note, $memprofile['username']); $awaydate = my_date($mybb->settings['dateformat'], $memprofile['awaydate']); if(!empty($memprofile['awayreason']))
|
{ $awayreason = htmlspecialchars_uni($memprofile['awayreason']); }
| { $reason = $parser->parse_badwords($memprofile['awayreason']); $awayreason = htmlspecialchars_uni($reason); }
|
else { $awayreason = $lang->away_no_reason;
|
else { $awayreason = $lang->away_no_reason;
|
}
| }
|
if($memprofile['returndate'] == '') { $returndate = "$lang->unknown";
| if($memprofile['returndate'] == '') { $returndate = "$lang->unknown";
|
Zeile 1450 | Zeile 1635 |
---|
require_once MYBB_ROOT."inc/functions_time.php"; $returnmkdate = adodb_mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]); $returndate = my_date($mybb->settings['dateformat'], $returnmkdate, "", 1, true);
|
require_once MYBB_ROOT."inc/functions_time.php"; $returnmkdate = adodb_mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]); $returndate = my_date($mybb->settings['dateformat'], $returnmkdate, "", 1, true);
|
}
| }
|
else { $returnmkdate = mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]);
| else { $returnmkdate = mktime(0, 0, 0, $returnhome[1], $returnhome[0], $returnhome[2]);
|
Zeile 1458 | Zeile 1643 |
---|
} // If our away time has expired already, we should be back, right?
|
} // If our away time has expired already, we should be back, right?
|
if ($returnmkdate < TIME_NOW)
| if($returnmkdate < TIME_NOW)
|
{ $db->update_query('users', array('away' => '0', 'awaydate' => '', 'returndate' => '', 'awayreason' => ''), 'uid=\''.intval($memprofile['uid']).'\'');
| { $db->update_query('users', array('away' => '0', 'awaydate' => '', 'returndate' => '', 'awayreason' => ''), 'uid=\''.intval($memprofile['uid']).'\'');
|
Zeile 1468 | Zeile 1653 |
---|
} // Check if our away status is set to 1, it may have been updated already (see a few lines above)
|
} // Check if our away status is set to 1, it may have been updated already (see a few lines above)
|
if ($memprofile['away'] == 1)
| if($memprofile['away'] == 1)
|
{ eval("\$awaybit = \"".$templates->get("member_profile_away")."\";"); }
| { eval("\$awaybit = \"".$templates->get("member_profile_away")."\";"); }
|
Zeile 1507 | Zeile 1692 |
---|
if($memprofile['birthdayprivacy'] != 'none') { if($membday[0] && $membday[1] && $membday[2])
|
if($memprofile['birthdayprivacy'] != 'none') { if($membday[0] && $membday[1] && $membday[2])
|
{
| {
|
$lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday'])); if($membday[2] >= 1970)
| $lang->membdayage = $lang->sprintf($lang->membdayage, get_age($memprofile['birthday'])); if($membday[2] >= 1970)
|
Zeile 1527 | Zeile 1712 |
---|
{ $membday = mktime(0, 0, 0, 1, 1, $membday[2]); $membday = date("Y", $membday);
|
{ $membday = mktime(0, 0, 0, 1, 1, $membday[2]); $membday = date("Y", $membday);
|
$membdayage = '';
| $membdayage = '';
|
} else { $membday = mktime(0, 0, 0, $membday[1], $membday[0], 0); $membday = date("F j", $membday); $membdayage = '';
|
} else { $membday = mktime(0, 0, 0, $membday[1], $membday[0], 0); $membday = date("F j", $membday); $membdayage = '';
|
} }
| } }
|
if($memprofile['birthdayprivacy'] == 'age') {
| if($memprofile['birthdayprivacy'] == 'age') {
|
Zeile 1572 | Zeile 1757 |
---|
// Get the user title for this user unset($usertitle); unset($stars);
|
// Get the user title for this user unset($usertitle); unset($stars);
|
| $starimage = '';
|
if(trim($memprofile['usertitle']) != '') { // User has custom user title
| if(trim($memprofile['usertitle']) != '') { // User has custom user title
|
Zeile 1585 | Zeile 1771 |
---|
else { // No usergroup title so get a default one
|
else { // No usergroup title so get a default one
|
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC')); while($title = $db->fetch_array($query)) { if($memprofile['postnum'] >= $title['posts']) { $usertitle = $title['title']; $stars = $title['stars']; $starimage = $title['starimage']; break; } } }
| $usertitles = $cache->read('usertitles');
if(is_array($usertitles)) { foreach($usertitles as $title) { if($memprofile['postnum'] >= $title['posts']) { $usertitle = $title['title']; $stars = $title['stars']; $starimage = $title['starimage'];
break; } } } }
|
if($displaygroup['stars'] || $displaygroup['usertitle'])
|
if($displaygroup['stars'] || $displaygroup['usertitle'])
|
{
| {
|
// Set the number of stars if display group has constant number of stars $stars = $displaygroup['stars']; } elseif(!$stars) {
|
// Set the number of stars if display group has constant number of stars $stars = $displaygroup['stars']; } elseif(!$stars) {
|
| if(!is_array($usertitles)) { $usertitles = $cache->read('usertitles'); }
|
// This is for cases where the user has a title, but the group has no defined number of stars (use number of stars as per default usergroups)
|
// This is for cases where the user has a title, but the group has no defined number of stars (use number of stars as per default usergroups)
|
$query = $db->simple_select("usertitles", "*", "", array('order_by' => 'posts', 'order_dir' => 'DESC')); while($title = $db->fetch_array($query))
| if(is_array($usertitles))
|
{
|
{
|
if($memprofile['postnum'] >= $title['posts'])
| foreach($usertitles as $title)
|
{
|
{
|
$stars = $title['stars']; $starimage = $title['starimage']; break;
| if($memprofile['postnum'] >= $title['posts']) { $stars = $title['stars']; $starimage = $title['starimage']; break; }
|
} } }
|
} } }
|
| $groupimage = '';
|
if(!empty($displaygroup['image'])) { if(!empty($mybb->user['language']))
| if(!empty($displaygroup['image'])) { if(!empty($mybb->user['language']))
|
Zeile 1633 | Zeile 1832 |
---|
eval("\$groupimage = \"".$templates->get("member_profile_groupimage")."\";"); }
|
eval("\$groupimage = \"".$templates->get("member_profile_groupimage")."\";"); }
|
if(!$starimage)
| if(empty($starimage))
|
{ $starimage = $displaygroup['starimage']; }
|
{ $starimage = $displaygroup['starimage']; }
|
if($starimage)
| if(!empty($starimage))
|
{ // Only display stars if we have an image to use... $starimage = str_replace("{theme}", $theme['imgdir'], $starimage);
| { // Only display stars if we have an image to use... $starimage = str_replace("{theme}", $theme['imgdir'], $starimage);
|
Zeile 1692 | Zeile 1891 |
---|
$reputation = get_reputation($memprofile['reputation']);
// If this user has permission to give reputations show the vote link
|
$reputation = get_reputation($memprofile['reputation']);
// If this user has permission to give reputations show the vote link
|
| $vote_link = '';
|
if($mybb->usergroup['cangivereputations'] == 1 && $memprofile['uid'] != $mybb->user['uid']) { $vote_link = "[<a href=\"javascript:MyBB.reputation({$memprofile['uid']});\">{$lang->reputation_vote}</a>]";
| if($mybb->usergroup['cangivereputations'] == 1 && $memprofile['uid'] != $mybb->user['uid']) { $vote_link = "[<a href=\"javascript:MyBB.reputation({$memprofile['uid']});\">{$lang->reputation_vote}</a>]";
|
Zeile 1716 | Zeile 1916 |
---|
} else {
|
} else {
|
$warning_link = "usercp.php";
| $warn_user = ''; $warning_link = 'usercp.php';
|
} eval("\$warning_level = \"".$templates->get("member_profile_warninglevel")."\";"); }
| } eval("\$warning_level = \"".$templates->get("member_profile_warninglevel")."\";"); }
|
Zeile 1741 | Zeile 1942 |
---|
$thing = explode("\n", $customfield['type'], "2"); $type = trim($thing[0]);
|
$thing = explode("\n", $customfield['type'], "2"); $type = trim($thing[0]);
|
| $customfieldval = '';
|
$field = "fid{$customfield['fid']}";
|
$field = "fid{$customfield['fid']}";
|
$useropts = explode("\n", $userfields[$field]); $customfieldval = $comma = ''; if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox")) { foreach($useropts as $val) { if($val != '') { $customfieldval .= "<li style=\"margin-left: 0;\">{$val}</li>"; } } if($customfieldval != '') { $customfieldval = "<ul style=\"margin: 0; padding-left: 15px;\">{$customfieldval}</ul>"; } } else { if($customfield['type'] == "textarea")
| if(isset($userfields[$field])) { $useropts = explode("\n", $userfields[$field]); $customfieldval = $comma = ''; if(is_array($useropts) && ($type == "multiselect" || $type == "checkbox"))
|
{
|
{
|
$customfieldval = nl2br(htmlspecialchars_uni($userfields[$field]));
| foreach($useropts as $val) { if($val != '') { $customfieldval .= "<li style=\"margin-left: 0;\">{$val}</li>"; } } if($customfieldval != '') { $customfieldval = "<ul style=\"margin: 0; padding-left: 15px;\">{$customfieldval}</ul>"; }
|
} else {
|
} else {
|
$customfieldval = htmlspecialchars_uni($userfields[$field]);
| $userfields[$field] = $parser->parse_badwords($userfields[$field]); if($customfield['type'] == "textarea") { $customfieldval = nl2br(htmlspecialchars_uni($userfields[$field])); } else { $customfieldval = htmlspecialchars_uni($userfields[$field]); }
|
} }
| } }
|
Zeile 1789 | Zeile 1997 |
---|
{ $timeonline = $lang->none_registered; }
|
{ $timeonline = $lang->none_registered; }
|
| $adminoptions = '';
|
if($mybb->usergroup['cancp'] == 1 && $mybb->config['hide_admin_links'] != 1) { eval("\$adminoptions = \"".$templates->get("member_profile_adminoptions")."\";"); }
|
if($mybb->usergroup['cancp'] == 1 && $mybb->config['hide_admin_links'] != 1) { eval("\$adminoptions = \"".$templates->get("member_profile_adminoptions")."\";"); }
|
else { $adminoptions = ''; }
| $modoptions = '';
|
if($mybb->usergroup['canmodcp'] == 1) { $memprofile['usernotes'] = nl2br(htmlspecialchars_uni($memprofile['usernotes']));
| if($mybb->usergroup['canmodcp'] == 1) { $memprofile['usernotes'] = nl2br(htmlspecialchars_uni($memprofile['usernotes']));
|
Zeile 1809 | Zeile 2015 |
---|
{ $memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100).'...'; }
|
{ $memprofile['usernotes'] = my_substr($memprofile['usernotes'], 0, 100).'...'; }
|
} else {
| } else {
|
$memprofile['usernotes'] = $lang->no_usernotes; } eval("\$modoptions = \"".$templates->get("member_profile_modoptions")."\";"); }
|
$memprofile['usernotes'] = $lang->no_usernotes; } eval("\$modoptions = \"".$templates->get("member_profile_modoptions")."\";"); }
|
else { $modoptions = ''; }
|
|
$buddy_options = '';
|
$buddy_options = '';
|
| |
if($mybb->user['uid'] != $memprofile['uid'] && $mybb->user['uid'] != 0) { $buddy_list = explode(',', $mybb->user['buddylist']); if(in_array($mybb->input['uid'], $buddy_list))
|
if($mybb->user['uid'] != $memprofile['uid'] && $mybb->user['uid'] != 0) { $buddy_list = explode(',', $mybb->user['buddylist']); if(in_array($mybb->input['uid'], $buddy_list))
|
{
| {
|
$buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&delete={$mybb->input['uid']}&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_buddy.gif\" alt=\"{$lang->remove_from_buddy_list}\" /> {$lang->remove_from_buddy_list}</a>"; } else
| $buddy_options = "<br /><a href=\"./usercp.php?action=do_editlists&delete={$mybb->input['uid']}&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_buddy.gif\" alt=\"{$lang->remove_from_buddy_list}\" /> {$lang->remove_from_buddy_list}</a>"; } else
|
Zeile 1838 | Zeile 2039 |
---|
$ignore_list = explode(',', $mybb->user['ignorelist']); if(in_array($mybb->input['uid'], $ignore_list))
|
$ignore_list = explode(',', $mybb->user['ignorelist']); if(in_array($mybb->input['uid'], $ignore_list))
|
{
| {
|
$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&manage=ignored&delete={$mybb->input['uid']}&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_ignore.gif\" alt=\"{$lang->remove_from_ignore_list}\" /> {$lang->remove_from_ignore_list}</a>";
|
$buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&manage=ignored&delete={$mybb->input['uid']}&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/remove_ignore.gif\" alt=\"{$lang->remove_from_ignore_list}\" /> {$lang->remove_from_ignore_list}</a>";
|
}
| }
|
else { $buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&manage=ignored&add_username=".urlencode($memprofile['username'])."&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_ignore.gif\" alt=\"{$lang->add_to_ignore_list}\" /> {$lang->add_to_ignore_list}</a>"; }
|
else { $buddy_options .= "<br /><a href=\"./usercp.php?action=do_editlists&manage=ignored&add_username=".urlencode($memprofile['username'])."&my_post_key={$mybb->post_code}\"><img src=\"{$theme['imgdir']}/add_ignore.gif\" alt=\"{$lang->add_to_ignore_list}\" /> {$lang->add_to_ignore_list}</a>"; }
|
}
| }
|
$plugins->run_hooks("member_profile_end");
|
$plugins->run_hooks("member_profile_end");
|
|
|
eval("\$profile = \"".$templates->get("member_profile")."\";"); output_page($profile); }
| eval("\$profile = \"".$templates->get("member_profile")."\";"); output_page($profile); }
|
Zeile 1859 | Zeile 2060 |
---|
verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("member_do_emailuser_start");
|
verify_post_check($mybb->input['my_post_key']);
$plugins->run_hooks("member_do_emailuser_start");
|
// Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid']) { error_no_permission(); } // Check group limits
| // Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid']) { error_no_permission(); } // Check group limits
|
if($mybb->usergroup['maxemails'] > 0) { $query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "fromuid='{$mybb->user['uid']}' AND dateline >= '".(TIME_NOW - (60*60*24))."'");
| if($mybb->usergroup['maxemails'] > 0) { $query = $db->simple_select("maillogs", "COUNT(*) AS sent_count", "fromuid='{$mybb->user['uid']}' AND dateline >= '".(TIME_NOW - (60*60*24))."'");
|
Zeile 1876 | Zeile 2077 |
---|
$lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']); error($lang->error_max_emails_day); }
|
$lang->error_max_emails_day = $lang->sprintf($lang->error_max_emails_day, $mybb->usergroup['maxemails']); error($lang->error_max_emails_day); }
|
}
| }
|
$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".intval($mybb->input['uid'])."'"); $to_user = $db->fetch_array($query);
|
$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".intval($mybb->input['uid'])."'"); $to_user = $db->fetch_array($query);
|
|
|
if(!$to_user['username']) { error($lang->error_invalidusername);
|
if(!$to_user['username']) { error($lang->error_invalidusername);
|
}
| }
|
if($to_user['hideemail'] != 0) {
| if($to_user['hideemail'] != 0) {
|
Zeile 1892 | Zeile 2093 |
---|
} if(empty($mybb->input['subject']))
|
} if(empty($mybb->input['subject']))
|
{ $errors[] = $lang->error_no_email_subject; }
| { $errors[] = $lang->error_no_email_subject; }
|
if(empty($mybb->input['message'])) {
| if(empty($mybb->input['message'])) {
|
Zeile 1948 | Zeile 2149 |
---|
// Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid'])
|
// Guests or those without permission can't email other users if($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid'])
|
{ error_no_permission();
| { error_no_permission();
|
} // Check group limits
| } // Check group limits
|
Zeile 1963 | Zeile 2164 |
---|
error($lang->error_max_emails_day); } }
|
error($lang->error_max_emails_day); } }
|
$query = $db->simple_select("users", "uid, username, email, hideemail", "uid='".intval($mybb->input['uid'])."'");
| $query = $db->simple_select("users", "uid, username, email, hideemail, ignorelist", "uid='".intval($mybb->input['uid'])."'");
|
$to_user = $db->fetch_array($query);
|
$to_user = $db->fetch_array($query);
|
|
|
$lang->email_user = $lang->sprintf($lang->email_user, $to_user['username']); if(!$to_user['uid'])
|
$lang->email_user = $lang->sprintf($lang->email_user, $to_user['username']); if(!$to_user['uid'])
|
{
| {
|
error($lang->error_invaliduser); } if($to_user['hideemail'] != 0) { error($lang->error_hideemail);
|
error($lang->error_invaliduser); } if($to_user['hideemail'] != 0) { error($lang->error_hideemail);
|
| }
if($to_user['ignorelist'] && (my_strpos(",".$to_user['ignorelist'].",", ",".$mybb->user['uid'].",") !== false && $mybb->usergroup['cansendemailoverride'] != 1)) { error_no_permission();
|
} if(count($errors) > 0)
| } if(count($errors) > 0)
|