} $sql = "INSERT INTO " . NV_USERS_GLOBALTABLE . "_reg (username, md5username, password, email, first_name, last_name, regdate, question, answer, checknum, users_info, openid_info) VALUES (\n\t\t\t:username,\n\t\t\t:md5username,\n\t\t\t'',\n\t\t\t:email,\n\t\t\t:first_name,\n\t\t\t:last_name,\n\t\t\t" . NV_CURRENTTIME . ",\n\t\t\t'',\n\t\t\t'',\n\t\t\t'',\n\t\t\t:users_info,\n :openid_info\n\t\t)"; $data_insert = array(); $data_insert['username'] = $reg_attribs['username']; $data_insert['md5username'] = nv_md5safe($reg_attribs['username']); $data_insert['email'] = $reg_attribs['email']; $data_insert['first_name'] = $reg_attribs['first_name']; $data_insert['last_name'] = $reg_attribs['last_name']; $data_insert['users_info'] = nv_base64_encode(serialize($query_field)); $data_insert['openid_info'] = nv_base64_encode(serialize($reg_attribs)); $userid = $db->insert_id($sql, 'userid', $data_insert); if (!$userid) { opidr(array('status' => 'error', 'mess' => $lang_module['err_no_save_account'])); die; } opidr(array('status' => 'success', 'mess' => $lang_module['account_register_to_admin'])); die; } $page_title = $lang_global['openid_login']; $key_words = $module_info['keywords']; $mod_title = $lang_global['openid_login']; $contents .= user_openid_login($gfx_chk, $attribs); include NV_ROOTDIR . '/includes/header.php'; echo nv_site_theme($contents, false); include NV_ROOTDIR . '/includes/footer.php'; exit; } //Dang nhap kieu thong thuong if ($nv_Request->isset_request('nv_login', 'post')) { $nv_username = nv_substr($nv_Request->get_title('nv_login', 'post', '', 1), 0, 100); $nv_password = $nv_Request->get_title('nv_password', 'post', '');
$stmt = $db->prepare($query); $stmt->bindParam(':email', $email, PDO::PARAM_STR); $stmt->execute(); $count = $stmt->fetchColumn(); if ($count) { opidr(6); die; } } $stmt = $db->prepare('INSERT INTO ' . NV_USERS_GLOBALTABLE . '_openid VALUES (' . $user_info['userid'] . ', :openid, :opid, :email )'); $stmt->bindParam(':openid', $server, PDO::PARAM_STR); $stmt->bindParam(':opid', $opid, PDO::PARAM_STR); $stmt->bindParam(':email', $email, PDO::PARAM_STR); $stmt->execute(); nv_insert_logs(NV_LANG_DATA, $module_name, $lang_module['openid_add'], $user_info['username'] . ' | ' . $client_info['ip'] . ' | ' . $opid, 0); opidr(1000); die; } //Basic if ($checkss == $array_data['checkss'] and $array_data['type'] == 'basic') { $array_data['first_name'] = nv_substr($nv_Request->get_title('first_name', 'post', '', 1), 0, 255); $array_data['last_name'] = nv_substr($nv_Request->get_title('last_name', 'post', '', 1), 0, 255); $array_data['gender'] = nv_substr($nv_Request->get_title('gender', 'post', '', 1), 0, 1); $array_data['birthday'] = nv_substr($nv_Request->get_title('birthday', 'post', '', 0), 0, 10); $array_data['view_mail'] = (int) $nv_Request->get_bool('view_mail', 'post', false); if ($array_data['gender'] != 'M' and $array_data['gender'] != 'F') { $array_data['gender'] = ''; } if (preg_match('/^([0-9]{1,2})\\/([0-9]{1,2})\\/([0-9]{4})$/', $array_data['birthday'], $m)) { $array_data['birthday'] = mktime(0, 0, 0, $m[2], $m[1], $m[3]); } else {