2

I'm customizing a phpLdapAdmin web site and I need to create a new settings page where users will change various configuration values inside the config.php file.

The page will not read or change any LDAP object. It will only read/write a config file.

What is the best approach?

The simplest is to develop a php page without the phpLdapAdmin libs and references and to load it inside phpLdapAdmin page using an iframe.

The second option is to create a new command "custom_config" and create a page integrated with phpLdapAdmin that uses the libs and the templating engine.

Are there any other solutions? What is the best way to develop this page?

Are there any document describing the phpLdapAdmin development?

Thanks in advance for your help.

4 April 2017 Note:

I ended developing a custom page that includes the common.php file in order to access the serverList function. This is needed if your page needs to know when the session is expired:

ini_set('display_errors', 1); //useful to get error details
include("../lib/common.php");
..
$islogged = false;
foreach ($_SESSION[APPCONFIG]->getServerList() as $index => $server) {
    if ($server->isLoggedIn(null)) {
        //echo('logged!');
        $islogged = true;
        break;
    }
}

//redirect to login if session is expired
if (!$islogged)
    header('Location: index.php');

The page doesn't use the phpLdapAdmin commands architecture, it was simple to develop an external page.

I found useful the Config_Lite php library for reading and writing a configuration file.

Matteo Conta
  • 1,423
  • 13
  • 17

0 Answers0