/**
* cmsdAm is a powerful, simple, scalable, quick, secure, GPL released, PHP4 written from scratch
* Content Management System framework. It is specially designed for people having some basic
* PHP knowledge. You can create powerful professional sites in a while using cmsdAm, and you
* don't have to rewrite each time php code for handle each section, users, search engine, ecc.
* cmsdAm do all the work for you! You just have to configure it, and write HTML or PHP code
* for your sections. You don't have to care about mails, HTTP headers, HTML strange tags, META
* tags, HTTP cache mechanisms, ecc, just write HTML or PHP code for your sections.
*
* Enjoy!!! Dino Ciuffetti - dam2k@users.sourceforge.net
*
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program (COPYING); if not, go to http://www.fsf.org/ or write
* to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*
*/
// LDAP check
$ldap_ok = false;
while (true) { // :-) This is a great trick to have a break to stop code execution ... ;-)
$error = "Problema sconosciuto con LDAP server";
include ("ldap_check2.php");
// ******* Checking PHP LDAP support availability
$db_handle = "ldap_connect";
if (!is_callable($db_handle)) { // LDAP support is NOT available
echo "
Supporto LDAP in PHP
";
echo "Problema: Problemi con il supporto LDAP in PHP, impossibile continuare l'installazione
";
echo "Soluzione: Controllare se l'interprete PHP e' configurato con il supporto LDAP.
";
break;
} // LDAP support is available
echo "
Supporto LDAP in PHP
";
ob_flush();
flush();
// ******* Checking LDAP connection
$ldap_port = ""; // Not implemented in cmsdam!
$ldap_handle = ldap_conn ($LDAP_servername, $ldap_port);
if ($ldap_handle === false) {
echo "
Connessione al server LDAP
";
echo "Problema: Problemi con LDAP server, impossibile continuare l'installazione
";
echo "Soluzione: Controllare se il nome dell'host o l'indirizzo IP del server LDAP sono impostati correttamente e che il server sia up e accetta correttamente le connessioni.
";
echo "Errore del server: $error";
break;
}
echo "
Connessione al server LDAP
";
ob_flush();
flush();
// ******* Checking Root DN
$ldap_handle = ldap_rootbind ($LDAP_servername, "", $LDAP_rootdn, $LDAP_rootdnpass);
if ($ldap_handle === false) { // DB name not valid, user or password not valid
echo "
LDAP Root Bind
";
echo "Problema: Problemi con il bind da utente rootdn. Il rootdn o la password sono errati.
";
echo "Soluzione: Controllare se il rootdn e la password sono impostati correttamente, e se il server LDAP sta su e accetta le connessioni.
";
echo "Errore del server: $error";
break;
}
if ($LDAP_rootdn == "") { // Anonymous bind
echo "
LDAP Root Bind (Anonymous: Read only mode)
";
} else { // Read/Write mode, OK.
echo "
LDAP Root Bind
";
}
ob_flush();
flush();
// ******* Checking Base DN availability
$err = ldap_checkdn ($ldap_handle, $LDAP_basedn);
if ($err === false) { // search failed
echo "
Controllo Base DN
";
echo "Problema: Problemi con il Base DN. Il DN impostato non esiste o comunque sono occorsi problemi.
";
echo "Soluzione: Controllare il Base DN e l'alberatura LDAP.
";
echo "Errore del server: $error";
break;
}
echo "
Controllo Base DN
";
ob_flush();
flush();
// ******* Checking search filter
$err = ldap_checkfilter ($ldap_handle, $LDAP_basedn, $LDAP_filter);
if ($err === false) { // search failed
echo "
Controllo del filtro di ricerca
";
echo "Problema: Problemi con il search filter.
";
echo "Soluzione: Controllare la sintassi del filtro di ricerca su LDAP.
";
echo "Errore del server: $error";
break;
}
if ($err == 0) { // Search filter does not have syntax errors, but returned 0 rows!
echo "
Controllo del filtro di ricerca (NOTA: $err entries ritornate da LDAP)
";
} else {
echo "
Controllo del filtro di ricerca ($err entries ritornate da LDAP)
";
}
ob_flush();
flush();
// ******* Checking Group Base DN availability
$err = ldap_checkdn ($ldap_handle, $LDAP_groupbasedn);
if ($LDAP_groupbasedn == "") { // Group Base DN is not defined
$err = true;
}
if ($err === false) { // search failed
echo "
Controllo Group Base DN
";
echo "Problema: Problemi con il Group Base DN. Il DN impostato non esiste o comunque sono occorsi problemi.
";
echo "Soluzione: Controllare il Group Base DN e l'alberatura LDAP.
";
echo "Errore del server: $error";
break;
}
if ($LDAP_groupbasedn == "") { // Group Base DN is not defined
echo "
Controllo Group Base DN (Not defined: ldap groups disabled)
";
} else {
echo "
Controllo Group Base DN
";
}
ob_flush();
flush();
// ******* Checking Group filter
$err = ldap_checkfilter ($ldap_handle, $LDAP_basedn, $LDAP_groupfilter);
if ($err === false) { // group failed
echo "
Controllo del filtro dei gruppi
";
echo "Problema: Problemi con il group filter.
";
echo "Soluzione: Controllare la sintassi del filtro dei gruppi su LDAP.
";
echo "Errore del server: $error";
break;
}
if ($err == 0) { // Search filter does not have syntax errors, but returned 0 rows!
echo "
Controllo del filtro dei gruppi (NOTA: $err entries ritornate da LDAP)
";
} else {
echo "
Controllo del filtro dei gruppi ($err entries ritornate da LDAP)
";
}
ob_flush();
flush();
// We are OK with LDAP
$ldap_ok = true;
break;
}
//!! $ldap_ok variable contains TRUE if LDAP is OK, FALSE on errors
?>