authentication II

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: authentication II

Kajar
This post has NOT been accepted by the mailing list yet.
HI

I remember some versions ago this authentication window  worked out of box when  Fusion layout was used , but now its  somehow disabled by default.
Can someone describe how and where  to add this login iframe so I can get this login window working.
Reply | Threaded
Open this post in threaded view
|

Re: authentication II

loic
I am also interested. I know how to pass variables from a prompt dialog to a php script. But like Kajar, I'm stuck.

Thanks in advance.
Reply | Threaded
Open this post in threaded view
|

Re: authentication II

loic
This post was updated on .
In reply to this post by Kajar
Kajar wrote
HI

I remember some versions ago this authentication window  worked out of box when  Fusion layout was used , but now its  somehow disabled by default.
Can someone describe how and where  to add this login iframe so I can get this login window working.
Fisrt, excuse me for my english ;-)

Here some explanations to make it working :

You have to make an input form in a index.html for exemple :

<body>
<form action="accueil.php" method="POST" accept-charset="ISO-8859-1">
 <p>Nom d'utilisateur : <input type="text" name="username" /></p>
 <p>Mot de passe : <input type="password" name="password" /></p>
 <p><input type="submit" value="valider"></p>
</form>
</body>

accueil.php is your page where the application will be embeded.

Then here a part of the code of accueil.php :

<head>
<?php
 $url = "http://sig:8008/mapguide/fusion/templates/mapguide/c3r/index.html?ApplicationDefinition=Library://maps/full-app.ApplicationDefinition&locale=fr";
?>
<frameset rows="30,*" frameborder="NO" border="0" framespacing="0">
<frame src="barre.html" name="TitleFrame" scrolling="NO" noresize>   
<frame src="<?php echo $url."&username=".$_POST[username]."&password=".$_POST[password] ?>" name="ViewerFrame">
</frameset>
</head>

$url is the location of your application. I put the ApplicationDefinition and locale parameters too.
<frame src="barre.html" name="TitleFrame" scrolling="NO" noresize> is a title bar.
<frame src="<?php echo $url."&username=".$_POST[username]."&password=".$_POST[password] ?>" name="ViewerFrame"> : this will embed your app with a concatenation of the parameters.


It should work !
Reply | Threaded
Open this post in threaded view
|

Re: authentication II

loic
This post was updated on .
Another solution, is to create a session. Only the session will be displayed in the address bar, not the login and the password.


Here is the code :


<head>
<?php

        // Initialize the web tier - path to webconfig.ini
        MgInitializeWebTier('C:\\Program Files\\OSGeo\\MapGuide\\Web\\www\\webconfig.ini');
       
        // Establish a connection to the site with a username and a password
        $userInformation = new MgUserInformation($_POST[username], $_POST[password]);
        $siteConnection = new MgSiteConnection();
        $siteConnection->Open($userInformation);
       
        // Create a session repository
        $site = $siteConnection->GetSite();
        $sessionID = $site->CreateSession();


 $url = "http://sig:8008/mapguide/fusion/templates/mapguide/c3r/index.html?ApplicationDefinition=Library://maps/full-app.ApplicationDefinition&locale=fr";

header('Location:'.$url.'&session='.$sessionID);
 ?>

</head>
12