Commit fa1da33e authored by Łukasz Nowak's avatar Łukasz Nowak

Provide basic input validation.

parent b2850aa7
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<dictionary> <dictionary>
<item> <item>
<key> <string>_EtagSupport__etag</string> </key> <key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts23259624.11</string> </value> <value> <string>ts23259892.99</string> </value>
</item> </item>
<item> <item>
<key> <string>__name__</string> </key> <key> <string>__name__</string> </key>
...@@ -281,6 +281,16 @@ function processRequest(event) {\n ...@@ -281,6 +281,16 @@ function processRequest(event) {\n
var url = $(\'#url\').val();\n var url = $(\'#url\').val();\n
var title = $(\'#software_instance_title\').val();\n var title = $(\'#software_instance_title\').val();\n
var xml = $(\'#software_instance_xml\').val();\n var xml = $(\'#software_instance_xml\').val();\n
\n
if (title.length == 0) {\n
alert(\'Title is required\');\n
return;\n
}\n
\n
if (xml.length == 0) {\n
alert(\'XML is required\');\n
return;\n
}\n
\n \n
$.post(vifib.site_url + "/ERP5Site_requestComputerPartitionAsJSON", {\n $.post(vifib.site_url + "/ERP5Site_requestComputerPartitionAsJSON", {\n
\'software_release_url\': url,\n \'software_release_url\': url,\n
...@@ -299,6 +309,10 @@ function processInstall(event) {\n ...@@ -299,6 +309,10 @@ function processInstall(event) {\n
var computer = $(\'#computer\').val();\n var computer = $(\'#computer\').val();\n
var url = $(\'#url\').val();\n var url = $(\'#url\').val();\n
\n \n
if (computer.length == 0) {\n
alert(\'Computer have to be selected\');\n
return;\n
}\n
$.post(vifib.site_url + "/ERP5Site_triggerSoftwareInstallationAsJSON", {\n $.post(vifib.site_url + "/ERP5Site_triggerSoftwareInstallationAsJSON", {\n
\'software_release_url\': url,\n \'software_release_url\': url,\n
\'computer_reference\': computer\n \'computer_reference\': computer\n
...@@ -511,7 +525,7 @@ function processAjaxError(jqXHR, textStatus, errorThrown) {\n ...@@ -511,7 +525,7 @@ function processAjaxError(jqXHR, textStatus, errorThrown) {\n
</item> </item>
<item> <item>
<key> <string>size</string> </key> <key> <string>size</string> </key>
<value> <int>16373</int> </value> <value> <int>16610</int> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment