On Dec 28, 2007, at 7:26 AM, Uwe Grauer wrote:

> Take a look at:
> http://paul.dabodev.com/doc/api/dabodoc/ 
> dabo.dSecurityManager.dSecurityManager.html
>
> Sorry for the short hint, as i don't have enough time now for a longer
> answer.

        Uwe's got you started on the answer. You would use your own subclass  
of dSecurityManager to get your login information from the user,  
using its validateLogin() hook method to authenticate. Then you can  
override its afterLoginSuccess() hook method to do whatever you need  
it to do; in your case, by creating the connection. So your code  
would look something like this:

def afterLoginSuccess(self):
        ci = dConnectInfo(DbType="MySQL", Host="localhost", User=self.UserName,
                        PlainTextPassword=self._password, Database="myData",
                        Name="myConnection")
        self.Application.addConnectInfo(ci)

        As far as getting the username and password from the dialog, you'll  
have to store the password value yourself in validateLogin(), as the  
class by default does not do that for the password. In the code  
above, I've assumed that it is stored in an attribute named  
'_password', but you can call it whatever you like.

        Once you add the dConnectInfo object to the app, it will be  
available just as if you had defined it in a .cnxml file.

-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com




_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/dabo-users/[EMAIL PROTECTED]

Reply via email to