Re: Social Networking Example
Have you forgotten to set the debug level to 0 in app/core.php for your production site? define('DEBUG', 0); --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Social Networking Example
There's a link on http://www.chattypet.com/about/ to http://www.chattypet.com/about/users/add , which has a missing controller debug message. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Implemented OthAuth
I am just starting with CakePHP and maybe I misunderstand your question, but can't you just get the list of permissions the logged-in user has from the db (via groups_permissions/permissions tables?) and use that to generate menu? You can also just make menu based on just group memberships (not as dynamic, but fast) BTW, some future features I'd love to see - multiple group memberships as well as users_permissions mapping for giving permissions directly to users. Also maybe a guest group, so that you can enable global lockdown and treat non-logged in users as guests - in effect doing deny all access unless logged in or action is in the guest group permissions. -M Olivier Percebois-Garve wrote: 2. I'd like to gather the name of all the controller having restricted methods, and the names of the restricted methods ($othAuthRestrictions) in my layout. Basically I'm doing : if restricted build adminMenu else build userMenu Any ideas on how to achieve this ? olivvv Langdon Stevenson wrote: Hi rombeh I have the following code in the controllers that I want to protect: (note: extra $helpers and $components have been removed to simplify) class LeadersController extends AppController { var $name = 'Leaders'; //for php4 var $helpers = array('othAuth'); var $components = array('othAuth'); var $othAuthRestrictions = array('index'); function beforeFilter() { $auth_conf = array('auto_redirect' = true, 'login_page' = 'leaders/login', 'logout_page' = 'leaders/logout', 'access_page' = '/leaders', 'hashkey' = 'mYpERsOnALhaSHkeY', 'strict_gid_check' = false); $this-othAuth-controller = $this; $this-othAuth-init($auth_conf); $this-othAuth-check(); } function index () { // Action code ... } } That is all that is required to add to the controller to protect the index action, assuming that you have followed the othAuth setup instructions and have the required classes and DB tables in place. As mentioned in my previous post I also have a permission in the permission table like this: INSERT INTO `cake_permissions` VALUES (1,'leaders/index','2006-03-13 23:19:31','-00-00 00:00:00'); And a Groups-Permissions mapping that connects that permission to the desired user's group. As a side note, you have to check that your User has the right group ID assigned, and that their Active field is set to 1. Hope this is useful. Regards, Langdon rombeh wrote: hi Langdon Stevenson, Can u show me quick walkthrough (place some code too :D) in order to get it works thanks --050902020402050200070309 Content-Type: text/html; charset=ISO-8859-1 X-Google-AttachSize: 3096 !DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN html head meta content=text/html;charset=ISO-8859-1 http-equiv=Content-Type /head body bgcolor=#ff text=#00 Wow. I see that there is more and more othAuth users. I've two issues I'm not sure how to tackle.br Just wanna to know if some peoples are sharing the same concerns (and if crazylegs thought about that for the new version) br br 1.Sometimes I hit the login page while its seems that I am already logged. if I fill in the right login, then I got back the message br that credentials are wrong. But n fact after thatnbsp; if I enter manuallynbsp; thenbsp; url of a restricted method, I can access it. br I'm not sure how to reproduce this but it happened often during testing of code in restricted method. maybe it is related to my usebr of requestAction.br br 2. I'd like to gather the name of all the controller having restricted methods, and the names of the restricted methods ($othAuthRestrictions) br in my layout. Basically I'm doing :br if restricted build adminMenubr else build userMenubr Any ideas on how to achieve this ?br br olivvvbr br br Langdon Stevenson wrote: blockquote cite=[EMAIL PROTECTED] type=cite pre wrap=Hi rombeh I have the following code in the controllers that I want to protect: (note: extra $helpers and $components have been removed to simplify) class LeadersController extends AppController { var $name = 'Leaders'; //for php4 var $helpers = array('othAuth'); var $components = array('othAuth'); var $othAuthRestrictions = array('index'); function beforeFilter() { $auth_conf = array('auto_redirect' =gt; true, 'login_page' =gt; 'leaders/login', 'logout_page' =gt; 'leaders/logout', 'access_page' =gt; '/leaders', 'hashkey' =gt; 'mYpERsOnALhaSHkeY', 'strict_gid_check' =gt; false); $this-gt;othAuth-gt;controller = amp;$this; $this-gt;othAuth-gt;init($auth_conf); $this-gt;othAuth-gt;check(); } function index () { // Action code ... } } That is all that is required to add to the
Re: Using cake to serve files
Other file serving php scripts do this by putting the files somewhere else on your system outside of the webroot. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Using cake to serve files
Hi Mtrautt. You just need to set the approprate headers and output the file contents (which can be anywhere on the files system) after checking access. Of course, you can do this with any type of file/download, for a pic example see: http://www.noswad.me.uk/demos/galleries/show/1/1 and http://www.noswad.me.uk/demos/galleries/serveImage/1/1 There may well be a better (written) example around somewhere. The controller code is available in the download Me link at the top of the page. The relavent controller being /app/plugins/demos/controllers/galleries_controller.php. HTH, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Inheriting other models
Hi. I need to share some code between models. The logical way to do it is to put the code in a model and have the others extend it. The problem is that in child models i have no way of ensuring that the base model is loaded before child models. I tried loadModel() but since it uses require instead of require_once i get an error saying that i can't redefine the class. How can i do this? Thanks in advance. -- Gonçalo Marrafa [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Post Variables Problem
I have setup a cake application.Everything is working fine except the form posting.Whenever i submit a form $this-params['data'] use to come empty. Do anyone have any idea about this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Inheriting other models
[EMAIL PROTECTED] wrote: How can i do this? copy app_model.php from /cake directory to /app. Then put your code inside this file I don't even think you have to copy the app_model.php if you don't want to change its functions, just create an own one that extends the model class. Atleast that works for controllers. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: multi image uploader
@Xeeton - Thank you. I had seen fileHandler component that Chris Partridge developed. It looks promising. I liked the idea up loading the files into the database though, and Daniel's implementation was so simple for a single file. If there is a way to adopt Daniel's script for use with multiple images, that would be my preference. I may have to resort to loading the files to a directory though. I've never done any image scaling programmatically before. I can see how this would be easier on the user though. How challenging of a task would this be? I am a beginner to MVC and CakePHP, but an experienced PHP developer. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: multi image uploader
I see two possible solutions: 1. Use different models for your files. 2. Extract in a loop the data from the $this-params['form'] array and create an array with the following structure: [Model] = Array ( [name] = [type] = [tmp_name] = [error] = [size] = ) With this array you can do the other things you do in your add() function. HTH -- Daniel Hofstetter http://cakebaker.wordpress.com --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Post Variables Problem
hi, have you checked your input tag? something like: ?php echo $html-input('Controller/field_name') ? D Smith wrote: I have setup a cake application.Everything is working fine except the form posting.Whenever i submit a form $this-params['data'] use to come empty. Do anyone have any idea about this problem? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Post Variables Problem
Also, make sure you have a form element: ?=$html-formTag('/application/add/) ? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Inheriting other models
On Sat, 15 Jul 2006 11:25:30 - [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: How can i do this? copy app_model.php from /cake directory to /app. Then put your code inside this file The code i want to share applies only to a few models and the extra baggage shouldn't be shared by all other models. I'll try AD7six's suggestion. -- Gonçalo Marrafa [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Framework Performance!
It will basically boil down to the performance of php and mysql communication. Or the guys from Symfony screwed up. Wich i hope :) --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: multi image uploader
@Daniel - Are either on of those solutions better than trying to implement image resizing programmatically in your opinion? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Social Networking Example
Maybe you or someone can help me with another issue. When I switch over to production mode (DEBUG 0) I get Not Found notices for all my links. What could be causing this? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Inheriting other models
Just a thought, this may be better. In terms of inheritance this is possibly close to what's required Model App_model OtherModels ParentModel ChildModel1 ChildModel2 ChildModel3 In the Parent Model, put any common attributes/methods not useful to all models. 1) Put ParentModel in app, extending app_model, if necessary (probably not) require once app_model. 2) In child Model require_once the ParentModel, and then declare the class Should then be able to use the models as 'normal'. Cheers, AD7six --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Inheriting other models
That's exactly what i want! Thanks for tip, AD7six. Best regards. On Sat, 15 Jul 2006 16:27:01 - AD7six [EMAIL PROTECTED] wrote: Just a thought, this may be better. In terms of inheritance this is possibly close to what's required Model App_model OtherModels ParentModel ChildModel1 ChildModel2 ChildModel3 In the Parent Model, put any common attributes/methods not useful to all models. 1) Put ParentModel in app, extending app_model, if necessary (probably not) require once app_model. 2) In child Model require_once the ParentModel, and then declare the class Should then be able to use the models as 'normal'. Cheers, AD7six -- Gonçalo Marrafa [EMAIL PROTECTED] --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Bug: using multiple models in controller
A controller is tied to its model. A controller can't really update models that don't share the controller's name. This seem to be a not yet implemented feature in CakePHP. Problem: Controller::$uses makes other models accessible but other methods don't take these models into account. This due to the use of Controller::$modelName wich is initialised to the controllers name. (I tought requestAction() solved my problem, but there isn't a way to pass data to it.) Affects: invalidate(), cleanUpFields(), ... (a search inside controller for 'modelName') Solution: setModelInUse(); or take into account the models in $uses. (requestAction($url, $extra, $formdata); ) Has anyone else encoutered these problems? It doesn't seem workable. $uses already takes into account more models. Thanks in advance for the positive response. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Error installing CakePHP
I couldn't find anything on baking in Installing CakePHP [1]. Open your browser and visit http://localhost/. You should get a CakePHP page with some information. If not, check that Apache is running and the DocumentRoot is set correctly. Now, follow the Cake Blog Tutorial at [2]. -- [1] http://manual.cakephp.org/chapter/3 [2] http://manual.cakephp.org/chapter/20 -- Good luck, Ryan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Error installing CakePHP
After the Blog Tutorial, follow it by example in building your own application. For reference to all Cake functions, visit the API at [1]. Also, you can check out the screencasts at [2]. Good luck with Cake! I haven't gone back to my old ways since I found it. -- [1] http://api.cakephp.org/ [2] http://cakephp.org/screencasts -- Ryan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: multi image uploader
I got it working by reorganizing the array like you suggested. I also needed to add... $this-File-create(); ...just before saving each image in order to do an insert on each one. Otherwise, every save() after the first one just overwrites the first one. It is likely that I will redo this at some point and resize the images programmatically, but for now this will work. Thanks again for you help. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Social Networking Example
try clearing /tmp/cache/models --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Social Networking Example
Thanks! that worked! --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
missing Ajax parameters
Just a word to say that it will be really useful to have more parameters to set with Ajax. For example, I had to add 'indicator' and 'fallback' to the Ajax Helper because I want to use these parameters with my autocomplete field -- Lfrb --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Error installing CakePHP
Hi, I tell you what happened. After I went to the cake URL as you said, I got lots of warnings at the top of the screen. To get rid of the warnings I had to manually create a folder in cake/app/ called models. After createing models folder the CakePHP home page didn't give any warnings, just said database file not configured. But I keep getting warnings for different things. Mostly only when I bake, when I get the warnings I find I have to create directories myself manually then I go through the bake process again and it works. So the problem is with the bake.php now. Is it unable to create directories? Is this due to some file/folder permission problem? Thanks, Philip ryanb006 wrote: After the Blog Tutorial, follow it by example in building your own application. For reference to all Cake functions, visit the API at [1]. Also, you can check out the screencasts at [2]. Good luck with Cake! I haven't gone back to my old ways since I found it. -- [1] http://api.cakephp.org/ [2] http://cakephp.org/screencasts -- Ryan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Simple HABTM find results in SQL Error; Where's the problem?
I have a simple app with 2 models (tags scraps) with a join table. Whenever I query the scraps I get a SQL error (I turned on debug level 2 to get this) 1064: You have an error in your SQL syntax near 'ON `tagvat_scraps_tags`.`scrap_id` = '1' AND `tagvat_scraps_tags`.`tag_id` = `Ta' at line 1 The SQL is this: SELECT `Tag`.`id`, `Tag`.`name`, `Tag`.`created`, `Tag`.`modified` FROM `tagvat_tags` AS `Tag` JOIN `tagvat_scraps_tags` ON `tagvat_scraps_tags`.`scrap_id` = '1' AND `tagvat_scraps_tags`.`tag_id` = `Tag`.`id` WHERE 1 = 1: Is there actually an error here? If so, what happened?! Thanks in advance! Drew. --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Error installing CakePHP
Ok. I don't remember having to create a models directory (or a components or views directory for that matter). Just create the folders if they are not already there. To configure your database file, rename /app/config/database.php.default to /app/config/database.php and then edit the file to suit your needs. You can configure different database settings, but you probably just need the one named $default. Baking advice: bake.php - Easy baking for lazy folks @ H3rald.com [1] Online Baker - rdBaker -- [1] http://www.h3rald.com/blog/view/26 [2] http://rdos.rd11.com/rdBaker/ -- Good luck, Ryan --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Using cake to serve files
Thanks AD7six, That's exactly what I was looking for :) I'm summarizing the relevant part of that controller here for anyone else: function SOME CONTROLLER() { #Turn of the default page rendering behaviour $this-layout = null; $this-autoLayout = false; #serve up the file header( Content-type: SOME TYPE ); @readfile( SOME FILE ); die; } --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Re: Simple HABTM find results in SQL Error; Where's the problem?
I just added an 'INNER' before JOIN and the query works as expected. Why does cake not specify the type of JOIN? Is this a bug? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---