[Catalyst] Need help inserting

2012-05-30 Thread Kenneth S Mclane
I have my authentication working through the company LDAP server. I am attempting to check for the existence of the user in a sqlite table and add them and their role if they are not found. I do this during the login: if ($username $password) { # Attempt to log the user in if

Re: [Catalyst] Need help inserting

2012-05-30 Thread Theodore Katseres
I'm not an expert but your check for existing user in the database should be -find; -search will return a resultset unless there is an exception. Also, you may want this instead. my $user = $c-model('authdb::User')-create({ username = $username }); $user-create_related('user_roles', {role='1'});

Re: [Catalyst] Need help inserting

2012-05-30 Thread Kenneth S Mclane
/2012 03:28 PM Subject: Re: [Catalyst] Need help inserting I'm not an expert but your check for existing user in the database should be -find; -search will return a resultset unless there is an exception. Also, you may want this instead. my $user = $c-model('authdb::User')-create({ username