Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?
Great, thanks Matt. ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?
On Mon, Aug 27, 2007 at 11:20:10PM +0900, Matt Rosin wrote: > I'm curious. I was asked to "clone" an existing catalyst system so a > different database would be used depending on the url. Doesn't seem > like a good idea unless it is a completely separate code base... Done this with Model::DBIC::Schema. Works fine. -- Matt S Trout Need help with your Catalyst or DBIx::Class project? Technical DirectorWant a managed development or deployment platform? Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote http://chainsawblues.vox.com/http://www.shadowcat.co.uk/ ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?
I'm curious. I was asked to "clone" an existing catalyst system so a different database would be used depending on the url. Doesn't seem like a good idea unless it is a completely separate code base... ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
Re: [Catalyst] Is there any way to change the catalyst model parameters at the runtime ?
On 2007-08-27 15:15:59 +0530, Sandip Patel wrote: > Actually i am using "Catalyst::Model::LDAP" model, where you have to > define your ldap configurations (like host, base, dn, password etc) > into LDAP model and that configuration will be static for all the > transactions. For all Relational databases, this type of model will > be ok but for ldap it should bind with the username and password > which has been provided by the loged in user. You can accomplish this using version 0.15 of Catalyst::Model::LDAP. The basic structure goes something like this: 1. In MyApp::Model::LDAP, override ACCEPT_CONTEXT to store the username and password from the request. 2. In MyApp::LDAP::Connection, override bind to use the username and password from step 1. If your LDAP server expects just a simple DN and password pair, you might not even need MyApp::LDAP::Connection. For example: package MyApp::Model::LDAP; use Class::C3; sub ACCEPT_CONTEXT { my $self = shift; my $c = $_[0]; $self{dn} = $c->req->param('username'); $self{password} = $c->req->param('password'); $self->next::method(@_); } For more information on customizing the bind process, please see: http://search.cpan.org/~danieltwc/Catalyst-Model-LDAP-0.15/lib/Catalyst/Model/LDAP/Connection.pm#OVERRIDING_METHODS -- Daniel Westermann-Clark ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/
[Catalyst] Is there any way to change the catalyst model parameters at the runtime ?
Hi Guys, Does anybody know how to change the parameters of catalyst model at the runtime ? Actually i am using "Catalyst::Model::LDAP" model, where you have to define your ldap configurations (like host, base, dn, password etc) into LDAP model and that configuration will be static for all the transactions. For all Relational databases, this type of model will be ok but for ldap it should bind with the username and password which has been provided by the loged in user. Once we can do this we can also use ldap level security (ACLs). That is why i am looking for the way i can modify the configuration parameters of the LDAP Model at runtime. -- Sandip Patel www.gnulinux.in ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/ Dev site: http://dev.catalyst.perl.org/