[ingo] problems with hordeauth and vfs-ftp-driver

Martin Luethi horde at humbapa.ch
Mon Jan 26 02:42:07 PST 2004


attached is a new patch for ingo/lib/Ingo.php who corrects the
'hordeauth'-problem. my first patch fixed that in ingo/lib/Driver/vfs.php
but I think it is better to do this in ingo/lib/Ingo.php.


g. martin luethi


Fri, 23 Jan 2004 15:30:04 +0100 Martin Luethi <horde at humbapa.ch>:

> hi list,
>
> I configured my vfs-ftp-driver with one global ftp-user:
>
> $split = explode('@', Auth::getAuth());
> $backends['procmail'] = array(
>    'driver' => 'vfs',
>    'preferred' => '',
>    'hordeauth' => false,
>    'params' => array(
>        'hostspec' => 'localhost',
>        'procmailrc' => '/'.$split[1].'/_mail/'.$split[0].'/.procmailrc',
>        'port' => 21,
>        'username' => 'linux',
>        'password' => '*****',
>        'vfstype' => 'ftp'
>    ),
>    'script' => 'procmail',
>    'scriptparams' => array(
>        'path_style' => 'maildir'
>    )
> );
>
> when I now try to activate a script the methode "setScriptActive"
> (lib/Driver/vfs.php) overrides the params "username" and "password"
> even with "'hordeauth' => false".
>
> I fixed that in "lib/Driver/vfs.php" (see patch)
>
> but I am not sure if hordeauth is meant to be "false" (what about the other
> drivers?)
>
> what do you think?
>
>
> g. martin luethi

-------------- next part --------------
Index: lib/Ingo.php
===================================================================
RCS file: /repository/ingo/lib/Ingo.php,v
retrieving revision 1.56
diff -u -r1.56 Ingo.php
--- lib/Ingo.php	18 Jan 2004 23:58:33 -0000	1.56
+++ lib/Ingo.php	26 Jan 2004 10:40:56 -0000
@@ -107,11 +107,21 @@
 
         require_once INGO_BASE . '/lib/Driver.php';
 
-        $uid = ($_SESSION['ingo']['backend']['hordeauth'] === 'full')
-               ? Auth::getAuth() : Auth::getBareAuth();
+        // Set authentication parameters.
+        if (!empty($_SESSION['ingo']['backend']['hordeauth'])) {
+            $username = ($_SESSION['ingo']['backend']['hordeauth'] === 'full')
+                        ? Auth::getAuth() : Auth::getBareAuth();
+            $password = Auth::getCredential('password');
+        } else if (isset($_SESSION['ingo']['backend']['params']['username']) && isset($_SESSION['ingo']['backend']['params']['password'])) {
+            $username = $_SESSION['ingo']['backend']['params']['username'];
+            $password = $_SESSION['ingo']['backend']['params']['password'];
+        } else {
+            $username = Auth::getBareAuth();
+            $password = Auth::getCredential('password');
+        }
 
         $driver = &Ingo_Driver::singleton($_SESSION['ingo']['backend']['driver'], $_SESSION['ingo']['backend']['params']);
-        $res = $driver->setScriptActive($script, $uid, Auth::getCredential('password'));
+        $res = $driver->setScriptActive($script, $username, $password);
         if (is_a($res, 'PEAR_Error')) {
             $msg = ($deactivate)
               ? _("There was an error deactivating the script.")


More information about the ingo mailing list