Location: PHPKode > scripts > Usermanage > usermanage/ReadME.html
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Usermanage ReadMe</title>
</head>

<body>

<b>Preamble</b>
<blockquote> 
  <p>By using this software, you agree to the terms of the <a href="LICENCE.txt">GPL 
    licence</a>.</p>
  <p>LEMP is a mini-framework that can help developers focus on their concept. 
    It is extended by modules to form the base and provide functions like database 
    interaction, which could also be extended by other modules like user management.</p>
  </blockquote>
<p><u><b>Sections</b></u></p>
<center>
    <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber5" width="578" bgcolor="#E8EFFF">
      <tr>
        <td width="574">
  <ol>
    <li><a href="#Intro">Intro</a></li>
    <li><a href="#Setup">Setup</a></li>
    <li><a href="#Modules">Modules</a></li>
    <li><font color="#FF0000"><a href="http://usermanage.sourceforge.net/docs/">
    Developers Guide</a></font><font size="1" color="#FF0000"> *</font></li>
    <li><a href="http://usermanage.sourceforge.net/">LEMP Homepage</a><font size="1" color="#FF0000"> *</font></li>
  </ol>
        <p><font size="1" color="#FF0000">* - Denotes an external link</font></td>
      </tr>
    </table>
    </center>
<p><u><b>Section 1 - <a name="Intro">Intro</a></b></u>
<blockquote> 
  <p>You must include lemp.php and create the object with create_obj:
  <center>
    <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber1" height="83" bgcolor="#E8EFFF">
      <tr>
                          
        <td NORAP> <p><code><font color="#000000"><font color="#0000CC">&lt;?php 
            <br />
            &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">include&nbsp;(</font><font color="#CC0000">'LEMP/lemp.php'</font><font color="#006600">);&nbsp;&nbsp;</font><font color="#FF9900">// 
            Point this to lemp.php <br />
            &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000CC">$lemp&nbsp;</font><font color="#006600">=&nbsp;&amp;</font><font color="#0000CC">create_obj&nbsp;</font><font color="#006600">();&nbsp; 
            &nbsp;&nbsp;&nbsp;</font><font color="#FF9900">// Create a reference 
            to the object <br />
            </font><font color="#0000CC">?&gt; 
            <br />
            </font> </font> </code> </p>
          </td>
      </tr>
    </table>
    </center>
  <br>
  <br>
  Restrict access to members only: <br>
  <br>
  <center>
    <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber2" bgcolor="#E8EFFF">
      <tr>
        <td height="115"><code><font color="#000000"><font color="#0000CC">&lt;?php 
          <br />
          &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">include&nbsp;(</font><font color="#CC0000">'LEMP/lemp.php'</font><font color="#006600"></font><font color="#006600">); 
          </font><font color="#FF9900">// Point this to lemp.php <br />
          &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000CC">$lemp&nbsp;</font><font color="#006600">=&nbsp;&amp;</font><font color="#0000CC">create_obj&nbsp;</font><font color="#006600">();&nbsp;&nbsp;</font><font color="#FF9900"> 
          </font><font color="#006600">&nbsp;</font><font color="#FF9900">// Create 
          a reference to the object<br />
          &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">if&nbsp;(</font><font color="#0000CC">$lemp</font><font color="#006600">-&gt;</font><font color="#0000CC">access&nbsp;</font><font color="#006600">&lt;=&nbsp;</font><font color="#0000CC">0</font><font color="#006600">)&nbsp;{&nbsp;</font><font color="#FF9900">// 
          Check the user's access (currently only 1 and 0)<br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000CC">error_add</font><font color="#006600">(</font>AUTH_NOT_LOGED_IN<font color="#006600">);&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF9900">// 
          Add error to log <br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">echo&nbsp;</font><font color="#0000CC">error_get_all&nbsp;</font><font color="#006600">(<font color="#000000">LEMP_HTML</font>);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF9900">// 
          Display all errors <br />
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">exit&nbsp;();&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#FF9900">// 
          Terminate script <br />
          &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">} <br />
          </font><font color="#0000CC">?&gt; </font></font></code></td>
      </tr>
    </table>
    </center>
  
</blockquote>
<p><u><b>Section 2 - <a name="Setup">Setup</a></b></u></p>
<blockquote>
  <p>* You should replace index.php with a custom page.<br>
    * You <u>should</u> <strong>remove setup.php</strong> after you have installed 
    LEMP, and then replace it when you want to remove it.</p>
  <p>Edit config.php<br>
  You must edit the vales shown below.</p>
  <font SIZE="2" COLOR="#800000"><blockquote>
<center>
    <table border="2" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" id="AutoNumber6" bgcolor="#E8EFFF">
      <tr>
          <td><code><font color="#000000"><font color="#0000CC">&lt;?php </font></font> 
            <p><font SIZE="2" color="#008000">// ...<br>
              // Edit the database config</font><font SIZE="2" COLOR="#c0c000"><br>
              </font><font SIZE="2" COLOR="#800000">$db</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'host'</font><font SIZE="2">] 
              = </font><font SIZE="2" COLOR="#0000f0">&quot;localhost&quot;</font><font SIZE="2">; 
              </font><font SIZE="2" color="#008000">// example - mysql.mysqlhost.com 
              or localhost</font><font SIZE="2" COLOR="#c0c000"><br>
              </font><font SIZE="2" COLOR="#800000">$db</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'username'</font><font SIZE="2">] 
              = </font><font SIZE="2" COLOR="#0000f0">&quot;LEMP&quot;</font><font SIZE="2">;&nbsp; 
              </font><font SIZE="2" color="#008000">// Database user name</font><font SIZE="2" COLOR="#c0c000"><br>
              </font><font SIZE="2" COLOR="#800000">$db</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'password'</font><font SIZE="2">] 
              = </font><font SIZE="2" COLOR="#0000f0">&quot;LEMP&quot;</font><font SIZE="2">; 
              </font><font SIZE="2" color="#008000">// Database password</font><font SIZE="2" COLOR="#c0c000"><br>
              </font><font SIZE="2" COLOR="#800000">$db</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'database'</font><font SIZE="2">] 
              = </font><font SIZE="2" COLOR="#0000f0">&quot;LEMP&quot;</font><font SIZE="2">;&nbsp; 
              </font><font SIZE="2" color="#008000">// Name of the database database 
              to use</font><font SIZE="2" COLOR="#c0c000"><br>
              </font><font SIZE="2" COLOR="#800000">$db</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'prefix'</font><font SIZE="2">] 
              = </font><font SIZE="2" COLOR="#0000f0">&quot;user&quot;</font><font SIZE="2">;&nbsp; 
              </font><font SIZE="2" COLOR="#008000">// Table names will start 
              with [prefix]_tablename. This cannot contain any underscores.</font><font SIZE="2" COLOR="#800000"><br>
              </font><font SIZE="2" COLOR="#800000"><font SIZE="2" color="#008000">// 
              ...<br>
              <br>
              </font></font><font color="#000000"><font color="#0000CC">?&gt; 
              </font></font></code></td>
      </tr>
    </table>
    </center>
</blockquote>
  <p>&nbsp;</p>
</blockquote>
<p><u><b>Section 3 - <a name="Modules">Modules</a></b></u></p>
<blockquote> 
  <p>All modules should be contained in a sub folder within "LEMP".</p>
  <p>To make sure that LEMP is aware of the module, enter the module schematics 
    in config.php.</p>
  <table border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#E8EFFF" id="AutoNumber4" style="border-collapse: collapse">
    <tr> 
      <td NOWRAP><p><code><font SIZE="2" color="#008000">// Schema goes like $objects['module_name']['data_name'] 
          = 'data';</font></code><br>
          <code><font SIZE="2" COLOR="#800000">$objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">][</font><font SIZE="2" COLOR="#0000f0">'file'</font><font SIZE="2">] 
          = </font><font SIZE="2" COLOR="#0000f0">'access/access.php'</font><font SIZE="2">;<br>
          </font><font SIZE="2" COLOR="#800000"> $objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">][</font><font SIZE="2" COLOR="#0000f0">'class'</font><font SIZE="2">] 
          = </font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">;</font><font color="#000000"><font color="#006600"> 
          </font><font color="#FF9900">// Optional</font></font><font SIZE="2"><br>
          </font><font SIZE="2" COLOR="#800000"> $objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">][</font><font SIZE="2" COLOR="#0000f0">'parent'</font><font SIZE="2">] 
          = </font><font SIZE="2" COLOR="#0000f0">'dbdat'</font><font SIZE="2">;</font><font color="#000000"><font color="#006600"> 
          </font><font color="#FF9900">// Optional</font></font><font SIZE="2"><br>
          </font><font SIZE="2" COLOR="#800000"> $objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">][</font><font SIZE="2" COLOR="#0000f0">'mode'</font><font SIZE="2">] 
          = </font><font SIZE="2" COLOR="#0000f0">'single'</font><font SIZE="2">;</font><font color="#000000"><font color="#006600"> 
          </font><font color="#FF9900">// Optiona</font></font><font color="#FF9900" SIZE="2">l</font><font SIZE="2"><br>
          </font><font SIZE="2" COLOR="#800000"> $objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'access'</font><font SIZE="2">][</font><font SIZE="2" COLOR="#0000f0">'args'</font><font SIZE="2">] 
          = array(</font><font SIZE="2" COLOR="#0000f0">'table'</font><font SIZE="2"> 
          =&gt; </font><font SIZE="2" COLOR="#0000f0">'dbdat'</font><font SIZE="2">);</font><font color="#000000"><font color="#006600"> 
          </font><font color="#FF9900">// Optional</font></font></code></p></td>
    </tr>
  </table>
  <blockquote> 
    <p><strong>Module_Name</strong> - This is the name you will use when you call 
      create_obj.</p>
    <table border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#E8EFFF" id="AutoNumber4" style="border-collapse: collapse">
      <tr> 
        <td NOWRAP><p><code><font color="#000000"><font color="#0000CC">&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#006600">include&nbsp;(</font><font color="#CC0000">'LEMP/lemp.php'</font><font color="#006600">); 
            </font><font color="#FF9900">// Point this to lemp.php <br />
            &nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000CC">$lemp&nbsp;</font><font color="#006600">=&nbsp;&amp;</font><font color="#0000CC">create_obj&nbsp;</font><font color="#006600">(<font color="#CC0000">'module_name'</font>); 
            </font><font color="#FF9900">// Create a reference to the object<br />
            </font></font></code></p></td>
      </tr>
    </table>
    <p>if you set</p>
    <table border="2" align="center" cellpadding="0" cellspacing="0" bordercolor="#111111" bgcolor="#E8EFFF" id="AutoNumber4" style="border-collapse: collapse">
      <tr> 
        <td NOWRAP><p><code><font SIZE="2" COLOR="#800000">$objects</font><font SIZE="2">[</font><font SIZE="2" COLOR="#0000f0">'</font><font SIZE="2" COLOR="#0000f0">default'</font><font SIZE="2">] 
            = </font><font color="#000000"><font color="#006600"><font color="#CC0000">'module_name'</font></font></font><font SIZE="2">;</font><font SIZE="2"></font></code></p></td>
      </tr>
    </table>
    <p>create_obj will create module_name on default, and you won't need to pass 
      any arguments.</p>
    <p> <strong>File</strong> - Point to the module class file from the directory 
      that lemp.php resides in. You can use '..' to travel up the folder hierarchy.</p>
    <p> <strong>Class</strong> - Optional, when class is not the same as the filename 
      (without the extensions).</p>
    <p> <strong>Parent</strong> - Only needed when module requires other classes 
      to be loaded first.</p>
    <p> <strong>Mode</strong> - Can either be 'single' or 'multi'. In single mode, 
      only one instance of the module will be used. In multi mode, a new instance 
      is used when create_obj (UMClass_Name) is called.</p>
    <p><strong>Args</strong> - This is module specific and should be documented 
      by the module.</p>
  </blockquote>
</blockquote>

</body>

</html>
Return current item: Usermanage