From: Andreas Gohr Date: Thu, 12 Aug 2010 14:34:17 +0000 (+0200) Subject: supress a few errors X-Git-Tag: 0.8.0~13^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ae9c03c947498d611ca8ffef049369905a61924f;p=contagged supress a few errors --- diff --git a/entry.php b/entry.php index c14ff2d..2bf488a 100644 --- a/entry.php +++ b/entry.php @@ -134,9 +134,9 @@ function _saveData(){ $newdn = 'uid='.$new_uid; if (empty($_REQUEST['type'])) { $_REQUEST['type']='public'; } if($_REQUEST['type'] == 'private' && $conf['privatebook']){ - $newdn .= ', '.$conf['privatebook'].', '.$_SESSION['ldapab']['binddn']; + $newdn .= ','.$conf['privatebook'].','.$_SESSION['ldapab']['binddn']; }else{ - $newdn .= ', '.$conf['publicbook']; + $newdn .= ','.$conf['publicbook']; } $entry['displayname'] = $entry['givenname'].' '.$entry['name'];; $entry = prepare_ldap_entry($entry); @@ -150,7 +150,7 @@ print ''; if(empty($dn)){ //new entry $entry['uid'][] = $new_uid; - $r = ldap_add($LDAP_CON,$newdn,$entry); + $r = @ldap_add($LDAP_CON,$newdn,$entry); tpl_ldaperror(); return $newdn; }else{ diff --git a/login.php b/login.php index 2aa4d16..96d0c4f 100644 --- a/login.php +++ b/login.php @@ -13,8 +13,8 @@ if(!empty($_REQUEST['username'])){ //create private address book if simple enough if(preg_match('/ou=([^,]+)$/',$conf['privatebook'],$match)){ $privatedn = $conf['privatebook'].', '.$_SESSION['ldapab']['binddn']; - if(!ldap_read($LDAP_CON,$privatedn,'')){ - ldap_add($LDAP_CON,$privatedn, + if(!@ldap_read($LDAP_CON,$privatedn,'')){ + @ldap_add($LDAP_CON,$privatedn, array('objectClass' => array ('organizationalUnit','top'), 'ou' => $match[1])); }