forked from atutor/adobe_connect
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index_admin.php
executable file
·112 lines (83 loc) · 3.12 KB
/
index_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
<?php
define('AT_INCLUDE_PATH', '../../include/');
require_once(AT_INCLUDE_PATH.'vitals.inc.php');
admin_authenticate(AT_ADMIN_PRIV_ADOBE_CONNECT);
require_once('lib/lib.php');
// save data
if (!empty($_POST['send'])) {
$tmpconfig->adobe_connect_adminpass = $addslashes($_POST['adobe_connect_adminpass']);
$tmpconfig->adobe_connect_adminuser = $addslashes($_POST['adobe_connect_adminuser']);
$tmpconfig->adobe_connect_folderid = (int)$_POST['adobe_connect_folderid'];
$tmpconfig->adobe_connect_host = $addslashes($_POST['adobe_connect_host']);
$tmpconfig->adobe_connect_port = $addslashes($_POST['adobe_connect_port']);
foreach ($tmpconfig as $value) {
if (empty($value)) {
$msg->addError('adobe_connect_fillall');
}
}
if (!$msg->containsErrors()) {
$config = getAdobeConnectConfig();
$inserts = array();
$updates = array();
foreach ($tmpconfig as $name => $value) {
if (!empty($config->$name)) {
$updates[] = " value = '$value' WHERE name = '$name'";
} else {
$inserts[] = " VALUES ('$name', '$value')";
}
}
if (!empty($inserts)) {
$insertsql = "INSERT INTO ".TABLE_PREFIX."config (name, value) ";
foreach ($inserts as $insert) {
$result = mysql_query($insertsql.$insert, $db);
if (!$result) {
die('db insert problem');
}
}
}
if (!empty($updates)) {
foreach ($updates as $update) {
$updatesql = "UPDATE ".TABLE_PREFIX."config SET ";
$result = mysql_query($updatesql.$update, $db);
if (!$result) {
die('db update problem');
}
}
}
if (!$msg->containsErrors()) {
$msg->addFeedback('adobe_connect_saved');
}
header('location: '.$_SERVER["php_self"]);
}
}
// print header
require (AT_INCLUDE_PATH.'header.inc.php');
// get config
if (!empty($_POST['send'])) {
foreach ($tmpconfig as $name => $tmp) {
$acc->$name = $tmp;
}
} else if (!$acc = getAdobeConnectConfig()) {
$acc->adobe_connect_adminpass = '';
$acc->adobe_connect_adminuser = '';
$acc->adobe_connect_folderid = '';
$acc->adobe_connect_host = '';
$acc->adobe_connect_port = '';
}
// print form
echo '<form method="post" action="'.$_SERVER["php_self"].'">';
echo '<div class="input-form">';
foreach ($acc as $name => $value) {
echo '<div class="row">';
echo '<div class="required" title="Required Field">*</div>';
echo '<label for="'.$name.'">'._AT($name).'</label><br/>';
echo '<input type="text" name="'.$name.'" value="'.stripslashes($value).'" size="35" maxlength="70" />';
echo '</div>';
}
echo '<div class="row buttons">';
echo '<input type="submit" name="send" value="'._AT("send").'" />';
echo '</div>';
echo '</form>';
// print footer
require (AT_INCLUDE_PATH.'footer.inc.php');
?>