Hi everyone!
I'm running an old version of Geoserver (GeoServer 2.0-RC1). I've set all
layers (read and write permissions) to be accessed only by
ROLE_ADMINISTRATOR users.
Geoserver side is working fine. When I open geoserver web interface, I
can't see any layers. If proceed with login with admin user, all layers are
shown.
My problem is with my PHP/OpenLayers application.
When I try to see my maps, an error saying that the layer doesn't exists is
shown. That's expected, but now, how can I login from PHP to Geoserver to
see my layers?
I'd like to use the same users in PHP login and Geoserver login (I just
replicated the users in users.properties).
If I login into geoserver interface, and after in PHP application, I can
see the maps. If I logout from geoserver interface, I can't see it anymore.
I'm trying to post user and password to geoserver login servlet (I think it
is a servlet) like that:
function loginGeoserver($username, $password) {
$geoserverURL = "http://mydomain/geoserver/j_acegi_security_check";
$data = http_build_query(array(
"username" => $username,
"password" => $password
));
$context = stream_context_create(array("http"=>array(
"method"=>"POST",
"header"=>"Content-Type:
application/x-www-form-urlencoded\r\n" .
"Content-Length: ". strlen($post) . "\r\n",
"content"=>$data
)));
$page = file_get_contents($geoserverURL, false, $context);
return $page;
}
*mydomain was replaced only here =)
When I echo $page, I see the geoserver login form and a message informing
username or password are wrong.
I've built a teste.html with a form inside it, at the same place this php
function is set. From the HTML form, I can login to geoserver just pointing
the method=post and action=http://mydomain/geoserver/j_acegi_security_check
Can someone help me to solve this?? Am I using the wrong way to do it or it
is a problem with my PHP script?!
I'd appreciate any help!
Best Regards,
Rodrigo C. Antonialli
======================================
Rio Claro - SP - Brasil
LinkedIn: http://www.linkedin.com/in/rcaprofile
Contato: (19) 8136-2347
[email protected]
Skype: rc_antonialli
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users