Securing Knop Database Connection Variables

View: New views
2 Messages — Rating Filter:   Alert me  

Securing Knop Database Connection Variables

by Steve Piercy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In reference to a recent post on LassoTalk about securing
variables, I ran into an issue of trying to secure the variables
for Knop:

http://www.listsearch.com/Lasso/Thread/index.lasso?22934#251686

// this is not secure
var('d'=knop_database(-database='db', -table='user',
-username='u', -password='p', -keyfield='keyfield', -lockfield='lockfield'));

// Putting the connection settings into a global array in an
atbegin in LassoStartup for the site causes an error:

     global('cnxn'           = array(
         -database   = 'db',
         -table      = 't',
         -username   = 'u',
         -password   = 'p',
         -maxrecords = 'all',
         -nothing
         )
     );

var('d'=knop_database($cnxn, -table='user',
-keyfield='keyfield', -lockfield='lockfield'));

=> The specified database was not found.

// By traversing the array, I made a workaround, but it is not sexy:
var('d'=knop_database(-database=$cnxn->get(1)->second,
-table='user', -username=$cnxn->get(3)->second,
-password=$cnxn->get(4)->second, -keyfield='keyfield', -lockfield='lockfield'));

Is there a more elegant way to pass the database connection
parameters as an array instead of individual strings?

--steve

-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- --
Steve Piercy               Web Site Builder              
Soquel, CA
<web@...>                  <http://www.StevePiercy.com/>


--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <knop@...>.
To unsubscribe, E-mail to: <knop-off@...>
Send administrative queries to  <knop-request@...>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/

Re: Securing Knop Database Connection Variables

by Johan Solve-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

At 03.51 -0700 2009-09-22, Steve Piercy - Web Site Builder wrote:
>Is there a more elegant way to pass the database connection parameters as an array instead of individual strings?

Not at the moment. I've been missing it too (but not strongly enough...).

--
     Johan Sölve    [FSA Member, Lasso Partner]
     Web Application/Lasso/FileMaker Developer
     MONTANIA SOFTWARE & SOLUTIONS
http://www.montania.se   mailto:joh-n@...
 (spam-safe email address, replace '-' with 'a')

--
#############################################################
This message is sent to you because you are subscribed to
the mailing list <knop@...>.
To unsubscribe, E-mail to: <knop-off@...>
Send administrative queries to  <knop-request@...>
List archive http://www.nabble.com/Knop-Framework-Discussion-f29076.html
Project homepage http://montania.se/projects/knop/
Google Code has the latest downloads at http://code.google.com/p/knop/