Exemplo n.º 1
0
 static function runSchemaCheck()
 {
     global $config;
     if ($config->get_cfg_value('schemaCheck') != 'TRUE') {
         return TRUE;
     }
     $cfg = array();
     $cfg['admin'] = $config->current['ADMINDN'];
     $cfg['password'] = $config->current['ADMINPASSWORD'];
     $cfg['connection'] = $config->current['SERVER'];
     $cfg['tls'] = $config->get_cfg_value('ldapTLS') == 'TRUE';
     $str = check_schema($cfg);
     foreach ($str as $tr) {
         if (isset($tr['IS_MUST_HAVE']) && !$tr['STATUS']) {
             return _('LDAP schema check reported errors:') . '<br/><br/><i>' . $tr['MSG'] . '</i>';
         }
     }
     return TRUE;
 }
Exemplo n.º 2
0
 }
 /* Check for schema file presence */
 if ($config->get_cfg_value("schemaCheck") == "TRUE") {
     $recursive = $config->get_cfg_value("ldapFollowReferrals") == "TRUE";
     $tls = $config->get_cfg_value("ldapTLS") == "TRUE";
     if (!count($ldap->get_objectclasses())) {
         msg_dialog::display(_("LDAP error"), _("Cannot detect information about the installed LDAP schema!"), ERROR_DIALOG);
         displayLogin();
         exit;
     } else {
         $cfg = array();
         $cfg['admin'] = $config->current['ADMINDN'];
         $cfg['password'] = $config->current['ADMINPASSWORD'];
         $cfg['connection'] = $config->current['SERVER'];
         $cfg['tls'] = $tls;
         $str = check_schema($cfg);
         $checkarr = array();
         foreach ($str as $tr) {
             if (isset($tr['IS_MUST_HAVE']) && !$tr['STATUS']) {
                 msg_dialog::display(_("LDAP error"), _("Your LDAP setup contains old schema definitions:") . "<br><br><i>" . $tr['MSG'] . "</i>", ERROR_DIALOG);
                 displayLogin();
                 exit;
             }
         }
     }
 }
 /* Check for locking area */
 $ldap->cat(get_ou('lockRDN') . get_ou('fusiondirectoryRDN') . $config->current['BASE'], array('dn'));
 $attrs = $ldap->fetch();
 if (!count($attrs)) {
     $ldap->cd($config->current['BASE']);