;;; This file contains the needed mechanism ensure authentification in php files
;;;
;;; License GPL
;;; Authors: Vincent Danjean

<defvar db_host "localhost">
<defvar db_user "user">
<defvar db_pass "password">
<defvar db_database "database">

<define-tag phpcode endtag=required>;;;
<ifeq $(PHP) 1
  <group
%body
  />
/>
</define-tag>

<phpcode><protect><?php
          ob_start();
	  error_reporting(E_ALL);
	  require_once("php/lib_db.php");
</protect>
    <ifeq $(auth) "user"
      <group
<protect>
	  db_auth("user");
</protect>
      />
    />
    <ifeq $(auth) "root"
      <group
<protect>
	  db_auth("root");
</protect>
      />
    />
    <ifeq $(auth) "anon"
      <group
<protect>
	  db_auth_user(1, "");
</protect>
      />
    />
<protect>
          ob_end_flush();
?></protect>
  </phpcode>

<define-tag phpinit>
  <phpcode>
<protect><?php
	  require_once("php/lib_annuaire.php");
?></protect>
  </phpcode>
</define-tag>