<!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">
Yes, thank you. I think that will help. I have not tried it yet, so I
don't know for sure, but I think it will. I didn't know about how to
store the username is a session variable. Thanks, and I will let you
know when I get it working for PHP and post my results.<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>