Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  Resources  Hop To Forums  Development, & Software Talk    pulling out username from eve cookies

Moderators: Mark Badolato
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Groupee Member
Picture of Ozbob
Posted
Howdy,

I would like to use the display name of our members for passing to a java applet.

I have had a look at the source code of the display page of the board

eg

quote:
script type="text/javascript">
<!--
if(eve_cookie.parsed && eve_cookie.u && eve_cookie.u!='' && eve_cookie.u!=null && eve_cookie.user_oid!='' && eve_cookie.user_oid!=null ){
showLoginMsg();
}
function showLoginMsg(){
// var msg = 'Welcome, ' + eve_cookie.u.replace(/\+/g," ") + ' [<a href="" rel="nofollow" >Logout</a>] ' ;
// getObjById('gs_login_text').innerHTML = msg;

showElement('ev_logout_text');
hideElement('groupee_off');

showElement('groupee_on');
hideElement('ev_login_text');


}// end fn
-->
</script>


the term 'eve_cookie.u.replace(/\+/g," ")' from above is the display name.

Anyone have any ideas of a simple script to pass that to a variable say $USERNAME, which I could then use in the applet?

Thanks.

Regards
Ozbob
 
Posts: 38 | Registered: January 09, 2005Reply With QuoteEdit or Delete MessageReport This Post
Groupee Member
Picture of Ozbob
Posted Hide Post
I have put this together

<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Get Cookie</title>
<script language="javascript" type="text/javascript">

/**
* Gets the value of the specified cookie.
*
* name Name of the desired cookie.
*
* Returns a string containing value of specified cookie,
* or null if cookie does not exist.
*/
function getCookie(name)
{
var dc = document.cookie;
var prefix = name + "=";
var begin = dc.indexOf("; " + prefix);
if (begin == -1)
{
begin = dc.indexOf(prefix);
if (begin != 0) return null;
}
else
{
begin += 2;
}
var end = document.cookie.indexOf(";", begin);
if (end == -1)
{
end = dc.length;
}
return unescape(dc.substring(begin + prefix.length, end));
}


</script>

</head>

<body>
<a href="#" onclick='document.write(getCookie("site_9506080871"))'>Get Cookie!</a>
</body>

</html>

this will read our site cookie and give the cookie information. What I need to do is to somehow parse that to extract the u name

eg. u=Wombat&md5p=38A116CE83F2A448F71FD54FE618CD68&user_oid=908107749&pref_datetime=200452894156&perms_datetime=200531792030&pl=Y
 
Posts: 38 | Registered: January 09, 2005Reply With QuoteEdit or Delete MessageReport This Post
 Previous Topic | Next Topic powered by eve community  
 

Eve For Enterprise    Eve Support Community    Forums  Hop To Forum Categories  Resources  Hop To Forums  Development, & Software Talk    pulling out username from eve cookies