[commits] [Wiki] changed: ImapSelect

Wiki Guest wikiguest at horde.org
Wed Jan 11 19:01:49 UTC 2012


guest [80.98.186.29]  Wed, 11 Jan 2012 19:01:49 +0000

Modified page: http://wiki.horde.org/ImapSelect
New Revision:  12
Change log:  changelog12

@@ -159,5 +159,37 @@
  <code>...
  $conf['hooks']['preauthenticate'] = true;
  ...
  </code>
+
+++ The same IMAP server selector hook function in Hode 4  
{{imp/config/hooks.php}}
+<code>
+class IMP_Hooks
+{
+
+public function preauthenticate($userId, $credentials)
+{
+    //Horde::logMessage('authM: '.$credentials['authMethod'].'  
id='.$userId, 'ERROR');
+    //return true;
+
+    /* when no userId given */
+    if (empty($userId)) return true;
+
+    /* list of ALL remote users */
+    $remote_users = array('username at remoteserver.hu' =>  
'remote-imap-servers-key');
+
+    /* local user */
+    if (!array_key_exists($userId, $remote_users)) return true;
+
+    /* remote user */
+    return array('credentials' => array('server' => $remote_users[$userId],
+                                        'transparent' => true,
+                                        'password' =>  
$GLOBALS['registry']->getAuthCredential('password')
+                                  )
+    );
+}
+
+}
+</code>
+
+Set server list to 'hidden' in Imp prefs, and all backend's hordeauth  
to full.




More information about the commits mailing list