-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathindex.php
executable file
·87 lines (65 loc) · 2.2 KB
/
index.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/*
Twando.com Free PHP Twitter Application
http://www.twando.com/
*/
include('inc/include_top.php');
//Set return page
if (strip_tags($_POST['return_url'] != "")) {
$return_url = strip_tags($_POST['return_url']);
} else {
$return_url = "";
}
$response_msg = "";
if (isset($_POST['a'])) {
//Set login
if ($_POST['a'] == 'login2') {
//Set
$_POST['username_login'] = strip_tags(trim($_POST['username_login']));
$_POST['password_login'] = strip_tags(trim($_POST['password_login']));
//Check Credentials
if ( ($_POST['username_login'] != LOGIN_USER) or ($_POST['password_login'] != LOGIN_PASSWORD) ) {
$error_array['message'] = mainFuncs::push_response(5);
} else {
//Set cookies
$_SESSION['twando_username'] = $_POST['username_login'];
//Redirect
header("Location: " . BASE_LINK_URL . $return_url);
//End of do login sequence
}
}
}
//Check if logged in
if (mainFuncs::is_logged_in() != true) {
$page_select = "not_logged_in";
} else {
$page_select = "index";
}
if (isset($_POST['a'])) {
//Do save keys update
if ($_POST['a'] == 'savekeys2') {
//Set
$_POST['consumer_key'] = strip_tags(trim($_POST['consumer_key']));
$_POST['consumer_secret'] = strip_tags(trim($_POST['consumer_secret']));
//Check if in DB
$q1 = $db->query("SELECT * FROM " . DB_PREFIX . "ap_settings WHERE id='twando'");
if ($db->num_rows($q1) == 0) {
//Insert
$db->query("INSERT INTO " . DB_PREFIX . "ap_settings (id,consumer_key,consumer_secret) VALUES
('twando','" . $db->prep($_POST['consumer_key']) . "','" . $db->prep($_POST['consumer_secret']) . "')");
} else {
//Update
$db->query("UPDATE " . DB_PREFIX . "ap_settings SET consumer_key='" . $db->prep($_POST['consumer_key']) . "', consumer_secret='" . $db->prep($_POST['consumer_secret']) . "'
WHERE id='twando'");
}
//End of keys update
}
}
//Check if we need to load twitter api box here
$ap_creds = @$db->get_ap_creds();
if ( ($ap_creds['consumer_key']) and ($ap_creds['consumer_secret']) ) {
$header_info['on_load'] = "ajax_index_update('0','0');";
}
mainFuncs::print_html($page_select);
include('inc/include_bottom.php');
?>