From 4072aae2bbc82303b5dbafce3087ef36b2f1860b Mon Sep 17 00:00:00 2001 From: Michael Tunnell Date: Fri, 16 Sep 2016 23:53:51 -0500 Subject: [PATCH] created Operator Status controller for external integration --- src/mibew/configs/routing.yml | 4 ++ .../Mibew/Controller/OpStatusController.php | 58 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 src/mibew/libs/classes/Mibew/Controller/OpStatusController.php diff --git a/src/mibew/configs/routing.yml b/src/mibew/configs/routing.yml index 7f67e159..3acfa296 100644 --- a/src/mibew/configs/routing.yml +++ b/src/mibew/configs/routing.yml @@ -90,6 +90,10 @@ button: path: /b defaults: { _controller: Mibew\Controller\ButtonController::indexAction } +op_status: + path: /opstatus + defaults: { _controller: Mibew\Controller\OpStatusController::indexAction } + captcha: path: /captcha defaults: { _controller: Mibew\Controller\CaptchaController::drawAction } diff --git a/src/mibew/libs/classes/Mibew/Controller/OpStatusController.php b/src/mibew/libs/classes/Mibew/Controller/OpStatusController.php new file mode 100644 index 00000000..d1cc3985 --- /dev/null +++ b/src/mibew/libs/classes/Mibew/Controller/OpStatusController.php @@ -0,0 +1,58 @@ +query->get('group', ''); + if (!preg_match("/^\d{1,8}$/", $group_id)) { + $group_id = false; + } + if ($group_id) { + if (Settings::get('enablegroups') == '1') { + $group = group_by_id($group_id); + if (!$group) { + $group_id = false; + } + } else { + $group_id = false; + } + } + + // Get image file content + $op_status = has_online_operators($group_id) ? true : false; + + return $op_status; + } +}