src/AdminStore.php
public function adm_list_user($args) {
		$this->init();

		if (!$this->store_is_logged_in())
			return [AdminStoreError::USER_NOT_LOGGED_IN];

		if (!$this->authz_list_user())
			return [AdminStoreError::USER_NOT_AUTHORIZED];

		extract($args['post']);

		$page = isset($page) ? (int)$page : 0;
		if ($page < 0)
			$page = 0;

		$limit = isset($limit) ? (int)$limit : 10;
		if ($limit <= 0 || $limit >= 40)
			$limit = 10;

		$offset = $page * $limit;

		if (!isset($order) || !in_array($order, ['ASC', 'DESC']))
			$order = '';

		// @note MySQL doesn't support '?' placeholder for limit and
		// offset.
		$stmt = sprintf(
			"SELECT uid, uname, fname, site, since " .
			"FROM udata ORDER BY uid %s LIMIT %s OFFSET %s",
		$order, $limit, $offset);

		return [0, $this->store->query($stmt, [], true)];
	}
public function adm_list_user($args) {
		$this->init();

		if (!$this->store_is_logged_in())
			return [AdminStoreError::USER_NOT_LOGGED_IN];

		if (!$this->authz_list_user())
			return [AdminStoreError::USER_NOT_AUTHORIZED];

		extract($args['post']);

		$page = isset($page) ? (int)$page : 0;
		if ($page < 0)
			$page = 0;

		$limit = isset($limit) ? (int)$limit : 10;
		if ($limit <= 0 || $limit >= 40)
			$limit = 10;

		$offset = $page * $limit;

		if (!isset($order) || !in_array($order, ['ASC', 'DESC']))
			$order = '';

		// @note MySQL doesn't support '?' placeholder for limit and
		// offset.
		$stmt = sprintf(
			"SELECT uid, uname, fname, site, since " .
			"FROM udata ORDER BY uid %s LIMIT %s OFFSET %s",
		$order, $limit, $offset);

		return [0, $this->store->query($stmt, [], true)];
	}
public function adm_list_user ( $ args ) { $ this -> init ( ) ; if ( ! $ this -> store_is_logged_in ( ) ) return [ AdminStoreError :: USER_NOT_LOGGED_IN ] ; if ( ! $ this -> authz_list_user ( ) ) return [ AdminStoreError :: USER_NOT_AUTHORIZED ] ; extract ( $ args [ 'post' ] ) ; $ page = isset ( $ page ) ? ( int ) $ page : 0 ; if ( $ page < 0 ) $ page = 0 ; $ limit = isset ( $ limit ) ? ( int ) $ limit : 10 ; if ( $ limit <= 0 || $ limit >= 40 ) $ limit = 10 ; $ offset = $ page * $ limit ; if ( ! isset ( $ order ) || ! in_array ( $ order , [ 'ASC' , 'DESC' ] ) ) $ order = '' ; // @note MySQL doesn't support '?' placeholder for limit and // offset. $ stmt = sprintf ( "SELECT uid, uname, fname, site, since " . "FROM udata ORDER BY uid %s LIMIT %s OFFSET %s" , $ order , $ limit , $ offset ) ; return [ 0 , $ this -> store -> query ( $ stmt , [ ] , true ) ] ; }
List all users.

@param array $args Dict with keys: `page`, `limit`, `order`
where `order` is `ASC` or `DESC`.

@manonly
@SuppressWarnings(PHPMD.CyclomaticComplexity)
@SuppressWarnings(PHPMD.NPathComplexity)
@endmanonly
List all users .