0 ) { $_myrow = remove_external_slashes(mysql_fetch_array($result,MYSQL_ASSOC)); if ($_myrow["option_account_lock"] == 1) { $error_message = '錯誤:此戶口已多次登入錯誤及已被鎖上,請聯絡技術員。Error: This account had been locked by wrong password failure. Please contact system administrator.'; write_event_log("", $error_message . ": (locked) " . $__POST["login"] . " IP: " . get_user_ip(), $__POST["login"]); } elseif ($_myrow["password"] == $_passwd) { $_SESSION["this_login"]["login_id"] = $_myrow["login_id"]; $_SESSION["this_login"]["last_login"] = $_myrow["last_login"]; $_SESSION["this_login"]["language"] = ( $_myrow["language"] == "") ? DEFAULT_LANGUAGE : $_myrow["language"]; $_access_key = genkey_db(table_login , "access_key" , 0 , 1 ); $_login_time = time(); sql("update " . table_login . " set access_key = '$_access_key', last_login = '$_login_time', login_retry = 0 where login_id = '{$__POST["login"]}' "); if ($result > 0 ) { $_SESSION["this_login"]["access_key"] = $_access_key; write_event_log("", "成功\登入" . $__POST["login"] . " IP: " . get_user_ip()); // Auto optimize db module ---------------------------------------------- $result = sql("select * from " . table_system_data); if (mysql_num_rows($result) > 0 ) { $_result = mysql_fetch_array($result , MYSQL_ASSOC); $_SESSION["this_login"]["enable_auto_optimize"] = ($_result["last_optimize"] + ( AUTO_OPTIMIZE_DAY * 86400) < time() ) ? true: false; } else { $_SESSION["this_login"]["enable_auto_optimize"] = true; } header("Location: main.php"); exit; } else { $error_message = '系統錯誤:無法建立登入連線,請聯絡技術員。Error: Cannot create login connection. Please contact system administrator.'; write_event_log("", "$error_message: " . $__POST["login"] . " IP: " . get_user_ip(), $__POST["login"]); } } else { $error_message = '錯誤:登入名稱或密碼錯誤。Error: Login or Password is incorrect.'; write_event_log("", "登入失敗" . $__POST["login"] . " IP: " . get_user_ip() , $__POST["login"] ); if ($__POST["login"] != "admin") { $_loginretry = $_myrow["login_retry"]; $_loginretry++; $option_account_lock = 0; if ($_loginretry >= LOGIN_RETRY_LOCK) $option_account_lock = 1; sql("update " . table_login . " set login_retry = '$_loginretry' , option_account_lock = '$option_account_lock' where login_id = '{$__POST["login"]}' "); } } } else { $error_message = '錯誤:登入名稱或密碼錯誤。Error: Login or Password is incorrect.'; write_event_log("", "登入失敗" . $__POST["login"] , $__POST["login"] ); } } } else { write_event_log("", "登入畫面", get_user_ip() ); } $_SESSION = array(); $result = sql("select * from " . table_notice ); $have_notice = false; if (mysql_num_rows($result) > 0) { $notice_detail = mysql_fetch_array($result,MYSQL_ASSOC); $_t = trim(strip_tags($notice_detail["notice_text"])); $_t = str_replace(" ","", $_t); if ($_t != "") $have_notice = true; } ?> <? echo HTML_HEADER; ?>


系統登入 System Login
登入名稱 Login:
密碼 Password: