Support A2Billing :

provided by Star2Billing S.L.

Support A2Billing :
It is currently Tue Mar 19, 2024 5:24 am
Voice Broadcast System


All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: $_SESSION variables
PostPosted: Thu Jun 04, 2009 7:32 pm 
Offline

Joined: Tue Feb 12, 2008 11:34 am
Posts: 87
Location: Germany
Dear All,
can anyone tell me where are $_SESSION variables defined?
for example in singup_confirmation.php i see statements like
Code:
if (!isset($_SESSION["date_mail"]) || (time()-$_SESSION["date_mail"]) > 60)

i need to make a check that only a single signup is made with an email address. that is the email address once registered cannot be used with any other new registration.

i tried to achieve this by querying the database if the email already exists, so in order to query i need to know the email address the new user is providing in the signup form.

i have tried using $_SESSION["email"] and $_SESSION["email_signup"] as i saw in other cases but no success.
I can not find those variable defined anywhere in the source code.

Please help and advise.

with sincere regards

mazhar


Top
 Profile  
 
 Post subject: Re: $_SESSION variables
PostPosted: Fri Jun 05, 2009 2:38 pm 
Offline
Moderator
User avatar

Joined: Thu Jun 22, 2006 2:19 pm
Posts: 2890
Location: Devon, UK
mazhar996 wrote:
can anyone tell me where are $_SESSION variables defined?
grep -R '$_SESSION\[.*\][-*\/+. ]*=' /path/to/a2b/source
Quote:
i need to make a check that only a single signup is made with an email address.
http://forum.asterisk2billing.org/viewtopic.php?f=12&t=4580


Top
 Profile  
 
 Post subject: Re: $_SESSION variables
PostPosted: Sat Jun 06, 2009 10:52 am 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Hello,

I searched the forum for this but could not find any code other than (dB unique index) solution..

When stavroz said he could not find it too, i gave up the search an prepared my own code.. here is how i did it :

in the file Class.FormHandler.inc.php there is an (if) statement that looks like this (around line 1421):

Code:
if (!$this-> FG_fit_expression[$i]){
                     $this->VALID_SQL_REG_EXP = false;
                     $form_action="ask-add";
                  }



Add an (else) branch and make it look similar to this :

Code:
                  if (!$this-> FG_fit_expression[$i]){
                     $this->VALID_SQL_REG_EXP = false;
                     $form_action="ask-add";
                  } else { // dB based verification
                      switch ($fields_name) {
                          case  'email' :
                           $QUERY = "select count(email) from cc_card where email = '".$_POST["email"]."' " ;
                           $res = $this -> DBHandle -> Execute($QUERY) ;
                           $row = $res -> fetchRow() ;
                           if ($row[0] > 0) {
                              $this -> FG_fit_expression[$i]= false ;
                              // Mean and dirty by all means, but hey .. all is fair in love and war and A2B hacking !
                              $this -> FG_regular[1][1] = " (This email is already registered!  Have you  forgot your account password ?  You can retrive it below)"  ;
                              $this->VALID_SQL_REG_EXP = false;
                              $form_action="ask-add";
                           }
                         break ;
                        
                     // case something else
                     // case something else 2
                      } // switch
                  }// else


The (switch) is not necessary but it is useful if you want to do dB verification on some other fields later


Top
 Profile  
 
 Post subject: Re: $_SESSION variables
PostPosted: Sat Jun 06, 2009 5:47 pm 
Offline

Joined: Fri Feb 27, 2009 5:43 pm
Posts: 33
Location: Germany, Berlin
Perfect! Thanks a lot!

I tried to find a solution for that a couple of times and also spent a few minutes to code my own solution but i gave up.

This one works perfectly.

Thanks for sharing!

Greetings from Berlin

:beer2:


Top
 Profile  
 
 Post subject: Re: $_SESSION variables
PostPosted: Thu Jan 22, 2015 10:42 am 
Offline

Joined: Wed Feb 19, 2014 8:44 am
Posts: 7
5 years later and we still have to deal with this hack to disable multiple signup with same email?


Top
 Profile  
 
 Post subject: Re: $_SESSION variables
PostPosted: Fri Jan 23, 2015 11:20 pm 
Offline

Joined: Fri Jan 18, 2008 9:54 pm
Posts: 135
Flattered ! :D


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 
VoIP Billing solution


All times are UTC


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group