function failover() { //this_feature_is_disabled_corp_license $users = new usersMenus(); $boot = new boostrap_form(); $tpl = new templates(); $t = time(); $page = CurrentPageName(); $sock = new sockets(); $eth = $_GET["nic"]; $nic = new system_nic($eth); for ($i = 1; $i < 256; $i++) { $ucarp_vids[$i] = $i; } $boot->set_hidden("save_nic", $eth); $array = unserialize(base64_decode($sock->getFrameWork("system.php?ucarp-status={$eth}"))); if (!isset($array["PID"])) { $boot->set_formdescription("{status}:{stopped}"); $boot->set_Newbutton("{start}", "Start{$t}()"); } else { $boot->set_Newbutton("{stop}", "Stop{$t}()"); $boot->set_formdescription("{status}:{running} PID:{$array["PID"]} {since} {$array["TIME"]}Mn"); } $XHR = array(); $XHR["start-vip"] = "yes"; $boot->set_AddScript("Start{$t}", array("XHR" => $XHR)); $XHR = array(); $XHR["stop-vip"] = "yes"; $boot->set_AddScript("Stop{$t}", array("XHR" => $XHR)); $boot->set_checkbox("ucarp_enabled", "{enabled}", $nic->ucarp_enabled, array("DISABLEALL" => true)); $boot->set_checkbox("ucarp_master", "{isamaster}", $nic->ucarp_master, array("TOOLTIP" => "{ucarp_master_explain}")); $boot->set_list("ucarp_vid", "{ucarp-vid}", $ucarp_vids, $nic->ucarp_vid); $boot->set_field("ucarp_vip", "{ucarp-vip}", $nic->ucarp_vip, array("MANDATORY" => true, "IPV4" => true, "TOOLTIP" => "{ucarp_vip_explain}")); $boot->set_list("ucarp_advskew", "{ucarp-advskew}", $ucarp_vids, $nic->ucarp_advskew); $boot->set_field("ucarp_advbase", "{interval} ({seconds})", $nic->ucarp_advbase, array("MANDATORY" => true)); $boot->set_button("{apply}"); $boot->set_RefreshSearchs(); if (!$users->AsSystemAdministrator) { $boot->set_form_locked(); } if (!$users->CORP_LICENSE) { $error = "<p class=text-error>{this_feature_is_disabled_corp_license}</p>"; $boot->set_form_locked(); } $form = $boot->Compile(); $tpl = new templates(); echo $tpl->_ENGINE_parse_body($error . $form); }