Mysidia Adoptables Support Forum  

Home Community Mys-Script Creative Off-Topic
Go Back   Mysidia Adoptables Support Forum > Mysidia Adoptables > Questions and Supports

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 11-06-2014, 11:23 PM
ilrak ilrak is offline
Goldfish Fanatic
 
Join Date: Aug 2014
Location: Utah
Posts: 57
Gender: Female
Credits: 11,621
ilrak is on a distinguished road
Default Registration issue

Hi! I'm not sure if anyone else has had this issue or not.

I decided to try and create a second "test" account for my site, but when I go to register, it leads to a blank page.

Here's the code for register:

PHP Code:
<?php

use Resource\Native\String;
use 
Resource\Collection\HashMap;

class 
RegisterController extends AppController{

    public function 
__construct(){
        
parent::__construct("guest");
    }
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");        
        if(
$mysidia->input->post("submit")){
            
$mysidia->session->validate("register");    
            
$validinput = array("username" => $mysidia->input->post("username"), "password" => $mysidia->input->post("pass1"), "email" => $mysidia->input->post("email"), "birthday" => $mysidia->input->post("birthday"), 
                                
"ip" => $mysidia->input->post("ip"), "answer" => $mysidia->input->post("answer"), "tos" => $mysidia->input->post("tos"));
            
$validator = new RegisterValidator($mysidia->user$validinput);
            
$validator->validate();
  
            if(!
$validator->triggererror()){
                
$mysidia->user->register();    
                include(
"inc/config_forums.php");
                if(
$mybbenabled == 1){
                    include_once(
"functions/functions_forums.php");   
                    
mybbregister();
                    
mybbrebuildstats();
                }
                
$mysidia->user->login($mysidia->input->post("username"));
            }
            
$pm = new PrivateMessage(); // Send them a welcoming message
                
$pm->setsender('YourUsernameHere');
                
$pm->setrecipient(htmlentities(addslashes(trim($mysidia->input->post("username")))));
                
$pm->setmessage("Welcome to the pond!""Greetings! Welcome to Auratus! Be sure to come to the forums and send a message to the administrative team for your two, free starter fish! If you have any questions, don't hesitate to ask us!");
                
$pm->post();  
            else throw new 
RegisterException($validator->triggererror());  
            
$mysidia->session->terminate("register");
            return;
        }
        
$mysidia->session->assign("register"1TRUE);        
    }              
}
?>
And the view code for it:
PHP Code:
<?php

class RegisterView extends View{
    
    public function 
index(){
        
$mysidia Registry::get("mysidia");
        
$document $this->document;        
        if(
$mysidia->input->post("submit")){
            
$document->setTitle($this->lang->success_title);
            
$document->addLangvar($this->lang->success.$mysidia->input->post("username").$this->lang->success2);    
            return;
        }

        
$document->setTitle($this->lang->title);
        
$document->addLangvar($this->lang->default);        
        
$registerForm = new Form("regform""""post");
        
        
$requiredField = new FieldSet("required");
        
$requiredField->add(new Legend("Required Info"));
        
$requiredField->add(new Comment("Username: "FALSE"b"));
        
$requiredField->add(new Comment("Your username may be up to 20 characters long with letters, numbers and spaces only."));
        
$requiredField->add(new TextField("username"));
        
$requiredField->add(new Comment("Password: "FALSE"b"));
        
$requiredField->add(new Comment("Your password may be up to 20 characters long and may contain letters, numbers, spaces and special characters. The use of a special character, such as * or ! is recommended for increased security. "));
        
$requiredField->add(new Comment("Enter Password "FALSE));
        
$requiredField->add(new PasswordField("password""pass1"""FALSE));
        
$requiredField->add(new Comment(" Confirm Password "FALSE));
        
$requiredField->add(new PasswordField("password""pass2"""TRUE));
        
$requiredField->add(new Comment("Email Address: "FALSE"b"));
        
$requiredField->add(new Comment("Enter a valid email address for yourself."));
        
$requiredField->add(new PasswordField("email""email"""TRUE));
        
$registerForm->add($requiredField);

        
$additionalField = new FieldSet("additional");
        
$additionalField->add(new Legend("Additional Info"));
        
$additionalField->add(new Comment("Birthday: "FALSE"b"));
        
$additionalField->add(new Comment("(mm/dd/yyyy)"));    
        
$additionalField->add(new TextField("birthday"));
        
$additionalField->add(new Comment("Avatar: "FALSE"b"));
        
$additionalField->add(new Comment("Enter the url of your avatar beginning with http://www."));    
        
$additionalField->add(new TextField("avatar""templates/icons/default_avatar.gif"));
        
$additionalField->add(new Comment("Nickname: "FALSE"b"));
        
$additionalField->add(new Comment("A nickname for yourself, do not use inappropriate words! "));    
        
$additionalField->add(new TextField("nickname"));
        
$additionalField->add(new Comment("Gender: "FALSE"b"));
        
$additionalField->add(new Comment("Male, Female or Not specified"));

        
$genderList = new RadioList("gender");    
        
$genderList->add(new RadioButton("Male""gender""male"));
        
$genderList->add(new RadioButton("Female""gender""female"));
        
$genderList->add(new RadioButton("Unknown""gender""unknown"));
        
$genderList->check("unknown");
        
$additionalField->add($genderList);

        
$additionalField->add(new Comment("Favorite Color: "FALSE"b"));
        
$additionalField->add(new Comment("Your favorite color. Red, Yellow, Blue, who knows? "));    
        
$additionalField->add(new TextField("color"));
        
$additionalField->add(new Comment("Biography: "FALSE"b"));
        
$additionalField->add(new Comment("Enter a bio for yourself, if you want to."));    
        
$additionalField->add(new TextArea("bio"""450));
        
$registerForm->add($additionalField);
        
        
$securityField = new FieldSet("security");
        
$securityField->add(new Legend("Anti-Spam Security Question"));
        
$securityField->add(new Comment("Question: "FALSE"b"));
        
$securityField->add(new Comment($mysidia->settings->securityquestion));
        
$securityField->add(new Comment("Answer: "FALSE"b"));
        
$securityField->add(new TextField("answer"));
        
$securityField->add(new CheckBox("I agree to the <a href='tos' target='_blank'>Terms of Service""tos""yes"));
        
$securityField->add(new PasswordField("hidden""ip"$_SERVER['REMOTE_ADDR'], TRUE));
        
$securityField->add(new Button("Register""submit""submit"));
        
$registerForm->add($securityField);
        
$document->add($registerForm);
    }              
}
?>
I'm really glad I saw this error before I decided to start the alpha! If anyone else knows what might be going on, help would definitely be appreciated!
Reply With Quote
  #2  
Old 11-07-2014, 03:57 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 332,975
Hall of Famer is on a distinguished road
Default

umm a blank page usually indicates a syntax error, are you sure you have never modified the registration script? Also do you have mybb forum integration enabled?
__________________


Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site.
Reply With Quote
  #3  
Old 11-07-2014, 10:46 PM
ilrak ilrak is offline
Goldfish Fanatic
 
Join Date: Aug 2014
Location: Utah
Posts: 57
Gender: Female
Credits: 11,621
ilrak is on a distinguished road
Default

Oddly enough, I did find a missing bracket in an area I didn't change (I had added a pm for people when they register), but then I kept getting an error so I took out this part:

else{throw new RegisterException($validator->triggererror());
$mysidia->session->terminate("register");
return;
}

And now it will open the registration page.
Reply With Quote
  #4  
Old 11-07-2014, 10:52 PM
IntoRain's Avatar
IntoRain IntoRain is offline
Moderator
 
Join Date: Jul 2013
Location: Portugal
Posts: 461
Gender: Female
Credits: 19,370
IntoRain is on a distinguished road
Default

Quote:
Originally Posted by ilrak View Post
Oddly enough, I did find a missing bracket in an area I didn't change (I had added a pm for people when they register), but then I kept getting an error so I took out this part:

else{throw new RegisterException($validator->triggererror());
$mysidia->session->terminate("register");
return;
}

And now it will open the registration page.
Looks like to me you are sending your PM outside the if(!$validator->triggererror()){} condition block, it should be inside. That's why the else{} is giving problems (it has no if() attached to it)
__________________


asp.net stole my soul.
Reply With Quote
  #5  
Old 11-07-2014, 11:21 PM
ilrak ilrak is offline
Goldfish Fanatic
 
Join Date: Aug 2014
Location: Utah
Posts: 57
Gender: Female
Credits: 11,621
ilrak is on a distinguished road
Default

Ahh ok! Thanks! It works perfectly now!
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Registration Validation? Kyttias Questions and Supports 1 04-13-2015 08:05 PM
Forum Registration Alaric Questions and Supports 24 06-05-2013 11:12 AM
reCaptcha on Registration John1 Questions and Supports 2 09-08-2010 11:12 PM
Registration Error SJC Questions and Supports 19 07-01-2009 05:03 PM
Registration exactly33 Suggestions and Feature Requests 1 01-05-2009 11:37 AM


All times are GMT -5. The time now is 02:25 AM.

Currently Active Users: 9589 (0 members and 9589 guests)
Threads: 4,080, Posts: 32,024, Members: 2,016
Welcome to our newest members, jolob.
BETA





What's New?

What's Hot?

What's Popular?


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
vBCommerce I v2.0.0 Gold ©2010, PixelFX Studios
vBCredits I v2.0.0 Gold ©2010, PixelFX Studios
Emoticons by darkmoon3636