<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE></TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16608" name=GENERATOR></HEAD>
<BODY><!-- Converted from text/plain format -->
<P><FONT size=2>Hi,<BR><BR>I'm planning to implement authenication
to. i'm using your scripts.<BR>After i add the line,<BR><BR><FONT
size=1>$oApp->moAuthenticator = new Authenticator('login.html'
);</FONT><BR><BR>to the index.phtml i got a black page and an error in my
php_error.log. <BR><BR><FONT size=1>[17-Mar-2008 09:18:00] PHP Fatal error: Call
to undefined method Authenticator::isAuthenticated() in
/home/gisarts/apps/chameleon-2.2.1/htdocs/chameleon.php on line
922<BR></FONT><BR>Chameleon.php (line 922)<BR><FONT size=1>function
CWCAuthenticate()<BR>{<BR>if ($this->moAuthenticator != null)<BR>{<BR>if
(isset($_REQUEST['username']) &&
isset($_REQUEST['password']))<BR>{<BR>if
($this->moAuthenticator->authenticate($_REQUEST['username'],
$_REQUEST['password'] ) == false)<BR>$this->setVar('szLoginError',
$this->moMLT->get("6", 'Login Failed - Incorrect Username and/or
Password'));<BR>}<BR>if
(!$this->moAuthenticator->isAuthenticated())<BR>{<BR>$this->setVar('SID',
session_id());<BR>$this->mszTemplateName =
$this->moAuthenticator->mszLoginTemplate;<BR>$this->CWCLoadTemplate($this->mszTemplateName);<BR>}<BR>}<BR>}<BR></FONT><BR><BR>Thanks
in advance,</FONT></P>
<P><FONT size=2>Fons<BR><BR><BR>________________________________<BR><BR>Van:
chameleon-bounces@lists.maptools.org [<A
href="mailto:chameleon-bounces@lists.maptools.org">mailto:chameleon-bounces@lists.maptools.org</A>]
Namens dominique briand<BR>Verzonden: donderdag 29 november 2007 19:14<BR>Aan:
chameleon@lists.maptools.org<BR>Onderwerp: [Chameleon] Re:I need help with
Authenticator.php<BR><BR><BR>hello,<BR>I implemented en authentication with
Authenticator.php, I use a postgres database to register users and
passwords,<BR>here are the modified
scripts:<BR><BR>login.html<BR><BR><html><BR><head><BR><title>*****</title><BR><link
href="samplelogin.css" rel="stylesheet"
type="text/css"><BR></head><BR><body><BR><form
method="POST"><BR><input type='hidden' name='sid'
value='[$SID$]'><BR><BR><div id="conteneur"
name="conteneur"><BR><div id="TitleLayer"
name="TitleLayer"><BR><br><b><u><center><FONT
SIZE="+1">Please authenticate to
access*****</center></u></br><BR></div><BR><BR><div
id="IconLayer"><BR><IMG SRC="./logo1.jpg" align = middle
><BR></div><BR><BR><div id="InboxLayer"
name="InboxLayer"><BR><TABLE><BR><TR><TD>User
:</TD><TD><input type="text" name="username"
value=""></TD></TR><BR><TR><TD>Password :
</TD><TD><input type="password" name="password"
value=""></TD></TR><BR><TR><TD><input
type="submit" name="submit" value="submit"></TD><TD><a href="
help.html"
target="_blank">?</TD></TR><BR></TABLE><BR></div><BR></div><BR><BR></form><BR></body><BR></html><BR><BR><BR>index.phtml<BR><BR><BR><?php<BR>/*<BR> *<BR> */<BR>include(
"../../htdocs/chameleon.php" );<BR><BR>$szTemplate =
"./template.html";<BR>$szMapFile = "../map/chameleon.map";<BR><BR>class
SampleApp extends Chameleon<BR>{<BR> function
SampleApp()<BR>
{<BR>
parent::Chameleon();<BR>
$this->moMapSession = new
MapSession_RW;<BR>
$this->moMapSession->setTempDir(
getSessionSavePath());<BR> }<BR>}<BR>//creation d'une nouvelle
session<BR>$oApp = new SampleApp();<BR>//appel pour
l'authetification<BR>$oApp->moAuthenticator = new Authenticator('login.html'
);<BR>//renseignement des chemins pour les fichiers
importants<BR>$oApp->registerSkin( 'skins/sample'
);<BR>$oApp->CWCInitialize( $szTemplate, $szMapFile );<BR>//acceptation
des widgets ayant un niveau de maturité alpha
(developpement)<BR>$oApp->mnMinimumMaturityLevel =
MATURITY_ALPHA;<BR>$oApp->CWCExecute();<BR>?><BR><BR><BR>in the file
Authenticator.php :<BR><BR>function Authenticator($szLoginTemplate)
{<BR> $this->mszLoginTemplate =
$szLoginTemplate; <BR>
}<BR> <BR> function authenticate( $user,
$password )<BR>
{<BR> $_SESSION['CWCAuthentication'] =
false;<BR> <BR>
$user="'$user'";<BR>
$password="'$password'";<BR><BR> $_SESSION['user'] =
$user;<BR><BR> //echo
$user."</br>";<BR> //echo
$password."</br>";<BR><BR> $conn = pg_connect("host=**
port=** dbname=** user=** password=***");<BR><BR> if (!$conn)
{<BR> return
"Autentification error
occured.\n";<BR>
exit;<BR> }<BR><BR> $result =
pg_query($conn, "SELECT *** FROM *** where (****=$user and
****=$password)");<BR><BR><BR> $nb_resultat =
pg_num_rows($result);<BR><BR>//echo
$nb_resultat."</br>";<BR><BR><BR>
if ($nb_resultat==1) <BR>
{<BR> <BR>
$_SESSION['CWCAuthentication'] =
true;<BR><BR> <BR>
}<BR><BR> else
{$_SESSION['CWCAuthentication'] =
false;}<BR><BR><BR> return
$_SESSION['CWCAuthentication'];<BR>
}<BR> <BR><BR>cheers<BR>dominique<BR><BR><BR>
----------------------------------------------------------<BR> <BR>
Message: 1<BR> Date: Wed, 28 Nov 2007
12:03:53 -0800 (PST)<BR> From: Minerva
Duran Martinez
<mine_tod@yahoo.com.mx><BR>
Subject: [Chameleon] I need help with
Authenticator.php<BR> To:
chameleon@lists.maptools.org<BR>
Message-ID:
<554011.93015.qm@web34413.mail.mud.yahoo.com><BR>
Content-Type: text/plain;
charset="utf-8"<BR> <BR>
Hi<BR> <BR>
I need help,<BR> Someone
Authenticator.php implemented in their applications chameleon, because I
want to implement but I don't know
as.<BR> <BR>
Regards,<BR> <BR>
Minerva<BR> <BR> <BR> <BR> <BR><BR><BR></P></FONT></BODY></HTML>