[cvs] [Wiki] changed: CustomizingPreferences
Wiki Guest
wiki at wiki.horde.org
Mon Mar 7 11:56:12 PST 2005
guest [68.228.225.160] Mon, 7 Mar 2005 11:56:12 -0800
Modified page: http://wiki.horde.org/display.php?page=CustomizingPreferences
New Revision: 1.7
@@ -20,16 +20,17 @@
first time that they log in. These hooks assume LDAP backend and should be instructive for someone wanting to create their
own custom hooks...this wasn't easy to figure out.
The first modification I did to hooks.php was to add the following (don't forget to add the
-{{'hook' => 'true'}} to {{$prefs['from_addr']}}).
+{{'hook' => 'true',}} to {{$prefs['from_addr']}}).
<code type="php">
if (!function_exists('_prefs_hook_from_addr')) {
function _prefs_hook_from_addr($user = null)
{
+ $domain_name = 'azapple.com';
$ldapServer = 'localhost';
$ldapPort = '389';
$searchBase = 'ou=People,dc=azapple,dc=com';
$ds = @ldap_connect($ldapServer, $ldapPort);
@@ -51,12 +52,10 @@
// derive the email address if possible
if ($information[0]['mail'][0] != '') {
$emailname = $information[0]['mail'][0];
} else {
- $emailname = $information[0]['uid'][0];
+ $emailname = $information[0]['uid'][0] . '@' . $domain_name;
}
-
- // $emailname = $information[0]['mail'][0];
ldap_close($ds);
return $emailname;
@@ -64,9 +63,9 @@
}
</code>
The second modification I did to hooks.php was to add the following (don't forget to add the
-{{'hook' => 'true'}} to {{$prefs['fullname']}}).
+{{'hook' => 'true',}} to {{$prefs['fullname']}}).
<code type="php">
if (!function_exists('_prefs_hook_fullname')) {
@@ -97,10 +96,8 @@
$name = $information[0]['cn'][0];
} else {
$name = $information[0]['gecos'][0];
}
-
- // $test = ($information[0]['gecos'][0]);
ldap_close($ds);
return $name;
More information about the cvs
mailing list