Encoding and saving password during login

Reply

Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Encoding and saving password during login

 
0
  #1
Nov 23rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Re: Encoding and saving password during login

 
0
  #2
Nov 23rd, 2008
This is a code i found into the socialengine's plugin.
I think this does all the work

  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. '')");
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 232
Reputation: Rhyan is an unknown quantity at this point 
Solved Threads: 24
Rhyan's Avatar
Rhyan Rhyan is offline Offline
Posting Whiz in Training

Re: Encoding and saving password during login

 
0
  #3
Nov 24th, 2008
Why don't you create an activate service page. E.g. imagine not all users want to participate in the arcade, but by mistake they click on the game page....
I think it would be better you create a single php page that explains the puspose of the arcade, etc. and you present there a link saying e.g. Activate your free arcade account, or Enable arcade for me, etc....
In this way once the user clicks this link a simple php will work and create new account only for those members who have requested this service, by simply re-registering the user into PHPBB with their current password and username.
If, by chance someone wants to register only to your arcade application, you create a custom page that checks in your social application login tables. If such user exists, it will offer one of the following - e.g. First to login with social account and go to the activate function, or, offer to create a new social account and then activate the arcade....
I hope you understand my suggestion.
" Of all the things I've lost,
I miss my mind the most...."
Mark Twain
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 31
Reputation: Punkis448 is an unknown quantity at this point 
Solved Threads: 0
Punkis448 Punkis448 is offline Offline
Light Poster

Re: Encoding and saving password during login

 
0
  #4
Nov 24th, 2008
Hi there thank you for your reply.
It is because I want it to be "automatic". However I figured a way, kinda same like yours..
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC