Re: Problem with multiple submit buttons in on ajax form

2006-11-14 Thread Langdon Stevenson
In case anyone comes across this issue I thought it worth reporting my findings since it is an artifact of using Scriptaculous and Ajax in Cake. > I have some strange behavior in an ajax form and am wondering if it > could be cake related? > > Cake version: 1.1.8.3544 > > Regardless of which

Blank lines at top of XML rendering

2006-11-14 Thread realien
Hi guys, We've created a REST based webservice with cake, and when we set the layout of the controller to var $layout = 'xml'; and we have views for each of the actions on the controller that wil render the xml. \n"; echo $content_for_layout; ?> What we are seeing is we always get 1 or 2 bl

Re: Webservices

2006-11-14 Thread [EMAIL PROTECTED]
Christoph, I don't have a solution, but I can confirm that I had the exact same results as you have. I suspect we need to do more than manual shows us. As for the article that Synchro recommended (http://bakery.cakephp.org/articles/view/126 ); I had to change the reg exp (regular expressions) to

Re: Automatic plugin detection

2006-11-14 Thread Dr. Tarique Sani
On 11/14/06, Christian Winther <[EMAIL PROTECTED]> wrote: > > Hi > Oh, that looks very cool - im going to check it out :) Thanks If you are interested - there is a tutorial on creating a cheesecake addon at http://cheesecake-photoblog.org/doku.php?id=tutorials Cheers Tarique -- ===

Re: ACLs, actions and views

2006-11-14 Thread Dr. Tarique Sani
On 11/15/06, Martin <[EMAIL PROTECTED]> wrote: > Hi, we have the need to manage ACLs not only based on actions which > allow/deny users (aros) > to access controllers accions (acos), but also to include the ability > to allow the users only to see a certain filtered view of the database > (only e

Re: Retrieve URL - New thread.

2006-11-14 Thread nate
The above code was lifted from an Actual Application (tm), but some of the variable names were changed for clarity, which is why some of the session setting doesn't match up with the session checking, but you get the idea. There's also some extra goodies in there on how to handle login expiration

Re: Retrieve URL - New thread.

2006-11-14 Thread nate
class AppController extends Controller { function beforeFilter () { if (!$this->Session->check('User') && $this->params['action'] != 'login') { if (!$this->RequestHandler->isAjax()) { // If this is not an Ajax Reques

Re: Retrieve URL - New thread.

2006-11-14 Thread Matt Adams
Bernard Grosperrin wrote: > I would like to improve my rather crude login system. For now, after > login, I redirect the user to '/', or the "Home" page. > I would like to "trap" or retrieve the URL the user intended to go to, > pass it as parameter to my login function, to redirect to this URL

Re: generateList()

2006-11-14 Thread Matt Adams
nate wrote: > You can never have enough rope. Amen. -- BASIC: A programming language. Related to certain social diseases in that those who have it will not admit it in polite company. --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: Output Escaping

2006-11-14 Thread Widi Harsojo
I like a(), or aa() :) --~--~-~--~~~---~--~~  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]

Re: Output Escaping

2006-11-14 Thread nate
Is short enough for you? Cake does URL's automatically, and most helper methods (like $html->link() and friends) automatically escape output by default. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP"

Re: How to add header to all pages

2006-11-14 Thread Widi Harsojo
not realy sure about the standard but I think if you concern about "how to add header to all your pages with the data inside it"  it must be using the standard MVC and logically in cakePHP, it a standard way how to access using url by creating standard coding of MVC in cakePHP, and how to put toget

Output Escaping

2006-11-14 Thread Synchro
How does cake handle output escaping? If I have a var to pass to a view: $this->set('thing', ''); and I echo it in my view I going to get unescaped output. I could do: But that's cumbersome to do all the time. I was wondering if Cake had something built-in for handling this automatically,

Re: ACLs, actions and views

2006-11-14 Thread Synchro
Something that I've done outside of cake is an ACL-style permissions system that allows the same user different permissions in different contexts, so for example they may be able to access all the registered users of one account but not another. It's not open source (and it's not a generic solutio

Re: Webservices

2006-11-14 Thread Synchro
Not quite what you asked about, but this is pretty interesting, especially the follow-up comment: http://bakery.cakephp.org/articles/view/126 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To po

Re: filtering HABTM associations

2006-11-14 Thread gourlay
Thank you nate. That got me going on the right direction (i think). So $result = $this->Post->Tag->findAll(array("Tag.id" => array(3, 6))); returns an array with each tag specified in the condition and their related posts within, and when I set recursive to 2 I get all the tags associated with e

Re: accessing session info in AppController

2006-11-14 Thread gabordemeter
Thanks nate! Worked like a charm! On Nov 14, 4:17 pm, "nate" <[EMAIL PROTECTED]> wrote: > If you have a beforeFilter method defined in one of your controllers, > try adding the following: > parent::beforeFilter(); > > See here:http://us3.php.net/keyword.parent --~--~-~--~~--

Re: Findall and group by

2006-11-14 Thread bingo
hi floepi, for grouping you can do this $conditions = 'Job.location = test Group by Col'; $this->Job->findAll($condition); you can set debug to 3 and see the actually query that is being issued by Cake regards, Bingo --~--~-~--~~~---~--~~ You received this me

Re: filtering HABTM associations

2006-11-14 Thread nate
$this->Post->Tag->findAll(array("Tag.id" => array(3, 6))); --~--~-~--~~~---~--~~ 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 g

filtering HABTM associations

2006-11-14 Thread gourlay
So say i'm working on a blog applicaiton and I have the HABTM association set up between the post model and the tag model. What I can't figure out is how do I 1.) call a findAll and get all the posts that have two specific tags; and 2.) how do I get those results to contain the other tags associa

Re: Slightly naughty but is it an acceptable way of doing things?

2006-11-14 Thread Olivier Percebois-Garve
By using phpThumb you could simplify your application logic and abstract image size to the views. olivvv TWIOF wrote: > HI Everyone, > > I've been making an images system for my site. There are various types > of image (e.g. thumb nails and illustrations). As far as the models go > an article m

Re: generateList()

2006-11-14 Thread nate
You can never have enough rope. --~--~-~--~~~---~--~~ 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

Re: accessing session info in AppController

2006-11-14 Thread nate
If you have a beforeFilter method defined in one of your controllers, try adding the following: parent::beforeFilter(); See here: http://us3.php.net/keyword.parent --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "

accessing session info in AppController

2006-11-14 Thread gabordemeter
Hi! my appController looks like below: class AppController extends Controller { var $helpers = array('Html','Ajax','Javascript'); function beforeFilter() { if($this->Session->check('User')) $this->set('userinfo', $this->Session->read('User.username')); }

Re: generateList()

2006-11-14 Thread Matt Adams
nate wrote: > Cake isn't designed to do everything you could possibly want to do, > just most things. And for the things it doesn't specifically cover, it > gives you more than enough leverage to cover them yourself. That brings to mind something about C and having enough rope. -- BASIC: A pr

ACLs, actions and views

2006-11-14 Thread Martin
Hi, we have the need to manage ACLs not only based on actions which allow/deny users (aros) to access controllers accions (acos), but also to include the ability to allow the users only to see a certain filtered view of the database (only every user's clients, providers, etc). For example: A user

Findall and group by

2006-11-14 Thread floepi
Hi all, i was just wondering if i could somehow use the genius findall function and define a group by option i am not sure how i put that in the conditions. i have an array like $conditions = array('Job.location'=>'test') $this->Job->findAll($conditions); but how can i group this now ?? Thank

Re: chmod

2006-11-14 Thread [EMAIL PROTECTED]
afaik, the cache goes in tmp too... so if you use caching, your view code is pulled out of the tmp/cache/ directory correct me if i'm wrong ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To

Re: Slightly naughty but is it an acceptable way of doing things?

2006-11-14 Thread [EMAIL PROTECTED]
(although, i would personally also use different tables because it's more future-proof, like Chris said. If you don't have a good reason to do it your way, i would do it our way ;-) --~--~-~--~~~---~--~~ You received this message because you are subscribed to th

Re: Slightly naughty but is it an acceptable way of doing things?

2006-11-14 Thread Chris Hartjes
On 11/14/06, TWIOF <[EMAIL PROTECTED]> wrote: > > HI Everyone, > > I've been making an images system for my site. There are various types > of image (e.g. thumb nails and illustrations). As far as the models go > an article might use hasOne for the thumb nails and hasMany for > illustrations. > >

Re: 2 noobie questions

2006-11-14 Thread Christoph
> " ... you can call this function to render the view at any point in the > controller logic" At first I was like "Huh? How does that help me. I'm still using just one view." then , the light bulb went on. :p duh. :) Thanks for pointing that out! thnx, Christoph --~--~-~--~~--

Query not returning associative array on 1 dev box

2006-11-14 Thread realien
Hi guys, have a weird error that only occurs on one developer machine. The query is : $columns = $this->MetaDataField->query("DESC assets_data"); On my machine if I do a pr($columns) I get : Array ( [0] => Array ( [COLUMNS] => Array (

Re: Not quite understanding associations

2006-11-14 Thread hydra12
To do HABTM, you need an extra table. To do HABTM between users and game_pieces, you'd need a table called game_pieces_users (table1_table2 in alphabetical order). game_pieces_users would have 2 fields: game_piece_id and user_id. I hope that helps a little. I've found that scaffolding helps me

Re: chmod

2006-11-14 Thread AD7six
On Nov 14, 4:55 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > 666 would disable execute rights, I'm not a habitual linux user (although I just bought a new dev machine, so let's see), thanks for clarifying what that would do to a folder. So: If you have access to modify php to run as a di

Re: chmod

2006-11-14 Thread Chris Hartjes
On 11/14/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > after update cake i have errors > > Warning: > file_put_contents(/home/andriu/beta/tmp/cache/models/default_lowcy_list) > [function.file-put-contents]: failed to open stream: Permission denied > in /home/andriu/cake/basics.php on line 8

Re: chmod

2006-11-14 Thread AD7six
On Nov 14, 4:36 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > afaik, the cache goes in tmp too... so if you use caching, your view > code is pulled out of the tmp/cache/ directory > > correct me if i'm wrong ;-) : The trouble is... If you are using a shared host, then php is probably runni

Re: chmod

2006-11-14 Thread [EMAIL PROTECTED]
Chris Hartjes wrote: > You should do a recursive chmod on the tmp directory > > chmod -R 777 tmp/ > > and that will fix the problem. Everything in tmp should be 777 in my opinion. > > > -- > Chris Hartjes > Imo, you should give read, write and execute (for directories) permissions to the user t

Re: chmod

2006-11-14 Thread Chris Hartjes
> > 777 means that anyone who has an account on the system can change these > files, changing the content of your website!! > True, but if you only give it to the tmp directory in your Cake install, they can't really do much to change the content of your website. -- Chris Hartjes "The greatest

chmod

2006-11-14 Thread [EMAIL PROTECTED]
after update cake i have errors Warning: file_put_contents(/home/andriu/beta/tmp/cache/models/default_lowcy_list) [function.file-put-contents]: failed to open stream: Permission denied in /home/andriu/cake/basics.php on line 843 Warning: file_put_contents(/home/andriu/beta/tmp/cache/models/defau

RE: Automatic plugin detection

2006-11-14 Thread Christian Winther
Hi Oh, that looks very cool - im going to check it out :) Thanks -Original Message- From: cake-php@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Dr. Tarique Sani Sent: 9. november 2006 08:03 To: cake-php@googlegroups.com Subject: Re: Automatic plugin detection On 10/31/06, C

Slightly naughty but is it an acceptable way of doing things?

2006-11-14 Thread TWIOF
HI Everyone, I've been making an images system for my site. There are various types of image (e.g. thumb nails and illustrations). As far as the models go an article might use hasOne for the thumb nails and hasMany for illustrations. BUT, i'm using one db table for all images (there won't be tha

Re: Security and performance of Cake PHP

2006-11-14 Thread nate
> and besides, cake programmers are programmers too... i've inspected the > cake code and that's why i *know* that cake handles stuff like sql > injections, session hijackings,.. also, it provides very easy ways for > the programmer to protect himself against XSS and the like. We also cover CSRF,

Re: chmod

2006-11-14 Thread [EMAIL PROTECTED]
666 would disable execute rights, for files that's okay, but not for directories. no-one (except root) would be able to go "into" directories (by definition) also there aren't really files in there that one would like to execute i think ;-) (unless someone with write access puts em there himself)

Re: 2 noobie questions

2006-11-14 Thread NOSLOW
>> Is it possible to tell a controller to use multiple views? I believe the example shown in the online manual for requestAction in the Controllers chapter is what you're looking for (http://manual.cakephp.org/chapter/controllers). In this example, a function named "showUserProducts" is added to

Re: Slightly naughty but is it an acceptable way of doing things?

2006-11-14 Thread [EMAIL PROTECTED]
your method is fine, if you have a column called "category" or something like that --~--~-~--~~~---~--~~ 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

Re: How to add header to all pages

2006-11-14 Thread devarz
Thanks, that made things a bit clearer to me. If I understand you correctly, does this mean that it is the *template* itself that is initiating the call to get the data. Is this the standard procedure in frameworks llike cake, or are there other ways of achieving the same result? --~--~

Re: generateList()

2006-11-14 Thread michaelo
I believe this entry from trac.cakephp.org will help you out. It did for me. https://trac.cakephp.org/ticket/1368 - Michael Odden Christoph skrev: > Ok, so I figured out how to generate a list using different > fields, other than the id, as the key => value pair. But I still have > some issue

Re: Security and performance of Cake PHP

2006-11-14 Thread [EMAIL PROTECTED]
> > Security is the responsibility of the PROGRAMMER, not the framework. > The best security features are not worth anything if you don't use > them properly. > > All the common security problems like XSS, cross-domain scripting and > SQL injection are easily solved by the programmer. Expecting

Re: Security and performance of Cake PHP

2006-11-14 Thread Chris Hartjes
On 11/13/06, Ger_Val <[EMAIL PROTECTED]> wrote: > > Hi! I'm new to CakePHP, seems it's a really great framework. I didn't > find any bad comments about it in the Internet. Probably, I was looking > badly. :) > What about using CakePHP for large projects? My concerns are about > performance and sec

Re: Security and performance of Cake PHP

2006-11-14 Thread [EMAIL PROTECTED]
Cakephp, combined with a decent auth system (check the bakery for that) will do pretty much everything they can to make your app as secure as possible. (sql injections, session hijackings, brute force attempts, network sniffings...) http://bakery.cakephp.org/articles/view/147 will address al thes