18 $production_update =
true;
19 $home_host = substr($_SERVER[
'HTTP_HOST'], 0, strpos($_SERVER[
'HTTP_HOST'],
"."));
24 $production_update = $prodStack;
26 $Remote_Servers[
"www5"][
"IP"] =
"www5.homecu.net";
27 $Remote_Servers[
"www5"][
"host"] =
"www5.homecu.net";
28 $Remote_Servers[
"www5"][
"upd"] = $production_update;
29 $Remote_Servers[
"www5"][
"http_login"] =
true;
31 $Remote_Servers[
"www6"][
"IP"] =
"www6.homecu.net";
32 $Remote_Servers[
"www6"][
"host"] =
"www6.homecu.net";
33 $Remote_Servers[
"www6"][
"upd"] = $production_update;
34 $Remote_Servers[
"www6"][
"http_login"] =
true;
36 $Remote_Servers[
"www3"][
"IP"] =
"www3.homecu.net";
37 $Remote_Servers[
"www3"][
"host"] =
"www3.homecu.net";
38 $Remote_Servers[
"www3"][
"upd"] = $production_update;
39 $Remote_Servers[
"www3"][
"http_login"] =
true;
41 $Remote_Servers[
"www4"][
"IP"] =
"www4.homecu.net";
42 $Remote_Servers[
"www4"][
"host"] =
"www4.homecu.net";
43 $Remote_Servers[
"www4"][
"upd"] =
false;
44 $Remote_Servers[
"www4"][
"http_login"] =
true;
46 $Remote_Servers[
"ivr"][
"IP"] =
"ivr.homecu.net";
47 $Remote_Servers[
"ivr"][
"host"] =
"ivr.homecu.net";
48 $Remote_Servers[
"ivr"][
"upd"] =
false;
49 $Remote_Servers[
"ivr"][
"http_login"] =
true;
52 $Remote_Servers[
"www"][
"IP"] =
"www.homecu.net";
53 $Remote_Servers[
"www"][
"host"] =
"www.homecu.net";
54 $Remote_Servers[
"www"][
"upd"] = $production_update;
55 $Remote_Servers[
"www"][
"http_login"] =
true;
69 $Allowed_Tables[
'cuvndr'][
'tablename'] =
'cuvendors';
70 $Allowed_Tables[
'cuvndr'][
'vendcode'] = array(
"name"=>
"vendor",
"dt"=>
"C",
"len"=>15,
"key"=>1);
71 $Allowed_Tables[
'cuvndr'][
'venddesc'] = array(
"name"=>
"venddesc",
"dt"=>
"C",
"len"=>30,
"key"=>0);
72 $Allowed_Tables[
'cuvndr'][
'vendvar'] = array(
"name"=>
"vendvar",
"dt"=>
"C",
"len"=>30,
"key"=>0);
73 $Allowed_Tables[
'cuvndr'][
'addr1'] = array(
"name"=>
"addr1",
"dt"=>
"C",
"len"=>40,
"key"=>0);
74 $Allowed_Tables[
'cuvndr'][
'addr2'] = array(
"name"=>
"addr2",
"dt"=>
"C",
"len"=>40,
"key"=>0);
75 $Allowed_Tables[
'cuvndr'][
'city'] = array(
"name"=>
"city",
"dt"=>
"C",
"len"=>25,
"key"=>0);
76 $Allowed_Tables[
'cuvndr'][
'st'] = array(
"name"=>
"st",
"dt"=>
"C",
"len"=>15,
"key"=>0);
77 $Allowed_Tables[
'cuvndr'][
'zip'] = array(
"name"=>
"zip",
"dt"=>
"C",
"len"=>15,
"key"=>0);
78 $Allowed_Tables[
'cuvndr'][
'phone'] = array(
"name"=>
"phone",
"dt"=>
"C",
"len"=>20,
"key"=>0);
79 $Allowed_Tables[
'cuvndr'][
'fax'] = array(
"name"=>
"fax",
"dt"=>
"C",
"len"=>20,
"key"=>0);
80 $Allowed_Tables[
'cuvndr'][
'email'] = array(
"name"=>
"email",
"dt"=>
"C",
"len"=>40,
"key"=>0);
81 $Allowed_Tables[
'cuvndr'][
'contact'] = array(
"name"=>
"contact",
"dt"=>
"C",
"len"=>40,
"key"=>0);
82 $Allowed_Tables[
'cuvndr'][
'comments'] = array(
"name"=>
"comments",
"dt"=>
"C",
"len"=>400,
"key"=>0);
86 $Allowed_Tables[
'cutrn'][
'tablename'] =
'cutrans';
87 $Allowed_Tables[
'cutrn'][
'trancode'] = array(
"name"=>
"trancode",
"dt"=>
"C",
"len"=>2,
"key"=>1);
88 $Allowed_Tables[
'cutrn'][
'trandesc'] = array(
"name"=>
"trandesc",
"dt"=>
"C",
"len"=>40,
"key"=>0);
89 $Allowed_Tables[
'cutrn'][
'transpec'] = array(
"name"=>
"specialproc",
"dt"=>
"N",
"len"=>0,
"key"=>0);
92 $Allowed_Tables[
'cuprg'][
'tablename'] =
'cuadminprogs';
93 $Allowed_Tables[
'cuprg'][
'program'] = array(
"name"=>
"program",
"dt"=>
"C",
"len"=>20,
"key"=>1);
94 $Allowed_Tables[
'cuprg'][
'displaytext'] = array(
"name"=>
"displaytext",
"dt"=>
"C",
"len"=>30,
"key"=>0);
95 $Allowed_Tables[
'cuprg'][
'sort_order'] = array(
"name"=>
"sort_order",
"dt"=>
"N",
"len"=>0,
"key"=>0);
96 $Allowed_Tables[
'cuprg'][
'description'] = array(
"name"=>
"description",
"dt"=>
"C",
"len"=>255,
"key"=>0);
97 $Allowed_Tables[
'cuprg'][
'def_set'] = array(
"name"=>
"def_set",
"dt"=>
"C",
"len"=>1,
"key"=>0);
101 $Allowed_Tables[
'excludelist'][
'program'] = array(
"name"=>
"program",
"dt"=>
"C",
"len"=>20,
"key"=>0);
104 $Allowed_Tables[
'cuiss'][
'tablename'] =
'cuissues';
105 $Allowed_Tables[
'cuiss'][
'iss_id'] = array(
"name"=>
"issue_id",
"dt"=>
"N",
"len"=>0,
"key"=>1);
106 $Allowed_Tables[
'cuiss'][
'iss_code'] = array(
"name"=>
"code",
"dt"=>
"C",
"len"=>20,
"key"=>0);
107 $Allowed_Tables[
'cuiss'][
'iss_prod'] = array(
"name"=>
"gen_for_product",
"dt"=>
"C",
"len"=>10,
"key"=>0);
110 $Allowed_Tables[
'cuissitm'][
'tablename'] =
'cuissuesitem';
111 $Allowed_Tables[
'cuissitm'][
'itm_id'] = array(
"name"=>
"item_id",
"dt"=>
"N",
"len"=>0,
"key"=>1);
112 $Allowed_Tables[
'cuissitm'][
'iss_id'] = array(
"name"=>
"issue_id",
"dt"=>
"N",
"len"=>0,
"key"=>0);
113 $Allowed_Tables[
'cuissitm'][
'itm_title'] = array(
"name"=>
"title",
"dt"=>
"C",
"len"=>80,
"key"=>0);
114 $Allowed_Tables[
'cuissitm'][
'itm_desc'] = array(
"name"=>
"item_desc",
"dt"=>
"C",
"len"=>500,
"key"=>0);
117 $Allowed_Tables[
'cuadmmsg'][
'tablename'] =
'cuadmin_message';
118 $Allowed_Tables[
'cuadmmsg'][
'msg_id'] = array(
"name"=>
"id",
"dt"=>
"N",
"len"=>0,
"key"=>1);
119 $Allowed_Tables[
'cuadmmsg'][
'active_date'] = array(
"name"=>
"active_date",
"dt"=>
"D",
"len"=>0,
"key"=>0);
120 $Allowed_Tables[
'cuadmmsg'][
'expires_on'] = array(
"name"=>
"expires_on",
"dt"=>
"D",
"len"=>0,
"key"=>0);
121 $Allowed_Tables[
'cuadmmsg'][
'message'] = array(
"name"=>
"message",
"dt"=>
"C",
"len"=>1000,
"key"=>0);
122 $Allowed_Tables[
'cuadmmsg'][
'subject'] = array(
"name"=>
"subject",
"dt"=>
"C",
"len"=>50,
"key"=>0);
123 $Allowed_Tables[
'cuadmmsg'][
'livebatch'] = array(
"name"=>
"livebatch",
"dt"=>
"C",
"len"=>1,
"key"=>0);
126 $Allowed_Tables[
'cuimgvnd'][
'tablename'] =
'cuimagevendors';
127 $Allowed_Tables[
'cuimgvnd'][
'imgcode'] = array(
"name"=>
"img",
"dt"=>
"C",
"len"=>10,
"key"=>1);
128 $Allowed_Tables[
'cuimgvnd'][
'imgdesc'] = array(
"name"=>
"imgdesc",
"dt"=>
"C",
"len"=>30,
"key"=>0);
129 $Allowed_Tables[
'cuimgvnd'][
'imgaddr1'] = array(
"name"=>
"addr1",
"dt"=>
"C",
"len"=>40,
"key"=>0);
130 $Allowed_Tables[
'cuimgvnd'][
'imgaddr2'] = array(
"name"=>
"addr2",
"dt"=>
"C",
"len"=>40,
"key"=>0);
131 $Allowed_Tables[
'cuimgvnd'][
'imgcity'] = array(
"name"=>
"city",
"dt"=>
"C",
"len"=>25,
"key"=>0);
132 $Allowed_Tables[
'cuimgvnd'][
'imgst'] = array(
"name"=>
"st",
"dt"=>
"C",
"len"=>2,
"key"=>0);
133 $Allowed_Tables[
'cuimgvnd'][
'imgzip'] = array(
"name"=>
"zip",
"dt"=>
"C",
"len"=>10,
"key"=>0);
134 $Allowed_Tables[
'cuimgvnd'][
'imgcnt1'] = array(
"name"=>
"contact1",
"dt"=>
"C",
"len"=>40,
"key"=>0);
135 $Allowed_Tables[
'cuimgvnd'][
'imgrol1'] = array(
"name"=>
"role1",
"dt"=>
"C",
"len"=>40,
"key"=>0);
136 $Allowed_Tables[
'cuimgvnd'][
'imgphn1'] = array(
"name"=>
"phone1",
"dt"=>
"C",
"len"=>20,
"key"=>0);
137 $Allowed_Tables[
'cuimgvnd'][
'imgem1'] = array(
"name"=>
"email1",
"dt"=>
"C",
"len"=>50,
"key"=>0);
138 $Allowed_Tables[
'cuimgvnd'][
'imgfx1'] = array(
"name"=>
"fax1",
"dt"=>
"C",
"len"=>20,
"key"=>0);
139 $Allowed_Tables[
'cuimgvnd'][
'imgcnt2'] = array(
"name"=>
"contact2",
"dt"=>
"C",
"len"=>40,
"key"=>0);
140 $Allowed_Tables[
'cuimgvnd'][
'imgrol2'] = array(
"name"=>
"role2",
"dt"=>
"C",
"len"=>40,
"key"=>0);
141 $Allowed_Tables[
'cuimgvnd'][
'imgphn2'] = array(
"name"=>
"phone2",
"dt"=>
"C",
"len"=>20,
"key"=>0);
142 $Allowed_Tables[
'cuimgvnd'][
'imgem2'] = array(
"name"=>
"email2",
"dt"=>
"C",
"len"=>50,
"key"=>0);
143 $Allowed_Tables[
'cuimgvnd'][
'imgfx2'] = array(
"name"=>
"fax2",
"dt"=>
"C",
"len"=>20,
"key"=>0);
144 $Allowed_Tables[
'cuimgvnd'][
'imgcnt3'] = array(
"name"=>
"contact3",
"dt"=>
"C",
"len"=>40,
"key"=>0);
145 $Allowed_Tables[
'cuimgvnd'][
'imgrol3'] = array(
"name"=>
"role3",
"dt"=>
"C",
"len"=>40,
"key"=>0);
146 $Allowed_Tables[
'cuimgvnd'][
'imgphn3'] = array(
"name"=>
"phone3",
"dt"=>
"C",
"len"=>20,
"key"=>0);
147 $Allowed_Tables[
'cuimgvnd'][
'imgem3'] = array(
"name"=>
"email3",
"dt"=>
"C",
"len"=>50,
"key"=>0);
148 $Allowed_Tables[
'cuimgvnd'][
'imgfx3'] = array(
"name"=>
"fax3",
"dt"=>
"C",
"len"=>20,
"key"=>0);
149 $Allowed_Tables[
'cuimgvnd'][
'imgcomm'] = array(
"name"=>
"comments",
"dt"=>
"C",
"len"=>1000,
"key"=>0);
150 $Allowed_Tables[
'cuimgvnd'][
'imgdate'] = array(
"name"=>
"datespec",
"dt"=>
"C",
"len"=>1000,
"key"=>0);
153 $Allowed_Tables[
'cussovnd'][
'tablename'] =
'cussovendors';
154 $Allowed_Tables[
'cussovnd'][
'ssocode'] = array(
"name"=>
"ssovendor",
"dt"=>
"C",
"len"=>10,
"key"=>1);
155 $Allowed_Tables[
'cussovnd'][
'ssotype'] = array(
"name"=>
"ssotype",
"dt"=>
"C",
"len"=>1,
"key"=>0);
156 $Allowed_Tables[
'cussovnd'][
'ssodesc'] = array(
"name"=>
"ssodesc",
"dt"=>
"C",
"len"=>30,
"key"=>0);
157 $Allowed_Tables[
'cussovnd'][
'ssocnt'] = array(
"name"=>
"contact",
"dt"=>
"C",
"len"=>50,
"key"=>0);
158 $Allowed_Tables[
'cussovnd'][
'ssophn'] = array(
"name"=>
"phone",
"dt"=>
"C",
"len"=>20,
"key"=>0);
159 $Allowed_Tables[
'cussovnd'][
'ssoem'] = array(
"name"=>
"email",
"dt"=>
"C",
"len"=>50,
"key"=>0);
160 $Allowed_Tables[
'cussovnd'][
'ssosetup'] = array(
"name"=>
"setup",
"dt"=>
"C",
"len"=>1000,
"key"=>0);
163 $Allowed_Tables[
'cuquest'][
'tablename'] =
'cuquestmaster';
164 $Allowed_Tables[
'cuquest'][
'qst_id'] = array(
"name"=>
"quest_id",
"dt"=>
"N",
"len"=>0,
"key"=>1);
165 $Allowed_Tables[
'cuquest'][
'qst_lang'] = array(
"name"=>
"quest_lang",
"dt"=>
"C",
"len"=>5,
"key"=>1);
166 $Allowed_Tables[
'cuquest'][
'qst_txt'] = array(
"name"=>
"quest_text",
"dt"=>
"C",
"len"=>80,
"key"=>0);
167 $Allowed_Tables[
'cuquest'][
'qst_etxt'] = array(
"name"=>
"example_text",
"dt"=>
"C",
"len"=>30,
"key"=>0);
168 $Allowed_Tables[
'cuquest'][
'qst_type'] = array(
"name"=>
"quest_type",
"dt"=>
"C",
"len"=>1,
"key"=>0);
171 $Allowed_Tables[
'dmsusers'][
'tablename'] =
'dmsmonitorusers';
172 $Allowed_Tables[
'dmsusers'][
'user_name'] = array(
"name"=>
"user_name",
"dt"=>
"C",
"len"=>12,
"key"=>1);
173 $Allowed_Tables[
'dmsusers'][
'passwd'] = array(
"name"=>
"passwd",
"dt"=>
"C",
"len"=>34,
"key"=>0);
174 $Allowed_Tables[
'dmsusers'][
'ip_range'] = array(
"name"=>
"ip_range",
"dt"=>
"C",
"len"=>1000,
"key"=>0);
175 $Allowed_Tables[
'dmsusers'][
'allowed_scripts'] = array(
"name"=>
"allowed_scripts",
"dt"=>
"C",
"len"=>2000,
"key"=>0);
176 $Allowed_Tables[
'dmsusers'][
'altipaddress'] = array(
"name"=>
"altipaddress",
"dt"=>
"C",
"len"=>15,
"key"=>0);
177 $Allowed_Tables[
'dmsusers'][
'usersms'] = array(
"name"=>
"usersms",
"dt"=>
"C",
"len"=>40,
"key"=>0);
178 $Allowed_Tables[
'dmsusers'][
'notifyemail'] = array(
"name"=>
"notifyemail",
"dt"=>
"C",
"len"=>100,
"key"=>0);
179 $Allowed_Tables[
'dmsusers'][
'userconfirm'] = array(
"name"=>
"userconfirm",
"dt"=>
"C",
"len"=>50,
"key"=>0);
180 $Allowed_Tables[
'dmsusers'][
'notifyhours'] = array(
"name"=>
"notifyhours",
"dt"=>
"C",
"len"=>20,
"key"=>0);
181 $Allowed_Tables[
'dmsusers'][
'notifypin'] = array(
"name"=>
"notifypin",
"dt"=>
"C",
"len"=>34,
"key"=>0);
182 $Allowed_Tables[
'dmsusers'][
'notifyenabled'] = array(
"name"=>
"notifyenabled",
"dt"=>
"C",
"len"=>100,
"key"=>0);
184 $Allowed_Tables[
'trustvendor'][
'tablename'] =
'cutrustedmaster';
185 $Allowed_Tables[
'trustvendor'][
'trustedid'] = array(
"name"=>
"trustedid",
"dt"=>
"C",
"len"=>20,
"key"=>1);
186 $Allowed_Tables[
'trustvendor'][
'trustedvendor'] = array(
"name"=>
"trustedvendor",
"dt"=>
"C",
"len"=>15,
"key"=>0);
187 $Allowed_Tables[
'trustvendor'][
'trustedtype'] = array(
"name"=>
"trustedtype",
"dt"=>
"C",
"len"=>10,
"key"=>0);
188 $Allowed_Tables[
'trustvendor'][
'hcuinterface'] = array(
"name"=>
"hcuinterface",
"dt"=>
"C",
"len"=>100,
"key"=>0);
189 $Allowed_Tables[
'trustvendor'][
'trustedfields'] = array(
"name"=>
"trustedfields",
"dt"=>
"C",
"len"=>5000,
"key"=>0);
192 $Allowed_Tables[
'lnappanslookupheader'][
'tablename'] =
'lnappanslookupheader';
193 $Allowed_Tables[
'lnappanslookupheader'][
'ansid'] = array(
"name"=>
"ansid",
"dt"=>
"N",
"len"=>0,
"key"=>1);
194 $Allowed_Tables[
'lnappanslookupheader'][
'anstitle'] = array(
"name"=>
"anstitle",
"dt"=>
"C",
"len"=>50,
"key"=>0);
197 $Allowed_Tables[
'lnappanslookupdetail'][
'tablename'] =
'lnappanslookupdetail';
198 $Allowed_Tables[
'lnappanslookupdetail'][
'ansdetailid'] = array(
"name"=>
"ansdetailid",
"dt"=>
"N",
"len"=>0,
"key"=>1);
199 $Allowed_Tables[
'lnappanslookupdetail'][
'ansid'] = array(
"name"=>
"ansid",
"dt"=>
"N",
"len"=>0,
"key"=>0);
200 $Allowed_Tables[
'lnappanslookupdetail'][
'ansvalue'] = array(
"name"=>
"ansvalue",
"dt"=>
"C",
"len"=>50,
"key"=>0);
201 $Allowed_Tables[
'lnappanslookupdetail'][
'ansdisplay'] = array(
"name"=>
"ansdisplay",
"dt"=>
"C",
"len"=>50,
"key"=>0);
204 $Allowed_Tables[
'cucmsdocs'][
'tablename'] =
'cucmsdocs';
205 $Allowed_Tables[
'cucmsdocs'][
'docsid'] = array(
"name"=>
"docsid",
"dt"=>
"N",
"len"=>0,
"key"=>1);
206 $Allowed_Tables[
'cucmsdocs'][
'docsname'] = array(
"name"=>
"docsname",
"dt"=>
"C",
"len"=>50,
"key"=>0);
207 $Allowed_Tables[
'cucmsdocs'][
'docsdesc'] = array(
"name"=>
"docsdesc",
"dt"=>
"C",
"len"=>250,
"key"=>0);
208 $Allowed_Tables[
'cucmsdocs'][
'docstitle'] = array(
"name"=>
"docstitle",
"dt"=>
"C",
"len"=>100,
"key"=>0);
209 $Allowed_Tables[
'cucmsdocs'][
'docstype'] = array(
"name"=>
"docstype",
"dt"=>
"N",
"len"=>2,
"key"=>0);
210 $Allowed_Tables[
'cucmsdocs'][
'docsdisplaylink'] = array(
"name"=>
"docsdisplaylink",
"dt"=>
"C",
"len"=>1,
"key"=>0);
211 $Allowed_Tables[
'cucmsdocs'][
'docsdisplaytext'] = array(
"name"=>
"docsdisplaytext",
"dt"=>
"C",
"len"=>100,
"key"=>0);
212 $Allowed_Tables[
'cucmsdocs'][
'docsdefaultavail'] = array(
"name"=>
"docsdefaultavail",
"dt"=>
"C",
"len"=>1,
"key"=>0);
213 $Allowed_Tables[
'cucmsdocs'][
'docsresponsetype'] = array(
"name"=>
"docsresponsetype",
"dt"=>
"C",
"len"=>1,
"key"=>0);
214 $Allowed_Tables[
'cucmsdocs'][
'docsmaintsection'] = array(
"name"=>
"docsmaintsection",
"dt"=>
"C",
"len"=>30,
"key"=>0);
215 $Allowed_Tables[
'cucmsdocs'][
'docsmaintsort'] = array(
"name"=>
"docsmaintsort",
"dt"=>
"N",
"len"=>3,
"key"=>0);
216 $Allowed_Tables[
'cucmsdocs'][
'docstarget'] = array(
"name"=>
"docstarget",
"dt"=>
"C",
"len"=>20,
"key"=>0);
217 $Allowed_Tables[
'cucmsdocs'][
'docstargetname'] = array(
"name"=>
"docstargetname",
"dt"=>
"C",
"len"=>100,
"key"=>0);
222 $http_user =
"nobody";
223 $http_pwd =
"no1home";
234 $Remote_Fields = array();
239 function remote_update_list() {
240 global $Remote_Servers;
242 <table border=
"0" cellpadding=
"1" cellspacing=
"1">
244 <td
class=
"hdr">Please select all remote servers you wish to update:</td>
247 foreach ($Remote_Servers as $key => $value) {
248 if ($_SERVER[
'HTTP_HOST'] != $value[
'host']) {
250 $default_checked = ($value[
'upd'] ?
"checked" :
"");
254 <input type=\"checkbox\" value=\"$key\" name=\"Remote_Update[]\" $default_checked>$key 261 <td class=\"dtl\"><hr></td> 266 function Remote_Update_Selected() {
267 if (isset($_POST[
'Remote_Update']) && is_array($_POST[
'Remote_Update'])) {
273 function Remote_Update_Send($action, $table) {
274 global $Remote_Servers;
276 if (Remote_Update_Selected()) {
277 foreach ($_POST[
'Remote_Update'] as $key => $value) {
279 if (isset($Remote_Servers[$value][
"IP"])) {
280 $remote_url = Remote_Field_URL($action, $table, $value);
281 list($call_cd, $call_desc) = Call_URL($remote_url);
283 if ($call_cd <
"900") {
285 $call_msg .=
"<li>Update to server $value was successful.<br>";
288 $call_msg .=
"<li>Update to server $value failed with description '$call_desc'.<br>";
293 $call_msg .=
"$value - NOT FOUND";
298 return "No Remote Servers Selected to Update";
307 function Remote_Update_All($action, $table) {
308 global $Remote_Servers;
311 foreach ($Remote_Servers as $key => $value) {
313 if ($value[
"upd"] ==
true && ($_SERVER[
'HTTP_HOST'] != $value[
'host'])) {
316 $remote_url = Remote_Field_URL($action, $table, $key);
317 list($call_cd, $call_desc) = Call_URL($remote_url);
318 if ($call_cd <
"900") {
320 $call_msg .=
"<li>Update to server $key was successful.<br>";
323 $call_msg .=
"<li>Update to server $key failed with description '$call_desc'.<br>";
334 function Remote_Field_Add($table, $fld_key, $fld_value) {
336 global $Remote_Fields, $Allowed_Tables;
339 if (isset($Allowed_Tables[$table][$fld_key])) {
340 $Remote_Fields[] = array(
"name"=>$fld_key,
"value"=>trim($fld_value));
345 function Remote_Field_URL($action, $table, $server) {
347 global $Remote_Servers, $Allowed_Tables, $Remote_Fields, $Remote_Table, $http_user, $http_pwd;
349 $return_url = Array(
'url'=>
'',
'data'=>
'',
'security'=>
'');
353 if (is_array($Remote_Servers[$server]) && in_array($action, array(
"U",
"D",
"S")) && is_array($Allowed_Tables[$table])) {
354 foreach ($Remote_Fields as $key=>$value) {
355 $return_data .=
"&" .
"col[$key][name]=" . urlencode($value[
'name']) .
356 "&" .
"col[$key][value]=" . urlencode($value[
'value']);
359 if ($Remote_Servers[$server][
"http_login"] ==
true) {
360 $url_security =
"{$http_user}:{$http_pwd}@";
366 $return_url[
'url'] =
"https://" . $Remote_Servers[$server][
"IP"] .
"/hcuadm/remote_monitor_save";
367 $return_url[
'data'] =
"ac=$action&tbl=$table" . $return_data;
368 if ($Remote_Servers[$server][
"http_login"] ==
true) {
369 $return_url[
'security'] =
"{$http_user}:{$http_pwd}";
373 $Remote_Table = $table;
378 function Call_URL($remote_url) {
380 global $http_use_curl;
385 $opts =
"--connect-timeout 5 --retry 3 --retry-delay 2";
389 if ($http_use_curl) {
390 if ($remote_url[
'security'] !=
'') {
391 $url_security =
" -u {$remote_url['security']} ";
394 $fd = popen(
"/usr/bin/curl -k -N $url_security --silent $opts -d '{$remote_url['data']}' '{$remote_url['url']}'",
"r");
396 $results_ary = Array();
399 while ($buff = fread ($fd, 1500)) {
402 $pipe_err = pclose($fd);
403 $results_ary = explode(
"\n", $packet);
410 $params = array(
'http' => array(
'method' =>
'POST',
'content' => $remote_url[
'data']));
411 if ($remote_url[
'security'] !=
'') {
412 $params[
'http'][
'header'] =
"Authorization: Basic " . base64_encode($remote_url[
'security']);
415 $ctx = stream_context_create($params);
417 $results_ary = @file($remote_url[
'url'],
false, $ctx);
429 if (count($results_ary) == 1 && strstr($results_ary[0],
"RU: ") !== FALSE) {
431 return array(substr($results_ary[0], 4, 3), substr($results_ary[0], 10));
434 return array(
"999",
"Unable to update the remote server");
438 function Remote_Fields_Reset() {
440 global $Remote_Fields;
441 $Remote_Fields = array();
444 function Remote_Update_Special($specialcode) {
445 global $Remote_Servers;
447 if (Remote_Update_Selected()) {
448 foreach ($_POST[
'Remote_Update'] as $key => $value) {
450 if (isset($Remote_Servers[$value][
"IP"])) {
451 $remote_url = Remote_Field_URL(
"S", $specialcode, $value);
452 list($call_cd, $call_desc) = Call_URL($remote_url);
453 if ($call_cd <
"900") {
455 $call_msg .=
"<li>Update to server $value was successful.<br>";
458 $call_msg .=
"<li>Update to server $value failed with description '$call_desc'.<br>";
463 $call_msg .=
"$value - NOT FOUND";
468 return "No Remote Servers Selected to Update";