function admin() { global $settings, $service_settings, $service_settings_pw; if (!$_SESSION["tf_service_settings_login"] && $service_settings_pw) { header("Location: /tf_service_settings/login/"); } if (array_key_exists("jobtype", $_REQUEST) && $_REQUEST["jobtype"] == "modify") { $ss2 = array(); foreach ($service_settings as $svs) { $k = $svs["key"]; $v = $svs["value"]; $d = $svs["description"]; $v = $_REQUEST["key_" . $k]; if (!$_REQUEST["todel_" . $k]) { $new_svs = array(); $new_svs["key"] = $k; $new_svs["value"] = $v; $new_svs["description"] = $d; $ss2[] = $new_svs; } } $service_settings = $ss2; if ($ss2) { ss_save($ss2, $service_settings_pw); } } if (array_key_exists("new_key", $_REQUEST)) { $ss2 = array(); $ss2["key"] = $_REQUEST["new_key"]; $ss2["value"] = $_REQUEST["new_value"]; $ss2["description"] = $_REQUEST["new_desc"]; $service_settings[] = $ss2; ss_save($service_settings, $service_settings_pw); } if (array_key_exists("pw", $_REQUEST)) { ss_save($service_settings, $_REQUEST["pw"]); } $this->assigns["service_settings"] = $service_settings; //if ($ss2) // $this->assigns["service_settings"] = $ss2; $this->tpl_name = "tf_service_settings8/views/admin"; $this->layout = ""; }
//make get = to post $id = $_POST['ss_id']; // echo "ss_handler.php called with different ss_id: $id."; } } else { $_POST['ss_load'] = TRUE; //always make task load ss if $POST ss_id is not set } } else { echo 'Wordpress Spreadsheet: No ss_id in URL'; } require_once '../../../wp-config.php'; require_once 'ss_functions.php'; //handle possible spreadsheet functions from name of submit button in form if ($_POST['ss_save']) { ss_save(); } else { if ($_POST['ss_load']) { ss_load($id); //saved, so reload } else { if ($_POST['ss_clear']) { ss_clear($id); //erase spreadsheet, save and reload } } } ?>