Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Author Topic: $pass2  (Read 1903 times)

Sheepdisease

  • Jr. Member
  • **
  • Karma: -1
  • Posts: 79
$pass2
« on: March 11, 2008, 02:26:06 pm »

Could someone please tell me what the function of $pass2 is?
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: $pass2
« Reply #1 on: March 11, 2008, 03:20:42 pm »

Could someone please tell me what the function of $pass2 is?

The only person who could provide the definitive answer on that one would be the author of the MU package... Bakercad.
However, using a bit of exploratory deduction in the snewsMU.php file, we might be able to figure it out for ourselves... by searching through Bakercad's function bulk_users() .

The first occurence in that function is where the $pass2 variable is defined as - trim($_POST['password2']);

The next occurence of $pass2   is in the same function... a few more lines down... in this string - if ($pass1 === $pass2) . This string is saying... "If password1 is equal to password2... and they are of the same type... " then let's do something which follows the string.

Now... what does this function bulk_users() do? When you are logged in as the Admin... and you click the "Add Users" link to add a new user account... you get the "Add Users" panel displayed. This is generated by this function. Now... notice that there are 2 password fields in the form. The "Password" (1st) field is for password1 and the second field - "Repeat Password" is for password2.

Two are used so that the person... if registering a new account on their own... must enter their password twice. I think this is to ensure that the fields are being filled in by a real legitimate person and not a spambot. And... that if ($pass1 === $pass2)  begins a process that checks to make sure both password entries are the same. If they are not the same... then the registration entry is rejected. If they do check out to be the same... then it is accepted and saved to the database.  ;)
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Sheepdisease

  • Jr. Member
  • **
  • Karma: -1
  • Posts: 79
Re: $pass2
« Reply #2 on: March 11, 2008, 05:04:15 pm »

If you include $pass2 in the bulk user email, it displays as "password:      ". The password is not displayed, however, if you put $pass1 in its place, it would display the password registered.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6020
  • Semantically Challenged
    • snews.ca
Re: $pass2
« Reply #3 on: March 11, 2008, 05:15:16 pm »

If you include $pass2 in the bulk user email, it displays as "password:      ". The password is not displayed, however, if you put $pass1 in its place, it would display the password registered.

? ? ? ? ? ???
I haven't a clue what you are referring to.
Could you provide a much clearer explanation of what you are doing and what results when you do it?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU