diff --git a/livesupport/modules/storageServer/var/conf.php b/livesupport/modules/storageServer/var/conf.php
index cae94405d..9716798f2 100644
--- a/livesupport/modules/storageServer/var/conf.php
+++ b/livesupport/modules/storageServer/var/conf.php
@@ -23,13 +23,19 @@
Author : $Author: tomas $
- Version : $Revision: 1.5 $
+ Version : $Revision: 1.6 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/conf.php,v $
------------------------------------------------------------------------------*/
+/**
+ * \file conf.php
+ * storageServer configuration file
+ */
+
/**
* configuration structure:
+ *
*
* - dsn
- datasource setting
*
- tblNamePrefix
- prefix for table names in the database
diff --git a/livesupport/modules/storageServer/var/xmlrpc/put.php b/livesupport/modules/storageServer/var/xmlrpc/put.php
index cfdc58979..7e522c851 100644
--- a/livesupport/modules/storageServer/var/xmlrpc/put.php
+++ b/livesupport/modules/storageServer/var/xmlrpc/put.php
@@ -23,10 +23,38 @@
Author : $Author: tomas $
- Version : $Revision: 1.1 $
+ Version : $Revision: 1.2 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/put.php,v $
------------------------------------------------------------------------------*/
+
+/**
+ * \file put.php
+ * Store PUT data as temporary file.
+ *
+ * put.php is remote callable script through HTTP PUT method.
+ * Requires token returned by appropriate storageServer XMLRPC call.
+ * Appropriate closing XMLRPC call should follow.
+ *
+ * This script accepts following HTTP GET parameter:
+ *
+ * - token : string, put token returned by appropriate
+ * XMLRPC call
+ *
+ *
+ * On success, returns HTTP return code 200.
+ *
+ * On errors, returns HTTP return code >200
+ * The possible error codes are:
+ *
+ * - 400 - Incorrect parameters passed to method
+ * - 403 - Access denied
+ * - 500 - Application error
+ *
+ *
+ * @see XR_LocStor
+ */
+
require_once '../conf.php';
require_once 'DB.php';
require_once '../LocStor.php';
@@ -36,8 +64,6 @@ $dbc = DB::connect($config['dsn'], TRUE);
$dbc->setFetchMode(DB_FETCHMODE_ASSOC);
$gb = &new GreenBox(&$dbc, $config);
-$token = $_REQUEST['token'];
-
function http_error($code, $err){
header("HTTP/1.1 $code");
header("Content-type: text/plain; charset=UTF-8");
@@ -45,9 +71,15 @@ function http_error($code, $err){
exit;
}
+if(preg_match("|^[0-9a-f]{32}$|", $_REQUEST['token'])){
+ $token = $_REQUEST['token'];
+}else{
+ http_error(400, "Error on token parameter. ({$_REQUEST['token']})");
+}
+
$tc = $gb->bsCheckToken($token, 'put');
-if(PEAR::isError($tc)){ echo "ERR".$tc->getMessage()."\n"; exit; }
-if(!$tc){ http_error(410, "Token not valid."); }
+if(PEAR::isError($tc)){ http_error(500, $ex->getMessage()); }
+if(!$tc){ http_error(403, "Token not valid."); }
#var_dump($tc); exit;
header("Content-type: text/plain");
diff --git a/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php b/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php
index f52d04c0b..0e2cfa485 100644
--- a/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php
+++ b/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php
@@ -23,15 +23,17 @@
Author : $Author: tomas $
- Version : $Revision: 1.3 $
+ Version : $Revision: 1.4 $
Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/modules/storageServer/var/xmlrpc/simpleGet.php,v $
------------------------------------------------------------------------------*/
/**
- * simpleGet.php is remote callable script through HTTP GET method.
+ * \file simpleGet.php
* Returns stored media file identified by global unique ID.
- * Requires valid session ID and read permission for requested file.
+ *
+ * simpleGet.php is remote callable script through HTTP GET method.
+ * Requires valid session ID with read permission for requested file.
*
* This script accepts following HTTP GET parameters:
*