Auth Component; Strange behavior
Using Cake 2.2.5 My app is exhibiting a strange behavior in one of my controller/views. I have $this-Auth-allowedActions = array('view', 'index'); defined in the beforeFilter of one of my controllers. When an authenticated user navigates to the index view, Auth Component does not work on that page. Removing 'index' from allowedActions gets Auth Component working but then does not allow public access to that view. This is the only controller/view exhibiting this behavior, all others work fine. Any idea what could be going on here? - ED -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Auth Component; Strange behavior
Still learning Cake but maybe you have some code conflicting with auth on your AppController beforeFilter? Happened to me when trying out the Auth component. Pablo. On Monday, March 11, 2013 6:15:02 AM UTC-3, CrotchFrog wrote: Using Cake 2.2.5 My app is exhibiting a strange behavior in one of my controller/views. I have $this-Auth-allowedActions = array('view', 'index'); defined in the beforeFilter of one of my controllers. When an authenticated user navigates to the index view, Auth Component does not work on that page. Removing 'index' from allowedActions gets Auth Component working but then does not allow public access to that view. This is the only controller/view exhibiting this behavior, all others work fine. Any idea what could be going on here? - ED -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Auth Component; Strange behavior
Define Auth Component does not work. If Auth is allowing access then what else do you need? Could this be a routing issue? Are you using admin prefixes? (It's been a long day so I may well be missing something obvious here.) On Mon, Mar 11, 2013 at 5:15 AM, Ed Propsner crotchf...@gmail.com wrote: Using Cake 2.2.5 My app is exhibiting a strange behavior in one of my controller/views. I have $this-Auth-allowedActions = array('view', 'index'); defined in the beforeFilter of one of my controllers. When an authenticated user navigates to the index view, Auth Component does not work on that page. Removing 'index' from allowedActions gets Auth Component working but then does not allow public access to that view. This is the only controller/view exhibiting this behavior, all others work fine. Any idea what could be going on here? - ED -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Auth Component; Strange behavior
Pablito was correct, there was a conflict in my code. I had a custom helper to handle ckeditor and it was causing the conflict. On Monday, March 11, 2013 7:56:19 PM UTC-4, cricket wrote: Define Auth Component does not work. If Auth is allowing access then what else do you need? Could this be a routing issue? Are you using admin prefixes? (It's been a long day so I may well be missing something obvious here.) On Mon, Mar 11, 2013 at 5:15 AM, Ed Propsner crotc...@gmail.comjavascript: wrote: Using Cake 2.2.5 My app is exhibiting a strange behavior in one of my controller/views. I have $this-Auth-allowedActions = array('view', 'index'); defined in the beforeFilter of one of my controllers. When an authenticated user navigates to the index view, Auth Component does not work on that page. Removing 'index' from allowedActions gets Auth Component working but then does not allow public access to that view. This is the only controller/view exhibiting this behavior, all others work fine. Any idea what could be going on here? - ED -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+u...@googlegroups.com javascript:. To post to this group, send email to cake...@googlegroups.comjavascript:. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message because you are subscribed to the Google Groups CakePHP group. To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscr...@googlegroups.com. To post to this group, send email to cake-php@googlegroups.com. Visit this group at http://groups.google.com/group/cake-php?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Re: Component or Behavior?
Consider database triggers. I recommend using database trigger for REALLY simple situations that involve no more then 3 line of code. In you example pseudo code should looks something like this. After update trigger on competitions . #If NEW.complete == yes #Select awardpoints into new_points from competitions #Update users set points = new_points where id = user_id; Its better to call stored procedures from within the trigger to do the job. For more complicated situations create a stored procedure in the database and call this procedure from your model aftersave(); Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Component or Behavior?
I'd do it from within the main model, assuming that all of the models are related. Jeremy Burns Class Outfit jeremybu...@classoutfit.com http://www.classoutfit.com On 10 Jan 2011, at 07:01, Eric Anderson wrote: Hi everyone, I'm creating an app and have a situation where after an event occurs, I need to save data in many different models. Essentially, when a competition ends, I need to save the winner, award points to everyone who entered the competition and as well as award credits. Essentially, I end up editing 4 (or more) different models when a competition ends and needs to be evaluated. What's the best way to handle things like this, where an event occurs but the consequences affect many models? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Component or Behavior?
Hi everyone, I'm creating an app and have a situation where after an event occurs, I need to save data in many different models. Essentially, when a competition ends, I need to save the winner, award points to everyone who entered the competition and as well as award credits. Essentially, I end up editing 4 (or more) different models when a competition ends and needs to be evaluated. What's the best way to handle things like this, where an event occurs but the consequences affect many models? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Component or Behavior?
Since you are mostly dealing with Models you should first try to see if you can find relationships between the models Something like Event hasMany Participants and so on - this will make your task easier and if at all needed what you should program is a Behaviour HTH Tarique On Mon, Jan 10, 2011 at 12:31 PM, Eric Anderson andersoneric...@gmail.com wrote: Hi everyone, I'm creating an app and have a situation where after an event occurs, I need to save data in many different models. Essentially, when a competition ends, I need to save the winner, award points to everyone who entered the competition and as well as award credits. Essentially, I end up editing 4 (or more) different models when a competition ends and needs to be evaluated. What's the best way to handle things like this, where an event occurs but the consequences affect many models? Thanks! Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -- = Cheesecake-Photoblog: http://cheesecake-photoblog.org PHP for E-Biz: http://sanisoft.com = Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
component or behavior?
I've been tidying up my classes, moving a lot of stuff from controllers to models and, so far, it's all been quite intuitive. However, there's one controller I'm really stuck on. This one involves uploads, though they can be several different types. I'll call the model Record because the actual name would be meaningless. A record can involve exactly one of several file resources. When it's created, the controller can expect, eg. an image, an audio file, a video, or some text (from a textarea). The latter is saved as text file while the others are--big surprise--uploaded to the filesystem. If it's an image, it's resized, if necessary, to maximum width/height. Upon successful save, the user is presented with a view that allows cropping to create a thumbnail. If it's any of the other types, the record is saved after various tasks are performed (eg, grab video frames with FFmpeg) and then the user is presented with an opportunity to upload a thumbnail, after which the cropper view is displayed. So, there are several different behaviors or components that are necessary here: image resizing, thumbnail cropping, text file creation, video fiddling, etc. And, there's a difference in redirects if it's an image or not. Using components, I can't seem to get this all pulled together without creating ridiculously convoluted controller actions. Given that I need both add and edit, plus the same for admin routes, this gets stupid fairly quick. I'd like to move all this to behaviors (in spite of the gut feeling I can't shake that this sort of thing is much more component-like) but I can't decide how to proceed. One of my hangups is trying to figure out how to propagate errors from the behavior back to the controller. The way I see it, the controller won't know anything about *what* the problem was, only that $this-Record-Save() failed for some reason. What am I missing here? How should I be approaching this? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using Auth Component from behavior
Hello, just a simple question, I guess: How could I load the AuthComponent from a behavior, that I am writing ? I think it should work with something like: App::import('Component', 'AuthComponent'); $this-Auth = new AuthComponent(); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Using Auth Component from behavior
Hello, just a simple question, I guess: How could I load the AuthComponent from a behavior, that I am writing ? I think it should work with something like: App::import('Component', 'AuthComponent'); $this-Auth = new AuthComponent(); from within the behavior. But if I want to call it like this: $user = $this-Auth-user(); I get a Undefined property: AuthComponent::$Session Any hints ? Thanks and sorry for the other incomplete posting in the list. Siegfried --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Auth Component from behavior
Session in not available in models. The best in your case would be to pass the parameters to the behavior from controller. hth On Jul 7, 2:05 pm, Siegfried Hirsch [EMAIL PROTECTED] wrote: Hello, just a simple question, I guess: How could I load the AuthComponent from a behavior, that I am writing ? I think it should work with something like: App::import('Component', 'AuthComponent'); $this-Auth = new AuthComponent(); from within the behavior. But if I want to call it like this: $user = $this-Auth-user(); I get a Undefined property: AuthComponent::$Session Any hints ? Thanks and sorry for the other incomplete posting in the list. Siegfried --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Using Auth Component from behavior
Here is a post where nate suggests a way to model sessions.. http://groups.google.com/group/cake-php/browse_thread/thread/8911d61137f80eb5/00217852f762f67c?lnk=gstq=novice.program+session+model#00217852f762f67c Thanks. On 7/7/08, francky06l [EMAIL PROTECTED] wrote: Session in not available in models. The best in your case would be to pass the parameters to the behavior from controller. hth On Jul 7, 2:05 pm, Siegfried Hirsch [EMAIL PROTECTED] wrote: Hello, just a simple question, I guess: How could I load the AuthComponent from a behavior, that I am writing ? I think it should work with something like: App::import('Component', 'AuthComponent'); $this-Auth = new AuthComponent(); from within the behavior. But if I want to call it like this: $user = $this-Auth-user(); I get a Undefined property: AuthComponent::$Session Any hints ? Thanks and sorry for the other incomplete posting in the list. Siegfried -- Thanks Regards, Novice. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Component in Behavior
Hi and thanks for this great group which gives a lot of answers to crazy problems. I wanted to know if it was possible to use a component in a behavior (cakephp 1.2). In fact, I have a component that permits to retrieve the latitude and longitude from a webservice and want to automate the saving of those field in the model. Thanks in advance. Martin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Component in Behavior
On Aug 29, 9:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I wanted to know if it was possible to use a component in a behavior (cakephp 1.2). No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Component in Behavior
Thanks On 29 août, 17:28, nate [EMAIL PROTECTED] wrote: On Aug 29, 9:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I wanted to know if it was possible to use a component in a behavior (cakephp 1.2). No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: Component in Behavior
You're welcome. It sounds like this code is better off in a behavior anyway. On Aug 29, 12:04 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Thanks On 29 août, 17:28, nate [EMAIL PROTECTED] wrote: On Aug 29, 9:50 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I wanted to know if it was possible to use a component in a behavior (cakephp 1.2). No --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---