1
nmshah
registration error or bug
  • 2008/2/6 15:02

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


when someone tries to register on my website, in the regiter form there is a option that asks for Time Zone*.

If a user selects a timezone GMT+5.30 and submits the next page shows it as GMT+5.

Check it here
http://makingdestiny.com/register.php

pls let me know how to correct this

2
nmshah
Re: registration error or bug
  • 2009/2/3 20:10

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Well it seems this is not a problem only on my site as on all aoops related sites where i have registered including xuups.com, xoops.org, http://mark.boyden.name and so on have the same issue. The problem exists in 2.3 series also. Just try and register on any XOOPS based site with timezone as gmt+5.30 and then check the timezone in the new registered account. You will find that the account gets registered with a default timezone as gmt+5.

Any fixes for this. Kindly help

3
ghia
Re: registration error or bug
  • 2009/2/3 22:51

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


It is a bug:
In register.php the value from the form
<option value="5.5" selected="selected">(GMT+5:30MumbaiKolkataChennai, New Delhioption>

is rounded through an intval function:
$timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];

Solution could be to make the option values multiplied by 10 (eg 55 for Mumbai)and divide after the validation with 10 to have the correct offset.
$timezone_offset = isset($_POST['timezone_offset']) ? intval($_POST['timezone_offset'])/10 $xoopsConfig['default_TZ'];

4
nmshah
Re: registration error or bug
  • 2009/2/4 5:43

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Thanks i will check this out and come back with the results.

5
nmshah
Re: registration error or bug
  • 2009/2/17 9:43

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Now it seems the timezone is automatically set to default ie GMT.

Btw i am also using the user profile module for user registration so will i need to make some changes in the user profile module to get this to work.

6
ghia
Re: registration error or bug
  • 2009/2/17 11:43

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Humm,the easiest way would be to use floatval instead.
$timezone_offset = isset($_POST['timezone_offset']) ? floatval($_POST['timezone_offset']) : $xoopsConfig['default_TZ'];

7
nmshah
Re: registration error or bug
  • 2009/2/17 18:14

  • nmshah

  • Just can't stay away

  • Posts: 556

  • Since: 2007/7/2 8


Thanks ghia,

but I have tried this but i still am getting timezone as GMT no matter what the timezone is set during registration.

I am using user profile module for handling registration process, so do you think i will need to make some changes in the user profile module as well.

8
ghia
Re: registration error or bug
  • 2009/2/18 2:15

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Did you set a default value for the timezone_offset field (/modules/profile/admin/field.php)?
I did a check here (on 2.3.1) and had set the default as Mumbai and when I register once unchanged and once changed to Tehran (+3.5) and in both cases the selected value was present after the registration in the profile.
For the field, I had set the default value as +5.5 and the form for it as basic. It appears on the first form as mandatory.
What was your XOOPS and profile version?

Login

Who's Online

225 user(s) are online (33 user(s) are browsing Support Forums)


Members: 0


Guests: 225


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Oct 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits