From cbde304b98e4e0fc2ff33fd84068d63ae3e86c45 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Thu, 01 Apr 2010 02:25:29 -0400
Subject: [PATCH] - Use MDB2's Manager module for listing tables

---
 program/include/rcube_imap_generic.php |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php
index 4fd49d0..41c053d 100644
--- a/program/include/rcube_imap_generic.php
+++ b/program/include/rcube_imap_generic.php
@@ -366,7 +366,7 @@
         }
     
         // generate hash
-        $hash  = md5($this->xor($pass,$opad) . pack("H*", md5($this->xor($pass, $ipad) . base64_decode($encChallenge))));
+        $hash  = md5($this->_xor($pass,$opad) . pack("H*", md5($this->_xor($pass, $ipad) . base64_decode($encChallenge))));
     
         // generate reply
         $reply = base64_encode($user . ' ' . $hash);
@@ -415,7 +415,7 @@
         return $result;
     }
 
-    function namespace()
+    function getNamespace()
     {
 	    if (isset($this->prefs['rootdir']) && is_string($this->prefs['rootdir'])) {
     		$this->rootdir = $this->prefs['rootdir'];
@@ -566,7 +566,7 @@
 	    // check input
 	    if (empty($host)) {
 		    $this->error    = "Empty host";
-		    $this->errornum = -1;
+		    $this->errornum = -2;
 		    return false;
 	    }
         if (empty($user)) {
@@ -684,7 +684,7 @@
             if ($this->prefs['force_caps']) {
 			    $this->clearCapability();
             }
-		    $this->namespace();
+		    $this->getNamespace();
             $this->logged = true;
 		    return true;
 	    } else {
@@ -1553,18 +1553,19 @@
 	    return false;	
     }
 
-    function search($folder, $criteria)
+    function search($folder, $criteria, $return_uid=false)
     {
 	    if (!$this->select($folder)) {
     		return false;
 	    }
 
     	$data = '';
-	    $query = "srch1 SEARCH " . chop($criteria);
+	    $query = 'srch1 ' . ($return_uid ? 'UID ' : '') . 'SEARCH ' . chop($criteria);
 
 	    if (!$this->putLineC($query)) {
 		    return false;
 	    }
+
     	do {
 	    	$line = trim($this->readLine());
 		    if ($this->startsWith($line, '* SEARCH')) {
@@ -2150,7 +2151,7 @@
 	    return $result;
     }
 
-    private function iil_xor($string, $string2)
+    private function _xor($string, $string2)
     {
 	    $result = '';
 	    $size = strlen($string);

--
Gitblit v1.9.1