Re: model validation rules order ?

2008-07-07 Thread Dia
ok, thanks for the explanaition and the hint :) On 7 juil, 08:47, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hey! > > The rules are indeed executed in order, but only the last validation > rule that didn't pass will be shown. If you want Cake to stop > validating if a condition isn't met, yo

Re: Auth Redirect based on Active

2008-07-07 Thread francky06l
A solution, maybe not best, would be to remove the userScope and set autoRedirect to false. Once the user is logged, you can then check the active flag, if it's not activated, you can logout the user and set a different message before redirect. On Jul 8, 4:12 am, DanielMedia <[EMAIL PROTECTED]> w

Re: cake php 1.1 to 1.2

2008-07-07 Thread Daniel Hofstetter
Hi Jack, > This is my first post. > I'd like to migrate from cakephp 1.1 to 1.2. > Is there any tools or procedures to do that ? Have a look at http://book.cakephp.org/view/411/migrating-from-cakephp-1-1-to- Good luck with your migration! -- Daniel Hofstetter http://cakebaker.42dh.com --~--~--

Re: Cakephp 1.2 App::import

2008-07-07 Thread mich2211
Clear now. Thank you for fast resopnse. Mich On Jul 8, 6:39 am, "Siebren Bakker" <[EMAIL PROTECTED]> wrote: > In 1.2RC1, when using uses(), I get a deprecated warning, so I'm assuming > that uses will be removed in the near future, as App::import() replaces it > completely in the new system. > >

Re: Paginate Order By COUNT()

2008-07-07 Thread Jonathan Snook
> 1) add a behaviour > 2) add a field to your table It seems to be built into CakePHP now: http://book.cakephp.org/view/490/countercache-cache-your-count --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" gro

Re: Paginate Order By COUNT()

2008-07-07 Thread Chris Hartjes
On Mon, Jul 7, 2008 at 9:56 PM, Dardo Sordi Bogado <[EMAIL PROTECTED]> wrote: > > Or use counterCache. Perhaps you could explain why counterCache is a better option than writing a custom paginateCount() method in this case. As far as I can tell, to use counterCache you have to 1) add a behaviou

Re: Controller:redirect to blank page

2008-07-07 Thread Jonathan Snook
Do you get anything if debug mode is set to 2? any error messages? On Mon, Jul 7, 2008 at 10:25 PM, MauroEC04 <[EMAIL PROTECTED]> wrote: > > Hello. > > Just some hours ago, I've spent my time migrating from CakePHP 1.2 > beta to RC2. > > Now, I'm having troubles with de Controller::redirect() met

Controller:redirect to blank page

2008-07-07 Thread MauroEC04
Hello. Just some hours ago, I've spent my time migrating from CakePHP 1.2 beta to RC2. Now, I'm having troubles with de Controller::redirect() method. All methods from all controlers using $this->redirect are returning blank pages (except for the debugs messages, but none about why the blank pag

cake php 1.1 to 1.2

2008-07-07 Thread Cake Php
Hello, This is my first post. I'd like to migrate from cakephp 1.1 to 1.2. Is there any tools or procedures to do that ? Thanks Jack --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this

Re: Automatic propagation of named params?

2008-07-07 Thread b logica
You could store it in the session and have your controllers check that in beforeFilter(). Or, rather, check to see if it's in $this->params first, then session, and finally have a default to fall back on. On Mon, Jul 7, 2008 at 5:52 AM, sam <[EMAIL PROTECTED]> wrote: > > Dear Cake pros, > > I hav

Re: Auth Redirect based on Active

2008-07-07 Thread DanielMedia
I was wondering this also. And how do you test if the "active" part is what went wrong with a login to supply a different error message to the user? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To

Re: Paginate Order By COUNT()

2008-07-07 Thread Dardo Sordi Bogado
Or use counterCache. On Mon, Jul 7, 2008 at 10:01 AM, Chris Hartjes <[EMAIL PROTECTED]> wrote: > > On Mon, Jul 7, 2008 at 8:52 AM, Kyle Decot <[EMAIL PROTECTED]> wrote: >> >> Is it possible to order a paginated set of results by the total number >> of comments a user has? > > Yes, but you will ha

CakePHP Docs

2008-07-07 Thread DanielMedia
Just wanted to give props to whoever is working on the docs at http://book.cakephp.org. Its actually becoming a good reference! Didn't always feel that way. Anyway, great job. Can't wait to see even more stuff added in the coming months : ) --~--~-~--~~~---~--~~ You

Re: Escaping quotes in SQL

2008-07-07 Thread Grant Cox
What is your save query, and what is the SQL generated? When saving using the standard Model->save() syntax, the data provided is assumed to be unquoted - and will automatically be made safe for SQL. $this->Model->save( array('Model'=>array( 'field1' => "'value'",

Re: Using mysql now() on save() in 1.2 RC2

2008-07-07 Thread Grant Cox
You cannot use array syntax for these any more, you have to use string syntax (where escaping falls to you, rather than Cake). $conditions = array( 'FooModel.foo_important_type = NOW()' ); On Jul 8, 7:50 am, vb13 <[EMAIL PROTECTED]> wrote: > HI all, > > there is already a > threadhttp://grou

Using mysql now() on save() in 1.2 RC2

2008-07-07 Thread vb13
HI all, there is already a thread http://groups.google.com/group/cake-php/browse_thread/thread/fb93a2e5241c719/cc219332a9756281?lnk=gst&q=now()#cc219332a9756281 that recommends using a cake 'escape' !-' to use now() function literally, and not quoted but this does not work in RC2. The value is st

Re: ACL: allowing modifications to row to owner only

2008-07-07 Thread francky06l
This is exactly ACL. User/creator will be an ARO and the "row" will be an ACO, the rest is permissions on CRUD operations. Now if it's just to limit the user/creator to "edit" the record AND if the creator/user_id is in the row, checking the user/creator_id of the row against the logged in user (

Re: Cakephp 1.2 App::import

2008-07-07 Thread Siebren Bakker
In 1.2RC1, when using uses(), I get a deprecated warning, so I'm assuming that uses will be removed in the near future, as App::import() replaces it completely in the new system. In the name of Life, Liberty, and the pursuit of my sanity. Siebren Bakker(Aevum Decessus) On Mon, Jul 7, 2008 at 05:4

Re: Image Helper memory usage fatal error

2008-07-07 Thread francky06l
You should use rc2 ;-) By the way, what is the image size you try to resize ? On Jul 7, 3:34 pm, clrockwell <[EMAIL PROTECTED]> wrote: > Hello All, hoping someone can point out the why I keep getting a > memory error at line 59 of image helper, it is using a ridiculous > amount of memory. > > The

Re: Auth logout redirect no functioning properly

2008-07-07 Thread francky06l
Humm quite normal if your "news/index" requires to be logged in ..If this is the case, you redirect to an action that needs login, and you are not (after logout) ..then login action is invoked. On Jul 7, 7:15 pm, "Arak Tai'Roth" <[EMAIL PROTECTED]> wrote: > I am using Auth and ACL for my website

Re: Auth Redirect based on Active

2008-07-07 Thread francky06l
This is indeed ACL. Your use/creator will be an ARO and the row an ACO, after story of permissions on CRUD. Now if it's only to limit to "edit" and you have the creator_id/ user_id in the row, you can make it simple by checking if the creator_id of the row is the "logged in" user (from session)..

Re: ACL: allowing modifications to row to owner only

2008-07-07 Thread francky06l
This is really ACL. Your user/creator will be an ARO and your "row" will be an ACO. After it's a story of CRUD type actions. On Jul 7, 6:10 pm, Paolo <[EMAIL PROTECTED]> wrote: > Hi, > > I need to know if it is possible by using cake ACL to allow > modifications to a single row only to the origin

Re: Mod_Rewrite problem...

2008-07-07 Thread francky06l
What append if you do localhost/app/index.php ? On Jul 7, 10:28 pm, "Jonathan Snook" <[EMAIL PROTECTED]> wrote: > Are you sure you're hitting the local PHP install and not the local > IIS install? with the index.php file in webroot, it'd be unlikely to > get a directory listing. > > On Mon, Jul

Re: HABTM Save Issues

2008-07-07 Thread [EMAIL PROTECTED]
Hi, It is not exactly the easiest to follow exactly what you have a problem with. Guess that may be why no-one has come to the rescue. You should strip your code and your question down to the root issue. This makes it much easier to follow your reasoning, plus it show that you have "done your hom

Re: redirect( URL + target) ?

2008-07-07 Thread bujanga
Sorry, bad question. Frame targeting is client side. Will do with some javascript. Gary On Mon, Jul 7, 2008 at 9:55 AM, bujanga <[EMAIL PROTECTED]> wrote: > Working on an old PHP site and found a few forms that need immediate > replacement. So, I thought I would use some cake forms and insert t

Re: Mod_Rewrite problem...

2008-07-07 Thread Jonathan Snook
Are you sure you're hitting the local PHP install and not the local IIS install? with the index.php file in webroot, it'd be unlikely to get a directory listing. On Mon, Jul 7, 2008 at 4:07 PM, Hitsugaya <[EMAIL PROTECTED]> wrote: > > Hello all, im a new CakePHP user. Im setting up for my first p

Mod_Rewrite problem...

2008-07-07 Thread Hitsugaya
Hello all, im a new CakePHP user. Im setting up for my first project, but im running into some trouble with mod_rewrite. Now for the problemwhen i use: http://localhost/ i get a list of the files from: C:/Program Files/Apache Group/Apache2/htdocs/cakePHP/app/webroot/ If mod_rewrite was config

Re: ACL in Cake 1.2

2008-07-07 Thread mark_story
parentNode is required for AclBehavior to work, I just posted the first of two articles on using Auth and Acl to my site, should check it out if that is what you are using the Acl for. http://mark-story.com/Posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1 -Mark On Jul 7, 10:40 am, francky06l

Re: HABTM Save Issues

2008-07-07 Thread Novice Programmer
No one to the rescue? Thanks. On Mon, Jul 7, 2008 at 9:50 PM, Novice Programmer <[EMAIL PROTECTED]> wrote: > Hello again, > > > I am stuck with the HABTM save/retrieval.. Please help.. I have got three > models. > > 1. Entitiy (id auto_increment) > 2. User (id auto_increment) > 3. Favorite(id au

Re: How can I generate an automatic daily bulletin with cake?

2008-07-07 Thread DaveMahon
I think you're looking for a cron job: http://bakery.cakephp.org/articles/view/calling-controller-actions-from-cron-and-the-command-line On Jul 7, 12:08 pm, José Luis González Ledezma <[EMAIL PROTECTED]> wrote: > Hi, I was looking for some sort of solution in cakephp, or an example > about how to

Re: Anyone use Mantis BT?

2008-07-07 Thread Samuel DeVore
I use mantis, trac and fogbugz depending on the clients and the project (not always my choice) I have to say that mantis has a lot of nice features. I've been using mantis since 2003. It supports very well multiple projects (including sub-projects), you can integrate nicely svn, there are some

Auth logout redirect no functioning properly

2008-07-07 Thread Arak Tai'Roth
I am using Auth and ACL for my website and am having a problem with the logout redirect of Auth. It is not taking the user to the page I want it to, and is instead taking them to the login screen again. Just wondering if anyone can spot the problem. Here is some of the code I think is important,

Auth Redirect based on Active

2008-07-07 Thread Kyle Decot
I want to be able to redirect my users to a "Your Account is not yet active page" if active is set to 0. I know there is userScope which will not allow them to login, but how to I redirect them afterwards? Thank you as always for the help. --~--~-~--~~~---~--~~ You

Unexpected (missing) result with findAll() on Cake 1.1.19

2008-07-07 Thread stefano
After some months where working for another company brought me away from cake :-( now I have to do some developement on a Cake application I wrote months ago. First of all I updated from 1.1.15.5144 to 1.1.19.6305 But now I have an unexpected result with a findAll() on a query. Maybe in the past

How can I generate an automatic daily bulletin with cake?

2008-07-07 Thread José Luis González Ledezma
Hi, I was looking for some sort of solution in cakephp, or an example about how to automaticly generate a bulletin at the end of the day only if there has been any change (info added) in the tables of some models. Eg if I add a new Info about surfing, internet, etc, then send at the end of the da

HABTM Save Issues

2008-07-07 Thread Novice Programmer
Hello again, I am stuck with the HABTM save/retrieval.. Please help.. I have got three models. 1. Entitiy (id auto_increment) 2. User (id auto_increment) 3. Favorite(id auto_increment, entity_id) A user can have many favorite entities and a favorite can belong to many users.. so i have created

ACL: allowing modifications to row to owner only

2008-07-07 Thread Paolo
Hi, I need to know if it is possible by using cake ACL to allow modifications to a single row only to the original creator of that row. I'm not sure if also visibility is limited to the creator, but modification would be fine for the moment. Should I create something on my own or is it already po

Escaping quotes in SQL

2008-07-07 Thread Nirav Mehta
Hi all, I have a problem escaping quotes in my SQL queries. I initially assumed that cakePHP's implementation for postgres in cake/libs/model/dbo_postgres.php escapes all data strings using pg_escape_string(). I have a string which is already in single quotes. I am supplying that to the model->sav

postgres dbo alterSchema and index

2008-07-07 Thread Ziad
Hi, I was looking to use the schema shell tool for our project but it seems that postgres support is not quite there yet. In my attempts to use schema I've figured out that the postgres dbo does not have the alterSchema and the index methods implemented (overridden from the base class) which mean

Re: schema shell problem

2008-07-07 Thread Ziad
Was looking into doing the alterSchema function for postgres dbo and found that postgres dbo doesnt have the index function either! This seems a lot more complex than the alterSchema function so I might just have to wait for the Cake guys to get around to supporting postgres properly. On Jul 5, 1

redirect( URL + target) ?

2008-07-07 Thread bujanga
Working on an old PHP site and found a few forms that need immediate replacement. So, I thought I would use some cake forms and insert them with an iframe. This works fine and the forms function properly but I was wondering it the following were possible. Once the form is successfully submitted c

Security component - sometimes works

2008-07-07 Thread bujanga
I use the Security component in a few controllers. I have had no problems with any of these but one of my clients is not able to get a particular controller to work. The same snippet is used in 4 controllers and the client has problems with only the VolunteerInterest controller. Here is my snippe

Re: ACL in Cake 1.2

2008-07-07 Thread francky06l
Of course, the "Department.1" can be used with the console. But if you have a User than belongsTo Departement, you could implement the parentNode() in the User model that will send back the "Department" along with it's id. On Jul 7, 4:02 pm, Stinkbug <[EMAIL PROTECTED]> wrote: > I tried the mode

Re: Session problem

2008-07-07 Thread amfriedman
I am experiencing a similar issue, but a more subtle one. The solutions provided in the links do not help. I've tried them all. Here's what I'm trying to do: I keep an array of the last 10 URLs on my site the user has visited in the session variable 'urlBackTrack'. With every page the user la

Re: ACL in Cake 1.2

2008-07-07 Thread Stinkbug
I tried the model.id and it didn't work. $user_array['foreign_key'] = $user['User']['id']; $user_array['parent_id'] = 'Department.1'; $user_array['model'] = 'User'; $user_array['alias'] = 'User.' . $user['User']['id']; but when I use just an id (integer) it does work. $user_array['parent_id'] =

Image Helper memory usage fatal error

2008-07-07 Thread clrockwell
Hello All, hoping someone can point out the why I keep getting a memory error at line 59 of image helper, it is using a ridiculous amount of memory. The helper is posted here: http://bin.cakephp.org/view/859527090 Using nightly build 6296 (just grabbed it yesterday), cakephp 1.2 rc1 Thanks much

Re: set debug to 2 regarding the user connected otherwise set it to 0

2008-07-07 Thread Pierre MARCOURT
Thanks a lot Daniel. That's just what i needed. Daniel Hofstetter wrote: > Hi Pierre, > > >> I would like to know if it is possible to set the debug to a certain >> value regarding the user who is connected. >> I put my project in test today, so my company can test it but I don't >> want them

Re: set debug to 2 regarding the user connected otherwise set it to 0

2008-07-07 Thread Daniel Hofstetter
Hi Pierre, > I would like to know if it is possible to set the debug to a certain > value regarding the user who is connected. > I put my project in test today, so my company can test it but I don't > want them to see all the debug stuff. > But me, I would like to see it. > To connect to my proje

Re: Paginate Order By COUNT()

2008-07-07 Thread Chris Hartjes
On Mon, Jul 7, 2008 at 8:52 AM, Kyle Decot <[EMAIL PROTECTED]> wrote: > > Is it possible to order a paginated set of results by the total number > of comments a user has? Yes, but you will have to create a customized pageCount() method. Check out this link, as it might help you: http://www.littl

Re: Using Auth Component from behavior

2008-07-07 Thread Novice Programmer
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=gst&q=novice.program+session+model#00217852f762f67c Thanks. On 7/7/08, francky06l <[EMAIL PROTECTED]> wrote: > > > Session in not avail

set debug to 2 regarding the user connected otherwise set it to 0

2008-07-07 Thread Pierre MARCOURT
Hello all, I would like to know if it is possible to set the debug to a certain value regarding the user who is connected. I put my project in test today, so my company can test it but I don't want them to see all the debug stuff. But me, I would like to see it. To connect to my project, there i

Paginate Order By COUNT()

2008-07-07 Thread Kyle Decot
Is it possible to order a paginated set of results by the total number of comments a user has? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroup

Re: Problem with primary key made up of several fields

2008-07-07 Thread Jonathan Snook
You'd want to get rid of the $belongsTo relationship. This is just a HABTM relationship (the composite primary key here shouldn't be a problem, although I don't believe Cake will enforce it.). On Mon, Jul 7, 2008 at 6:38 AM, zpon <[EMAIL PROTECTED]> wrote: > I have a sql table which only contains

Re: Problem with primary key made up of several fields

2008-07-07 Thread James K
CakePHP does not support composite primary keys. You need to add another column to your table called id and make that the primary key. To ensure this doesn't break your database, you can add a unique constraint to user_id and group_id at the database level. Kinda sucks, but it's the only option un

Re: Using Auth Component from behavior

2008-07-07 Thread francky06l
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, tha

Using Auth Component from behavior

2008-07-07 Thread Siegfried Hirsch
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 ca

Re: Problem with setFlash

2008-07-07 Thread francky06l
Seems you are always setting the flash message somehow .. Try to trace in log before you use $this->Session->setFlash, maybe it's done when you think it's not... On Jul 7, 1:44 pm, angel333 <[EMAIL PROTECTED]> wrote: > Thank you for your reply. > > No, I don't use view caching. > I am on debug 1,

Using Auth Component from behavior

2008-07-07 Thread Siegfried Hirsch
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(); --~--~-~--~~~--

Re: Problem with setFlash

2008-07-07 Thread angel333
Thank you for your reply. No, I don't use view caching. I am on debug 1, but I've tried debug 0 with the same result. I'm using both Opera and Firefox. Ondrej On Jul 7, 1:10 am, the_woodsman <[EMAIL PROTECTED]> wrote: > This sounds like caching to me. > What debug level are you on? > Do you use

Automatic propagation of named params?

2008-07-07 Thread sam
Dear Cake pros, I have a route that allows me to switch the layout by supplying it as the first parameter in de URI. Example for using the "green" layout: http://myhost/green/items/index Here's the route: Router::connect('/:layout/:controller/:action/*', array('controller' => 'items', 'action'

Problem with primary key made up of several fields

2008-07-07 Thread zpon
Hello I have a sql table which only contains two field (user_id and group_id), these fields also makes up a primary key, but whenever I try to delete from the table (del(array('user_id' => $this->data..., 'group_id' => $this->data...)) I get the following error: SELECT COUNT(*) AS `count` FROM `

Re: Use models/views object from other controllers/models/views ?

2008-07-07 Thread FluF
It's working fine. Thanks a lot. On Jul 4, 8:19 pm, mark_story <[EMAIL PROTECTED]> wrote: > On Jul 4, 11:46 am, FluF <[EMAIL PROTECTED]> wrote: > > > > > This is what i'm trying to do > > > class FooController extends AppController{ > > var $name = "Foo"; > > var $useTable = false; > > > }; >

Re: Application access problem

2008-07-07 Thread Ifti Khan
The problem is solved. I was missing to change AllowOverride from None to All for the document root section. One more thing, if u may help. I am using aliasing as: Alias /cake12/ "D:/cake1.2/" Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all But w

Re: Cakephp 1.2 App::import

2008-07-07 Thread dr. Hannibal Lecter
Simple questions usually have simple answers :) http://api.cakephp.org/class_app.html#2a84eb340fe947c7fdc753c3bf8cd053 I believe App::import() is supposed to replace the uses() some day, but I'm not sure about that.. On Jul 7, 12:21 pm, mich2211 <[EMAIL PROTECTED]> wrote: > Hi everyone > I am n

Cakephp 1.2 App::import

2008-07-07 Thread mich2211
Hi everyone I am new to PHP and Cakephp. I was ask to find out how to use App::import and how it differs from the Use fuctionality. This is probably a pretty simple question so apologies. Thanks in advance Mich --~--~-~--~~~---~--~~ You received this message be

Re: Bake missing relations v1.2 rc2

2008-07-07 Thread Maxus
Just for anyone else, who gets stuck on this, Dont name you tables using capitals e.g. "User" -> wont work "user" -> does work Cheers M On Jul 5, 11:40 am, Maxus <[EMAIL PROTECTED]> wrote: > Hi People, > > When using Bake in phpcake 1.2 rc2, the bake model function never asks > about relations

Re: Correct install screenshot

2008-07-07 Thread [EMAIL PROTECTED]
http://default.eimermusic.com/cake_install.png You are looking for these 4 lines of text: Your tmp directory is writable. The FileEngine is being used for caching. To change the config edit APP/config/core.php Your database configuration file is present. Cake is able to connect to the database.