Prova501 Posted July 8, 2013 Share Posted July 8, 2013 .,~ السلآم عليكم و رحمة الله و بركآته انا قبل كم يوم حطيت موضوع الاتصآل ب قآعدة البيآنآت لآكن احس ان قآعدة البيآنات و الاتصآل فيهآ قلق يعني لو جآ هجوم مثل ع الموقع و كذا =============================== شباب عندي ملف السيرفر للدخول ع الحسآبات الي في قآعدة البيآنآت !! لآكن بخليه مثل أي لوقين ثآني موب لآزم قآعدة البيآنآت ============================== اتركم مع الملف كآمل .,~ ====================== local serverContainer = {} serverContainer.Settings = {} --[[dbname]]serverContainer.Settings.user = 'user' --[[pass]]serverContainer.Settings.pass = 'pass' --[[host]]serverContainer.Settings.host = '' --[[name]]serverContainer.Settings.name = 'name' -- only for example ;p serverContainer.StartResource = function() local connection = dbConnect('mysql', 'dbname='..serverContainer.Settings.name..';host='..serverContainer.Settings.host, serverContainer.Settings.user, serverContainer.Settings.pass) if connection then outputDebugString('[_Login Panel]: Could connect to the mysql server') serverContainer.connection = connection; else outputDebugString('[_Login Panel]: Couldn not connect to the mysql server') end end serverContainer.loginClient = function(user, pass) local qh = dbQuery(serverContainer.connection > connection,'SELECT * FROM mybb_users WHERE username = ?',user) local result, row, errmsg = dbPoll ( qh, 5000 ) if row > 0 then for id, result in ipairs(result) do local salt = result['salt'] local username = result['username'] local password = result['password'] if salt and username and password then local newPass = md5(md5(salt):lower()..md5(pass):lower()):lower() if newPass == password then triggerClientEvent(source,'onClientSuccessfullyLogin',source) outputChatBox('#ff6666[sERVER]#ffffff You have successfully login.', source,1,1,1,true) else outputChatBox('#ff6666[sERVER]#ffffff This account doesn\'t exists or the password is wrong.', source,1,1,1,true) end end end end end addEvent('onClientLogins', true) addEventHandler('onClientLogins', root, serverContainer.loginClient) ابي يكون مثل اي لوقين ثآني بالأحتفآظ بالأعدآدات اذا ممكن Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now