Exemplo n.º 1
0
$script->date = $backend->get('date');
$backend->profiler->start('initialize');
/* get arguments */
$name = $backend->get('name', $backend->getRouteValue());
$use_regex = (bool) $backend->get('regex');
$show_locked = (bool) $backend->get('show_locked');
$show_hidden = (bool) $backend->get('show_hidden');
$case_insensitive = (bool) $backend->get('icase');
/* add user name filter */
if ($name != null) {
    $script->name = $name;
    $operator = $use_regex ? Script::OP_REGEXP : Script::OP_LIKE;
    if ($case_insensitive) {
        $script->filter(Script::T_GLOBALUSER, 'UPPER(CONVERT(gu_name USING utf8))', $operator, strtoupper($name));
        $script->filter(Script::T_LOCALWIKIS, 'UPPER(CONVERT(lu_name USING utf8))', $operator, strtoupper($name));
        $script->describeFilter("username {$operator} {$name}");
    } else {
        $script->filter(Script::T_GLOBALUSER, 'gu_name', $operator, $name);
        $script->filter(Script::T_LOCALWIKIS, 'lu_name', $operator, $name);
        $script->describeFilter("username {$operator} {$name}");
    }
}
/* add lock status filter */
if (!$show_locked) {
    $script->filter(Script::T_GLOBALUSER, 'gu_locked', Script::OP_NOT_EQUAL, '1');
    $script->describeFilter("NOT locked");
}
/* add hide status filter */
if (!$show_hidden) {
    $script->filter(Script::T_GLOBALUSER, 'gu_hidden', Script::OP_NOT_EQUAL, 'lists');
    $script->filter(Script::T_GLOBALUSER, '`gu_hidden`', Script::OP_NOT_EQUAL, 'suppressed');