-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathtest.php
More file actions
executable file
·117 lines (92 loc) · 2.8 KB
/
test.php
File metadata and controls
executable file
·117 lines (92 loc) · 2.8 KB
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
$config = parse_ini_file("config.ini");
$url = $config["casurl"];
//echo $url;
$cookie_set_url = $config["cookieurl"];
$data = array('username'=> 'testme@gmail.com','password'=> '$P$BeyKKgqcQCjY28XqSvdamJFpi36l3M/');
$handle = curl_init();
curl_setopt($handle, CURLOPT_URL, $url);
curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);
curl_setopt($handle, CURLOPT_POST, true);
curl_setopt($handle, CURLOPT_POSTFIELDS, $data);
curl_setopt($handle, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($handle, CURLOPT_SSL_VERIFYPEER, 0);
$response = json_decode(curl_exec($handle),TRUE);
print_r($response);
//echo $response['type'];
if($response['type']=="confirmation"){
//echo "hiiii";
//setcookie("tgt",$response['tgt'],time()+3600*24,'/',$cookie_set_url);
setcookie("tgt",$response['tgt'], false, "/", $cookie_set_url);
//setcookie('test', 'This is a test', time() + 3600);
}
if(isset($_COOKIE['tgt'])){
$cookieSet = 'The cookie is ' . $_COOKIE['tgt'];
} else {
$cookieSet = 'No cookie has been set';
}
echo $cookieSet;
?>
<html>
<head><title>cookie</title></head>
<body>
<?php
//define( 'ABSPATH', dirname(__FILE__) . '/' );
//require_once( ABSPATH . 'User.php' );
//require_once( ABSPATH . 'course.php' );
include('User.php');
include('course.php');
//require "User.php";
//require "course.php";
$user=new User();
$course=new Course();
//$courses=$course->get_course("2");
//print_r($courses);
//exit();
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
//define('WP_USE_THEMES', true);
/** Loads the WordPress Environment and Template */
//require('./wp-blog-header.php');
//$courses=$user->list_users("1");
//print_r($courses);
//$response=$user->check_existing_user("33");
//print_r($response);
//print_r($course);
//$response=$course->modules(2);
//var_dump($response);
//echo $response->name;
//echo $response->id;
// foreach($response as $item)
// {
// echo $item->name."<br>";
// }
//$response=$course->modules(2);
//print_r($response);
//$response=$course->create_course(1,"ruby","ruby","ruby");
//print_r($response);
//echo $response["id"];
//$response=$user->create_user(1,"babinasdasdas","babinasdasdas","babinasdasdas$");
//print_r($response);
//echo $response["id"];
//$response=$user->update_user(9,"anand");
//print_r($response);
//echo $response["id"];
//$response=$user->delete_user(1,9);
//print_r($response);
//echo $response["id"];
//$courses=$user->get_course(2);
//print_r($courses);
?>
</body>
</html>
<?php //get_footer(); ?>