Alright, so I’m getting this on my page:
“Notice: Undefined index: authData in /home/paulmc1/domains/kuarrel.tk/public_html/admin/classes/lib/SessionData.php on line 27 Notice: Undefined index: authData in /home/paulmc1/domains/kuarrel.tk/public_html/admin/classes/lib/SessionData.php on line 29 Notice: Undefined index: HTTP_REFERER in /home/paulmc1/domains/kuarrel.tk/public_html/index.php on line 16 Notice: Undefined index: authData in /home/paulmc1/domains/kuarrel.tk/public_html/admin/classes/lib/SessionData.php on line 27 Notice: Undefined index: authData in /home/paulmc1/domains/kuarrel.tk/public_html/admin/classes/lib/SessionData.php on line 29 Fatal error: Class ‘MongoClient’ not found in /home/paulmc1/domains/kuarrel.tk/public_html/admin/classes/lib/Log.php on line 29”
SessionData.PHP
[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();
$this->authData = $_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(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);
}
}
?>
[/php]
Index.PHP
[php]<?php
//Error Checking
ini_set(‘display_errors’,1);
error_reporting(E_ALL);
include($_SERVER[“DOCUMENT_ROOT”].’/admin/classes/classes.php’); // Include local class lib
$sess = new SessionData(); // Creates session object
//$sess->CheckValidFBSession();
if($sess->CheckValidSession()){
header(‘Location: home.php’);
}
$log= new log($_SERVER[“PHP_SELF”], $_GET, $_POST, $_SERVER[‘HTTP_REFERER’] );
$stats=new Statistics();
$totalusers=$stats->totalscope();
?>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?php echo $sess->fbappid; ?>',
session : <?php echo json_encode($sess->fbsession); ?>, // don't refetch the session when PHP already has it
status : true, // check login status
cookie : true, // enable cookies to allow the server to access the session
xfbml : true // parse XFBML
});
};
(function() {
var e = document.createElement('script');
e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
e.async = true;
document.getElementById('fb-root').appendChild(e);
}());
</script>
Kuarrel | Welcome to Kuarrel!