Jump to content

Recommended Posts

Notice: Undefined property: SessionData::$authData in /home/paulmc1/xxx/SessionData.php on line 40 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 41 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 42 Notice: Undefined index: HTTP_REFERER in /xxx/index.php on line 16 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 40 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 41 Notice: Undefined property: SessionData::$authData in /xxx/SessionData.php on line 42 

 

Not sure why I'm getting this error. I've already tried troubleshooting it and just ended up failing.

 

Here's my code:

 

SessionData.PHP

<?PHP

//Error Checking
ini_set('display_errors',1); 
error_reporting(E_ALL);

class SessionData{

    function __construct($page = 'default'){
        $this->SetSession($page);
    }


    public function SetSession($page = 'default'){
        $currentCookieParams = session_get_cookie_params(); 

        $rootDomain = 'kuarrel.tk'; 

        session_set_cookie_params( 
            $currentCookieParams["lifetime"], 
            $currentCookieParams["path"], 
            $rootDomain, 
            $currentCookieParams["secure"], 
            $currentCookieParams["httponly"] 
        ); 
        //session_start();
        if(isset($_SESSION['authData'])){ 
            $this->authData = $_SESSION['authData'];
        }
        if(isset($_SESSION['authData'])){ 
            if($_SESSION['authData']['accountstatus']=="-1" && $page=="default"){
                echo $page;
                header("Location: account.php");
                exit();
            }
        }

        //Currently Known Values

        $this->authData['email'];
        $this->authData['id'];
        $this->authData['name'];

}
    public function Retrieve($name){
        if( in_array($name,$this->validSessVars()) && isset($this->authData['name']) ){
            return($this->authData[$name]);
        }
        return(FALSE);
    }

    public function RetrieveAll(){
        return($this->authData);
    }

    private function validSessVars(){
        $valid=array();
        $count=0;
        if(is_array($this->authData))
            foreach($this->authData as $key => $value){
                $valid[$count]=$key;
                $count++;
            }
        return($valid); 
    }


    public function Logout(){
            unset($authData);
            $_SESSION['authData'] = $authData;
            header("Location: http://".$_SERVER["HTTP_HOST"]."/index.php");
            exit();
    }

    public function Login(){
                unset($authData);
                $_SESSION['authData'] = $authData;
                header("Location: http://".$_SERVER["HTTP_HOST"]."/login.php");
                exit();
        }   

    public function CheckValidSession(){
    if(isset($_SESSION['authData'])){ 

      $this->authData = $_SESSION['authData'];
        if(is_array($this->authData)&&$this->authData['id']>0){
            return(TRUE);
        }
        return(FALSE);
    }   
    }

    public function CheckValidFBSession(){
        if (!$this->CheckValidSession()){
            header('location: bind.php');
        }

    }   


    public function CheckValidAdminSession(){
        if($this->authData['accountstatus']==9){
            return(TRUE);
        }
        return(FALSE);
    }   

}

?>
Link to comment
https://forums.phpfreaks.com/topic/286953-undefined-property-sessiondataauthdata/
Share on other sites

Alright, I've fixed those errors but now I'm getting this...

 

Fatal error: Class 'MongoClient' not found in /xxx/Log.php on line 25

 

 

Log.PHP:

<?PHP

//Error Checking
ini_set('display_errors',1); 
 error_reporting(E_ALL);

class log{

	public function __construct($page, $get= '', $post = '', $ref = '') {
	
		$sess = new SessionData('account');	
		if($sess->CheckValidSession()){	
			$userid=$sess->Retrieve('id');
		}else{
			$userid="0";
		}
		
		if($userid=='45403199'){
			return false;
		}
		
		
		if(!$ref) $ref="";
		
		$ip=$_SERVER["REMOTE_ADDR"];
		

		$values=array('page'=>$page,'ip'=>$ip,'userid'=>$userid, 'timestamp'=>(int) time(), 'gets'=>$get, 'posts'=>$post, 'referral'=>$ref); 
		$m = new MongoClient();
		$collection = $m->selectCollection('kuarrel', 'log');
		$collection->insert($values);

		if($ip=='202.94.191.47'||$ip=='202.94.191.13'||$ip=='202.94.191.183'){
			echo "Your address: ".$ip." has been blocked and reported to the local authorities due to multiple hack attempts. Please contact admin@harvardconnection.co if you feel this is an error.";
			die(); 
		}
	}
	
	function lastpage($userid){
		$m = new MongoClient();
			$collection = $m->selectCollection('thefacebook', 'log');
			$cursor = $collection->find(array('userid'=>$userid));
			$cursor->sort(array('timestamp'=>-1))->limit(2);
			$records = iterator_to_array($cursor);
			
			return($records[1]['page']);
	}
	
}
?>
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.