brute-force changed access to $_GET['key'] to use get_array instead
[plewww.git] / plekit / php / updateConfiguration.php
index 8b37381..97c12d9 100644 (file)
@@ -13,16 +13,23 @@ require_once 'plc_drupal.php';
 // Common functions
 require_once 'plc_functions.php';
 
-$value=$_GET["value"];
-$person_id=$_GET["person_id"];
-$slice_id=$_GET["slice_id"];
-$tag_id=intval($_GET["tag_id"]);
-
-$api->UpdatePersonTag( $tag_id, $value );
-
-$myFile = "/var/log/myslice-log";
-$fh = fopen($myFile, 'a') or die("can't open file");
-$stringData = "\n".date('Ymd-H:i')."|".$person_id.":".$slice_id.":".$value;
+$value=get_array($_GET, "value");
+$person_id=intval(get_array($_GET, "person_id"));
+$slice_id=get_array($_GET, "slice_id");
+$tag_id=intval(get_array($_GET, "tag_id"));
+$tag_name=get_array($_GET, "tag_name");
+
+#$res = $api->UpdatePersonTag( $tag_id, $value );
+if ($tag_name == "columnconf")
+$res = $api->SetPersonColumnconf( $person_id, $value );
+else if ($tag_name == "showconf")
+$res = $api->SetPersonShowconf( $person_id, $value );
+
+$myFile = "/var/log/myslice/myslice.log";
+if (file_exists($myFile))
+       $fh = fopen($myFile, 'a') or die("can't open file");
+
+$stringData = date('Y-m-d@H:i')."|p=".$person_id.":s=".$slice_id.":t=".$tag_name.":v=".$value."\n";
 fwrite($fh, $stringData);
 fclose($fh);