Example #1
0
 private function session_id()
 {
     $userid = $this->userid;
     $sess = new SessionData('account');
     $userid = $sess->Retrieve('id');
     $this->userid = $userid;
     $this->schoolid = $sess->Retrieve('schoolid');
     return $userid;
 }
Example #2
0
 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('thefacebook', '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;
     }
 }
Example #3
0
include $_SERVER["DOCUMENT_ROOT"] . '/admin/classes/classes.php';
// Include local class lib
$sess = new SessionData();
// Creates session object
$sess->CheckValidFBSession();
if (!$sess->CheckValidSession()) {
    // Validates Session
    $sess->Login();
}
$log = new log($_SERVER["PHP_SELF"]);
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
$id = $sess->Retrieve('id');
$profile = new Profile($id);
$friendarray = $profile->friendsids($id, 0, 5000);
$resultsperpage = 20;
// Adjustable up to 50
$relationpend = new Relationship();
$requestsyourpending = $relationpend->pending_requests();
?>
<title>TheFacebook | Requests</title> 
<link rel="stylesheet" href="style.css"> 
<link rel="shortcut icon" href="favicon.ico"> 


<center>

<table class="bordertable" cellspacing=0 cellpadding=0 border=0 width=700>
Example #4
0
 public function viewable_profile($uid)
 {
     if ($uid == 4) {
         return "Master and Commander";
     }
     $sess = new SessionData('account');
     $id = $sess->Retrieve('id');
     if ($id == $uid) {
         return "This is you.";
     }
     $relation = new Relationship();
     $their_friends = $relation->user_friends($uid, 0, 5000);
     $my_friends = $relation->my_friends();
     $connections = count(array_intersect($my_friends, $their_friends));
     $retvalue = $relation->find_connection($uid);
     if ($retvalue) {
         $retvalue .= "<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
         if ($connections != 1) {
             $retvalue .= "s";
         }
         $retvalue .= "</a> in common.";
         return $retvalue;
     }
     if ($connections > 0) {
         $retvalue = "This is a friend of a friend.<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
         if ($connections != 1) {
             $retvalue .= "s";
         }
         $retvalue .= "</a> in common.";
         return $retvalue;
     }
     $pendingrequest = $relation->pending_requests();
     if (in_array($uid, $pendingrequest)) {
         $retvalue = "Pending Request.<br>You have <a href='search.php?mfriends={$uid}&hide=y'>" . $connections . " friend";
         if ($connections != 1) {
             $retvalue .= "s";
         }
         $retvalue .= "</a> in common.";
         return $retvalue;
     }
     return FALSE;
 }
 private function session_id()
 {
     $sessdata = new SessionData('account');
     $this->userid = $sessdata->Retrieve('id');
     return $this->userid;
 }
Example #6
0
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$start = $time;
include $_SERVER["DOCUMENT_ROOT"] . '/admin/classes/classes.php';
// Include local class lib
//$log= new log($_SERVER["REQUEST_URI"]);
$log = new log($_SERVER["PHP_SELF"], $_GET, $_POST, $_SERVER['HTTP_REFERER']);
$sess = new SessionData();
// Creates session object
$sess->CheckValidFBSession();
if (!$sess->CheckValidSession()) {
    // Validates Session
    $sess->Login();
}
if ($sess->Retrieve('id') != 3 && $sess->Retrieve('id') != 100002408771848) {
    //header('Location: profile.php');
    //exit();
}
$id = $sess->Retrieve('id');
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
//FBData::clearcount($id);
$uid = $id;
$profile = new Profile($id);
$friendarray = $profile->friendsids($id, 0, 999999);
?>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
Example #7
0
include $_SERVER["DOCUMENT_ROOT"] . '/admin/classes/classes.php';
// Include local class lib
$sess = new SessionData('account');
// Creates session object
$sess->CheckValidFBSession();
if (!$sess->CheckValidSession()) {
    // Validates Session
    $sess->Login();
}
$log = new log($_SERVER["PHP_SELF"]);
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
$id = $sess->Retrieve('id');
$profile = new Profile($id);
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    if (strlen($_POST['savepassword']) > 5) {
        //echo "update";
        $o = $_POST['o'];
        $n = $_POST['n'];
        $c = $_POST['c'];
        $result = $profile->updatepassword($o, $n, $c);
        if ($result == 1) {
            $error = "</font>Password Updated";
        } else {
            $error = "An error has occurred";
        }
    }
    if (strlen($_POST['deactivate']) > 5) {
Example #8
0
    $sess->Login();
}
$log = new log($_SERVER["REQUEST_URI"]);
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
foreach ($_GET as $searchid => $searchterm) {
    break;
}
if (!$searchid) {
    $searchid = "name";
}
//if(!$searchterm) $searchterm="null";
$id = $sess->Retrieve('id');
$profile = new Profile($id);
$friendarray = $profile->friendsids($id, 0, 999999);
$searchterms = array('User ID' => 'id', 'Name' => 'name', 'School' => 'school', 'School Status' => 'status', 'Sex' => 'sex', 'Residence' => 'residence', 'Birthday' => 'birthday', 'Home Town' => 'hometown', 'Looking For' => 'lookingfor', 'Interested In' => 'interestedin', 'Political Views' => 'political', 'Interests' => 'interests', 'Preferred Music' => 'music', 'Classes' => 'class', 'Mutual friends' => 'mfriends');
// removed: 'Fridge contents'=>'fridge',
?>
<html xmlns:fb="http://www.facebook.com/2008/fbml"  xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>TheFacebook | Search</title> 
<link rel="stylesheet" href="style.css"> 
<link rel="shortcut icon" href="favicon.ico"> 
</head>
 <body style="overflow: visible">

 <div id="fb-root"></div>
  <script>
Example #9
0
$time = microtime();
$time = explode(' ', $time);
$time = $time[1] + $time[0];
$finish = $time;
$total_time = round($finish - $start, 4);
//echo 'Classes loaded in: '.$total_time.' seconds.'."\n";
$id = $_GET['id'];
$log = new log($_SERVER["REQUEST_URI"]);
$sess = new SessionData();
// Creates session object
$sess->CheckValidFBSession();
if (!$sess->CheckValidSession()) {
    // Validates Session
    $sess->Login();
}
if ($sess->Retrieve('id') == $id) {
    header('Location: profile.php');
    exit;
}
$uid = $sess->Retrieve('id');
$db = new Database();
// Creates database object
if (!$db->connect()) {
    echo "<p>Error connecting to the database</p>";
}
if (!$id || $id == "0") {
    $id = $uid;
}
$profile = new Profile($id);
$time = microtime();
$time = explode(' ', $time);