PHPackages                             armenio/armenio-zf2-restrictaccess-module - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. armenio/armenio-zf2-restrictaccess-module

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

armenio/armenio-zf2-restrictaccess-module
=========================================

Restrict Access (Database|Ldap) Module for Zend Framework 2

1.0.17(9y ago)262MITPHP

Since May 7Pushed 9y ago1 watchersCompare

[ Source](https://github.com/armenio/armenio-zf2-restrictaccess-module)[ Packagist](https://packagist.org/packages/armenio/armenio-zf2-restrictaccess-module)[ Docs](https://github.com/armenio/armenio-zf2-restrictaccess-module)[ RSS](/packages/armenio-armenio-zf2-restrictaccess-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (1)Versions (19)Used By (0)

armenio-zf2-restrictaccess-module
=================================

[](#armenio-zf2-restrictaccess-module)

The Restrict Access Module for Zend Framework 2

How to install
--------------

[](#how-to-install)

1. Install via composer. Don't know how? [Look here](http://getcomposer.org/doc/00-intro.md#introduction)
2. `cd my/project/directory`
3. Edit composer.json :

    ```
    {
    	"require": {
    		"armenio/armenio-zf2-restrictaccess-module": "1.*"
    	}
    }
    ```
4. Edit config/application.config.php :

    ```
    'modules' => array(
    	 'Application',
    	 'RestrictAccess', // array(
            'factories' => array(
                'AuthenticationService' => function(\Zend\ServiceManager\ServiceManager $serviceManager) {
                    $service = new \RestrictAccess\Service\Authentication\DbTableService();
                    // $service = new \RestrictAccess\Service\Authentication\LdapService();

                    $service->setServiceManager($serviceManager);

                    return $service;
                }
            ),
        ),
    ```
6. Usage inside Controllers

    6.1 Use with Zend\\Db

    ```
    $username = $data['username'];
    $password = $data['password'];

    $authService = $this->getServiceLocator()->get('AuthenticationService');

    $authService->setNamespace('Default');
    $authService->setTableName('users');
    $authService->setIdentityColumn('username');
    $authService->setCredentialColumn('password');

    $authenticationResult = $authService->authenticate($username, $password);

    if( ! $authenticationResult->isValid() ){
    	var_dump($authenticationResult->getMessages());
    }
    // else var_dump($authService->getIdentity());
    ```

    6.2 Use with Zend\\Ldap

    ```
    $username = $post['username'];
    $password = $post['password'];

    $ldapOptions = array(
    	'server1' => array(
    		'host' => 'dc1.w.net',
    		'useStartTls' => 'false',
    		'useSsl' => 'false',
    		'baseDn' => 'CN=Users,DC=w,DC=net',
    		'accountCanonicalForm' => 3,
    		'accountDomainName' => 'w.net',
    		'accountDomainNameShort' => 'W',
    	),
    );

    $authService = $this->getServiceLocator()->get('AuthenticationService');

    $authService->setNamespace('Default');
    $authService->setOptions($ldapOptions);

    $authenticationResult = $authService->authenticate($username, $password);

    if( ! $authenticationResult->isValid() ){
    	var_dump($authenticationResult->getMessages());
    }
    // else var_dump($authService->getIdentity());
    ```
7. Getting user identity

    ```
    if( $authService->hasIdentity() ){
    	var_dump($authService->getIdentity());
    }
    ```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~2 days

Total

18

Last Release

3612d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6cf8071002275755f2af2e5a99220bd99e8385118afe0c1aaa82c7603d4b66a3?d=identicon)[armenio](/maintainers/armenio)

---

Top Contributors

[![armenio](https://avatars.githubusercontent.com/u/349304?v=4)](https://github.com/armenio "armenio (32 commits)")

---

Tags

helperaclldapzf2armeniorestrictaccess

### Embed Badge

![Health badge](/badges/armenio-armenio-zf2-restrictaccess-module/health.svg)

```
[![Health](https://phpackages.com/badges/armenio-armenio-zf2-restrictaccess-module/health.svg)](https://phpackages.com/packages/armenio-armenio-zf2-restrictaccess-module)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
