473,320 Members | 1,744 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Encoding and saving password during login

12
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 1402
Punkis
12
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
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,...
4
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...
2
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...
12
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...
0
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...
6
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...
0
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...
2
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...
2
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 |...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.