Using the Back Office

The Amfphp Back Office is made up of 3 main tools:

Editing the Back Office configuration

The easy way is to edit Amfphp_BackOffice_Config. The problem with editing Amfphp_BackOffice_Config directly is that you’re editing Amfphp’s source code, so you risk overwriting your changes when you upgrade. The alternative is to create « extraConfig.php » next to it.
Here’s a sample extraConfig.php:


<?php
$this->backOfficeCredentials['a'] = 'a';
$this->amfphpEntryPointPath = '../Tests/TestData/index.php';

Getting Access

The Back Office is protected by a sign in, so that it can be safely put online. To keep things simple the Back Office does not use a database. This means that  credentials(username and passwords) are stored directly in the configuration of the Back Office, and that there is no ‘remember me’ feature.

By default, no credentials are set, so it is not possible to access the Back Office.

So to use it, the first step is to add some credentials.


$this->backOfficeCredentials['yourUserName'] = 'yourPassWord';

Alternatively, if this is a private server, you may want to do without signing in altogether. In that case, you must make 2 changes:

  • edit the Back Office config so that it doesn’t require signing in

    $this->requireSignIn = false;
  • edit the Amfphp Config file so that the AmfphpDiscovery and AmfphpMonitor plugins don’t restrict access

    $this->pluginsConfig['AmfphpDiscovery']['restrictAccess'] = false;
    $this->pluginsConfig['AmfphpMonitor']['restrictAccess'] = false;

Once you’ve done this you should be able to sign in to the Back Office.

Using another entry point

By default the Back Office uses « ../Amfphp/index.php » as an entry point. If you want to use another URL:


$this->amfphpEntryPointPath = '../Tests/TestData/index.php';

How it works

The BackOffice is nearly all HTML/Javascript. The only things done in PHP are some initialization and controlling access via sessions. It communicates with Amfphp mostly using JSON and with some AMF, so it’s important that the AmfphpJson plugin is available. It pulls its data from 2 services, AmfphpDiscoveryService and AmfphpMonitorService. These are part of the the AmfphpDiscovery and and AmfphpMonitor plugins respectively.

AmfphpDiscovery is used to analyse Amfphp services and returns information about them to the Back Office. It is used by the Client Generator and the Service Browser, so don’t disable it if you want to use these parts of the Back Office. If you want to hide a method or service from AmfphpDiscovery, put the @amfphpHide tag in its comment. The AmfphpDiscovery uses this itself so it doesn’t show up in the Service Browser.

AmfphpMonitor is used to gather data about performance, and is used by the Profiler, so don’t disable it if you want to use the Profiler.

Access to these services is controlled by the AmfphpAuthentication plugin, so unless you are on a private server, don’t disable the AmfphpAuthentication plugin because otherwise anybody can call these services to gather information about your server.

These 4 plugins are all included in the download and enabled by default, so you shouldn’t need to play with them.

Comments

  1. ChristianL

    1 Oct 14

    How to get rid of the error messages:
    « Fatal error: Uncaught exception ‘Amfphp_Core_Exception’ with message ‘User not authenticated’ in ../Amfphp/Plugins/AmfphpAuthentication/AmfphpAuthentication.php:136 »

    like i. e. seen on http://www.baguetteamf.com/test/BackOffice/ServiceBrowser.php when trying to call Service Browser or Client Generator with a password protected AMF Back Office?

    When following the two steps to use Back Office without signing in everything works, but I want to use it with user credentials.

  2. rrrfusco

    30 Nov 14

    The writeup refers to Amfphp_BackOffice_Config when the configuration file to be edited is /amfphp-2.xxx/BackOffice/Config.php

    Without a link or mention of Config.php, one might search for /doc/classes/Amfphp_BackOffice_Config

    Personally, I’d put ‘Gaining Access’ paragraph first and make it simple as possible.

  3. ReggieTheDog

    20 Juil 15

    rrrfusco was absolutely right. Without a link or mention of Config.php, one might search for /doc/classes/Amfphp_BackOffice_Config.

    Perhaps you might want to suggest make changes to the config.php file located in ..\amfphp xx\BackOffice. Once changes are saved, copy the file, rename the original file as configOrig.php and then paste the copied file to the same directory. End result
    one file named configOrig.php, one file named config.php and both are identical in content. If a new release overwrites the config.php you can always go back to configOrig.php for settings.

  4. ReggieTheDog

    20 Juil 15

    suggest update to your bullet

    « edit the Amfphp Config file so that the AmfphpDiscovery and AmfphpMonitor plugins don’t restrict access »
    edit the amfPHP config.php file located in the ..\amfphp-x.x.x\Amfphp\Core folder

Laissez un commentaire

Événements à venir / Upcoming Events

  1. Master Class Web Design à l’E2C95

    17 mai - 5 juillet

News letter

Evénements Silex Labs sur Paris et sa région: Inscrivez vous à la Newsletter mensuelle

Silex Labs community Tweets

Facebook page

Abonnez-vous aux news via Email

Rejoignez 42 autres abonnés