|
 |
|
..ช่วยหน่อยค่ะ พอดีเป็นมือใหม่คะ รบกวนช่วยเเนะนำด้วยนะคะ |
|
 |
|
|
 |
 |
|
เอา code มาดูครับ
|
 |
 |
 |
 |
Date :
2011-06-16 11:11:08 |
By :
webmaster |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
$sql = 'SELECT login, attempt, expiry FROM '.TABLE_PREFIX."member_login_attempt WHERE login='$this_login'";
$result = mysql_query($sql, $db);
if ($result && mysql_numrows($result) > 0){
list($attempt_login_name, $attempt_login, $attempt_expiry) = mysql_fetch_array($result);
} else {
$attempt_login_name = '';
$attempt_login = 0;
$attempt_expiry = 0;
}
if($attempt_expiry > 0 && $attempt_expiry < time()){
//clear entry if it has expired
$sql = 'DELETE FROM '.TABLE_PREFIX."member_login_attempt WHERE login='$this_login'";
mysql_query($sql, $db);
$attempt_login = 0;
$attempt_expiry = 0;
}
if ($used_cookie) {
$sql = "SELECT member_id, login, first_name, second_name, last_name, preferences,password AS pass, language, status, last_login FROM ".TABLE_PREFIX."members WHERE login='$this_login' AND password='$this_password'";
} else {
$sql = "SELECT member_id, login, first_name, second_name, last_name, preferences, language, status, password AS pass, last_login FROM ".TABLE_PREFIX."members WHERE (login='$this_login' OR email='$this_login') AND SHA1(CONCAT(password, '$_SESSION[token]'))='$this_password'";
}
$result = mysql_query($sql, $db);
if($_config['max_login'] > 0 && $attempt_login >= $_config['max_login']){
$msg->addError('MAX_LOGIN_ATTEMPT');
} else if (($row = mysql_fetch_assoc($result)) && ($row['status'] == AT_STATUS_UNCONFIRMED)) {
$msg->addError('NOT_CONFIRMED');
} else if ($row && $row['status'] == AT_STATUS_DISABLED) {
$msg->addError('ACCOUNT_DISABLED');
} else if ($row) {
$_SESSION['valid_user'] = true;
$_SESSION['member_id'] = intval($row['member_id']);
$_SESSION['login'] = $row['login'];
if ($row['preferences'] == "")
assign_session_prefs(unserialize(stripslashes($_config["pref_defaults"])), 1);
else
assign_session_prefs(unserialize(stripslashes($row['preferences'])), 1);
$_SESSION['is_guest'] = 0;
$_SESSION['lang'] = $row['language'];
$_SESSION['course_id'] = 0;
if ($auto_login == 1) {
$parts = parse_url($_base_href);
// update the cookie.. increment to another 2 days
$cookie_expire = time()+172800;
ATutor.setcookie('ATLogin', $this_login, $cookie_expire, $parts['path']);
ATutor.setcookie('ATPass', $row['pass'], $cookie_expire, $parts['path']);
}
บรรทัดนี้ค่ะ ที่มีปันหา
} else if (($row = mysql_fetch_assoc($result)) && ($row['status'] == AT_STATUS_UNCONFIRMED)) {
$msg->addError('NOT_CONFIRMED');
|
ประวัติการแก้ไข 2011-06-16 11:17:37 2011-06-16 11:35:20
 |
 |
 |
 |
Date :
2011-06-16 11:15:06 |
By :
tle.demons |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 05
|