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..4863681b --- /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 status of operators in chat. (supports group based status) + $op_status = has_online_operators($group_id) ? true : false; + + return $op_status; + } +}