xlabs/mmadminbundle

Admin functionalities by browser extension


Keywords
xlabs mmadmin bundle
License
MIT

Documentation

A redis driven like engine.

Installation

Install through composer:

php -d memory_limit=-1 composer.phar require xlabs/mmadminbundle

In your AppKernel

public function registerbundles()
{
    return [
    	...
    	...
    	new XLabs\MMAdminBundle\XLabsMMAdminBundle(),
    ];
}

Routing

Append to main routing file:

# app/config/routing.yml

x_labs_mm_admin:
    resource: "@XLabsMMAdminBundle/Resources/config/routing.yml"
    prefix:   /

Configuration sample

Default values are shown below:

# app/config/config.yml

x_labs_mm_admin:
    user_class: XLabs\CoreBundle\Entity\User

Usage

Append this anywhere in you template

{% embed 'XLabsMMAdminBundle:MMAdmin:container.html.twig' with {
    'userSwitch': true,
    ...
} %}
{% endembed %}

You can send the following switchers to the template:

userSwitch: true/false
accountStatus: true/false

You can also add your own controls for your project, by defining the HTML/JS in a block within the embed label:

{% embed 'XLabsMMAdminBundle:MMAdmin:container.html.twig' with {
    'userSwitch': true,
    ...
} %}
    {% block _xlabs_mmadmin_custom %}
        ...
    {% endblock _xlabs_mmadmin_custom %}
{% endembed %}

Browser extension

Try on Firefox this url: https://addons.mozilla.org/firefox/downloads/file/733781/manicamedia_admin_extension-1.0-an+fx-windows.xpi?src=devhub

  • OR - Point your Firefox to 'about:debugging' and install a temporary extension. You will find it under:
MMAdminBundle\Resources\public\firefox_ext\ManicaMedia_Admin.xpi

Authentication handlers: Login / Logout

If you have any login/logout handlers set, make sure to create the following services and set your current handlers as parent services for them:

# YourBundle/Resources/config/services.yml
services:
    ...
    
    xlabs_mmadmin_login_handler:
        parent: <your_login_handler_service_id>
            
    xlabs_mmadmin_logout_handler:
        parent: <your_logout_handler_service_id>

Also make sure to include in your handlers a way to skip captcha, if set in login page:

...
if($captcha_verified || $container->get('xlabs_mm_admin')->isMMAdmin() || ...)
{
    ...