Chris Blackwell wrote:

I just had a quick look at the admin api code and it doesn't look like login() actually does anything right now.

Actually that's at the root of why it can't currently be used as a true API (and addresses the question about creating a datasource)--on the API side you're correct, all it does is return true if you supply the correct password. The session variable indicating whether or not someone is logged in happens on the application side, meaning in the admin console that's happening not in the API itself but in the admin console code.

So on the application side at this point, it's responsible for creating a session.auth.loggedIn variable (which as you point out causes issues if someone is using that same name for their own "logged in" type code), but since on the API side it checks for exactly that, this could stand some rework.This code is in the _loginController.cfm file if you're interested in seeing what's going on.

Early on Adam Haskell suggested a factory approach to avoid the annoyance that you have with the ColdFusion admin API and how it works, so in a future release we'll probably go that route.

how about refactoring slightly so there is a factory class on which login can be called, with methods for retrieving the individual api classes.
Yep, that's likely how this will end up working.

Thanks for all the feedback! And apologies if the "API" name is a bit of a misnomer at this point. We'll address this in a future release so it can be used as a true API.

Matt

--
Matt Woodward
[email protected]
http://www.mattwoodward.com/blog

Please do not send me proprietary file formats such as Word, PowerPoint, etc. 
as attachments.
http://www.gnu.org/philosophy/no-word-attachments.html

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to