PMF_Ldap::error PHP 메소드

error() 공개 메소드

Returns the LDAP error message of the last LDAP command
public error ( resource $ds = null ) : string
$ds resource LDAP resource
리턴 string
    public function error($ds = null)
    {
        if ($ds === null) {
            $ds = $this->ds;
        }
        return ldap_error($ds);
    }

Usage Example

예제 #1
0
파일: setup.php 프로젝트: noon/phpMyFAQ
     if (is_null($ldap_password)) {
         print "<p class=\"error\"><strong>Error:</strong> There's no LDAP password input.</p>\n";
         HTMLFooter();
         die;
     }
     $ldap_base = PMF_Filter::filterInput(INPUT_POST, 'ldap_base', FILTER_SANITIZE_STRING);
     if (is_null($ldap_base)) {
         print "<p class=\"error\"><strong>Error:</strong> There's no distinguished name input for LDAP.</p>\n";
         HTMLFooter();
         die;
     }
     // check LDAP connection
     require PMF_ROOT_DIR . "/inc/Ldap.php";
     $ldap = new PMF_Ldap($ldap_server, $ldap_port, $ldap_base, $ldap_user, $ldap_password);
     if (!$ldap) {
         print "<p class=\"error\"><strong>LDAP Error:</strong> " . $ldap->error() . "</p>\n";
         HTMLFooter();
         die;
     }
 }
 // check user entries
 $password = PMF_Filter::filterInput(INPUT_POST, 'password', FILTER_SANITIZE_STRING);
 if (is_null($password)) {
     print "<p class=\"error\"><strong>Error:</strong> There's no password for the administrator's account. Please set your password.</p>\n";
     HTMLFooter();
     die;
 }
 $password_retyped = PMF_Filter::filterInput(INPUT_POST, 'password_retyped', FILTER_SANITIZE_STRING);
 if (is_null($password_retyped)) {
     print "<p class=\"error\"><strong>Error:</strong> There's no retyped password. Please set your retyped password.</p>\n";
     HTMLFooter();
All Usage Examples Of PMF_Ldap::error