Mysidia Adoptables v1.3.2[Security Release]

Forum
Last Post
Threads / Messages
Status
Not open for further replies.
Well your webhost is running PHP 5.2, right? Are you running a VPS server? If so, ask your server provider to upgrade PHP, thats the best way to resolve the problem.

But anyway, you probably do not need the UserCreator/MemberCreator/VisitorCreator classes if you only need the adoptshop feature.
 
You mean the 'cannot inherit' error? Well thats what happens with PHP 5.2, its incompatible with Mys v1.3.2. There's a simple fix though, you just have to edit the UserCreator and remove the 'implements Creator' part. But keep in mind that in a long run you have to use PHP 5.3 anyway, Mys v1.4.0 will not support PHP 5.2 at all.
 
Actually I posted a solution before:
http://www.mysidiaadoptables.com/forum/showpost.php?p=25038&postcount=5

This will get rid of the Creator method inherit error, but wont fix all incompatibility issue with PHP 5.2. I recommend you not to use all script files from Mys v1.3.2, just choose whatever you need to add the features. Like I told you, you shouldnt even need to touch these Creator type classes if you just want to add the adoptshop. You are overkilling by importing way too many classes from Mys v1.3.2 that does not really help you anything.
 
Well I had to keep adding in files. I'm only trying to add in what is needed but I'm not sure what IS needed.

Now I have this :/
Parse error: syntax error, unexpected T_PROTECTED in /home/taleofdr/public_html/classes/abstract/abstract_usercreator.php on line 33
 
Well post the UserCreator.php file and I will find out the problem for ya. Looks like you did not edit the file correctly, something is missing.
 
I fixed it.... getting this. *sigh*

Fatal error: Declaration of Member::login() must be compatible with that of User::login() in /home/taleofdr/public_html/classes/class_member.php on line 3
 
Done and now:
Parse error: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM in /home/taleofdr/public_html/classes/class_input.php on line 120

What on earth? lol
 
???
Code:
<?php

abstract class User{
  // The abstract class User
  public $uid = 0;
  public $username;
  public $ip;
  public $usergroup;
  public $lastactivity;
  
  public function getid(){
     return $this->uid;
  }

  public function getusername(){
     return $this->username;
  }
  
  public function getcurrentip(){
     return $this->ip;
  }
  
  public function getgroupid(){
     if(is_numeric($this->usergroup)) return $this->usergroup;
     else return $this->usergroup->gid;
  }
  
  public function getgroup(){
     return $this->usergroup;
  }
  
  public function lastactivity(){
     return $this->lastactivity;
  }
  
  
  public function isbanned(){
     // will be added later
  }
  
}
?>
 
Well I said you need to look into classes/class_input and search for line 120 that seems to be malfunctioning. It seems to have two colons that cause the trouble, you need to remove them.
 
I removed one and got Parse error: syntax error, unexpected ':' in /home/taleofdr/public_html/classes/class_input.php on line 120
 
I did. Still got an error.
Parse error: syntax error, unexpected T_VARIABLE in /home/taleofdr/public_html/classes/class_input.php on line 120

I'm starting to think I won't be able to add in the adopt shop :/

Code:
<?php

/**
 * The Input Class, it is one of Mysidia system core classes.
 * It acts as a secure wrapper for user input in $_GET and $_POST.
 * Input is a final class, no child class shall derive from it.
 * An instance of Input class is generated upon Mysidia system object's creation. 
 * This specific instance is available from Registry, just like any other Mysidia core objects. 
 * @category Resource
 * @package Core
 * @author Hall of Famer 
 * @copyright Mysidia Adoptables Script
 * @link http://www.mysidiaadoptables.com
 * @since 1.3.2
 * @todo incorporate input class in Mysidia adoptables system.
 */

final class Input{

    /**
	 * The request property, which holds request method information: get, post or else.
	 * @access public
	 * @var String
    */
    public $request;
	
	/**
	 * The post property, it stores all user input vars in $_POST.
	 * @access private
	 * @var ArrayObject
    */
    private $post; 
	
	/**
	 * The get property, it stores all user input vars in $_GET.
	 * @access private
	 * @var ArrayObject
    */
    private $get;
	
	/**
	 * The action property, which specifies users action.
	 * @access private
	 * @var String
    */
    private $action;

	
	/**
     * Constructor of Input Class, it generates basic properties for an input object.
     * @access public
     * @return Void
     */	 
    public function __construct(){	 
        $this->checkrequest();
	    $this->initialize();
    }
  
    /**
     * The initialize method, which handles parsing of user input vars.
     * @access public
     * @return Void
     */
    public function initialize(){
	    if(isset($_POST)){
	        $post = array_map('secure',$_POST);
		    $this->post = new ArrayObject($post, ArrayObject::ARRAY_AS_PROPS);
		    if(isset($this->post->action)) $this->action = $this->post->action;
            unset($_POST);     
	    }
	    if(isset($_GET)){ 
	        $get = array_map('secure',$_GET);
	        $this->get = new ArrayObject($get, ArrayObject::ARRAY_AS_PROPS);
		    if(isset($this->get->action)) $this->action = $this->get->action;
            unset($_GET);
	    }
        if(defined("SUBDIR")){
            $parser = new UrlParser($_SERVER['REQUEST_URI']);
			$elements = $parser->parse();
			$get = array_map('secure', $elements);
			$this->get = new ArrayObject($get, ArrayObject::ARRAY_AS_PROPS);
            if(isset($this->get->action)) $this->action = $this->get->action;
        }		
    }
  
    /**
     * The post method, returns a user input var stored in Input::$post property.
	 * @param String  $key
     * @access public
     * @return Object
     */
    public function post($key = ""){
        if(empty($key) and !empty($this->post)) return $this->post;
	    elseif(isset($this->post->{$key})) return $this->post->{$key};
	    else return FALSE;
    }
  
    /**
     * The get method, returns a user input var stored in Input::$get property.
	 * @param String  $key
     * @access public
     * @return Object
     */
    public function get($key = ""){
        if(empty($key) and !empty($this->get)) return $this->get;
	    elseif(isset($this->get->{$key})) return $this->get->{$key};
	    else return FALSE;    
    }

    /**
     * The manipulate method, set values in a get variable from post variable.
     * This can be manipulated by controller objects.
     * It serves as a temporary solution to url rewrite problem with get forms.
	 * @param String  $controller
     * @access public
     * @return Void
     */
    public function manipulate($controller){
        if(!($controller instanceof AppController)) throw new Exception("Controller not found.");
        elseif(is_array($controller::$param)){
            foreach($controller::$param as $key){
                if($this->post->{$key}) $this->get->{$key} = $this->post->{$key};
            }
        }
        else{
            $key = $controller::$param;
            if($this->post->{$key}) $this->get->{$key} = $this->post->{$key};
        }   
    }
  
    /**
     * The action method, verifies whether a specified action is taken by this user.
	 * @param String  $act
     * @access private
     * @return Boolean
     */
    public function action(){
        if(empty($this->action)) return FALSE;
	    else return $this->action;
    }
  
    /**
     * The checkrequest method, checks to see the request method of a particular user
     * @access private
     * @return Boolean
     */
    private function checkrequest(){
        // This method checks if there is user input, and returns the request_method if evaluated to be true
        if($_SERVER['REQUEST_METHOD'] == "POST"){
  	        $this->request = "post";
		    return TRUE;
	    }	
	    elseif($_SERVER['REQUEST_METHOD'] == "GET"){
	        $this->request = "get";
		    return TRUE;
	    }	
	    else $this->request = FALSE;
    }
  
    /**
     * The secure method, parse user input in a safe manner.
	 * @param Array  $data
     * @access private
     * @return ArrayObject
     */
    private function secure($data){
        if(is_array($data) and SUBDIR != "AdminCP") die("Hacking Attempt!");
	    $data = htmlentities($data);
        $data = addslashes($data);	
	    $data = strip_tags($data, '');
	    return $data;
    }  
}
?>
 
I see, you dont have a controller object, and thus the double colons are invalid. You shouldnt be using the input class at all, get rid of it and see what happens.
 
Ok where is it and what exact part? Sorry, I don't want to mess anything up and I'm not familiar with it at all.
 
Status
Not open for further replies.

Users who are viewing this thread

  • Forum Contains New Posts
  • Forum Contains No New Posts

Forum statistics

Threads
4,274
Messages
33,114
Members
1,602
Latest member
BerrieMilk
BETA

Latest Threads

Latest Posts

Top