[HELP] Setting Default User Rank

Clit

Posting Freak
Feb 25, 2012
1,065
103
Using RevCMS and Phoenix Database.
How can I change the Default User Rank so it is not Rank 1.
I would like it to be Rank 2.
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Open up app/class.users.php.

Search for;
'$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));'

(It's on the register function).

And change it to this;

'$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'], 2, $template->form->reg_figure, $template->form->reg_gender, $core->hashed($template->form->reg_key));'

Now all your users will sign up as rank 2.
 

Clit

Posting Freak
Feb 25, 2012
1,065
103
Creg, appreciate the reply, but that is no where in any document in my wwwroot,

here is this,
PHP:
/*-------------------------------Login or Register user-------------------------------------*/
   
    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;
            }
        }
    }   
   
    final public function login()
    {
        global $template, $_CONFIG, $core;
       
        if(isset($_POST['login']))
        {
            $template->form->setData();
            unset($template->form->error);
           
            if($this->nameTaken($template->form->log_username))
            {
                if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                {
                    if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))
                    {
                        $this->turnOn($template->form->log_username);
                        $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
                        $template->form->unsetData();
                        header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                        exit;
                    }
                    else
                    {
                        $template->form->error = 'Details do not match';
                        return;
                    }
                }
                else
                {
                    $template->form->error = 'Sorry, it appears this user is banned<br />';
                    $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username);
                    return;
                }
            }
            else
            {
                $template->form->error = 'Username does not exist';
                return;
            }
        }
    }
   
    final public function loginHK()
    {
        global $template, $_CONFIG, $core;
       
        if(isset($_POST['login']))
        {   
            $template->form->setData();
            unset($template->form->error);
           
            if(isset($template->form->username) && isset($template->form->password))
            {
                if($this->nameTaken($template->form->username))
                {   
                    if($this->userValidation($template->form->username, $core->hashed($template->form->password)))
                    {
                        if(($this->getInfo($_SESSION['user']['id'], 'rank')) >= 4)
                        {
                            $_SESSION["in_hk"] = true;
                            header("Location:".$_CONFIG['hotel']['url']."/ase/index.php?url=dash");
                            exit;
                        }
                        else
                        {
                            $template->form->error = 'Incorrect access level.';
                            return;
                        }
                    }
                    else
                    {
                        $template->form->error = 'Incorrect password.';
                        return;
                    }       
                }
                else
                {
                    $template->form->error = 'User does not exist.';
                    return;
                }
            }
   
            $template->form->unsetData();
        }
    }   
   
    final public function help()
    {
        global $template, $_CONFIG;
        $template->form->setData();
       
        if(isset($template->form->help))
        {
            $to = $_CONFIG['hotel']['email'];
            $subject = "Help from RevCMS user - " . $this->getInfo($_SESSION['user']['id'], 'username');
            $body = $template->form->question;
               
            if (mail($to, $subject, $body))
            {
                $template->form->error = 'Message successfully sent! We will answer you shortly!';
            }
            else
            {
                  $template->form->error = 'Message delivery failed.';
            }
        }
    }
 

Sledmore

Chaturbate Livestreamer
Staff member
FindRetros Moderator
Jul 24, 2010
5,195
3,906
Creg, appreciate the reply, but that is no where in any document in my wwwroot,

here is this,

- Removed -

I can see it right there, btw you only needed to paste one function, but anyways I've done it for you, replace ALL of that, that you just pasted with this:

PHP:
/*-------------------------------Login or Register user-------------------------------------*/
 
    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'], 2, $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;
            }
        }
    } 
 
    final public function login()
    {
        global $template, $_CONFIG, $core;
     
        if(isset($_POST['login']))
        {
            $template->form->setData();
            unset($template->form->error);
         
            if($this->nameTaken($template->form->log_username))
            {
                if($this->isBanned($template->form->log_username) == false || $this->isBanned($_SERVER['REMOTE_ADDR']) == false)
                {
                    if($this->userValidation($template->form->log_username, $core->hashed($template->form->log_password)))
                    {
                        $this->turnOn($template->form->log_username);
                        $this->updateUser($_SESSION['user']['id'], 'ip_last', $_SERVER['REMOTE_ADDR']);
                        $template->form->unsetData();
                        header('Location: ' . $_CONFIG['hotel']['url'] . '/me');
                        exit;
                    }
                    else
                    {
                        $template->form->error = 'Details do not match';
                        return;
                    }
                }
                else
                {
                    $template->form->error = 'Sorry, it appears this user is banned<br />';
                    $template->form->error .= 'Reason: ' . $this->getReason($template->form->log_username);
                    return;
                }
            }
            else
            {
                $template->form->error = 'Username does not exist';
                return;
            }
        }
    }
 
    final public function loginHK()
    {
        global $template, $_CONFIG, $core;
     
        if(isset($_POST['login']))
        { 
            $template->form->setData();
            unset($template->form->error);
         
            if(isset($template->form->username) && isset($template->form->password))
            {
                if($this->nameTaken($template->form->username))
                { 
                    if($this->userValidation($template->form->username, $core->hashed($template->form->password)))
                    {
                        if(($this->getInfo($_SESSION['user']['id'], 'rank')) >= 4)
                        {
                            $_SESSION["in_hk"] = true;
                            header("Location:".$_CONFIG['hotel']['url']."/ase/index.php?url=dash");
                            exit;
                        }
                        else
                        {
                            $template->form->error = 'Incorrect access level.';
                            return;
                        }
                    }
                    else
                    {
                        $template->form->error = 'Incorrect password.';
                        return;
                    }     
                }
                else
                {
                    $template->form->error = 'User does not exist.';
                    return;
                }
            }
 
            $template->form->unsetData();
        }
    } 
 
    final public function help()
    {
        global $template, $_CONFIG;
        $template->form->setData();
     
        if(isset($template->form->help))
        {
            $to = $_CONFIG['hotel']['email'];
            $subject = "Help from RevCMS user - " . $this->getInfo($_SESSION['user']['id'], 'username');
            $body = $template->form->question;
             
            if (mail($to, $subject, $body))
            {
                $template->form->error = 'Message successfully sent! We will answer you shortly!';
            }
            else
            {
                  $template->form->error = 'Message delivery failed.';
            }
        }
    }
 

Clit

Posting Freak
Feb 25, 2012
1,065
103
Can you tell me where I can change the amount of times a person can register, I know that it is set to 1 right now. Nobody can register more than one account.
 

Users who are viewing this thread

Top