-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathajax.php
35 lines (28 loc) · 794 Bytes
/
ajax.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
/**
* File that gets called on AJAX requests to process the sent and requested data.
* @author Matthias Knoll <[email protected]>
* @since 0.2
*/
require 'bootstrap.php';
//Check if a user record exists
if($_POST['checkRecord'] == true){
$fbUser = new FBUser();
$fbUser->getByAttributes(array('fb_uid'=>$_POST['fb_uid']));
}
//save new user
if($_POST['saveUser'] == true){
$fbUser = new FBUser();
$fbUser->save($_POST['user']);
}
//save invited friends
if($_POST['saveFriends'] == true){
$fbUserInvited = new FBUserInvited();
$fbUserInvited->saveFriends($_POST['fb_uid'],$_POST['invited']);
}
//load invited friends
if($_POST['loadInvitedFriends'] == true){
$fbUserInvited = new FBUserInvited();
$fbUserInvited->getByAttributes(array('fb_uid'=>$_POST['fb_uid']));
}
?>