-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
63 lines (41 loc) · 1.33 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
<?php
/*Domenic Bianchi
CIS 2750 Assignment 3
March 17, 2017
This program displays a web interface to display posts from a signle or mutliple streams*/
$counter = 0;
//If a user was added/removed from a set of streams using the button on the login page
if (!empty($_POST['streamList'])) {
//Split the list of streams into array elements
$result2 = explode(",",$_POST['streamList']);
$commandLine = './addauthor ';
//If the user is to be removed from the stream(s)
if ($_POST['authorMode'] == ' Remove Author') {
$commandLine = $commandLine.' '.'"-r" "';
}
else {
$commandLine = $commandLine.'"" "';
}
//Create command that will be used to call the addauthor executable
foreach ($result2 as $argument) {
$commandLine = $commandLine.''.trim($argument).',';
}
if (!empty($_POST['userID2'])) {
$commandLine = $commandLine.'" "'.$_POST['userID2'].'"';
exec($commandLine, $result3);
//Print any response messages to the browser (success, failure, etc)
foreach ($result3 as $text) {
echo $text."\n";
}
}
}
//Load web page content
exec('./a3 index.wpml', $result);
foreach($result as $text) {
//Add any values that will need to be passed between webpages
if ($text == "</form>") {
echo "<input type=\"hidden\" name=\"fromLogin\" value=\"1\"/>\n";
}
echo $text."\n";
}
?>