Re: Ubersimple auth system... any idea?

2011-12-23 Thread homem-arvore
Have you looked at 
http://tv.cakephp.org/video/andrewperk/2011/01/27/cakephp_auth_component_tutorial_part_1
Watch the 3 parts of the series... it will probably answer all your
questions.

On Dec 23, 9:15 am, denisr  wrote:
> I am very newbie, so I am stucked in the auth system for Cake 1.3
>
> I have a basic CRUD app done, I have my USER table... I need to make a
> basic auth system with:
>
> User registration (can be the ADD action of the USER model)
> User can edit only its own content
>
> I tried Authake, It looks cool, but I do not know how to extend the
> user profile... perhaps should I link the models together? Could I
> associate the POST model to the AUTHAKE model (instead of USER model)?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Sharing my TextMate Bundle for Cakephp 1.3

2011-09-06 Thread homem-arvore
I just wanted to share with you my TextMate Bundle for Cakephp 1.3.
It provides you with auto-complete for the most commonly used
functions

Picking where Matthew Harris left, I update the bundle for the lattest
version and added a little regex smartness that makes it figure how
what model you're using.

So, as an example, if you're working on a file called
posts_controller.php and type find>Tab will expand to $this->Post-
>find($conditions, $fields, $order, $recursive);

This is kind of a work in progress so there might still be some bugs/
room for improvement. Let me know if you have any suggestions.

install instructions: 1. copy files to -> ~/Library/Application
Support/TextMate/Bundles (in Mac OS 10.7, the Library folder is
hidden. In finder type cmd+shift+G to get there) 2. Restart TextMate

http://www.homem-arvore.com/files/php-cake.tmbundle.zip

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Please help with htaccess

2011-07-05 Thread homem-arvore

> IO think I read once about it, I think I have to change the /cake/app/
> webroot/.htaccess file, but I cant find this information anymore and
> are quite unsure about it.

was it somewhere around here?
-› http://book.cakephp.org/view/912/Installation
-› http://book.cakephp.org/view/917/Apache-and-mod_rewrite-and-htaccess

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Can't save hasmany records

2011-06-08 Thread homem-arvore
I found it. :)

$this->Post->Attachment->saveAll($fakedata['Attachment']); works

on
http://book.cakephp.org/view/1031/Saving-Your-Data :

"Note that we are passing $data['Article'] instead of usual $data.
When saving multiple records of same model the records arrays should
be just numerically indexed without the model key."


Many, many thanks for your sugestions Jeremy, wouldn't have figured it
out without you.

On 8 Jun, 09:57, homem-arvore  wrote:
> It think so:
>
> post model:
>
> var $hasMany = array(
>         'Attachment' => array(
>                 'className' => 'Attachment',
>                 'foreignKey' => 'post_id',
>                 'dependent' => true,
>         )
> );
>
> attachment model:
>
> var $belongsTo = array(
>         'Post' => array(
>                 'className' => 'Post',
>                 'foreignKey' => 'post_id',
>         ),
> );
>
> On 8 Jun, 09:48, Jeremy Burns | Class Outfit
>
>
>
>
>
>
>
>  wrote:
> > Have you got your model associations set up correctly?
>
> > Jeremy Burns
> > Class Outfit
>
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> > On 8 Jun 2011, at 09:45, homem-arvore wrote:
>
> > > $this->Post->saveAll($fakedata); does not work
>
> > > $this->Post->Attachment->saveAll($fakedata); actually works
>
> > > I think I'm almost there understanding how it works... My current
> > > theory :P is that saveAll only saves multiple records they're related
> > > data.
>
> > > --
> > > Our newest site for the community: CakePHP Video 
> > > Tutorialshttp://tv.cakephp.org
> > > Check out the new CakePHP Questions sitehttp://ask.cakephp.organdhelp 
> > > others with their CakePHP related questions.
>
> > > To unsubscribe from this group, send email to
> > > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Can't save hasmany records

2011-06-08 Thread homem-arvore
It think so:

post model:

var $hasMany = array(
'Attachment' => array(
'className' => 'Attachment',
'foreignKey' => 'post_id',
'dependent' => true,
)
);


attachment model:

var $belongsTo = array(
'Post' => array(
'className' => 'Post',
'foreignKey' => 'post_id',
),
);

On 8 Jun, 09:48, Jeremy Burns | Class Outfit
 wrote:
> Have you got your model associations set up correctly?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 8 Jun 2011, at 09:45, homem-arvore wrote:
>
>
>
>
>
>
>
> > $this->Post->saveAll($fakedata); does not work
>
> > $this->Post->Attachment->saveAll($fakedata); actually works
>
> > I think I'm almost there understanding how it works... My current
> > theory :P is that saveAll only saves multiple records they're related
> > data.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Can't save hasmany records

2011-06-08 Thread homem-arvore
$this->Post->saveAll($fakedata); does not work

$this->Post->Attachment->saveAll($fakedata); actually works

I think I'm almost there understanding how it works... My current
theory :P is that saveAll only saves multiple records they're related
data.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: Can't save hasmany records

2011-06-08 Thread homem-arvore
Now I've tried.

the sql queries that ran were:

START TRANSACTION
INSERT INTO `posts` (`event_datetime`, `description_pt`,
`description_en`, `status`, `modified`, `created`) VALUES ('2011-06-07
23:10:00', 'desc pt', 'desc en', 1, '2011-06-08 08:20:28', '2011-06-08
08:20:28')
SELECT LAST_INSERT_ID() AS insertID
INSERT INTO `attachments` (`post_id`) VALUES (8)
SELECT LAST_INSERT_ID() AS insertID
COMMIT

So yes it added a record in attachments table with the post_id, but
it's not getting the data from $fakedata['Attachment']


On 8 Jun, 09:00, Jeremy Burns | Class Outfit
 wrote:
> Have you tried saveAll?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 8 Jun 2011, at 08:58, homem-arvore wrote:
>
>
>
>
>
>
>
> > Hi.
> > I've been banging my head on the walls for almost a day now and still
> > haven't understood what am I doing wrong
>
> > I've set up a test that I think should work but it doesn't:
>
> > $fakedata = array(
> >    'Post' => array(
> >            'event_datetime' => "2011-06-07 23:10:00", 'description_pt' => 
> > 'desc
> > pt', 'description_en' => 'desc en', 'status' => 1
> >            ),
> >    'Attachment' => array(
> >            array("post_id" => 500, 'dirname' => "dir", 'basename' =>
> > 'file1.png', 'category' => 'poster', 'order' => 0),
> >            array("post_id" => 500, 'dirname' => "dir", 'basename' =>
> > 'file2.png', 'category' => 'poster', 'order' => 1),
> >            array("post_id" => 500, 'dirname' => "dir", 'basename' =>
> > 'file3.png', 'category' => 'poster', 'order' => 2),
> >            array("post_id" => 500, 'dirname' => "dir", 'basename' =>
> > 'file4.png', 'category' => 'poster', 'order' => 3),
> >            array("post_id" => 500, 'dirname' => "dir", 'basename' =>
> > 'file5.png', 'category' => 'poster', 'order' => 4),
> >            ));
>
> > shouldn't:
> > $this->Post->Attachment->save($fakedata);
>
> > just work?
>
> > It returns 1 but there's data being sent to the mysql database
>
> > My Post model has set up the Attachment as an hasMany relationship and
> > the Attachment model has a belongsto relationship to Post.
>
> > --
> > Our newest site for the community: CakePHP Video 
> > Tutorialshttp://tv.cakephp.org
> > Check out the new CakePHP Questions sitehttp://ask.cakephp.organd help 
> > others with their CakePHP related questions.
>
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Can't save hasmany records

2011-06-08 Thread homem-arvore
Hi.
I've been banging my head on the walls for almost a day now and still
haven't understood what am I doing wrong

I've set up a test that I think should work but it doesn't:

$fakedata = array(
'Post' => array(
'event_datetime' => "2011-06-07 23:10:00", 'description_pt' => 
'desc
pt', 'description_en' => 'desc en', 'status' => 1
),
'Attachment' => array(
array("post_id" => 500, 'dirname' => "dir", 'basename' =>
'file1.png', 'category' => 'poster', 'order' => 0),
array("post_id" => 500, 'dirname' => "dir", 'basename' =>
'file2.png', 'category' => 'poster', 'order' => 1),
array("post_id" => 500, 'dirname' => "dir", 'basename' =>
'file3.png', 'category' => 'poster', 'order' => 2),
array("post_id" => 500, 'dirname' => "dir", 'basename' =>
'file4.png', 'category' => 'poster', 'order' => 3),
array("post_id" => 500, 'dirname' => "dir", 'basename' =>
'file5.png', 'category' => 'poster', 'order' => 4),
));

shouldn't:
$this->Post->Attachment->save($fakedata);

just work?

It returns 1 but there's data being sent to the mysql database

My Post model has set up the Attachment as an hasMany relationship and
the Attachment model has a belongsto relationship to Post.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php


Re: How to cake bake in Linux environment - Cakephp?

2011-05-18 Thread homem-arvore
> but in windows we need to set the environment variables like that any
> settings need for LINUX..

In linux you also must set the path:
export PATH =$PATH:fullPathToTheCakeConsoleDir

I've put it in a .profile file on the home dir, but I think it might
be different depending on the shell you're using.

more info 
http://tv.cakephp.org/video/gwoo/2010/12/24/setting_up_the_cakephp_console_on_nix

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php