Re: [SMARTY] fetch template function not handling httpuser httppass

From: Date: Thu, 08 Jan 2004 16:00:14 +0000
Subject: Re: [SMARTY] fetch template function not handling httpuser httppass
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10799@lists.php.net to get a copy of this message
Well, I found out that there are some undocumented parameters that you can send to the fetch plugin. I also discovered that the plugin could be rewritten to obviate the need for the user and pass parameters. Fetch plugin uses the url_parse php function to extract *some* of the url pieces into variables but the fetch code doesn't acquire the user and pass components of the url. So, there are two things going on here: 1) fetch disregards the user:pass strings in a file param structured like: http://user:pass@domain/path 2) fetch has undocumented parameters for user and pass If number 1) were fixed there would be no need for the extra parameters to fetch. On the other hand, this would require that designers create a proper syntax for user:pass in a url which is not as easy (IMO) as passing parameters user and pass. My suggestion is to expand the fetch code so that it supports both types of file parameter. That is, the user can write {fetch file="http://user:pass@domain"} or they can write {fetch file="http://domain" user="uname" pass="passwd"} Also, I would expand the manual so that it documents the hidden user and pass parameters that allow the function to work with realm protected resources. Hope this info helps someone in the future... Cheers, dan On 1/7/04 9:25 PM, "DC" <dan@dbmscan.com> wrote: > Hi smarty-listers, > > I am trying to use the fetch template function plugin to access a Filemaker > Pro database. > > The url format for a request to find a random record is like this: > > > http://user:pass@domain:port/FMPro?-db=dbname&-format=-dso_xml&-findany > > When I drop this into the file param in the fetch template function I always > get a "password invalid" error from Filemaker. > > {*fetch > > file="http://user:pass@domain:port/FMPro?-db=dbname&-format=-dso_xml&-findan > y"*} > > <snip> > Ideally, I'd like to be able to use the fetch > plugin as it streamlines the code and makes it so I don't have to use the > php block in a template that designers will see. I am happy to test out some > patches to the fetch plugin if someone could give me a quick headstart as to > what I should try to do to get it to work with my FMPro server. > > Thanks! > dan

« previous php.smarty.general (#10799) next »