function print_operators() { global $mibew_encoding; echo "<operators>"; $operators = operator_get_all(); foreach ($operators as $operator) { if (!operator_is_online($operator)) { continue; } $name = myiconv($mibew_encoding, "utf-8", safe_htmlspecialchars(safe_htmlspecialchars($operator['vclocalename']))); $away = operator_is_away($operator) ? " away=\"1\"" : ""; echo "<operator name=\"{$name}\"{$away}/>"; } echo "</operators>"; }
$errors[] = "You are not allowed to remove operators"; } if ($operatorid == $operator['operatorid']) { $errors[] = "Cannot remove self"; } if (count($errors) == 0) { $op = operator_by_id($operatorid); if (!$op) { $errors[] = getlocal("no_such_operator"); } else { if ($op['vclogin'] == 'admin') { $errors[] = 'Cannot remove operator "admin"'; } } } if (count($errors) == 0) { $link = connect(); perform_query("delete from {$mysqlprefix}chatgroupoperator where operatorid = " . intval($operatorid), $link); perform_query("delete from {$mysqlprefix}chatoperator where operatorid = " . intval($operatorid), $link); mysql_close($link); header("Location: {$mibewroot}/operator/operators.php"); exit; } } $page = array(); $page['allowedAgents'] = operator_get_all(); $page['canmodify'] = is_capable($can_administrate, $operator); setlocale(LC_TIME, getstring("time.locale")); prepare_menu($operator); start_html_output(); require '../view/agents.php';
function print_operators() { echo "<operators>"; $operators = operator_get_all(); foreach ($operators as $operator) { if (!operator_is_online($operator)) { continue; } $name = htmlspecialchars(htmlspecialchars($operator['vclocalename'])); $away = operator_is_away($operator) ? " away=\"1\"" : ""; echo "<operator name=\"{$name}\"{$away}/>"; } echo "</operators>"; }