Roundcube Community Forum

 

Display logged account

Started by darkcoder, July 13, 2006, 11:12:30 PM

Previous topic - Next topic

rantdepot

Quote from: Scubes13 I like this bit of code. I modified it so that it displays right under the logo. I also added a bit of text to it, including the domain based on the host

...

This line:
$_SERVER['HTTP_HOST']);ends up appending the server on which RoundCube is hosted as opposed to the actual IMAP server being connected to.

For example:
RoundCube is hosted on website.com where as the IMAP server is mail.com; when logged in the text shows:
User: [email]username@website.com[/email] instead of
User: [email]username@mail.com[/email]
Any idea on how to change this so the correct server is reflected?

ashleyfox

Anyone know how to get this to work with the latest roundcube release: 0.1-RC1.

I've added everything it says but it doesnt work. I've narrowed down the problem (I think anyway) to the additions made in main.inc.

Specifically:

/***** display user information *****/
function rcmail_user_display($attrib)
 {
 global $OUTPUT, $JS_OBJECT_NAME;

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

 $OUTPUT->add_script(sprintf("%s.gui_object('userdisplay', '%s');", $JS_OBJECT_NAME, $attrib['id']));

 // 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 = $_SESSION['username'];
 $out .= '</span>';
 return $out;
}

Any help would be appreciated.

ashleyfox

I think I've fixed it. Just changed the code in main.inc. It works now in roundcube release: 0.1-RC1. Changes are shown below:

/***** display user information *****/
function rcmail_user_display($attrib)
 {
 global $OUTPUT, $JS_OBJECT_NAME;

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

 $OUTPUT->add_script(sprintf(&quot;rcmail.gui_object('userdisplay', '%s');&quot;, $JS_OBJECT_NAME, $attrib['id']));

 // 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 = $_SESSION['username'];
 $out .= '</span>';
 return $out;
}

timelord

Quote from: SKaero Thanks for the 2 way it looks nice to, but I have a clock there :(

Any code for that clock? ;)
SCUBA LIBRE :D

SKaero

Yes I think I have it in a old back-up I will see if I can dig it up and get it to work in rc1

seansan

Has this been added to SVN - or logged as a patch in trac?

Could by nice to set as an option (to not dustrub users who dont want it)

rsw686

Quote from: seansan Has this been added to SVN - or logged as a patch in trac?

Could by nice to set as an option (to not dustrub users who dont want it)

I would like to see this added as well. I have multiple accounts I open at the same time and I can never remember which window is what. I have a feeling most would users would appreciate this feature.

njohal

Say you want to display their name rather then the email address that they have typed in the identity.. how can one pursue that??

ricardobond

This code is for rc1 right?
I'm using rc2

Anybody help me?

Sorry, but my english is very poor!

Thx.

luxerama

Quote from: njohal Say you want to display their name rather then the email address that they have typed in the identity.. how can one pursue that??

Depends what their name is or where it comes from. I have a virtual setup where finding the users name is very easy as its just the string before the @. Which means I can just do:
$username = explode('@', $_SESSION['username']);
 $out .= $username[0];
Instead of:
$out .= $_SESSION['username'];

luxerama

Quote from: ricardobond This code is for rc1 right?
I'm using rc2

Anybody help me?

Sorry, but my english is very poor!

Thx.

Still interested? If so let me know and Ill post the information.

dunccs

Quote from: luxerama
Quote from: ricardobond This code is for rc1 right?
I'm using rc2

Anybody help me?

Sorry, but my english is very poor!

Thx.

Still interested? If so let me know and Ill post the information.

He has gone but i sure am intrested int he code. Hope to hear from you Soon, God bless!!

dunccs

Quote from: luxerama
Quote from: ricardobond This code is for rc1 right?
I'm using rc2

Anybody help me?

Sorry, but my english is very poor!

Thx.

Still interested? If so let me know and Ill post the information.

i sure am intrested , please Post !!

jasonar

I'm also using RC2 and would like to know how to use it with my version.

bswinnerton

For some reason when I do this it greys out all of my icons for checking mail, replying etc. =(. It has something to do with the app.js because once i went back to the old one it worked fine.