[dev] more cyrsql fixes

Vilius Sumskas vilius at lnk.lt
Thu Feb 19 04:56:19 PST 2004


Hi,

new Cyrus versions does not allow @ in a username, so there are places where
you need to use $name, not $userId. See patch attached.

--
  Vilius
-------------- next part --------------
--- cyrsql.php.orig     2004-02-19 14:49:06.000000000 +0200
+++ cyrsql.php  2004-02-19 14:49:49.000000000 +0200
@@ -139,7 +139,7 @@
             return $dbresult;
         }

-        $name = imap_utf7_encode($userId);
+        $name = imap_utf7_encode($name);
         if (@imap_createmailbox($this->_imapStream,
                                 imap_utf7_encode($this->_params['imap_dsn'] .
                                                  'user' . $this->_separator . $name))) {
@@ -198,13 +198,13 @@
         /* Set ACL for mailbox deletion. */
         list($admin)=explode('@',$this->_params['cyradmin']);
         @imap_setacl($this->_imapStream,
-                     'user' . $this->_separator . $userId,
+                     'user' . $this->_separator . $name,
                      $admin, 'lrswipcda');

         /* Delete IMAP mailbox. */
         $imapresult = @imap_deletemailbox($this->_imapStream,
                                           $this->_params['imap_dsn'] .
-                                          'user' . $this->_separator . $userId);
+                                          'user' . $this->_separator . $name);

         if (!$imapresult) {
             return PEAR::raiseError(sprintf(_("IMAP mailbox deletion failed: %s"), imap_last_error()));


More information about the dev mailing list