473,698 Members | 2,034 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Encoding and saving password during login

12 New Member
Hello all.
I am having some questions about a subject.
I am running a small social community using SocialEngine and i want to include phpbb3 with an arcade mod or any arcade board that support high scores.
My problem is that i do not want my users to re-register into the board. So if I manage to encode the password during login, into the encoding system of phpbb3 or just md5, I will make the registrations my self through the database.

That means they will login every time they want to access the arcade unless they press remember me, but they will not register themselves.

I know that this is something that is able to be made.
Also is there any chance to make the login into the arcade automatic?
There is tutorial and a script that it is used for phpbb2 and it is available here http://www.socialengine.net/tutorial...tutorial_id=44

Thank you all.
Nov 23 '08 #1
1 1422
Punkis
12 New Member
This is a code i found into the socialengine's plugin.
I think this does all the work

Expand|Select|Wrap|Line Numbers
  1.     // THIS METHOD CREATES A FORUM USER WITH THE SAME USERNAME AS THE CURRENT USER
  2.     // INPUT: 
  3.     // OUTPUT: 
  4.     function forum_user_create() {
  5.       global $db, $board_config;
  6.  
  7.       // GET NEXT USER ID
  8.       $row = $db->sql_fetchrow($db->sql_query("SELECT MAX(user_id) AS max_user_id FROM " . USERS_TABLE));
  9.       $forum_user_id = $row['max_user_id'] + 1;
  10.  
  11.       // ENCRYPT PASSWORD
  12.       $password_md5 = md5(randomcode());
  13.  
  14.       // SET DEFAULT VALUES FOR SOME VARIABLES
  15.       $viewemail          = FALSE;
  16.       $allowviewonline    = TRUE;
  17.       $notifyreply        = FALSE;
  18.       $notifypm           = TRUE;
  19.       $popup_pm           = TRUE;
  20.       $attachsig          = $board_config['allow_sig'];
  21.       $allowhtml          = $board_config['allow_html'];
  22.       $allowbbcode        = $board_config['allow_bbcode'];
  23.       $allowsmilies       = $board_config['allow_smilies'];
  24.       $user_style         = $board_config['default_style'];
  25.       $user_dateformat    = $board_config['default_dateformat'];
  26.       $user_timezone      = $board_config['board_timezone'];
  27.       $user_lang          = $board_config['default_lang'];
  28.  
  29.       // BEGIN PHPBB2 INSERT
  30.       $db->sql_query("INSERT INTO " . USERS_TABLE . "(user_id,
  31.                             username,
  32.                             user_regdate,
  33.                             user_password,
  34.                             user_email,
  35.                             user_viewemail,
  36.                             user_attachsig,
  37.                             user_allowsmile,
  38.                             user_allowhtml,
  39.                             user_allowbbcode,
  40.                             user_allow_viewonline,
  41.                             user_notify,
  42.                             user_notify_pm,
  43.                             user_popup_pm,
  44.                             user_timezone,
  45.                             user_dateformat,
  46.                             user_lang,
  47.                             user_style,
  48.                             user_level,
  49.                             user_allow_pm,
  50.                             user_active,
  51.                             user_actkey
  52.                             ) VALUES (
  53.                             '$forum_user_id',
  54.                             '".$this->user_info[user_username]."',
  55.                             '".time()."', 
  56.                             '$password_md5',
  57.                             '".$this->user_info[user_email]."',
  58.                             '$viewemail',
  59.                             '$attachsig',
  60.                             '$allowsmilies',
  61.                             '$allowhtml',
  62.                             '$allowbbcode',
  63.                             '$allowviewonline',
  64.                             '$notifyreply',
  65.                             '$notifypm',
  66.                             '$popup_pm',
  67.                             '$user_timezone',
  68.                             '".str_replace("\'", "''", $user_dateformat)."',
  69.                             '".str_replace("\'", "''", $user_lang)."',
  70.                             '$user_style',
  71.                             0,
  72.                             1,
  73.                             1,
  74.                             '')");
Nov 24 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2256
by: Lamp | last post by:
Is it possible to save session values between pages? I did a little script to let the users login. I use this script to check username and password the user introduces in a form in the main page, index.php. If a user is found with username and password, than I create $_SESSION and assign it a value of true, else I assign it a value of false. If a user is non registered, I send it to the proper page to register, RegistraUtente.php, if he is...
4
3204
by: Tim Daneliuk | last post by:
OK, I've Googled for this and cannot seem to quite find what I need. So, I turn to the Gentle Geniuses here for help. Here is what I need to do from within a script: Given a username and a password (plain text): 1) Validate that the password is correct for that user *without actually logging in*. 2) If the password is valid, return a list of all the groups the user belongs to. Otherwise, return some error string.
2
1695
by: hellrazor | last post by:
Hi there, We want to be able to encrypt the user ID and password within a URL, so when we send the URL via email, they'll be able to click said URL, and the aspx page should be able to decode it and authenticate it. I'm thinking the url would look something like this: http://localhost/login.aspx?id=af3awfalj3o3i3ok0890
12
1483
by: Anon | last post by:
Hello All! I was wondering how I can go about saving the last string entered into a textbox. I would like to save username or pwd info in textboxes in my forms so that users don't have to continually type them! Thanks! Luis
0
971
by: Mark A. Sam | last post by:
Hello, I am learning to use Visual Web Developer 2005 Express Edition. I am using a Gridview control with a remote SQL Database connection. Whenever I configure the data source I am asked for the password from screen to screen. When I first drag the control onto the page, it asks for the password twice and sometimes when I previiew the page. Also I can't get the page to preview, I get an error which I think may be password related:
6
8117
by: Jeff | last post by:
Hey (and thank you for reading my post) In visual web developer 2005 express edition I've created a simple website project.. At this website I want users who register to be able to upload a picture of themselves to their profile... I admit that I'm a newbie... but this is how I understand this:
0
1065
by: Ron | last post by:
Hi, I need to turn off my menu control when a user is in the process of changing there password. I know this can be done because the Login control automatically prevents the rendering of the control during login. I would like this same no rendering of the menu control when users are changing there passwords. The ChangePassword.aspx page sits inside the master as dose the login control so if the login control can do this so can the...
2
1839
by: chiefsitebuilder | last post by:
I have a question about saving an MS Access program to CD and verifyng that the program works after being saved. Here is my situation, I have a person who developed an application for me using MS Access 2003 and the person will be transferring ownership to me. The developer will be giving me a CD with Access DBase source code on it. How do I verify that he gives me everthing I need to run the application once the developer departs. ...
2
7530
by: JW | last post by:
Hello. I'm trying to make a SOAP request, and enable compression in the response (by sending the Accept-Encoding header). To do this, I'm sending 'compression' =SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP in the SoapClient constructor's options. But when I print the request headers, I don't see the Accept-Encoding header. Am I doing something wrong? I also tried SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP | 9 to set the...
0
8672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8600
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9155
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8890
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5859
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2322
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1997
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.