-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathadmin.php
211 lines (187 loc) · 8.45 KB
/
admin.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
<?PHP
/*========================================================================================*\
# Coder : Ian Newton
# Date : 24th May,2011
# Test version
# itest controller to send and display responses to simulate admin end
\*=========================================================================================*/
require_once("./lib/config0.php");
require_once("./lib/classes/output.class.php");
$mysqli = new mysqli($dbLogin['dbhost'], $dbLogin['dbusername'], $dbLogin['dbuserpass'], $dbLogin['dbname']);
$outObj = new Default_Model_Output_Class();
if (isset($_REQUEST['action_select'])) {
if ($_REQUEST['action_select'] == 'transcode-media') {
$fdata[]= array('collection_id'=>'', 'infile'=>'BSG_4.2.avi', 'outfile'=>'BSG_4.2.avi', 'type'=>'utube', 'encode'=>'500kbs', 'count'=>'1');
// $fdata[]= array('collection_id'=>'', 'infile'=>'1443_test/1300469084.wmv', 'outfile'=>'1300469084.wmv', 'type'=>'itunes', 'encode'=>'196kbs', 'count'=>'2');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'transcode-media-and-deliver'){
$fdata[]= array('workflow'=>'screencast-wide', 'source_path'=>'1485_testpodcastbycharles/', 'filename'=>'12604_Wildlife.wmv', 'count'=>'1');
// $fdata[]= array('collection_id'=>'', 'infile'=>'1443_test/1300469084.wmv', 'outfile'=>'1300469084.wmv', 'type'=>'itunes', 'encode'=>'196kbs', 'count'=>'2');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'transfer-file-to-media-server'){
$fdata[]= array('collection_id'=>'', 'infile'=>'dd205-globalised-world-rss2.xml', 'outfile'=>'dd205-globalised-world-rss2.xml', 'type'=>'utube', 'encode'=>'500kbs', 'count'=>'1');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'rename-file-on-media-server'){
$fdata[]= array('collection_id'=>'', 'infile'=>'dd205-globalised-world-rss2.xml', 'outfile'=>'dd205-globalised-world-rss2.xml', 'type'=>'utube', 'encode'=>'500kbs', 'count'=>'1');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'transfer-folder-to-media-server'){
$fdata[]= array('collection_id'=>'', 'foldername'=>'/itunes', 'count'=>'1');
$number=4;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'check-file-exists'){
$fdata[]= array('collection_id'=>'', 'collectionpath'=>'amediacollectionpath', 'fname'=>'firstfile.mp4', 'count'=>'1');
$fdata[]= array('collection_id'=>'', 'collectionpath'=>'amediacollectionpath', 'fname'=>'secondfile.mp4', 'count'=>'2');
$fdata[]= array('collection_id'=>'', 'collectionpath'=>'amediacollectionpath', 'fname'=>'thirdfile.mp4', 'count'=>'3');
$fdata[]= array('collection_id'=>'', 'collectionpath'=>'amediacollectionpath', 'fname'=>'fourthfile.mp4', 'count'=>'4');
$number=4;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'check-folder-exists'){
$fdata[]= array('collection_id'=>'', 'collectionpath'=>'amediacollectionpath', 'count'=>'1');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'update-file-metadata'){
$fdata[]= array('collection_id'=>'',
'folder'=>'/',
'fname'=>'firstfile.mp4',
'account'=>'The account',
'author'=>'The author',
'comments'=>'Some comments here',
'contentId'=>'A content ID',
'expirationDate'=>'24/09/2011',
'releaseDate'=>'24/09/2010',
'revision'=>'1.01',
'securityGroup'=>'secure group',
'title'=>'Title 1',
'type'=>'the data type',
'count'=>'1');
$fdata[]= array('collection_id'=>'',
'folder'=>'/',
'fname'=>'firstfile.mp4',
'account'=>'The account',
'author'=>'The author',
'comments'=>'Some comments here',
'contentId'=>'A content ID',
'expirationDate'=>'24/09/2011',
'releaseDate'=>'24/09/2010',
'revision'=>'1.01',
'securityGroup'=>'secure group',
'title'=>'Title 1',
'type'=>'the data type',
'count'=>'2');
$fdata[]= array('collection_id'=>'',
'folder'=>'/',
'fname'=>'firstfile.mp4',
'account'=>'The account',
'author'=>'The author',
'comments'=>'Some comments here',
'contentId'=>'A content ID',
'expirationDate'=>'24/09/2011',
'releaseDate'=>'24/09/2010',
'revision'=>'1.01',
'securityGroup'=>'secure group',
'title'=>'Title 1',
'type'=>'the data type',
'count'=>'3');
$fdata[]= array('collection_id'=>'',
'folder'=>'/',
'fname'=>'firstfile.mp4',
'account'=>'The account',
'author'=>'The author',
'comments'=>'Some comments here',
'contentId'=>'A content ID',
'expirationDate'=>'24/09/2011',
'releaseDate'=>'24/09/2010',
'revision'=>'1.01',
'securityGroup'=>'secure group',
'title'=>'Title 1',
'type'=>'the data type',
'count'=>'4');
$number=4;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'set-permissions-folder'){
$fdata[]= array('collection_id'=>'', 'foldername'=>'/itunes', 'count'=>'1');
$fdata[]= array('collection_id'=>'', 'foldername'=>'/utube', 'count'=>'2');
$number=2;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'delete-file-on-media-server'){
$fdata[]= array('collection_id'=>'', 'filename'=>'firstfile.mp4', 'count'=>'1');
$fdata[]= array('collection_id'=>'', 'filename'=>'secondfile.mp4', 'count'=>'2');
$fdata[]= array('collection_id'=>'', 'filename'=>'thirdfile.mp4', 'count'=>'3');
$fdata[]= array('collection_id'=>'', 'filename'=>'fourthfile.mp4', 'count'=>'4');
$number=4;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'delete-folder-on-media-server'){
$fdata[]= array('collection_id'=>'', 'foldername'=>'/itunes', 'count'=>'1');
$fdata[]= array('collection_id'=>'', 'foldername'=>'/utube', 'count'=>'2');
$number=2;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'poll-media'){
$fdata[]= array('requested'=>'Status from media?');
$number=1;
$action=$_REQUEST['action_select'];
}else if ($_REQUEST['action_select'] == 'poll-encoder'){
$fdata[]= array('requested'=>'Status from encoder?');
$number=1;
$action=$_REQUEST['action_select'];
}else{
$fdata[]=array('data'=>'some data here!');
$action='status-media';
$number=1;
}
}else{
$fdata=array('data'=>'some data here!');
$action='status-media';
$number=1;
}
// echo $action.", ".$mediaUrl.", ".$fdata.", ".$number;
$result=$outObj->message_send($action, $mediaUrl, $fdata, $number);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Admin post command</title>
<script type="application/x-javascript">
<!--
function submitform()
{
document.getElementById('action').submit();
}
-->
</script>
</head>
<body>
<?PHP
echo "<b>Source: </b>".$adminUrl."<br /><br />";
echo "<b>Destination: </b>".$mediaUrl."<br /><br />";
echo "<b>Command: </b>".$action."<br /><br /><b>Sending: </b>";
print_r(json_encode($fdata));
echo "<br /><br /><b>Returns: </b>";
if (isset($result)) print_r ($result);?>
<br /><br />
<form action="" method="post" enctype="application/x-www-form-urlencoded" name="action" id="action">
<select name="action_select" onchange="javascript:submitform();">
<option value="">Select action ...</option>
<option value="poll-media">Poll Media</option>
<option value="poll-encoder">Poll Encoder</option>
<option value="transcode-media">C - Transcode media</option>
<option value="transcode-media-and-deliver">C - Transcode-media-and-deliver</option>
<option value="transfer-file-to-media-server">C - Transfer-file-to-media-server</option>
<option value="transfer-folder-to-media-server">C - Transfer-folder-to-media-server</option>
<option value="delete-file-on-media-server">D - Delete-file(s)-on-media-server</option>
<option value="delete-folder-on-media-server">D - Delete-folder-on-media-server</option>
<option value="update-file-metadata">U - Update-file(s)-metadata</option>
<option value="rename-file-on-media-server">U - Rename-file(s)-on-mediaserver</option>
<option value="update-folder-metadata">U - Update-folder-metadata</option>
<option value="set-permissions-folder">R - Set-permissions-folder (media-server)</option>
<option value="check-file-exists">D - Check-file(s)-exists (media-server)</option>
<option value="check-folder-exists">D - Check-folder-exists (media-server)</option>
</select>
</form>
<?PHP // phpinfo(); ?>
</body>
</html>