Re: cakephp.org hacked?

2009-11-02 Thread mark_story
Yeah its partially a halloween design. For everyone with their panties in a twist, it will be changed back soon. We can all resume being _serious_ about a framework with many food based puns. -Mark On Nov 2, 7:23 am, Adrenalin wrote: > I think that is funny, cakephp rockz ! ;) > > > > On Mon,

Re: Tree reorder tweaking

2009-11-02 Thread Kerr
One more note, MonkeyGirl, and I'm sure we're already on the same page, but the syntax should be $this->ModelName->reorder(); Using the categories example from http://book.cakephp.org/view/228/Basic-Usage , the syntax to reorder the entire tree by name is $this->Category- >reorder(); On Nov 2, 9

Re: Weird Router Catchall Problem

2009-11-02 Thread Dr. Loboto
On catch all page action check if URL is valid or at least not too wrong (like /style.css). If request isn't valid, display error page. On Nov 2, 10:46 am, TimG wrote: > I am using this: > Router::connect('(?!admin|items|images)(.*)', array > ('controller'=>'displays', 'action'=>'index')); > > H

Re: single-field validation from controller

2009-11-02 Thread Robert P
Option C does seem to be your best bet. I don't see anything wrong with something like this in AppModel: function validateSingle($field, $value = null) { $this->validate = array($field => $this->validate[$field]); $this->data[$this->alias][$field] = $value; return $thi

RE: Cache Help

2009-11-02 Thread Dave
Maybe I should have put in baby steps for you to follow. 1. Click edit 2.Save 3. Save redirects you back to index. 4.Look no new content 5.Click new or edit 6.Save 7.Back to index 8.No new content , add or edit new content and nothing shows up until you hit refresh...(the index is cached)i know on

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread Dr. Loboto
I think you must convert array structure before save call. saveAll function determine the way must be used for actual save before beforeSave is called. So saveAll thinks that it should save one record of one structure, but then you change it to many records of other structure. So save fails. Make

Re: Tree reorder tweaking

2009-11-02 Thread Robert P
Also note that one issue with your reorderAll() function is that it loops through all non-empty parent IDs. The only problem with this is that top-level items WILL have an empty parent. On Nov 3, 10:27 am, Kerr wrote: > To be more specific in addressing, "I'm also still not > sure if reorder() r

Re: Two Auth problems never found sloutions for it

2009-11-02 Thread Robert P
He doesn't need to. Auth redirects only come into play on login, logout and when the user isn't authorised. Presumable Dave has allowed unauthorised access to RegistrationsController::pending_email_confirmation() On Nov 3, 6:47 am, Simon wrote: > did you set auth redirect to false ?? > > On Nov

Re: Cache Help

2009-11-02 Thread Robert P
OK, this one confused me. You have to hit refresh to reload a webpage... like everyone else? And I've never seen $this->disableCache() before. Since 1.1 I've been using $this->cacheAction = false; On Nov 3, 8:48 am, "Dave" wrote: > I need some help figuring out caching. A lot of the site I am w

Re: Tree reorder tweaking

2009-11-02 Thread Kerr
To be more specific in addressing, "I'm also still not sure if reorder() recurses as far as it can, or just one level. " -- Yes, it will recurse the tree until it finds no children in all affected branches. On Nov 2, 8:25 pm, Kerr wrote: > Hi, I've been playing around with thetreefunctionality

Re: Tree reorder tweaking

2009-11-02 Thread Kerr
Hi, I've been playing around with the tree functionality as well. Looking at the code, you'll notice that the reorder method calls itself recursively. If you want to reorder the entire tree, simply pass no arguments... e.g. $this->reorder(); Overall, I'm pretty impressed so far with how easy

Cache Help

2009-11-02 Thread Dave
I need some help figuring out caching. A lot of the site I am working on is dynamic and I do not want to cache the constantly changing data / actions. I have added Cache to app_controller, even to individual controllers, added nocache blocks in the views, $this->disableCache(); in controllers

Re: Cake Hosting - Who is the best?

2009-11-02 Thread balc...@gmail.com
I use https://www.nearlyfreespeech.net/ over 2 years and am more then contented. Excellent scalable hosting service. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email

try to set login system at home

2009-11-02 Thread leafchild
I'm trying to set login functionality at home.ctp I have problem with error "Notice (8): Use of undefined constant   - assumed ' ' [APP/views/layouts/default.php, line 49]" which from this code"create('User', array('action' => 'login')); ?>" also after click "login" botton goes to user/login pag

Re: Help doing this in CakePHP

2009-11-02 Thread Chad Casselman
Any idea how to use this approach with pagination? Chad On Mon, Nov 2, 2009 at 7:11 PM, Pablo Viojo wrote: > You can do something using subqueries (but if you're quering the same table > on main and sub query, it will not perform well) > I recommend to do two queries instead. > Regards, > > Pab

Re: Help doing this in CakePHP

2009-11-02 Thread Pablo Viojo
You can do something using subqueries (but if you're quering the same table on main and sub query, it will not perform well) I recommend to do two queries instead. Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://needish.com On Mon, Nov 2, 2009 at 8:49 PM, Chad C

Re: Edits being Added for form with associated model

2009-11-02 Thread ajoberstar
Just fixed it. I was passing the $id to the action, but I hadn't added the hidden id fields to the form, so that each element knew what to update. So the two things I had to add were: - hidden id field for the Album - hidden id field for each track that was already part of the Album (i.e. in my

Re: Help doing this in CakePHP

2009-11-02 Thread Chad Casselman
Is there anyway to get all the row information with all those ids or does it require another query to get row details for returned ids? Thanks, Chad On Mon, Nov 2, 2009 at 6:36 PM, Pablo Viojo wrote: > Something like this may help: > SELECT domain_id, search_engine_id, MAX(id) FROM table GROUP

Re: Help doing this in CakePHP

2009-11-02 Thread Pablo Viojo
Something like this may help: SELECT domain_id, search_engine_id, MAX(id) FROM table GROUP BY domain_id, search_engine_id Regards, Pablo Viojo pvi...@gmail.com http://pviojo.net ¿Que necesitas? http://needish.com On Mon, Nov 2, 2009 at 8:29 PM, Chad Casselman wrote: > > I have a table that

Re: How to prevent Cross Site Foreign Script Attacks on your actions.

2009-11-02 Thread Miles J
Well in most cases then not, if your on, says a users profile, you would submit to that page. Within that page you would check if a $_POST exists and then perform the add friend logic. On Nov 2, 8:44 am, Jonas Hartmann wrote: > Given someone mails you a link with html images that tries to > fet

Help doing this in CakePHP

2009-11-02 Thread Chad Casselman
I have a table that looks like: id created modifieddomain_id pages search_engine_id 92 2009-11-02 14:32:11 2009-11-02 14:32:11 2 19990 3 90 2009-11-02 14:32:11 2009-11-02 14:32:11 2 725 1 89 2009-11-02 14:32:10 2009

Re: Two Auth problems never found sloutions for it

2009-11-02 Thread Simon
did you set auth redirect to false ?? On Nov 2, 2:37 pm, "Dave" wrote: > For #2 in my login function I have > > if ($this->Auth->user('confirmed') == '0') { >                       $this->Session->destroy(); >                       $this->redirect(array('controller' => 'registrations', > 'action

RE: Two Auth problems never found sloutions for it

2009-11-02 Thread Dave
For #2 in my login function I have if ($this->Auth->user('confirmed') == '0') { $this->Session->destroy(); $this->redirect(array('controller' => 'registrations', 'action' => 'pending_email_confirmation')); } Dave -Original Message

Two Auth problems never found sloutions for it

2009-11-02 Thread Simon
1. is save the last login without the auth redirect = to false 2. if the email is not verified redirect them if you have any sloutions please share --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: WSOD on large number of elements in a form

2009-11-02 Thread Tonu Tusk
I also set the upload_max_filesize and post_max_size to 128M and the available memory size to 256M Probably not going to make the shared host happy, but phpinfo is reporting these values as having been set. It's a mystery. I am going to try and replicate the problem on a clean install to try an

Re: WSOD on large number of elements in a form

2009-11-02 Thread Tonu Tusk
oh yes, as I mentioned, I have also set a simple php script that is outside of the cake "jursadiction" and rewrite / routing mechanism but still hosted on the same shared host to just vardump the POSTed data, and that works absolutely fine. On Nov 2, 8:09 pm, Tonu Tusk wrote: > Hi OK, well it

Re: WSOD on large number of elements in a form

2009-11-02 Thread Tonu Tusk
Hi OK, well it is on a shared host so don't know how much luck I can get on accessing their logs. I have debug on level 2. I have stripped my controller back now so that it unconditionally just prepares the data to pass to the view to display the form. Everything is ok with that. I have written

Re: WSOD on large number of elements in a form

2009-11-02 Thread Dragos Chiriac
http://httpd.apache.org/docs/2.0/mod/core.html#limitrequestbody upload_max_filesize and post_max_size in your php.ini file. Each name/value is limited to 1024 characters, if the form type is not multipart. Also look at memory size available for script ... the default 16M is not enough, as cake i

Re: How to search inside http://code.cakephp.org/tickets ?

2009-11-02 Thread schneimi
It's not just you, I am also missing this feature. I hope this is coming soon. Jaime schrieb: > Hi all, > > Am I crazy, or it is impossible to search inside the new ticket system > at http://code.cakephp.org/tickets? Wanted to report an issue, but I'm > unable to filter the ticket list to check w

Re: WSOD on large number of elements in a form

2009-11-02 Thread Pedro Nascimento
Also, check apache logs. There may be some valuable info there. On Mon, Nov 2, 2009 at 17:04, John Andersen wrote: > > If you haven't, turn on debug and tell us the debug information that > you can see, look also at the source! > > Please provide the code for the Controller action in which the f

Re: WSOD on large number of elements in a form

2009-11-02 Thread John Andersen
If you haven't, turn on debug and tell us the debug information that you can see, look also at the source! Please provide the code for the Controller action in which the failure occur, so that we may be able to assist you better! Enjoy, John On Nov 2, 6:22 pm, Tonu Tusk wrote: > Hi, This is

Re: Helper or Model Function?

2009-11-02 Thread John Andersen
Helpers are used in Views and if you pass data from the Controller to the View, then the Helper has access to the data. The View has no direct access to Model data. That is why I suggested using requestAction in an Element to get the needed data. Enjoy, John On Nov 2, 7:50 pm, dtirer wrote:

Re: Helper or Model Function?

2009-11-02 Thread dtirer
Hi John, thanks for the info. I'll give that a whirl A general question: do helpers have access to Model data, or would you need to import the Model into the helper to access data like that?. Im just getting into Helpers, Components, etc so I'm trying to figure out when its best to use each O

Re: Helper or Model Function?

2009-11-02 Thread John Andersen
Based on the information you provided (not enough): One possible solution is to have a separate Element to create the link, when the database contains the specific record. The element will use requestAction to query the database for the specific record, and display/not display the link depending

WSOD on large number of elements in a form

2009-11-02 Thread Tonu Tusk
Hi, This is going to sounds a bit vague to start with, but I basically have a form that has a lot of input boxes in it ( > 500 text input boxes) and when this is posting back to the controller I get the WSOD. I have turned off all of my actual processing code in my controller and it did all work

How to prevent Cross Site Foreign Script Attacks on your actions.

2009-11-02 Thread Jonas Hartmann
Given someone mails you a link with html images that tries to fetch http://domain.tld/users/add_friend/5 - now the user is logged into a web client that fetches that URL. How do you protect your cake application to not modify data. HTML wise this should be a PUT or POST method not a GET met

Helper or Model Function?

2009-11-02 Thread dtirer
So here's my scenario. On a particular page, I want to display a link. However, I only want to display this link if a particular record exists in the database. Firstly, do helpers have access to DB/Model info? If so, should I make a helper to check if the records exists in the DB? Whats the bes

Re: Containable together with Translate Behavior

2009-11-02 Thread Marco
Had to add some facts: I removed AppModel's beforeFind and beforeSave (I forgot to write Config.language, which is used by Translate Behavior). So forget about these lines. Another important thing is, that field_a and field_b in my real world app are named equal. But tested it also with different

Re: CakePHP Application Design Help

2009-11-02 Thread toneee
A very cool, didnt even think about doing it that way, had even started to look at mysql triggers to do it. Thankyou robustsolution! Tony --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post

Containable together with Translate Behavior

2009-11-02 Thread Marco
Hi guys, i'm trying to combine Containable and Translate Behavior. My setup: Models: A hasMany B A Translate = 'field_a' B belongsTo A B Translate = 'field_b' Controllers: A->contain('B'); A->read(null, $id); AppModel: beforeFind: $this->locale = 'de_de'; beforeSave: $this->locale = 'de_de';

Re: CakePHP Application Design Help

2009-11-02 Thread robustsolution
you dont need to create a controller class for the settings table just create a model for the settings table In case user is not created with its settings (in the same add form), do the following in the User model put this function afterSave($created) { if($created) { $this->Setting->create();

CakePHP Application Design Help

2009-11-02 Thread toneee
Hi Guys, I am creating an application that hold user names / passwords and settings. So I have 2 tables in a DB, users and settings They have a hasOne relationship. I have come up to a little problem, When a new user is created i want to have a row in the settings table created too. is this po

Re: Sanitize:: clean help

2009-11-02 Thread robustsolution
nice approach... euromark. On Nov 1, 9:23 am, "euromark (munich)" wrote: > way to complicated > > dont sanitize it > and use h() for output (text, varchar) > > that is way more handy than any other approach > > On 1 Nov., 06:44, Kyle Decot wrote: > > > Try echo $form->input("description",ar

Re: Cake Hosting - Who is the best?

2009-11-02 Thread robustsolution
I meant cakePHP is working as it should be On Nov 2, 2:56 pm, robustsolution wrote: > I have a linux based hosting account on fasthosts.co.uk and PHP is > working as it should be. > even though I am using it right now for testing from time to time and > it is fine. > > I think the things we shou

Re: Cake Hosting - Who is the best?

2009-11-02 Thread robustsolution
I have a linux based hosting account on fasthosts.co.uk and PHP is working as it should be. even though I am using it right now for testing from time to time and it is fine. I think the things we should ask about are: -is htaccess enabled and is Apache allowing mod rewrite rule? -since most of us

Re: Auth Component does not logout via URL

2009-11-02 Thread robustsolution
Prof.No Time try to take a coffee cup and get relaxed, this is my current solution/ tips/tricks for the moment 1)put this in your AppController class final protected function _logout() { if (!empty($this->Cookie)) { //this ensures if you were using the Cookie component al

Re: Cake and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR

2009-11-02 Thread AD7six
On 2 nov, 12:47, "Prof. No Time" wrote: > Thanks so so much AD7six, > > Your suggestion of Router::url() worked like magic but for the second > suggestion on the query, I tried it and the debug dump gave me this: > > SELECT `AppSetting`.`id`, `AppSetting`.`name`, `AppSetting`.`value`, > `AppSet

single-field validation from controller

2009-11-02 Thread pigeon
Hello everyone, let me quickly explain my situation and what i'm trying to achieve. I have a User model with 5 fields having validation rules, out of these 5, 3 are required ( required => true, and they also have the notEmpty rule ) I would like to pre-validate each field, one by one, from the

Re: Hide Link with username and password using CakePHP

2009-11-02 Thread robustsolution
this depends on how the other php site (the server site) is prepared to receive credentials... in general it is a bad practice to pass credentials through URL for many security reasons... On Nov 2, 2:22 am, badz lee wrote: > Hi CakeTeam, > > Need your guys advice how to encapsulate link or hide

Re: saveAll and update issue across multiple models

2009-11-02 Thread robustsolution
Dear appel268576, It seems your edit form does not include the id of each child record, that is why when you submit, new records are creating as if you are in create mode!!! have a nice baking day --~--~-~--~~~---~--~~ You received this message because you are sub

Re: Cake and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR

2009-11-02 Thread j0n4s.h4rtm...@googlemail.com
You probably did not understand SQL / IN. FOO IN (1,2,3) means FOO can be 1 OR 2 OR 3 or to express it other ways FOO is contained in the list afterwards. While I am not sure which is faster and what the "internal" differences are, the result (should be) is the same. I am not sure if you can en

Re: Framework for existing database and complicated joins Click to flag this post

2009-11-02 Thread j0n4s.h4rtm...@googlemail.com
My idea: You can encapsulate complex writes by modifing your function save() of models you create and you can encapsulate complex reads by creating SQL VIEWS. Other than that: 100 tables? for what? Clean database design based on an ERD does NOT depend on applications running ORM-Layers or in MVC-

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
Even if I remove the unique key from table, Cake is not inserting. In logs I have: START TRANSACTION COMMIT No other SQL queries, any INSERT nor UPDATE. On 2 Lis, 11:59, Robert P wrote: > And is "key" unique, but not validated against? > > Since there are no IDs included, saveAll() will try t

saveAll and update issue across multiple models

2009-11-02 Thread appel268576
Hi there. I have a bit of an issue. I am working on creating a post model that handles multiple postmeta data for easily creating scalable forms. I have the two models post: var $hasMany = array('Meta' => array('className' => 'Meta', 'foreignKey' => 'pos

Re: Some links to cakephp

2009-11-02 Thread Mohame Cherif BOUCHELAGHEM
hi, you can use the bakery (http://bakery.cakephp.org/) u will find tutorials and codes there , download this great free ebook http://www.pseudocoder.com/free-cakephp-book/ it is about tips and tricks in cakephp or this links for cakephp core developers -> http://kevin.vanzonneveld.net/ -> http:/

Re: Some links to cakephp

2009-11-02 Thread jacmoe
I am probably going to sound like an ass, but CakePhp is extremely popular and Google will give you loads of links. If that doesn't help you, did you visit Cakephp.org? I mean, really visit? There's the Bakery, The Chaw, Cake code, ... On Nov 2, 6:45 am, Simon wrote: > Hii, > > Plz Give me some

Re: cookie data corrupted

2009-11-02 Thread tobi_one
Hi, I played around with this a little more. It turned out that the problem is tied to the standard encryption of the cookie. If I turn encryption off, it works. I didn't notice that in the first place, because the old cookies were not deleted... I encrypt the values now myself, as a work-around

Re: Cake and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR

2009-11-02 Thread Prof. No Time
Thanks so so much AD7six, Your suggestion of Router::url() worked like magic but for the second suggestion on the query, I tried it and the debug dump gave me this: SELECT `AppSetting`.`id`, `AppSetting`.`name`, `AppSetting`.`value`, `AppSetting`.`created`, `AppSetting`.`modified` FROM `app_sett

Re: Saving array with same information

2009-11-02 Thread Octavian
True, thanks for the tip. --~--~-~--~~~---~--~~ 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+unsubsc

Re: cakephp.org hacked?

2009-11-02 Thread Adrenalin
I think that is funny, cakephp rockz ! ;) On Mon, Nov 2, 2009 at 10:14 AM, Shadab Shaikh wrote: > Its look like horror film related website,probably due to celebration of > Halloween, but the theme/graphics does not match with the purpose and > concern of the website. Most weird graphics so far

Re: Saving array with same information

2009-11-02 Thread Robert P
Possibly a little easier right now, but a mess to maintain. If the user has to add the Event first, then go through date by date reloading every time, then that's because you built the system that way. From my perspective it's easier to normalise and simplify now than it is to future-proof someth

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread Robert P
And is "key" unique, but not validated against? Since there are no IDs included, saveAll() will try to create the entries which could be why it fails. Try copying the generated queries from the SQL log and running them from phpMyAdmin for more detailed error messages. On Nov 2, 6:16 pm, red wro

Re: Saving array with same information

2009-11-02 Thread Octavian
Because I thought it would make things too complicated. The user would have to add an event first, then add several days to it. Doing it all in once seems me easier. I actually found the right code: foreach ($this->data['Event'] as $event) { $event['name'] = $this->data['Event'][0]['name'

Re: Saving array with same information

2009-11-02 Thread Robert P
Why not normalise the database, and simply move the dates to a new EventDate model? Event hasMany EventDate I don't see why in this case you would purposefully populate the table with redundant data. On Nov 2, 6:22 pm, Octavian wrote: > Hi, > > I'm trying to add new events. An event can have m

Saving array with same information

2009-11-02 Thread Octavian
Hi, I'm trying to add new events. An event can have more than one date, but always has the same name/description. So this same info is only entered once in the add form, but dates can be added dynamically to the form. Controller should insert for each date a new event with a different date but th

Re: Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
Oh, the table structure is: settings(id, key, value, created, modified) key & value are of course VARCHARS. On 2 Lis, 11:04, red wrote: > Hi, > I've pasted code here:http://bin.cakephp.org/saved/52122 > > The problem is that the saveAll() doesn't work at all. Ok, it's > invoked and $this->da

Re: Some links to cakephp

2009-11-02 Thread AD7six
On 2 nov, 06:45, Simon wrote: > Hii, > > Plz Give me some useful links to refer the cakephp codes for my > project other than cakephp manual. > > thanking you, >            Simon I like this one: http://tinyurl.com/yk2ork6 --~--~-~--~~~---~--~~ You received this

Problem with saveAll() and beforeSave() - did not remember changes?

2009-11-02 Thread red
Hi, I've pasted code here: http://bin.cakephp.org/saved/52122 The problem is that the saveAll() doesn't work at all. Ok, it's invoked and $this->data is modified, but saveAll() does not save any records and debug($this->data) after success of saveAll() shows the old structure of $this->data. What

Re: Cake and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR

2009-11-02 Thread AD7six
On 2 nov, 04:08, "Prof. No Time" wrote: > Please people, I seriously need answers to the following questions. I > need them treated as numbered please. > Regards, > > Questions: > 1. When shall cake PHP be fully PHP 5 compatible and all the PHP 4 OOP > be gone since PHP 5.3 is already throwing

Re: cakephp.org hacked?

2009-11-02 Thread Shadab Shaikh
Its look like horror film related website,probably due to celebration of Halloween, but the theme/graphics does not match with the purpose and concern of the website. Most weird graphics so far ! It should be changed asap ! Shadab On Mon, Nov 2, 2009 at 1:33 PM, tobi_one wrote: > > Sorry for th

Re: Converting Existing Project into Cake PHP

2009-11-02 Thread schneimi
Hi, I can't really help you with your questions on the basis of experience, but I believe that cake should handle that pretty well and alot of optimizations can also be done on database side. But I already read about the possibility of lazy loading models in cake, maybe this is something you coul

updating trac tickets / dbo_sqlite3

2009-11-02 Thread Marcelo Andrade
Hi there, How to request permission to attach files to tickets in trac? I've made a small fix to sqlite3 driver (http://trac.cakephp.org/ticket/3003) to use "select..as" queries. As I could'nt update the ticket so I pasted it to bin: http://bin.cakephp.org/view/2044269319 Hope it could be usef

Re: cakephp.org hacked?

2009-11-02 Thread tobi_one
Sorry for that multithread. I did not see any related thread, when posting. The "RIP" Cakephp graphics still feels weird to me, even though it maybe halloween... But then, we don't celebrate Halloween over here! Cheers, tobi_one On 1 Nov., 18:54, SERKAN TURAN wrote: > *Halloween* :) > > On Sun

Re: cookie data corrupted

2009-11-02 Thread tobi_one
Hi John, thanks for your response! I tried just a single key and it does not work either. I tried various cookie settings, but none of them seem to have an influence on this issue. The current cookie settings I'm using is just $this->Cookie->name = 'somename'; $this->Cookie->time = '2 weeks'; /