$endpoint->db->query($sql); } $endpoint->message['advanced_settings'] = "Globals Reset to Default!"; } if ($_REQUEST['custom'] == 0) { //This is a group template $sql = 'SELECT global_settings_override FROM endpointman_template_list WHERE id = ' . $_REQUEST['tid']; $settings = $endpoint->db->getOne($sql); } else { //This is an individual template $sql = 'SELECT global_settings_override FROM endpointman_mac_list WHERE id = ' . $_REQUEST['tid']; $settings = $endpoint->db->getOne($sql); } if (isset($settings)) { $settings = unserialize($settings); $settings['tz'] = $endpoint->listTZ($settings['tz']); } else { $settings['srvip'] = $endpoint->global_cfg['srvip']; $settings['ntp'] = $endpoint->global_cfg['ntp']; $settings['config_location'] = $endpoint->global_cfg['config_location']; $settings['tz'] = $endpoint->listTZ($endpoint->global_cfg['tz']); } //Because we are working with global variables we probably updated them, so lets refresh those variables $endpoint->global_cfg =& $endpoint->db->getAssoc("SELECT var_name, value FROM endpointman_global_vars"); $endpoint->tpl->assign("ip", $_SERVER["SERVER_ADDR"]); $endpoint->tpl->assign("srvip", $settings['srvip']); $endpoint->tpl->assign("ntp_server", $settings['ntp']); $endpoint->tpl->assign("config_location", $settings['config_location']); $endpoint->tpl->assign("list_tz", $settings['tz']); $endpoint->prepare_message_box(); echo $endpoint->tpl->draw('advanced_settings_settings_pop');