Is session variable a good place to store authorization info?

2012-05-13 Thread Toby G
By saving into the session it means that you would not need to call the method that sets the values on each page load, as the data is save between page loads. If you need to call the method to check the values are updated on each page load then perhaps it might be better to save them as a

Re: Login / idle timeout

2012-05-13 Thread Toby G
Might it be because you are not touching the session after the initial login? Not sure if cake touches the session for you on each page load, to prevent it from expiring? On Monday, 14 May 2012 03:04:10 UTC+1, bs28723 wrote: Is a user's login controlled by session timeout? What is the

Re: CakePHP 2.1.2 2.2.0-beta released

2012-05-13 Thread Toby G
Great to see Cake continues to get better. On Monday, 30 April 2012 04:12:50 UTC+1, mark_story wrote: The CakePHP core team is proud to announce the immediate availability of both CakePHP 2.1.2 [1], and 2.2.0-beta [2]. 2.1.2 is a bugfix release for the 2.1.x branch, while 2.2.0-beta is the

Re: CakePHP 2.1.2 2.2.0-beta released

2012-05-13 Thread Toby G
Great to see Cake continues to get better. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: Undefined property: LinksController::$Text

2012-05-13 Thread Toby G
What version of Cake are you using? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

Re: hasAndBelongsToMany Question

2011-12-15 Thread Toby G
Don't think that there's an easy way to do this, but if you have another unique value field in the table, you could use the solution mentioned here... http://cakephp.1045679.n5.nabble.com/saveall-and-getLastInsertId-or-return-all-last-inserted-ids-td1294886.html Perhaps create a field just to

Default route pointing to plugin action

2011-12-12 Thread Toby G
RE: v1.3 Hi there, I am trying to define my initial route to point to an action within one of my plugins, but it doesn't appear to be working. Can anyone explain to my why this doesn't work...? Router::connect( '/', array( 'plugin' = 'facebook', 'controller' = 'facebook_pages', 'action' =

Re: Can a plugin component auto-load a helper

2011-12-09 Thread Toby G
component, all you have to do: $this-controller-helpers[] = 'MyPluginName.MyHelperName'; or $controller-helpers[] = 'MyPluginName.MyHelperName'; (depending on where you are) dont pass the helpers in this set. bad idea :) On 9 Dez., 00:51, Toby G t...@cubicmushroom.co.uk wrote: Hi

Can a plugin component auto-load a helper

2011-12-08 Thread Toby G
Hi there, I've been attempting to get a plugin component auto-load the plugin's helper file. I have added it to the controller's helper array, but it's not loading the helper into view (under $this-Helper), so I think that the helpers have already been loaded prior to me adding the plugin helper

Cake 1.3 - Complicated Model associations

2011-12-04 Thread Toby G
Hi there, Am have a dilemma... I have a store that sells eTickets physical tickets. Details of the sale of each type of ticket are stored in 2 tables (etickets ptickets). I also have a table that stores details of when a user is directed off to PayPal to pay for their tickets

Re: Cake 1.3 - Complicated Model associations

2011-12-04 Thread Toby G
I think I may have just answered my own question in writing that! If I use the 2 model added a beforeSave to set the type when saving to set the 'type' field. the condition on the relationship, then each of the ticket type models will not be able to see the transactions that relate to the other

Re: Validation problems

2011-12-03 Thread Toby G
= Array ( [name] = Toby Griffiths [phone_no] = [no_of_tickets] = 10 ) ) [submit] = Request tickets [add_more_text] = SOMETHING RANDOM ) On Dec 1, 5:05 pm, Toby G t...@cubicmushroom.co.uk wrote: Hi

Re: Validation problems

2011-12-02 Thread Toby G
Hmmm... My earlier reply appears to have got lost. Thanks for the advice. I worked it out. It was because the relationship was a hasMany I'd forgot to add the .0. into the field name. T On Dec 2, 8:43 am, AD7six andydawso...@gmail.com wrote: On Thursday, 1 December 2011 18:05:57 UTC+1, Toby

Validation problems

2011-12-01 Thread Toby G
Hi there, Version: 1.3.12 I seem to be having a problem with the 'numeric' validation rule on an associated Model's fields. For some reason it is not validating '10' as a valid numeric value. Here are the validation rules for the (PhysicalTicket) no_of_tickets field in question...

Re: Cakephp Transaction

2011-10-02 Thread Toby G
Don't forget that your d/b table engine needs to support transactions... For transactions to work correctly in MySQL your tables must use InnoDB engine. Remember that MyISAM tables do not support transactions. - from SaveAll page of manual http://bit.ly/nUJyv2 On Sep 30, 11:42 pm,

Re: I can find() but can't save(), why?

2011-09-30 Thread Toby G
I think we'll need some more info... I woud suggest inspecting your validation erros to see if that's preventing the records from being saved. debug( $this-Modalidad-validationErrors ); If you enable debugging, can you see any insert comments in the MySQL debugging info? On Sep 29, 3:53 

Re: Ajax Link - How to exchange/toogle a link?

2011-09-30 Thread Toby G
Hi heohni, In these instances I normally include both links in the original view then use CSS to hide 1, JS to toggle them when required. you can change the class on a parent element using JS to make the toggle happen... HTML... span id=link_container class=show_link_1 a id=link_1Link 1/a

Generating files using view elements in controller

2011-09-30 Thread Toby G
Hi there, Can anyone suggest the best way to generate output files within the controller, using view elements? Thanks, T -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with

Problems with default actions on a custom route

2011-05-18 Thread Toby G
Hi all, I'm trying to setup a custom route that allows me to serve content based on a customer's unique ID in the URL... http://example.com/c-customer-id/action I have setup this in the routes.php as follows... Router::connect('/c-:clientId/:action/*', array( 'controller' = 'clients',

Site down config

2011-04-29 Thread Toby G
Hi there, I'd like to be able to set a 'catch-all' route or config that allows me to direct all site trafic to a maintenance page. Any suggestions on the best way to do this? Thanks, T -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new

Ordering by associated dates

2011-01-23 Thread Toby G
Morning all, I'm a little stumped this morning, on how to sort a model's records based on the max value of it's associated (has many) dates. Initially I used a find then a sort, however I now need to paginate the results, so I need to be able to order the results as part of the paginated find.

Re: Pagination using associated model record count?

2010-12-13 Thread Toby G
Thanks for the response, Cricket. Unfortunately, I can't use the HABTM relationship, as the joining table contains notes notes relating to the link. I think the idea of storing the number in the member table could be the best option. Think I'll add a beforeSave method to the Role model to

Pagination using associated model record count?

2010-12-05 Thread Toby G
Hi there, Not sure where to start with this one, so offering it up for advice. I have 2 associated models... * Members * Events * Roles The Roles table links the members to events. What I would like to do is include the number of events a member has been involved with by including the Event

Re: Baffling blank screen problem

2010-11-17 Thread Toby G
Can you clarify... Do you have debugging enabled? Is it actually a blank screen, or just falling over, but not displaying the error? Toby On Nov 17, 1:00 am, Jules fattyju...@gmail.com wrote: I have a new CakePHP installation I'm fiddling around with. I've built a reasonably sophisticated

Re: Saving data in many tables in CakePHP

2010-11-17 Thread Toby G
Don't forget, if you're database does not support transactions you should make sure you validate the data before you saveAll, or ensure that any failure to save is handled properly. Toby On Nov 16, 5:26 am, Amit Badkas amit.sanis...@gmail.com wrote: Hi, First of all you need to set User's

Re: Static Pages not working for me

2010-10-25 Thread Toby G
Don't forget to use 'echo' if using the HtmlHelper to render your tags. I've been using CakePHP for ages that one still gets me from time to time. Toby On Oct 24, 10:13 pm, Tom tast...@gmail.com wrote: Day 3 on using CakePhp and I like it. But I am running into the problem with generating

$this-Auth-allow(array('*')); in AppController causing error

2010-10-20 Thread Toby G
Hi all, I've just added the line... $this-Auth-allow(array('*')); ... to my beforeFilter method in my AppController, but am now getting this error when attempting to view my home page (/views/pages/ home.ctp)... Fatal error: Call to undefined method Debugger::checksessionkey() I am running

Re: $this-Auth-allow(array('*')); in AppController causing error

2010-10-20 Thread Toby G
More details... It looks like it's use of any Auth method in the AppController beforeFilter method. Toby On 20 Oct, 10:47, Toby G t...@tgpromotions.com wrote: Hi all, I've just added the line... $this-Auth-allow(array('*')); ... to my beforeFilter method in my AppController, but am now

Re: Schema generation for plugins

2010-10-18 Thread Toby G
Majerlehttp://majerle.eu 2010/10/17 Toby G t...@tgpromotions.com Hi all, I've recently created a Users plugin to manage all my user logins, however I would now like to create a migration schema for the users table, but running the... cake schema generate ... on the app ignores

Schema generation for plugins

2010-10-17 Thread Toby G
Hi all, I've recently created a Users plugin to manage all my user logins, however I would now like to create a migration schema for the users table, but running the... cake schema generate ... on the app ignores the models in the plugin. Does anyone know a way of generating schemas for plugin