minor gui fixes

This commit is contained in:
SJ 2013-07-03 11:36:41 +02:00
parent d0ef91ea72
commit d3073dd444
2 changed files with 3 additions and 3 deletions

View File

@ -370,7 +370,7 @@ class ModelSearchMessage extends Model {
}
private function highlight_search_terms($s = '', $terms = array()) {
private function highlight_search_terms($s = '', $terms = '') {
$terms = preg_replace("/(\'|\")/", "", $terms);
$terms = explode(" ", $terms);
@ -378,7 +378,7 @@ class ModelSearchMessage extends Model {
if(count($terms) <= 0) { return $s; }
while(list($k, $v) = each($terms)) {
if($v == '') { continue; }
if(strlen($v) < 3) { continue; }
$s = preg_replace("/$v/i", "<span class=\"message_highlight\">$v</span>", $s);
}

View File

@ -69,7 +69,7 @@ class ModelUserAuth extends Model {
$query = $ldap->query(LDAP_BASE_DN, "(&(objectClass=" . LDAP_ACCOUNT_OBJECTCLASS . ")(" . LDAP_MAIL_ATTR . "=$username))", array());
if(isset($query->row['dn'])) {
if(isset($query->row['dn']) && $query->row['dn']) {
$a = $query->row;
$ldap_auth = new LDAP(LDAP_HOST, $a['dn'], $password);