-
Notifications
You must be signed in to change notification settings - Fork 3
/
item_action.php
69 lines (53 loc) · 1.28 KB
/
item_action.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
ob_start();
require_once 'includes.php';
global $DB;
//print_r($user);
$user_in_db = is_user_in_db($user);
if($user_in_db ==0) {
$facebook->redirect("$facebook_canvas_url/install.php");
}
$coin_total = get_coin_total($user);
$buried_coin_total = get_coin_total_buried($user);
$level = get_level($user);
//$how_many_bombs = get_how_many_bombs($user);
//print dashboard();
$item = $_REQUEST['item'];
if($item == "rum") {
$action = get_current_action($user);
$no_captcha = get_no_captcha();
$pass = false;
if (in_array($user, $no_captcha )) {
$pass = true;
}
//echo "action $action pass $pass";
//exit();
if($action != "captcha_complete" && $pass == false) {
update_action($user, "captcha");
$facebook->redirect("$facebook_canvas_url/captcha_page.php?page=item_action.php&item=rum");
}
else { //this means they've completed the captcha
update_action($user, "NULL");
}
$success = drink_rum($user);
if($success == true) {
//echo 'hello';
$facebook->redirect("index.php?msg=drank-rum");
}
else {
$facebook->redirect("index.php");
}
}
else if($item == "ham") {
$success = eat_ham($user);
if($success == true) {
$facebook->redirect("index.php?msg=eat-ham");
}
else {
$facebook->redirect("index.php");
}
}
else {
$facebook->redirect("index.php");
}
?>