summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole/includes
diff options
context:
space:
mode:
Diffstat (limited to 'admin/WebConsole/includes')
-rw-r--r--admin/WebConsole/includes/restfunctions.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/admin/WebConsole/includes/restfunctions.php b/admin/WebConsole/includes/restfunctions.php
index 8d8bf931..d45dd9c9 100644
--- a/admin/WebConsole/includes/restfunctions.php
+++ b/admin/WebConsole/includes/restfunctions.php
@@ -85,6 +85,7 @@ define('TYPE_TASK', 3);
define('OG_SCHEDULE_COMMAND', 'command');
define('OG_SCHEDULE_PROCEDURE', 'procedure');
define('OG_SCHEDULE_TASK', 'task');
+define('PART_MAX_NUM_FIELDS', 5);
$conf_file = json_decode(file_get_contents(__DIR__ . '/../../etc/ogserver.json'), true);
define('OG_REST_API_TOKEN', 'Authorization: ' . $conf_file['rest']['api_token']);
@@ -551,7 +552,8 @@ function setup($string_ips, $params) {
$file_system = array();
$part_size = array();
$format = array();
- for ($x = 0; $x < 4; $x++) {
+ $num_partitions = (sizeof($matches[0]) - 5) / PART_MAX_NUM_FIELDS;
+ for ($x = 0; $x < $num_partitions; $x++) {
$partition_number[$x] = $matches[0][5 + 5 * $x];
$partition_code[$x] = $matches[0][6 + 5 * $x];
$file_system[$x] = $matches[0][7 + 5 * $x];