RoundCube Webmail Forum  

Go Back   RoundCube Webmail Forum > Third Party Contributions > Plug-Ins

For more information about the ads and why they're here, please see the FAQ
Reply
  #1  
Old 03-09-2008, 07:34 PM
Registered User
 
Join Date: Aug 2006
Posts: 25
Downloads: 0
Uploads: 0
Default [0.1 stable] - Display IMAP username

I don't know about you, but I used to like this modification that allowed you to display the current user when you logged in.

So, I tried what they said again for 0.1 stable (I'd previously been using SVN releases) and noticed it didn't work properly. First of all the CSS wasn't working, and secondly some buttons that shouldn't be greyed-out were, javascript functionality was broken, etc.

So I played around with the code for a bit. And got it working again... here's what you need to do.



1. Open program/include/main.inc and search for 'username' => 'rcmail_current_username',

You should see:

Code:
 // register common UI objects
 $OUTPUT->add_handlers(array(
  'loginform' => 'rcmail_login_form',
  'username' => 'rcmail_current_username',
  'message' => 'rcmail_message_container',
  'charsetselector' => 'rcmail_charset_selector',
 ));
Change it to this:

Code:
 // register common UI objects
 $OUTPUT->add_handlers(array(
  'loginform' => 'rcmail_login_form',
  'username' => 'rcmail_current_username',
  'userdisplay' => 'rcmail_user_display',
  'message' => 'rcmail_message_container',
  'charsetselector' => 'rcmail_charset_selector',
 ));
2. Scroll to the bottom of the same file and find ?>

Above it add:

Code:
/***** display user information *****/

function rcmail_user_display($attrib)
 {
 if (!$attrib['id'])
  $attrib['id'] = 'rcmuserdisplay';

 // allow the following attributes to be added to the <span> tag
 $attrib_str = create_attrib_string($attrib, array('style', 'class', 'id'));

 $out = '<span' . $attrib_str . '>';
 $out .= '<b>User:</b>&nbsp;';
 $out .= $_SESSION['username'];
 $out .= '</span>';
 return $out;
}
3. Edit skins/default/common.css, search for #taskbar

Above it, add:

Code:
.mailuser
{
 position: absolute;
 top: 12px;
 left: 200px;
 height: 8px;
 width: 120px;
 color: #333333;
 text-decoration: none;
 font-size: 10px;
 font-family: "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
 z-index: 10;
}
4. Open skins/default/includes/taskbar.html, and add at the top of the file:

Code:
<div id="mailuser">
<roundcube:object name="userdisplay" class="mailuser" />
</div>
That's all folks.

Enjoy,
BTCentral
__________________
http://www.btcentral.org.uk - Cheap, Top Quality Web-design.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2  
Old 03-09-2008, 08:01 PM
Registered User
 
Join Date: Feb 2008
Posts: 2
Downloads: 0
Uploads: 0
Default Re: 0.1 stable - Display current user

Thats a very nice mod and it works perfectly, this kind of thing should be included in releases by default, because you see this kind of thing in GMail and Yahoo and Hotmail... So why not roundcube?

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3  
Old 03-10-2008, 02:38 AM
GunFro's Avatar
Registered User
 
Join Date: Jun 2006
Posts: 31
Downloads: 0
Uploads: 0
Send a message via ICQ to GunFro Send a message via AIM to GunFro Send a message via MSN to GunFro
Default Re: 0.1 stable - Display current user

Hi.
Nice mod, works just fine.
It would be even more fun if the text "User" followed the selected language.
Would be in program/localization/labeles.inc i think.
Yes, a lot off file to edit if You want all languages.
I made i even more simple, I removed the "User:" text.......

Have a nice day
Gunnar
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4  
Old 03-10-2008, 09:09 AM
Registered User
 
Join Date: Sep 2007
Posts: 17
Downloads: 2
Uploads: 0
Default Re: 0.1 stable - Display current user

That's pretty awesome. Unfortunately it only shows IMAP User name. And that is something like web1p*. Nonetheless nice plugin.
Attached Images
File Type: png Bild_5.png (2.3 KB, 2 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5  
Old 03-10-2008, 12:07 PM
Registered User
 
Join Date: Feb 2008
Posts: 2
Downloads: 0
Uploads: 0
Default Re: 0.1 stable - Display current user

Ahh, yeah I noticed that... But none the less it works fine, you dont really need the "User:" but anyway...
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6  
Old 03-10-2008, 04:21 PM
hkr hkr is offline
Registered User
 
Join Date: Mar 2008
Posts: 17
Downloads: 0
Uploads: 0
Default Re: 0.1 stable - Display current user

i get the foll error :

Quote:
Fatal error: Cannot redeclare rcmail_user_display() (previously declared in /home/clubturz/public_html/email/program/include/main.inc:1642) in /home/clubturz/public_html/email/program/include/main.inc on line 1987
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7  
Old 03-11-2008, 01:25 PM
Registered User
 
Join Date: Aug 2006
Posts: 25
Downloads: 0
Uploads: 0
Default Re: 0.1 stable - Display current user

Quote:
Originally Posted by GunFro
Hi.
Nice mod, works just fine.
It would be even more fun if the text "User" followed the selected language.
Would be in program/localization/labeles.inc i think.
Yes, a lot off file to edit if You want all languages.
I made i even more simple, I removed the "User:" text.......

Have a nice day
Gunnar
Yeah, that's the easiest way to do it, at the end of the day this is a pretty "quick n' dirty" hack, if the developers were to end up implementing the feature, then obviously it would be worth their trouble to translate the tag, for now simply remove it, or change it yourself.

Quote:
Originally Posted by Rudy
That's pretty awesome. Unfortunately it only shows IMAP User name. And that is something like web1p*. Nonetheless nice plugin.
Ouch, that's a shame. I guess the IMAP server my host provides uses the username@domain.com as the IMAP username format. This will obviously vary for different IMAP servers/configurations - I've changed the topic title to reflect this change.

Quote:
Originally Posted by hkr
i get the foll error :

Quote:
Fatal error: Cannot redeclare rcmail_user_display() (previously declared in /home/clubturz/public_html/email/program/include/main.inc:1642) in /home/clubturz/public_html/email/program/include/main.inc on line 1987
You've defined the same function twice, it even tells you the line numbers of each place you did in the error.

Cheers,
BTCentral
__________________
http://www.btcentral.org.uk - Cheap, Top Quality Web-design.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8  
Old 03-12-2008, 02:44 PM
hkr hkr is offline
Registered User
 
Join Date: Mar 2008
Posts: 17
Downloads: 0
Uploads: 0
Default Re: [0.1 stable] - Display IMAP username

Yes,it does but how do i fix it, sorry my knowledge about php is very less, so pls help.

thnx..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9  
Old 03-13-2008, 10:15 PM
Registered User
 
Join Date: Mar 2008
Posts: 3
Downloads: 0
Uploads: 0
Default Re: [0.1 stable] - Display IMAP username

What do you think about this hack to view username?
http://roundcubeforum.net/forum/index.php?topic=2796.0[/b]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10  
Old 03-15-2008, 11:47 PM
Registered User
 
Join Date: Mar 2008
Posts: 2
Downloads: 0
Uploads: 0
Default Re: [0.1 stable] - Display IMAP username

It's hard to click that link bacause of bad bbc.

Here's that link again.
Link to
http://roundcubeforum.net/forum/index.php?topic=2796.0

I prefer this version of the mod since it works better for me. The one that starts this thread is good but on my layout (which is standard) it puts the User: xxxx@yyyy beneath the RoundCube logo. Must be something weird in the css code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

For more information about the ads and why they're here, please see the FAQ

All times are GMT. The time now is 11:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Copyright © 2006-2008 RoundCube Webmail Community