www-thermferm/getprofiles.php

changeset 132
8bd209d1c020
parent 131
528dc0bb81ab
--- a/www-thermferm/getprofiles.php	Thu Jul 24 20:45:15 2014 +0200
+++ b/www-thermferm/getprofiles.php	Thu Jul 24 23:11:28 2014 +0200
@@ -24,6 +24,33 @@
 require_once('utilities.php');
 
 
+
+if (isset($_GET['update'])) {
+    /*
+     * Build the update command
+     */
+    $update_cmd = "PROFILE ".$_GET['UUID'].",".$_GET['Name'];
+
+    $sock = open_socket();
+    if ($sock != false) {
+    	/*
+    	 * Send command and absorb the result.
+    	 */
+    	socket_write($sock, $update_cmd, 4096);
+    	while (1) {
+	    $line = socket_read($sock, 4096);
+	    if ($line === '')
+	    	break;
+    	}
+    	socket_close($sock);
+    }
+}
+
+
+
+/*
+ * Get current profiles
+ */
 $sock = open_socket();
 if ($sock == false) {
     echo "";
@@ -40,9 +67,8 @@
 }
 socket_close($sock);
 $arr = explode("\r\n", $answer);
-
+$row = '[';
 
-$row = '[';
 
 /* We don't use json_encode because it doesn't work for our purpose */
 if (startsWith($arr[0], "212")) {

mercurial