title: How to develop a phplapadmin custom page
body: <p>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.</p>
  
  <p>The page will not read or change any LDAP object. It will only read/write a config file.</p>
  
  <p>What is the best approach? </p>
  
  <p>The simplest is to develop a php page without the phpLdapAdmin libs and references and to load it inside phpLdapAdmin page using an iframe.</p>
  
  <p>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.</p>
  
  <p>Are there any other solutions? What is the best way to develop this page?</p>
  
  <p>Are there any document describing the phpLdapAdmin development?</p>
  
  <p>Thanks in advance for your help.</p>
  
  <p><strong>4 April 2017 Note:</strong></p>
  
  <p>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:</p>
  
  <pre><code>ini_set('display_errors', 1); //useful to get error details
  include("../lib/common.php");
  ..
  $islogged = false;
  foreach ($_SESSION[APPCONFIG]-&gt;getServerList() as $index =&gt; $server) {
      if ($server-&gt;isLoggedIn(null)) {
          //echo('logged!');
          $islogged = true;
          break;
      }
  }
  
  //redirect to login if session is expired
  if (!$islogged)
      header('Location: index.php');
  </code></pre>
  
  <p>The page doesn't use the phpLdapAdmin commands architecture, it was simple to develop an external page.</p>
  
  <p>I found useful the <a href="https://github.com/pear/Config_Lite" rel="nofollow noreferrer">Config_Lite php library</a> for reading and writing a configuration file.</p>