$message_type = 'error'; $message = "{$lng['LNG_PLEASE_FILL']} {$lng['LNG_PASSWORD']}"; } } elseif (isset($_SESSION['login'])) { // login อยู่ก่อนแล้ว $login_email = $_SESSION['login']['email']; $login_password = $_SESSION['login']['password']; } elseif (!empty($_COOKIE[PREFIX . '_login_email']) && !empty($_COOKIE[PREFIX . '_login_password'])) { // เข้ามาครั้งแรก อ่านจาก cookie $login_email = empty($_COOKIE[PREFIX . '_login_email']) ? '' : gcms::decode($_COOKIE[PREFIX . '_login_email']); $login_password = empty($_COOKIE[PREFIX . '_login_password']) ? '' : gcms::decode($_COOKIE[PREFIX . '_login_password']); } // ตรวจสอบการ login $login_success = false; if ($login_email != '' && $login_password != '') { $login_result = gcms::CheckLogin($login_email, $login_password); $login_success = is_array($login_result) && ($login_result['status'] == 1 || $login_result['admin_access'] == 1); if (!$login_success && $action == 'login') { $login_result = is_array($login_result) ? 5 : $login_result; $message_type = 'error'; // ข้อความผิดพลาด $error = array(); $error[] = $lng['LNG_MEMBER_NOT_FOUND']; $error[] = $lng['LNG_MEMBER_NO_ACTIVATE']; $error[] = $lng['LNG_MEMBER_BAN']; $error[] = $lng['LNG_PASSWORD_INCORRECT']; $error[] = $lng['LNG_MEMBER_LOGIN_EXISTS']; $error[] = $lng['ACTION_FORBIDDEN']; $input = $login_result == 3 ? 'login_password' : 'login_email'; $message = strip_tags($error[$login_result]); }
$ret['ret_reply_detail'] = 'DETAIL_EMPTY'; } elseif ($id == 0) { // แสดงความคิ ดเห็นใหม่ if ($email == '') { // ไม่ได้กรอกอีเมล์ $ret['error'] = 'EMAIL_EMPTY'; $ret['input'] = 'reply_email'; $ret['ret_reply_email'] = 'EMAIL_EMPTY'; } elseif ($password == '' && !$guest) { // สมาชิกเท่านั้น ไม่ได้กรอก รหัสผ่าน $ret['error'] = 'PASSWORD_EMPTY'; $ret['input'] = 'reply_password'; $ret['ret_reply_password'] = '******'; } elseif ($email != '' && $password != '') { // ตรวจสอบสมาชิกหากมีการกรอก email และ password $user = gcms::CheckLogin($email, $password); if ($user == 0 || $user == 3) { $ret['error'] = 'EMAIL_OR_PASSWORD_INCORRECT'; $ret['input'] = $user == 0 ? 'reply_email' : 'reply_password'; $ret['ret_' . $ret['input']] = 'EMAIL_OR_PASSWORD_INCORRECT'; } elseif ($user == 1) { $ret['error'] = 'MEMBER_NO_ACTIVATE'; $ret['input'] = 'reply_email'; $ret['ret_reply_email'] = 'MEMBER_NO_ACTIVATE'; } elseif ($user == 2) { $ret['error'] = 'MEMBER_BAN'; $ret['input'] = 'reply_email'; $ret['ret_reply_email'] = 'MEMBER_BAN'; } elseif (!in_array($user['status'], $can_reply)) { $ret['error'] = 'DO_NOT_REPLY'; $ret['input'] = 'reply_email';