Get all user flags.

@return array
502625
public function getUserFlags() : array
    {
        if ($this->flags !== null) {
            return $this->flags;
        }

        $this->flags = [];
        $usergroups = $this->usergroups;

        foreach ($usergroups as $usergroup) {
            $group = $usergroup->group;
            $flags = $group->flags;

            if (!empty($flags)) {
                $this->flags = array_merge($this->flags, $flags);
            }
        }

        return $this->flags;
    }
597141
public function users()
    {
        $list  = [];
        $users = User::all();

        foreach ($users as $key => $user) {
            $list[$user->id] = $user->name;
        }

        return $list;
    }
1274026
protected function getLoadFlags()
    {
        $flags = LIBXML_NONET | LIBXML_NOWARNING;

        foreach ([
            'LIBXML_PARSEHUGE', //  libxml >= 2.7.0
            'LIBXML_HTML_NOIMPLIED', // libxml >= 2.7.7
            'LIBXML_HTML_NODEFDTD', // libxml >= 2.7.8
            'LIBXML_BIGLINES', // libxml >= 2.9.0
        ] as $flagName) {
            if (defined($flagName)) {
                $flags |= constant($flagName);
            }
        }

        return $flags;
    }
411645
private int getFlags() {

        int flags = 0;
        if (m_hideLogin.getValue().booleanValue()) {
            flags += CmsOrganizationalUnit.FLAG_HIDE_LOGIN;
        }
        if (m_webuser.getValue().booleanValue()) {
            flags += CmsOrganizationalUnit.FLAG_WEBUSERS;
        }
        return flags;
    }
1023153
protected function users()
    {
        $user   = auth()->user();
        $roles  = $childs = $user->roles->first()->getChilds();

        $users = User::select(['id'])->withoutGlobalScopes()->whereHas('roles', function($query) use($roles) {
                    $query->whereIn('tbl_roles.id', array_values($roles));
                })->get()->pluck('id')->toArray();
        array_push($users, $user->id);
        return $users;
    }
376235
public function update_user_flags($flags) {
        global $DB;
        if ($flags->userid <= 0 || $flags->assignment <= 0 || $flags->id <= 0) {
            return false;
        }

        $result = $DB->update_record('assign_user_flags', $flags);
        return $result;
    }
612641
private function FlagsString()
    {
        $result = '';
        foreach ($this->flags as $flag)
        {
            if ($result)
            {
                $result .= ',';
            }
            $result .= $flag->ToString();
        }
        if ($result)
        {
            $result = '[' . $result . ']';
        }
        return $result;
    }
841243
public function getFilters()
    {
        $roles = user_roles(true);
        unset($roles[DRUPAL_AUTHENTICATED_RID]);

        return [
            (new Filter('status', $this->t("Active")))->setChoicesMap(
                [
                    0 => $this->t("No"),
                    1 => $this->t("Yes"),
                ]
            ),
            (new Filter('role', $this->t("Role")))->setChoicesMap($roles),
            (new Filter('name', $this->t("Name"))),
        ];
    }
1354215
protected function getUserRoles()
    {
        if (!$this->auth->guest()) {
            return $this->auth->roles();
        }


        return $this->roles->has('guest') ? ['guest'] : [];
    }
824686
public function all()
    {
        if ( $this->subject == 'user' ) {
            return $this->getUserPermissions( $this->user );
        } elseif ( $this->subject == 'role' ) {
            return $this->getRolePermissions( $this->role );
        }
    }
1050646
public function findAllUsers()
    {
        $this->checkDb();
        return $this->db->connect()
                        ->select()
                        ->from($this->tableName)
                        ->where("deleted IS NULL")
                        ->execute()
                        ->fetchAllClass(get_class($this));
    }
1288888
public function getDefaults()
    {
        return [
            'activation_token_expire' => self::SECONDS_ACTIVATION_TOKEN_EXPIRE,
            'allow_polls' => self::FLAG_ALLOW_POLLS,
            'email_token_expire' => self::SECONDS_EMAIL_TOKEN_EXPIRE,
            'from_email' => self::DEFAULT_FROM_EMAIL,
            'from_name' => self::DEFAULT_FROM_NAME,
            'hot_minimum' => self::HOT_MINIMUM,
            'maintenance_mode' => self::MAINTENANCE_MODE,
            'max_attempts' => self::MAX_SEND_ATTEMPTS,
            'members_visible' => self::FLAG_MEMBERS_VISIBLE,
            'merge_posts' => self::FLAG_MERGE_POSTS,
            'meta_description' => self::META_DESCRIPTION,
            'meta_keywords' => self::META_KEYWORDS,
            'name' => self::PODIUM_NAME,
            'password_reset_token_expire' => self::SECONDS_PASSWORD_RESET_TOKEN_EXPIRE,
            'recaptcha_secretkey' => '',
            'recaptcha_sitekey' => '',
            'registration_off' => self::REGISTRATION_OFF,
            'use_captcha' => self::FLAG_USE_CAPTCHA,
            'use_wysiwyg' => self::FLAG_USE_WYSIWYG,
            'version' => Podium::getInstance()->version,
        ];
    }
78139
public function getUsers()
    {
        if ($this->users === null) {
            $this->setUsers($this->userRepository->getAllByEnvironment($this));
        }
        return $this->users;
    }
1149097
public function getPermissions(): array
    {
        $userID = $this->getID();
        if ($userID === null) {
            return [];
        }
        $data = Internal\Data::getValue('bearcms/users/user/' . md5($userID) . '.json');
        if ($data !== null) {
            $user = json_decode($data, true);
            return isset($user['permissions']) ? $user['permissions'] : [];
        }
        return [];
    }
632149
protected function getUserRules()
    {
        $rules = [];

        foreach ($this->repository->all() as $field) {
            $rules[$field->getName()] = $field->getOption('rules');
        }

        return $rules;
    }
1079391
public function getCredentials()
    {
        $rc_file = $this->parse();
        if ( array_key_exists('username',$rc_file) && array_key_exists('username',$rc_file)) {
            return [$rc_file['username'],$rc_file['token']];
        }
    }
736770
public function getAllOptions() {
      $options = array();

      foreach($this->_flags as $option => $index) {
        if(array_key_exists($index, $this->_options)) {
          $options[$option] = $this->_options[$index];
        }
      }

      return $options;
    }