By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,242 Members | 1,139 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,242 IT Pros & Developers. It's quick & easy.

Encoding and saving password during login

P: 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
Share this Question
Share on Google+
1 Reply


P: 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

Post your reply

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