Attached quick patch for username 2.3. Patch is applied with 'patch -p 1 <
username.diff' command. If you don't have access to patch utility, you can
apply it manually. minus shows removed lines, plus - added lines. Other
lines allow to locate modified code.
Added configuration variable allows to remove domain from left folder
listing. You will have to modify your config.php in order to enable this
option. See config.php.sample changes. I haven't modified MOTD and user
options functions.
> I am setting up a webmail solution for a educational institution.
> Hosted in a FBSD server. Qmail and Courier Imap. I have no control on
> their software. They have a standard shared SM hosting. I wanted a
> customised SM exclusively for me. They said sorry, I may install in a
> sub domain and redirect webmail. So I started doing this.
>
> I started doing this only three days back. Absolutely no background in
> php and unix. So finding it tough. In fact I am trying out the
> installation on a win2k3 server locally. (PHP5, Apache2). So far so
> good.
>
> At present using full e-mail ID to login. I am planning to install the
> vlogin plugin to remove the domain part. May be over the weekend.
>
> I want to give as customised a solution as possible to my users so
> that they do not mess up things. That is why all the forced prefs
> part.
>
> Regards
>
> kmnair
>
>
>
> On 5/6/06, Tomas Kuliavas <[EMAIL PROTECTED]> wrote:
>> > I am at a loss to remove the domain part from the username.
>> > Plugins/Username/functions.php. How do I reconfigure that?
>> >
>> > Some of our users have slightly long usernames. So the left pane
>> > develops a scroll bar. Is there a way to show the username on the
>> > right frame top main header/navigation bar.
>>
>> Could you provide more details about your email setup? Used smtp server,
>> local delivery agent, etc. Are you using only one domain? Do you have to
>> use [EMAIL PROTECTED] in order to log into IMAP server?
>>
>> --
>> Tomas
>>
>>
>> -------------------------------------------------------
>> Using Tomcat but need to do more? Need to support web services,
>> security?
>> Get stuff done quickly with pre-integrated technology to make your job
>> easier
>> Download IBM WebSphere Application Server v.1.0.1 based on Apache
>> Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
>> --
>> squirrelmail-users mailing list
>> Posting Guidelines:
>> http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
>> List Address: [email protected]
>> List Archives:
>> http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
>> List Archives:
>> http://sourceforge.net/mailarchive/forum.php?forum_id=2995
>> List Info:
>> https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
>
>
> -------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job
> easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
> --
> squirrelmail-users mailing list
> Posting Guidelines:
> http://www.squirrelmail.org/wiki/MailingListPostingGuidelines
> List Address: [email protected]
> List Archives:
> http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
> List Archives: http://sourceforge.net/mailarchive/forum.php?forum_id)95
> List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users
>
diff -urN username.orig/config.php.sample username/config.php.sample
--- username.orig/config.php.sample 2003-08-30 04:13:14.000000000 +0300
+++ username/config.php.sample 2006-05-06 22:00:54.752598024 +0300
@@ -1,6 +1,7 @@
<?php
- global $usernameMotdWelcomeMessage, $add_domain_to_username,
$username_replaces_motd;
+ global $usernameMotdWelcomeMessage, $add_domain_to_username,
$username_replaces_motd,
+ $username_remove_domain;
@@ -27,5 +28,10 @@
$add_domain_to_username = 0;
+ /**
+ * Removes default domain from username, if set to true.
+ * @global boolean $username_remove_domain
+ */
+ $username_remove_domain = false;
?>
diff -urN username.orig/functions.php username/functions.php
--- username.orig/functions.php 2003-08-30 04:09:34.000000000 +0300
+++ username/functions.php 2006-05-06 21:59:27.308891488 +0300
@@ -43,22 +43,28 @@
function username_show() {
- global $color, $username, $show_username, $domain,
$add_domain_to_username;
+ global $color, $username, $show_username, $domain,
$add_domain_to_username, $username_remove_domain;
if (! $show_username)
return;
-
+
+ if ($add_domain_to_username) {
+ $displayed_username = $username . '@' . $domain;
+ } elseif ($username_remove_domain &&
preg_match("/^(.+)@$domain$/",$username,$matches)) {
+ $displayed_username = $matches[1];
+ } else {
+ $displayed_username = $username;
+ }
+
?>
<table align="center" cellpadding="0" cellspacing="0" border="0"
bgcolor="<?php echo $color[10] ?>"><tr><td>
<table width="100%" cellpadding="2" cellspacing="1" border="0" bgcolor="<?php
echo $color[5] ?>"><tr><td align="center">
<small><?php
if ($show_username == 1)
- echo $username;
+ echo $displayed_username;
if ($show_username == 2)
- echo _("Logged in as:") . ' ' . $username;
- if ($add_domain_to_username)
- echo '@' . $domain;
+ echo _("Logged in as:") . ' ' . $displayed_username;
?></small>
</td></tr></table>