Get all dashboards which a user has created.

@param string $userLogin login of the user
@return \array[]
11465
private function getUserDashboards($userLogin)
    {
        $userDashboards = $this->dashboard->getAllDashboards($userLogin);

        $dashboards = array();

        foreach ($userDashboards as $userDashboard) {
            $widgets = $this->getVisibleWidgetsWithinDashboard($userDashboard);
            $dashboards[] = $this->buildDashboard($userDashboard, $widgets);
        }

        return $dashboards;
    }
775616
protected function getAllRoles(User $user)
    {
        $roles = [
            'Neos.Flow:Everybody' => $this->policyService->getRole('Neos.Flow:Everybody'),
            'Neos.Flow:AuthenticatedUser' => $this->policyService->getRole('Neos.Flow:AuthenticatedUser')
        ];

        /** @var Account $account */
        foreach ($user->getAccounts() as $account) {
            $accountRoles = $account->getRoles();
            /** @var $currentRole Role */
            foreach ($accountRoles as $currentRole) {
                if (!in_array($currentRole, $roles)) {
                    $roles[$currentRole->getIdentifier()] = $currentRole;
                }
                /** @var $currentParentRole Role */
                foreach ($currentRole->getAllParentRoles() as $currentParentRole) {
                    if (!in_array($currentParentRole, $roles)) {
                        $roles[$currentParentRole->getIdentifier()] = $currentParentRole;
                    }
                }
            }
        }

        return $roles;
    }
215231
public function getUserGroups(string $userId = ''): array
    {
        // if not specified, get current user's id
        if (empty($userId)) {
            $userId = $this->Auth->user('id');
        }

        $groups = TableRegistry::get('Groups.Groups');

        $query = $groups->find('list', [
            'keyField' => 'id',
            'valueField' => 'name'
        ]);
        $query->matching('Users', function ($q) use ($userId) {
            return $q->where(['Users.id' => $userId]);
        });

        return $query->toArray();
    }
1033727
public function getChildren(User $user)
    {
        $returnArray = array();
        foreach ($this->userList as $u) {
            /** @var $u User */
            if ($u->getParent() == $user->getUsername()) {
                $returnArray[] = $u;
                $returnArray = array_merge($returnArray, $this->getChildren($u));
            }
        }
        return $returnArray;
    }
685466
public static function getByLogin($username)
    {    
        $fields = self::getDbConnection()->fetchAssoc( 'SELECT * FROM '.User::TABLE.' WHERE login = ?', array( $username ) );
        if (!$fields) return false;
        return self::fetch($fields);    
  	}
42966
protected function loadEzUser($login)
    {
        if (empty($login)) {
            return null;
        }

        /** @var \eZ\Publish\API\Repository\UserService $userService */
        $userService = $this->getContainer()->get('ezpublish.api.service.user');

        try {
            return $userService->loadUserByLogin($login);
        } catch (NotFoundException $e) {
            return null;
        }
    }
625245
public function listUserOrganizations(string $username): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/users/:username/orgs', $username));
    }
347360
public function loadByLogin($login)
    {
        try {
            return $this->innerGateway->loadByLogin($login);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1319775
public function getRegistrationsSummaryForUser(User $user)
    {
        $data = [];
        $rsm = $this->createResultSetMappingBuilder('d');
        $rsm->addScalarResult('sbas_id','sbas_id');
        $rsm->addScalarResult('base_id','base_id');
        $rsm->addScalarResult('dbname','dbname');
        $rsm->addScalarResult('time_limited', 'time_limited');
        $rsm->addScalarResult('limited_from', 'limited_from');
        $rsm->addScalarResult('limited_to', 'limited_to');
        $rsm->addScalarResult('actif', 'actif');

        $sql = "
        SELECT dbname, sbas.sbas_id, time_limited,
               UNIX_TIMESTAMP( limited_from ) AS limited_from,
               UNIX_TIMESTAMP( limited_to ) AS limited_to,
               bas.server_coll_id, Users.id, basusr.actif,
               bas.base_id, " . $rsm->generateSelectClause(['d' => 'd',]) . "
        FROM (Users, bas, sbas)
          LEFT JOIN basusr ON ( Users.id = basusr.usr_id AND bas.base_id = basusr.base_id )
          LEFT JOIN Registrations d ON ( d.user_id = Users.id AND bas.base_id = d.base_id )
        WHERE basusr.actif = 1 AND bas.sbas_id = sbas.sbas_id
        AND Users.id = ?";

        $query = $this->_em->createNativeQuery($sql, $rsm);
        $query->setParameter(1, $user->getId());

        foreach ($query->getResult() as $row) {
            $registrationEntity = $row[0];
            $data[$row['sbas_id']][$row['base_id']] = [
                'base-id' => $row['base_id'],
                'db-name' => $row['dbname'],
                'active' => (Boolean) $row['actif'],
                'time-limited' => (Boolean) $row['time_limited'],
                'in-time' => $row['time_limited'] && ! ($row['limited_from'] >= time() && $row['limited_to'] <= time()),
                'registration' => $registrationEntity
            ];
        }

        return $data;
    }
1182155
public function getUserCapabilities(string $userId): array
    {
        if (empty($this->userCapabilities)) {
            $this->userCapabilities = Utils::fetchUserCapabilities($userId);
        }

        return $this->userCapabilities;
    }
1056831
public function getPassRequestDataByLogin($login) 
    {
        $table = $this->getServiceLocator()->get('MelisLostPasswordTable');
        $data = $table->getEntryByField('rh_login', $login);
        
        if($data)
            return $data;
    }
1349467
protected function getRoles($userId)
    {
        $roles = [];
        $result = $this->userRoles->query(new RqlQuery(new EqNode($this->config['userIdInUserRoles'], $userId)));

        foreach ($result as $item) {
            $role = $this->roles->read($item[$this->config['roleIdInUserRoles']]);

            if (isset($role[$this->config['roleName']])) {
                $roles[] = $role[$this->config['roleName']];
            }
        }

        return $roles;
    }
612927
public function getList(array $options)
    {
        $options += array('active' => true);

        $sql = 'SELECT * FROM dashboard';

        $conditions = array();

        if (isset($options['user_id'])) {
            $sql .= ' WHERE user_id=?';
            $conditions[] = $options['user_id'];
        }

        $list = $this->db->fetch($sql, $conditions, array('unserialize' => 'data'));
        $result = $this->prepareList($list, $options);

        $this->hook->attach('dashboard.get.user', $result, $this);
        return $result;
    }
648979
public function getUserData($login_name, $organization)
    {
        $orgs = null;

        try {
            $orgs = $this->db->fetchPairs("SELECT gor_id_organization, gor_name FROM gems__organizations WHERE gor_active = 1 ORDER BY gor_name");
            natsort($orgs);
        } catch (\Zend_Db_Exception $zde) {
        }
        if (! $orgs) {
            // Table might not exist or be empty, so do something failsafe
            $orgs = array($organization => 'create db first');
        }

        return array(
            'user_id'                => \Gems_User_UserLoader::SYSTEM_USER_ID,
            'user_login'             => $login_name,
            'user_name'              => $login_name,
            'user_group'             => 800,
            'user_role'              => $this->project->getConsoleRole(),
            'user_style'             => 'gems',
            'user_base_org_id'       => $organization,
            'user_allowed_ip_ranges' => null,
            'user_blockable'         => false,
            '__allowedOrgs'          => $orgs
            );
    }
259068
public function getCampaignsByLogin($login)
    {
        $resource = 'campaigns/by_login/' . $login . '.json';

        $response = $this->sendRequest('GET', $this->getServiceUrl($resource));

        $decodedResponseBody = $this->getDecodedBody($response->getBody());

        $getCampaignsResponse = new Models\GetCampaignsResponse($decodedResponseBody);
        return $getCampaignsResponse->getCampaigns();
    }
156625
public function allLoggedIn(): Collection
    {
        return DB::table('user')
            ->join('session', 'session.user_id', '=', 'user.user_id')
            ->where('user.user_id', '>', 0)
            ->orderBy('real_name')
            ->select(['user.*'])
            ->distinct()
            ->get()
            ->map(User::rowMapper());
    }
858393
public function createTokenAuth($userLogin)
    {
        return md5($userLogin . microtime(true) . Common::generateUniqId() . SettingsPiwik::getSalt());
    }