-
Notifications
You must be signed in to change notification settings - Fork 30
/
actions.php
47 lines (36 loc) · 1.21 KB
/
actions.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
<?php
namespace phpListRestapi;
class Actions {
/**
* <p>Function to call for login.<p>
* <p><strong>Parameters:</strong><br/>
* [*login] {string} loginname as an admin to phpList<br/>
* [*password] {string} the password
* </p>
*/
static function login() {
Response::outputMessage( 'Welcome!' );
}
/**
* <p>Processes the Message Queue in phpList.<br/>
* Perhaps this is done via CRON or manually through the admin interface?</p>
* <p><strong>Parameters:</strong><br/>
* [*login] {string} loginname as an admin to phpList<br/>
* [*password] {string} the password
*
*/
static function processQueue() {
$admin_id = $_SESSION["logindetails"]["id"];
$url = Common::apiUrl( $_SERVER['HTTP_HOST'] );
$url = str_replace( 'page=call&pi=restapi', 'page=processqueue&login=' . $login . '&password=' . $password . '&ajax=1', $url );
//open connection
//ob_start();
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
$result = curl_exec($ch);
//clean up
curl_close($ch);
//ob_end_clean();
Response::outputMessage( 'Queue is processed!' );
}
}