Can't Register Twice

Status
Not open for further replies.

wwemsc13

New Member
Sep 11, 2010
23
0
I tried to register myself an account on a RevCMS retro I just made. But it comes up with the problem saying "Sorry, you can't register Twice". Any suggestions?
 

Attachments

  • Register Problem.png
    Register Problem.png
    23.8 KB · Views: 58

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,907
Hey,

Go to; app/class.users.php find 'register' and scroll down in that function and you should see 'Sorry, you can't register Twice' remove that and the code that operates it.
 

wwemsc13

New Member
Sep 11, 2010
23
0
Hey,

Go to; app/class.users.php find 'register' and scroll down in that function and you should see 'Sorry, you can't register Twice' remove that and the code that operates it.


What do I remove?

PHP:
if(!isset($template->form->reg_gender)) { $template->form->reg_gender = 'M'; }
                                            if(!isset($template->form->reg_figure)) { $template->form->reg_figure = $_CONFIG['hotel']['figure']; }
                                 
                                            $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));
                     
                                            $this->turnOn($template->form->reg_username);
                             
                                            header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                                            exit;
                                        }
                                        else
                                        {
                                            $template->form->error = 'Sorry, but you cannot register twice';
                                        }

Copy and paste the whole register() function and I'll do it for you.


Alright. here is is.

PHP:
  final public function register()
    {
        global $core, $template, $_CONFIG;
     
        if(isset($_POST['register']))
        {
            unset($template->form->error);
         
            $template->form->setData();
             
            if($this->validName($template->form->reg_username))
            {
                if(!$this->nameTaken($template->form->reg_username))
                {
                    if($this->validEmail($template->form->reg_email))
                    {
                        if(!$this->emailTaken($template->form->reg_email))
                        {
                            if(strlen($template->form->reg_password) > 6)
                            {
                                if($template->form->reg_password == $template->form->reg_rep_password)
                                {
                                    if(isset($template->form->reg_seckey))
                                    {
                                        if($this->validSecKey($template->form->reg_seckey))
                                        {
                                            //Continue
                                        }
                                        else
                                        {
                                            $template->form->error = 'Secret key must only have 4 numbers';
                                            return;
                                        }
                                    }
                                    if($this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                                    {
                                        if(!$this->hasClones($_SERVER['REMOTE_ADDR']))
                                        {
                                            if(!isset($template->form->reg_gender)) { $template->form->reg_gender = 'M'; }
                                            if(!isset($template->form->reg_figure)) { $template->form->reg_figure = $_CONFIG['hotel']['figure']; }
                                     
                                            $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));
                         
                                            $this->turnOn($template->form->reg_username);
                                 
                                            header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                                            exit;
                                        }
                                        else
                                        {
                                            $template->form->error = 'Sorry, but you cannot register twice';
                                        }
                                    }
                                    else
                                    {
                                        $template->form->error = 'Sorry, it appears you are IP banned.<br />';
                                        $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']);
                                        return;
                                    }
                                }
                                else 
                                {
                                    $template->form->error = 'Password does not match repeated password';
                                    return;
                                }
 
                            }
                            else
                            {
                                $template->form->error = 'Password must have more than 6 characters';
                                return;
                            }
                        }
                        else
                        {
                            $template->form->error = 'Email: <b>' . $template->form->reg_email . '</b> is already registered';
                            return;
                        }
                    }
                    else
                    {
                        $template->form->error = 'Email is not valid';
                        return;
                    }
                }
                else
                {
                    $template->form->error = 'Username is already registered';
                    return;
                }
            }
            else
            {
                $template->form->error = 'Username is invalid';
                return;
            }
        }
    }

Thanks a lot!
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,907
This should work:
PHP:
  final public function register()
    {
        global $core, $template, $_CONFIG;
   
        if(isset($_POST['register']))
        {
            unset($template->form->error);
       
            $template->form->setData();
           
            if($this->validName($template->form->reg_username))
            {
                if(!$this->nameTaken($template->form->reg_username))
                {
                    if($this->validEmail($template->form->reg_email))
                    {
                        if(!$this->emailTaken($template->form->reg_email))
                        {
                            if(strlen($template->form->reg_password) > 6)
                            {
                                if($template->form->reg_password == $template->form->reg_rep_password)
                                {
                                    if(isset($template->form->reg_seckey))
                                    {
                                        if($this->validSecKey($template->form->reg_seckey))
                                        {
                                            //Continue
                                        }
                                        else
                                        {
                                            $template->form->error = 'Secret key must only have 4 numbers';
                                            return;
                                        }
                                    }
                                    if($this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                                    {
                                            if(!isset($template->form->reg_gender)) { $template->form->reg_gender = 'M'; }
                                            if(!isset($template->form->reg_figure)) { $template->form->reg_figure = $_CONFIG['hotel']['figure']; }
                                   
                                            $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));
                       
                                            $this->turnOn($template->form->reg_username);
                               
                                            header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                                            exit;
                                    }
                                    else
                                    {
                                        $template->form->error = 'Sorry, it appears you are IP banned.<br />';
                                        $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']);
                                        return;
                                    }
                                }
                                else
                                {
                                    $template->form->error = 'Password does not match repeated password';
                                    return;
                                }
 
                            }
                            else
                            {
                                $template->form->error = 'Password must have more than 6 characters';
                                return;
                            }
                        }
                        else
                        {
                            $template->form->error = 'Email: <b>' . $template->form->reg_email . '</b> is already registered';
                            return;
                        }
                    }
                    else
                    {
                        $template->form->error = 'Email is not valid';
                        return;
                    }
                }
                else
                {
                    $template->form->error = 'Username is already registered';
                    return;
                }
            }
            else
            {
                $template->form->error = 'Username is invalid';
                return;
            }
        }
    }
 

wwemsc13

New Member
Sep 11, 2010
23
0
This should work:
PHP:
  final public function register()
    {
        global $core, $template, $_CONFIG;
 
        if(isset($_POST['register']))
        {
            unset($template->form->error);
     
            $template->form->setData();
         
            if($this->validName($template->form->reg_username))
            {
                if(!$this->nameTaken($template->form->reg_username))
                {
                    if($this->validEmail($template->form->reg_email))
                    {
                        if(!$this->emailTaken($template->form->reg_email))
                        {
                            if(strlen($template->form->reg_password) > 6)
                            {
                                if($template->form->reg_password == $template->form->reg_rep_password)
                                {
                                    if(isset($template->form->reg_seckey))
                                    {
                                        if($this->validSecKey($template->form->reg_seckey))
                                        {
                                            //Continue
                                        }
                                        else
                                        {
                                            $template->form->error = 'Secret key must only have 4 numbers';
                                            return;
                                        }
                                    }
                                    if($this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                                    {
                                            if(!isset($template->form->reg_gender)) { $template->form->reg_gender = 'M'; }
                                            if(!isset($template->form->reg_figure)) { $template->form->reg_figure = $_CONFIG['hotel']['figure']; }
                                 
                                            $this->addUser($template->form->reg_username, $core->hashed($template->form->reg_password), $template->form->reg_email, $_CONFIG['hotel']['motto'], $_CONFIG['hotel']['credits'], $_CONFIG['hotel']['pixels'], 1, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));
                     
                                            $this->turnOn($template->form->reg_username);
                             
                                            header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                                            exit;
                                    }
                                    else
                                    {
                                        $template->form->error = 'Sorry, it appears you are IP banned.<br />';
                                        $template->form->error .= 'Reason: ' . $this->getReason($_SERVER['REMOTE_ADDR']);
                                        return;
                                    }
                                }
                                else
                                {
                                    $template->form->error = 'Password does not match repeated password';
                                    return;
                                }
 
                            }
                            else
                            {
                                $template->form->error = 'Password must have more than 6 characters';
                                return;
                            }
                        }
                        else
                        {
                            $template->form->error = 'Email: <b>' . $template->form->reg_email . '</b> is already registered';
                            return;
                        }
                    }
                    else
                    {
                        $template->form->error = 'Email is not valid';
                        return;
                    }
                }
                else
                {
                    $template->form->error = 'Username is already registered';
                    return;
                }
            }
            else
            {
                $template->form->error = 'Username is invalid';
                return;
            }
        }
    }

Thank you!! it worked. But when I open my client, I get redirected to localhost/client.php instead of localhost/client. How do i change that? The client only works when the link is localhost/client.
 
Status
Not open for further replies.

Users who are viewing this thread

Top