943,712 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 976
  • PHP RSS
Nov 23rd, 2008
0

Encoding and saving password during login

Expand Post »
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.
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008
Nov 23rd, 2008
0

Re: Encoding and saving password during login

This is a code i found into the socialengine's plugin.
I think this does all the work

PHP Syntax (Toggle Plain Text)
  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. '')");
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008
Nov 24th, 2008
0

Re: Encoding and saving password during login

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.
Reputation Points: 21
Solved Threads: 26
Posting Whiz in Training
Rhyan is offline Offline
240 posts
since Oct 2006
Nov 24th, 2008
0

Re: Encoding and saving password during login

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..
Reputation Points: 8
Solved Threads: 0
Light Poster
Punkis448 is offline Offline
31 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Not getting data in list box
Next Thread in PHP Forum Timeline: Insert Multiple Records





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC