<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-2022-JP"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
I got it working. For everyone's info, in PHP it is done basically the
same way as below as far as the concept, but the following key points
are needed:<br>
<br>
<?php<br>
session_start(); //Needed at the top of the page that it is being
defined on, as well as every page that you will need to call the <br>
<br>
$_SESSION['USERNAME'] = "Source of the username" (i.e. login text box
or $_POST from a separate page's form) defines the session variable<br>
<br>
$username = $_SESSION['USERNAME']; //would put the username into a php
variable<br>
<br>
It is that easy. I can't believe it took me so long to get this
figured out. Thanks for your help.<br>
<br>
Rich<br>
<br>
Hidekazu Shimaji wrote:
<blockquote
cite="mid20070530034323.24906.qmail@web10003.mail.tnz.yahoo.co.jp"
type="cite">
<pre wrap="">Sorry I have no idea about PHP.
I usually use asp.net.
Here is a very simple sample of the asp.net.
I hope this can be a help for you.
---LogOnPage.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>>
<%@ Import Namespace="OSGeo.MapGuide" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//initialize settings
MapGuideApi.MgInitializeWebTier(@"C:\Program
Files\Autodesk\MapGuideEnterprise2007\WebServerExtensions\www\webconfig.ini");
//get user information from text boxes
MgUserInformation userInfo = new MgUserInformation(txtUserName.Text,
txtPassword.Text);
//keep the username in a session variable
Session["MGUSER"] = txtUserName.Text;
//create a mapguide session id
MgSite site = new MgSite();
site.Open(userInfo);
string sessionId = site.CreateSession();
//redirect
string url =
<a class="moz-txt-link-rfc2396E" href="http://localhost/mapguide/mapviewerdwf/?WEBLAYOUT=Library%3a%2f%2fTest%2fLayouts%2fTestLayer.WebLayout&SESSION=">"http://localhost/mapguide/mapviewerdwf/?WEBLAYOUT=Library%3a%2f%2fTest%2fLayouts%2fTestLayer.WebLayout&SESSION="</a>
+ sessionId;
Response.Redirect(url);
}
</script>
<html xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a> >
<head runat="server">
<title>Log On Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
username:<asp:TextBox ID="txtUserName" runat="server"></asp:TextBox><br />
password:<asp:TextBox ID="txtPassword" runat="server"
TextMode="Password"></asp:TextBox>
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="MapGuide"
/></div>
</form>
</body>
</html>
---
---TaskPanePage.aspx
<%@ Page Language="C#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</a>>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
//get the username
string username = Session["MGUSER"].ToString();
Response.Write(username);
}
</script>
<html xmlns=<a class="moz-txt-link-rfc2396E" href="http://www.w3.org/1999/xhtml">"http://www.w3.org/1999/xhtml"</a> >
<head runat="server">
<title>Task Pane Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
---
Hidekazu
--- Rich Bauer <a class="moz-txt-link-rfc2396E" href="mailto:rdbauer@gmail.com"><rdbauer@gmail.com></a> wrote:
---------------------------------
For the work around, how would you go about keeping the username in aweb session and
passing it into a frame. I have tried several things,but I can't seem to get it to work. I
am using php and JS.
Thanks,
Rich
Hidekazu Shimaji wrote:
Hello,I don't think it is possible to get a username which is logging in.Why don't you keep
the username in a web session at the log on page?I mean that you should post back first, then
redirect to the web layout.Regards,Hidekazu--- Rich Bauer <a class="moz-txt-link-rfc2396E" href="mailto:rdbauer@gmail.com"><rdbauer@gmail.com></a> wrote:
Hi all,I am new to this mailing list, so I don't know if this question has been asked before
(I also tried to find it in the archive with no success). The question is I am trying to let
the "user" access the data intended for them. Example: User "Bill" logs on using a log on
page and is taken to the weblayout and everything just fine. Then when "Bill" tries to
access a command that creates a "Markup" using sample code I found on the internet, I want
"Bill" to be able to access his markup and not everyones. In other words, I would like to
change the path from:Library://Markup/ to Library://Bill/Markup/The only problem I am
having is getting the username, "Bill", into the string that is sent by the code.My thought
was using the $_REQUEST['USERNAME'] or something, but can't get it working. By the way, the
user "Bill" is the user under the MapAdmin panel and that. Any help would be nice.
Thanks.Rich_______________________________________________mapguide-users mailing
<a class="moz-txt-link-abbreviated" href="mailto:listmapguide-users@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapguide-users">listmapguide-users@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
_______________________________________________mapguide-users mailing
<a class="moz-txt-link-abbreviated" href="mailto:listmapguide-users@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapguide-users">listmapguide-users@lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
<blockquote type="cite">
<pre wrap="">_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
<pre wrap=""><!---->
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
</pre>
</blockquote>
</body>
</html>