From 177791970ee86a6653b051ee393801ad37134d70 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 26 Nov 2014 21:01:37 +0100 Subject: Lots of small bugfixes, proxy config WIP, https config WIP, translation updates, added masterpassword to pxe menu, ... --- inc/taskmanager.inc.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'inc/taskmanager.inc.php') diff --git a/inc/taskmanager.inc.php b/inc/taskmanager.inc.php index 528b3f78..dd16c62d 100644 --- a/inc/taskmanager.inc.php +++ b/inc/taskmanager.inc.php @@ -79,6 +79,20 @@ class Taskmanager return $reply; } + /** + * Checks whether the given task id corresponds to a known task in the taskmanager. + * Returns true iff the taskmanager is reachable and the status of the task + * is different from NO_SUCH_TASK. + * + * @param string $taskid a task id + * @return boolean true if taskid exists in taskmanager + */ + public static function isTask($taskid) + { + $task = self::status($taskid); + return isset($task['statusCode']) && $task['statusCode'] !== NO_SUCH_TASK; + } + /** * Wait for the given task's completion. * -- cgit v1.2.3-55-g7522