Re: Public Opinion Needed

2010-09-23 Thread Andrei Mita
Where do you get the favorite posts from? Do you have them in a db?

On Fri, Sep 24, 2010 at 7:19 AM, calzone  wrote:

> I would save to both the db and the session when changes are made and
> read from the database to the session on login and then read from the
> session while it's active.
>
> If there is a memory limitation on the server that you risk hitting
> because you have too many users that all have too many favorites all
> at the same time, then you could just as easily save the favorites to
> a cookie instead regardless of database or whatever.
>
>
> On Sep 23, 8:55 pm, Nico Andrade 
> wrote:
> > Hi
> >
> > yes, I agree on this too; but I also trust on Dave decition. I think that
> if
> > he took the time to check the session filesize he is smart enough to note
> > this obvious manner too; and I think that if he asks about storing this
> in
> > sessions is because in some way it's important to have that information
> > quickly.
> >
> > I mean that if the favorites is not very very important, I would use the
> DB
> > approach too instead of working in a session. But he asked this for some
> > reason that we don't know and because of that we can only reply his
> question
> > instead of giving a more detailed solution.
> >
> > What I would do, if the info is important enough, is to:
> >
> > a (and necessary) - put the info in DB in a table as JBloutus suggests,
> > indexing both fields.
> > b-Put that information in memcache instead of Sessions.
> > c-Use Cake caching engine as default, without Memcache.
> >
> > Best!
> >
> >
> >
> > On Thu, Sep 23, 2010 at 11:06 PM, j.blotus  wrote:
> > > Why not just create a new table to store the favorites?
> >
> > > UserFavorites
> > > id
> > > user_id
> > > post_id
> >
> > > seems like it would be better than using a session
> >
> > > On Sep 23, 5:13 pm, "Dave Maharaj"  wrote:
> > > > I have my Users who save favourite Posts
> >
> > > > At login I get all the saved Posts id's and save then to the users
> > > session,
> > > > when they save new one it adds it's ID to the list, delete removes
> the ID
> > > > from the session. Now this list can get rather long as you can
> imagine
> > > say
> > > > roughly 200 saved favourite id's.
> >
> > > > Now rather than Session I have the option of CACHE to do the same
> thing.
> > > > Cache the users fav's on login, add / delete to the cached list.
> >
> > > > Session seems best since its created and deleted on login / logout
> but is
> > > > there a performance difference from the 2 that anyone knows of? I
> made a
> > > > dummy files with 1000 id's and the file size was 7k so its still
> rather a
> > > > small amount of data. So sticking with the session seems best but
> would
> > > like
> > > > to hear what others think.
> >
> > > > Any feedback would be great.
> >
> > > > Thanks.
> >
> > > > Dave
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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+unsubscr...@googlegroups.com
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: sending mail through Gmail SMTP by Email component?

2010-09-23 Thread Andrei Mita
Also keep in mind that you won't be able to send bulk e-mails using Gmail.
They have a lot of limitations.

On Fri, Sep 24, 2010 at 6:41 AM, archF6  wrote:

> I ran into this problem too.
>
> First, make sure ssl is enabled on your server.
>
> Next, make sure you format all email addresses in the following way:
> $this->Email->to = 'Recipient ';
>
> Note the "<" and ">" around the actual email address.  Google's SMTP
> server requires this.
> You must also do this for sender email, reply-to address, etc.  In
> other words, whenever you enter an email address, make sure it's
> surrounded by those carrots.
>
>
> On Sep 23, 10:52 am, pang  wrote:
> > I met a strange problem while using gmail as SMTP server.
> >
> > What I want to do is to send bulk email with my domain email
> > serv...@tagroup.se,
> >
> > I used cakephp Email component to handle this , I followed exact
> > configuration as mentioned in links below (CakePHP official tutorial
> > site), but the email can't be sent
> >
> > http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP
> >
> > My configuration is as follows:
> >
> > 'port'=>'465',
> > 'timeout'=>'30',
> > 'host' => 'ssl://smtp.gmail.com',
> > 'username'=>'serv...@tagroup.se',
> > 'password'=>''
> >
> > But mail can't be sent. Do I need to set any more parameters?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: acl and admin routing?

2010-09-23 Thread Andrei Mita
You could deny access in beforeFilter in AppController to all admin_ actions
for everyone except one ore more groups, I guess.

On Thu, Sep 23, 2010 at 11:14 PM, calzone  wrote:

> Yes, he wrote the tutorial on  book.cakephp.org I followed to begin
> with.
>
> But neither the tutorial nor his site answer my specific question.
> I'm trying to blanket deny any controller action that is accessed via
> admin routing to anyone who is not part of one specific group.
>
> Sure, I could manually create an aro-aco for every single action whose
> name begins with admin_ --but that defeats the purpose and simplicity
> of using a single centralized permission.
>
> It seems to me it should be easy (automatic even) to have acl
> automatically hook into admin and superadmin routing so that you
> DONT'T HAVE to define permissions for every single action.
>
>
> On Sep 23, 10:55 am, Sam Sherlock  wrote:
> > Mark covers this here
> >
> > http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-...
> >
> >  - S
> >
> > On 23 September 2010 17:45, calzone  wrote:
> >
> >
> >
> > > No takers?  I thought for sure there was a simple obvious answer I had
> > > overlooked somehow.
> >
> > > On Sep 22, 1:36 pm, calzone  wrote:
> > > > So I have acl and admin routing on a site.
> >
> > > > I'd like to create an aro-aco that blanket denies all admin actions
> to
> > > > anyone who is not in group x.
> >
> > > > And vice versa, i'd like to blanket allow all admin actions to anyone
> > > > who is in group x.
> >
> > > > After that I might fine tune access for certain subgroups or
> > > > individuals, but as a starting point, is there a way to set this up
> or
> > > > am I only able to allow or deny access on a controller or action
> basis?
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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+unsubscr...@googlegroups.com
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cascaded associations

2010-09-23 Thread Andrei Mita
Regarding containable behavior. Does anyone know which is better from
performance point of view: use it with $actAs or attach it on the fly?

On Thu, Sep 23, 2010 at 11:05 PM, Chris  wrote:

> Hi there!
>
> I just tryied your Containable behavior and it works! I had some
> problems but I simply forgot the $actAs attribute in the events model!
>
> Thank you for your help! (-:
>
> On 23 sep, 19:55, cricket  wrote:
> > On Thu, Sep 23, 2010 at 7:09 AM, Chris  wrote:
> > > Hi there!
> >
> > > I'm pretty new to CakePHP and I recently met a problem that I actually
> > > can not resolve by myself, so I would like some help understanding the
> > > source of the problem.
> >
> > > I have an events table that contains, with others things, a
> > > 'location_id' field.
> > > I have a locations table containing a 'country_id' field.
> > > And I have a countries table that contains some data related to
> > > specific countries.
> >
> > > Now, what I would like to get, is a page containing data for a
> > > specific event: it works. But my array looks like this:
> >
> > > Array
> > > (
> > >[Event] => Array
> > >(
> > >[id] => 1
> > >[created] => 2010-09-22 23:57:39
> > >[modified] => 2010-09-22 23:57:39
> > >[name] => Test event
> > >[start_date] => 2010-09-23 20:00:00
> > >[end_date] => 2010-09-24 03:00:00
> > >[location_id] => 1
> > >)
> >
> > >[Location] => Array
> > >(
> > >[id] => 1
> > >[name] => My home
> > >[street] => Here street
> > >[house_number] => 128
> > >[zip_code] => 7000
> > >[city] => Mons
> > >[country_id] => 1
> > >)
> > > )
> >
> > > I'd like to append a branch related to the country. I thought it could
> > > be "automagically" did, but I probably made a mistake. For now, in my
> > > events_controller file, I do this to get the data related to the
> > > location's country:
> >
> > >$data['Country'] =
> ClassRegistry::init('Countries')->find(
> > >'all', array(
> > >'conditions' => 'Countries.id =
> '.$data['Location']['country_id']
> > >)
> > >);
> > >$data['Country'] =
> $data['Country'][0]['Countries'];
> >
> > >$this->set('data', $data);
> >
> > > But It looks crap and I suppose that a "clean" way to to this exists.
> > > But I really do not know what to do with that.
> >
> > As Andrei mentioned, ContainableBehavior will help with that. See here:
> http://book.cakephp.org/view/474/Containable
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Public Opinion Needed

2010-09-23 Thread calzone
I would save to both the db and the session when changes are made and
read from the database to the session on login and then read from the
session while it's active.

If there is a memory limitation on the server that you risk hitting
because you have too many users that all have too many favorites all
at the same time, then you could just as easily save the favorites to
a cookie instead regardless of database or whatever.


On Sep 23, 8:55 pm, Nico Andrade 
wrote:
> Hi
>
> yes, I agree on this too; but I also trust on Dave decition. I think that if
> he took the time to check the session filesize he is smart enough to note
> this obvious manner too; and I think that if he asks about storing this in
> sessions is because in some way it's important to have that information
> quickly.
>
> I mean that if the favorites is not very very important, I would use the DB
> approach too instead of working in a session. But he asked this for some
> reason that we don't know and because of that we can only reply his question
> instead of giving a more detailed solution.
>
> What I would do, if the info is important enough, is to:
>
> a (and necessary) - put the info in DB in a table as JBloutus suggests,
> indexing both fields.
> b-Put that information in memcache instead of Sessions.
> c-Use Cake caching engine as default, without Memcache.
>
> Best!
>
>
>
> On Thu, Sep 23, 2010 at 11:06 PM, j.blotus  wrote:
> > Why not just create a new table to store the favorites?
>
> > UserFavorites
> > id
> > user_id
> > post_id
>
> > seems like it would be better than using a session
>
> > On Sep 23, 5:13 pm, "Dave Maharaj"  wrote:
> > > I have my Users who save favourite Posts
>
> > > At login I get all the saved Posts id's and save then to the users
> > session,
> > > when they save new one it adds it's ID to the list, delete removes the ID
> > > from the session. Now this list can get rather long as you can imagine
> > say
> > > roughly 200 saved favourite id's.
>
> > > Now rather than Session I have the option of CACHE to do the same thing.
> > > Cache the users fav's on login, add / delete to the cached list.
>
> > > Session seems best since its created and deleted on login / logout but is
> > > there a performance difference from the 2 that anyone knows of? I made a
> > > dummy files with 1000 id's and the file size was 7k so its still rather a
> > > small amount of data. So sticking with the session seems best but would
> > like
> > > to hear what others think.
>
> > > Any feedback would be great.
>
> > > Thanks.
>
> > > Dave
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Public Opinion Needed

2010-09-23 Thread Nico Andrade
Hi

yes, I agree on this too; but I also trust on Dave decition. I think that if
he took the time to check the session filesize he is smart enough to note
this obvious manner too; and I think that if he asks about storing this in
sessions is because in some way it's important to have that information
quickly.

I mean that if the favorites is not very very important, I would use the DB
approach too instead of working in a session. But he asked this for some
reason that we don't know and because of that we can only reply his question
instead of giving a more detailed solution.

What I would do, if the info is important enough, is to:

a (and necessary) - put the info in DB in a table as JBloutus suggests,
indexing both fields.
b-Put that information in memcache instead of Sessions.
c-Use Cake caching engine as default, without Memcache.

Best!



On Thu, Sep 23, 2010 at 11:06 PM, j.blotus  wrote:

> Why not just create a new table to store the favorites?
>
> UserFavorites
> id
> user_id
> post_id
>
> seems like it would be better than using a session
>
> On Sep 23, 5:13 pm, "Dave Maharaj"  wrote:
> > I have my Users who save favourite Posts
> >
> > At login I get all the saved Posts id's and save then to the users
> session,
> > when they save new one it adds it's ID to the list, delete removes the ID
> > from the session. Now this list can get rather long as you can imagine
> say
> > roughly 200 saved favourite id's.
> >
> > Now rather than Session I have the option of CACHE to do the same thing.
> > Cache the users fav's on login, add / delete to the cached list.
> >
> > Session seems best since its created and deleted on login / logout but is
> > there a performance difference from the 2 that anyone knows of? I made a
> > dummy files with 1000 id's and the file size was 7k so its still rather a
> > small amount of data. So sticking with the session seems best but would
> like
> > to hear what others think.
> >
> > Any feedback would be great.
> >
> > Thanks.
> >
> > Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: sending mail through Gmail SMTP by Email component?

2010-09-23 Thread archF6
I ran into this problem too.

First, make sure ssl is enabled on your server.

Next, make sure you format all email addresses in the following way:
$this->Email->to = 'Recipient ';

Note the "<" and ">" around the actual email address.  Google's SMTP
server requires this.
You must also do this for sender email, reply-to address, etc.  In
other words, whenever you enter an email address, make sure it's
surrounded by those carrots.


On Sep 23, 10:52 am, pang  wrote:
> I met a strange problem while using gmail as SMTP server.
>
> What I want to do is to send bulk email with my domain email
> serv...@tagroup.se,
>
> I used cakephp Email component to handle this , I followed exact
> configuration as mentioned in links below (CakePHP official tutorial
> site), but the email can't be sent
>
> http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP
>
> My configuration is as follows:
>
>         'port'=>'465',
>         'timeout'=>'30',
>         'host' => 'ssl://smtp.gmail.com',
>         'username'=>'serv...@tagroup.se',
>         'password'=>''
>
> But mail can't be sent. Do I need to set any more parameters?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Public Opinion Needed

2010-09-23 Thread j.blotus
Why not just create a new table to store the favorites?

UserFavorites
id
user_id
post_id

seems like it would be better than using a session

On Sep 23, 5:13 pm, "Dave Maharaj"  wrote:
> I have my Users who save favourite Posts
>
> At login I get all the saved Posts id's and save then to the users session,
> when they save new one it adds it's ID to the list, delete removes the ID
> from the session. Now this list can get rather long as you can imagine say
> roughly 200 saved favourite id's.
>
> Now rather than Session I have the option of CACHE to do the same thing.
> Cache the users fav's on login, add / delete to the cached list.
>
> Session seems best since its created and deleted on login / logout but is
> there a performance difference from the 2 that anyone knows of? I made a
> dummy files with 1000 id's and the file size was 7k so its still rather a
> small amount of data. So sticking with the session seems best but would like
> to hear what others think.
>
> Any feedback would be great.
>
> Thanks.
>
> Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Confusion with $this->data and $this->alias as used in this function...

2010-09-23 Thread Miles J
It is passed in as an argument to password_match().

On Sep 23, 5:24 pm, John L  wrote:
> Thanks Miles!
>
> I follow you on $this->alias but where does $password_field come from. I'm
> searching everywhere to find something on this.
>
> On Thu, Sep 23, 2010 at 8:11 PM, Miles J  wrote:
> > $this->alias is the name of the model. If your model is User, then you
> > must do that on $data to get the correct value.
>
> > $data['User']['password'] is equivalent to:
> > $data[$this->alias][$password_field] which is the better approach
> > because its dynamic.
>
> > On Sep 23, 4:59 pm, John L  wrote:
> > > Hello,
>
> > > I'm following this tutorial on the Auth component:http://bit.ly/aNWz3J
>
> > > I'm confused about three things and I can't figure it out on my own
> > (trust
> > > me I tried).
>
> > > Class User extends AppModel {
>
> > > // ..
>
> > > function password_match($data, $password_field, $hashed=true) {
> > >     $password = $this->data[$this->alias][$password_field];
> > >     $keys = array_keys($data);
> > >     $password_confirm = $hashed ?
> > >     Security::hash($data[$keys[0]], null, true) :
> > >     $data[$keys[0]];
> > >     return $password === $password_confirm
>
> > > }
> > > }
>
> > > *Confusion #1: $data*
> > > It's my understanding that $data is a property of class Controller and it
> > > contains data which has been posted to the controller user HtmlHelper and
> > > that data here is accessible using the
> > $this->data['ModelName']['fieldName']
> > > format.
>
> > > So why is it many times (in parameter list and in function body) that
> > it's
> > > put out there simply as "$data"?
>
> > > *Confusion #2: $this->alias*
> > > What is $this->alias
>
> > > *Confusion #3: Where is the matching?*
> > > I don't see any matching.
>
> > > Hope you guys can help. Thank you so much.
>
> > > Jon Lyles
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Confusion with $this->data and $this->alias as used in this function...

2010-09-23 Thread John L
Thanks Miles!

I follow you on $this->alias but where does $password_field come from. I'm
searching everywhere to find something on this.

On Thu, Sep 23, 2010 at 8:11 PM, Miles J  wrote:

> $this->alias is the name of the model. If your model is User, then you
> must do that on $data to get the correct value.
>
> $data['User']['password'] is equivalent to:
> $data[$this->alias][$password_field] which is the better approach
> because its dynamic.
>
> On Sep 23, 4:59 pm, John L  wrote:
> > Hello,
> >
> > I'm following this tutorial on the Auth component:http://bit.ly/aNWz3J
> >
> > I'm confused about three things and I can't figure it out on my own
> (trust
> > me I tried).
> >
> > Class User extends AppModel {
> >
> > // ..
> >
> > function password_match($data, $password_field, $hashed=true) {
> > $password = $this->data[$this->alias][$password_field];
> > $keys = array_keys($data);
> > $password_confirm = $hashed ?
> > Security::hash($data[$keys[0]], null, true) :
> > $data[$keys[0]];
> > return $password === $password_confirm
> >
> > }
> > }
> >
> > *Confusion #1: $data*
> > It's my understanding that $data is a property of class Controller and it
> > contains data which has been posted to the controller user HtmlHelper and
> > that data here is accessible using the
> $this->data['ModelName']['fieldName']
> > format.
> >
> > So why is it many times (in parameter list and in function body) that
> it's
> > put out there simply as "$data"?
> >
> > *Confusion #2: $this->alias*
> > What is $this->alias
> >
> > *Confusion #3: Where is the matching?*
> > I don't see any matching.
> >
> > Hope you guys can help. Thank you so much.
> >
> > Jon Lyles
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Confusion with $this->data and $this->alias as used in this function...

2010-09-23 Thread Miles J
$this->alias is the name of the model. If your model is User, then you
must do that on $data to get the correct value.

$data['User']['password'] is equivalent to:
$data[$this->alias][$password_field] which is the better approach
because its dynamic.

On Sep 23, 4:59 pm, John L  wrote:
> Hello,
>
> I'm following this tutorial on the Auth component:http://bit.ly/aNWz3J
>
> I'm confused about three things and I can't figure it out on my own (trust
> me I tried).
>
> Class User extends AppModel {
>
> // ..
>
> function password_match($data, $password_field, $hashed=true) {
>     $password = $this->data[$this->alias][$password_field];
>     $keys = array_keys($data);
>     $password_confirm = $hashed ?
>     Security::hash($data[$keys[0]], null, true) :
>     $data[$keys[0]];
>     return $password === $password_confirm
>
> }
> }
>
> *Confusion #1: $data*
> It's my understanding that $data is a property of class Controller and it
> contains data which has been posted to the controller user HtmlHelper and
> that data here is accessible using the $this->data['ModelName']['fieldName']
> format.
>
> So why is it many times (in parameter list and in function body) that it's
> put out there simply as "$data"?
>
> *Confusion #2: $this->alias*
> What is $this->alias
>
> *Confusion #3: Where is the matching?*
> I don't see any matching.
>
> Hope you guys can help. Thank you so much.
>
> Jon Lyles

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Confusion with $this->data and $this->alias as used in this function...

2010-09-23 Thread John L
Hello,

I'm following this tutorial on the Auth component: http://bit.ly/aNWz3J

I'm confused about three things and I can't figure it out on my own (trust
me I tried).

Class User extends AppModel {

// ..

function password_match($data, $password_field, $hashed=true) {
$password = $this->data[$this->alias][$password_field];
$keys = array_keys($data);
$password_confirm = $hashed ?
Security::hash($data[$keys[0]], null, true) :
$data[$keys[0]];
return $password === $password_confirm
}

}

*Confusion #1: $data*
It's my understanding that $data is a property of class Controller and it
contains data which has been posted to the controller user HtmlHelper and
that data here is accessible using the $this->data['ModelName']['fieldName']
format.

So why is it many times (in parameter list and in function body) that it's
put out there simply as "$data"?

*Confusion #2: $this->alias*
What is $this->alias

*Confusion #3: Where is the matching?*
I don't see any matching.


Hope you guys can help. Thank you so much.


Jon Lyles

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Public Opinion Needed

2010-09-23 Thread Nico Andrade
I think your approach is good. It depends on how many users you'll have
simultaneosly.

Also I had issues with Cake when the TMP directory was a NFS mount, so try
to avoid this if you can.

Best,

Nicolás Andrade

On Thu, Sep 23, 2010 at 6:13 PM, Dave Maharaj  wrote:

>  I have my Users who save favourite Posts
>
>
>
> At login I get all the saved Posts id’s and save then to the users session,
> when they save new one it adds it’s ID to the list, delete removes the ID
> from the session. Now this list can get rather long as you can imagine say
> roughly 200 saved favourite id’s.
>
>
>
> Now rather than Session I have the option of CACHE to do the same thing.
> Cache the users fav’s on login, add / delete to the cached list.
>
>
>
> Session seems best since its created and deleted on login / logout but is
> there a performance difference from the 2 that anyone knows of? I made a
> dummy files with 1000 id’s and the file size was 7k so its still rather a
> small amount of data. So sticking with the session seems best but would like
> to hear what others think.
>
>
>
> Any feedback would be great.
>
>
>
> Thanks.
>
>
>
> Dave
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Public Opinion Needed

2010-09-23 Thread Dave Maharaj
I have my Users who save favourite Posts

 

At login I get all the saved Posts id's and save then to the users session,
when they save new one it adds it's ID to the list, delete removes the ID
from the session. Now this list can get rather long as you can imagine say
roughly 200 saved favourite id's.

 

Now rather than Session I have the option of CACHE to do the same thing.
Cache the users fav's on login, add / delete to the cached list.

 

Session seems best since its created and deleted on login / logout but is
there a performance difference from the 2 that anyone knows of? I made a
dummy files with 1000 id's and the file size was 7k so its still rather a
small amount of data. So sticking with the session seems best but would like
to hear what others think.

 

Any feedback would be great.

 

Thanks.

 

Dave

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread Sam
> On Thu, Sep 23, 2010 at 12:40 PM, j.blotus  wrote:
> > I think you have used up your question quota for the week.

On Sep 23, 6:46 am, Joshua Muheim  wrote:
> What a luck that weekend is coming soon...!
Haha nice.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


some ajax drop menu with jquery and cakephp

2010-09-23 Thread hoss7
hi i am new in cakephp and json and ajax in need

menu 1 have category,when user selece category show subcategory in
other menu

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: acl and admin routing?

2010-09-23 Thread calzone
Yes, he wrote the tutorial on  book.cakephp.org I followed to begin
with.

But neither the tutorial nor his site answer my specific question.
I'm trying to blanket deny any controller action that is accessed via
admin routing to anyone who is not part of one specific group.

Sure, I could manually create an aro-aco for every single action whose
name begins with admin_ --but that defeats the purpose and simplicity
of using a single centralized permission.

It seems to me it should be easy (automatic even) to have acl
automatically hook into admin and superadmin routing so that you
DONT'T HAVE to define permissions for every single action.


On Sep 23, 10:55 am, Sam Sherlock  wrote:
> Mark covers this here
>
> http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-...
>
>  - S
>
> On 23 September 2010 17:45, calzone  wrote:
>
>
>
> > No takers?  I thought for sure there was a simple obvious answer I had
> > overlooked somehow.
>
> > On Sep 22, 1:36 pm, calzone  wrote:
> > > So I have acl and admin routing on a site.
>
> > > I'd like to create an aro-aco that blanket denies all admin actions to
> > > anyone who is not in group x.
>
> > > And vice versa, i'd like to blanket allow all admin actions to anyone
> > > who is in group x.
>
> > > After that I might fine tune access for certain subgroups or
> > > individuals, but as a starting point, is there a way to set this up or
> > > am I only able to allow or deny access on a controller or action basis?
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cascaded associations

2010-09-23 Thread Chris
Hi there!

I just tryied your Containable behavior and it works! I had some
problems but I simply forgot the $actAs attribute in the events model!

Thank you for your help! (-:

On 23 sep, 19:55, cricket  wrote:
> On Thu, Sep 23, 2010 at 7:09 AM, Chris  wrote:
> > Hi there!
>
> > I'm pretty new to CakePHP and I recently met a problem that I actually
> > can not resolve by myself, so I would like some help understanding the
> > source of the problem.
>
> > I have an events table that contains, with others things, a
> > 'location_id' field.
> > I have a locations table containing a 'country_id' field.
> > And I have a countries table that contains some data related to
> > specific countries.
>
> > Now, what I would like to get, is a page containing data for a
> > specific event: it works. But my array looks like this:
>
> > Array
> > (
> >    [Event] => Array
> >        (
> >            [id] => 1
> >            [created] => 2010-09-22 23:57:39
> >            [modified] => 2010-09-22 23:57:39
> >            [name] => Test event
> >            [start_date] => 2010-09-23 20:00:00
> >            [end_date] => 2010-09-24 03:00:00
> >            [location_id] => 1
> >        )
>
> >    [Location] => Array
> >        (
> >            [id] => 1
> >            [name] => My home
> >            [street] => Here street
> >            [house_number] => 128
> >            [zip_code] => 7000
> >            [city] => Mons
> >            [country_id] => 1
> >        )
> > )
>
> > I'd like to append a branch related to the country. I thought it could
> > be "automagically" did, but I probably made a mistake. For now, in my
> > events_controller file, I do this to get the data related to the
> > location's country:
>
> >                        $data['Country'] = 
> > ClassRegistry::init('Countries')->find(
> >                                'all', array(
> >                                'conditions' => 'Countries.id = 
> > '.$data['Location']['country_id']
> >                                )
> >                        );
> >                        $data['Country'] = $data['Country'][0]['Countries'];
>
> >                        $this->set('data', $data);
>
> > But It looks crap and I suppose that a "clean" way to to this exists.
> > But I really do not know what to do with that.
>
> As Andrei mentioned, ContainableBehavior will help with that. See 
> here:http://book.cakephp.org/view/474/Containable

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to execute bash(.sh) files in cake php

2010-09-23 Thread cricket
On Thu, Sep 23, 2010 at 2:12 PM, euromark  wrote:
> i have a related problem
> using exec('rm xyz') i can delete any (own) file (www-data/apache)
> but how i can i delete a file which has been uploaded with ftp and
> under a different username (e.g. "ftpaccount")?
>
> i tried everything
> from "sudo rm xyz" to "password | sudo -S rm xyz"
>
> i also tried writing a bash script. same result
>
> nothing seemed to work
> the problem is that you are usually prompted for the password
> but with php and exec() you usually can't insert this into the shell
>

You could write a shell script to deal with the file and allow apache
to run it without a password.

Using visudo to update /etc/sudoers:

-- snip --
User_Alias APACHE = www-data
Cmnd_Alias FOO = /path/to/script

APACHE ALL = (ALL) NOPASSWD: FOO
-- snip --

Replace www-data with httpd/apache/nobody as required.

I think that'd work. YMMV. Personally, I'd think about this very carefully.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to execute bash(.sh) files in cake php

2010-09-23 Thread euromark
i have a related problem
using exec('rm xyz') i can delete any (own) file (www-data/apache)
but how i can i delete a file which has been uploaded with ftp and
under a different username (e.g. "ftpaccount")?

i tried everything
from "sudo rm xyz" to "password | sudo -S rm xyz"

i also tried writing a bash script. same result

nothing seemed to work
the problem is that you are usually prompted for the password
but with php and exec() you usually can't insert this into the shell

any ideas?


On 23 Sep., 19:52, cricket  wrote:
> On Thu, Sep 23, 2010 at 7:19 AM, Guru  wrote:
> > Hi,
>
> >  How can we execute bash(.sh) files from controller?
>
> >  Example : I have a file abc.sh. Whose contents are
> >     #!/bin/bash
> >     # declare STRING variable
> >     STRING="Hello World"
> >     #print variable on a screen
> >     echo $STRING
>
> >  I need to execute abc.sh from controller.
>
> Weird. This is the 3rd similar msg this week. What i said in the last one:
>
> Just like you would with any PHP script. Look at exec(), shell_exec(),
> escapeshellcmd(), system(), passthru(), etc.
>
>
>
>
>
> > 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+unsubscr...@googlegroups.com For more options, visit this group 
> > athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: tree structure problem

2010-09-23 Thread cricket
On Thu, Sep 23, 2010 at 8:59 AM, marvelade  wrote:
> Dear all
>
> For a documentation system we have a tree structure of key words (came
> from an excel file).
>
> it's now in a MySQL table with the following columns (field names are
> pretty self-explanatory)
>
> CREATE TABLE IF NOT EXISTS `keywords` (
> `id` smallint(5) unsigned NOT NULL auto_increment,
> `parent_id` int(10) unsigned default NULL,
> `keyword` varchar(64) collate utf8_unicode_ci NOT NULL,
> `approved` tinyint(1) NOT NULL default '0',
> PRIMARY KEY (`id`)
> )
>
> keywords at root level have parent_id NULL.
>
>
>
> I want to have a system so each keyword can display its chain of
> parents up to the root level
>
> For example I have this chain:
> "Nature sciences" -> "chemistry" -> "analysis methods" -> "gas
> analysis"
>
> When I view keyword "gas analysis" I want my code to display:
>
> Parent chain : "Nature sciences" -> "chemistry" -> "analysis methods"
>
>
> When I follow the procedure as described here:
> http://bakery.cakephp.org/articles/view/threaded-lists
>
> I can't get it to work. I keep getting the error:
>
> 1064: You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'findAllThreaded' at line 1
>
> For some reason the function name findAllThreaded is passed as a SQL
> statement :s
>
>
> Can anyone please advise? I use CakePHP 1.3

That's because the method no longer exists, so Cake simply passes the
request directly to the DB. There have been significant changes to the
Cake libs since that article was posted. Use find('threaded') instead.
Also, check out TreeBehavior:

http://book.cakephp.org/view/91/Tree

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: acl and admin routing?

2010-09-23 Thread Sam Sherlock
Mark covers this here

http://mark-story.com/posts/view/auth-and-acl-an-end-to-end-tutorial-pt-1

 - S


On 23 September 2010 17:45, calzone  wrote:

> No takers?  I thought for sure there was a simple obvious answer I had
> overlooked somehow.
>
> On Sep 22, 1:36 pm, calzone  wrote:
> > So I have acl and admin routing on a site.
> >
> > I'd like to create an aro-aco that blanket denies all admin actions to
> > anyone who is not in group x.
> >
> > And vice versa, i'd like to blanket allow all admin actions to anyone
> > who is in group x.
> >
> > After that I might fine tune access for certain subgroups or
> > individuals, but as a starting point, is there a way to set this up or
> > am I only able to allow or deny access on a controller or action basis?
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cascaded associations

2010-09-23 Thread cricket
On Thu, Sep 23, 2010 at 7:09 AM, Chris  wrote:
> Hi there!
>
>
> I'm pretty new to CakePHP and I recently met a problem that I actually
> can not resolve by myself, so I would like some help understanding the
> source of the problem.
>
> I have an events table that contains, with others things, a
> 'location_id' field.
> I have a locations table containing a 'country_id' field.
> And I have a countries table that contains some data related to
> specific countries.
>
> Now, what I would like to get, is a page containing data for a
> specific event: it works. But my array looks like this:
>
>
> Array
> (
>    [Event] => Array
>        (
>            [id] => 1
>            [created] => 2010-09-22 23:57:39
>            [modified] => 2010-09-22 23:57:39
>            [name] => Test event
>            [start_date] => 2010-09-23 20:00:00
>            [end_date] => 2010-09-24 03:00:00
>            [location_id] => 1
>        )
>
>    [Location] => Array
>        (
>            [id] => 1
>            [name] => My home
>            [street] => Here street
>            [house_number] => 128
>            [zip_code] => 7000
>            [city] => Mons
>            [country_id] => 1
>        )
> )
>
> I'd like to append a branch related to the country. I thought it could
> be "automagically" did, but I probably made a mistake. For now, in my
> events_controller file, I do this to get the data related to the
> location's country:
>
>
>                        $data['Country'] = 
> ClassRegistry::init('Countries')->find(
>                                'all', array(
>                                'conditions' => 'Countries.id = 
> '.$data['Location']['country_id']
>                                )
>                        );
>                        $data['Country'] = $data['Country'][0]['Countries'];
>
>                        $this->set('data', $data);
>
> But It looks crap and I suppose that a "clean" way to to this exists.
> But I really do not know what to do with that.

As Andrei mentioned, ContainableBehavior will help with that. See here:
http://book.cakephp.org/view/474/Containable

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: How to execute bash(.sh) files in cake php

2010-09-23 Thread cricket
On Thu, Sep 23, 2010 at 7:19 AM, Guru  wrote:
> Hi,
>
>  How can we execute bash(.sh) files from controller?
>
>  Example : I have a file abc.sh. Whose contents are
>     #!/bin/bash
>     # declare STRING variable
>     STRING="Hello World"
>     #print variable on a screen
>     echo $STRING
>
>  I need to execute abc.sh from controller.

Weird. This is the 3rd similar msg this week. What i said in the last one:

Just like you would with any PHP script. Look at exec(), shell_exec(),
escapeshellcmd(), system(), passthru(), etc.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Class 'Router' not found Error

2010-09-23 Thread cricket
On Wed, Sep 22, 2010 at 7:07 AM, avanrotciv  wrote:
> Hi,
>
> I'm getting this error, when trying to run a fresh copy of cakephp:
>
> Fatal error: Class 'Router' not found in ./cake/dispatcher.php on line
> 264
>
> I just copy and paste the code version 1.3.4 from github, didn't to
> any modification.
>

Did you just go from 1.2.x to 1.3.4? If so, you'll need to update
app/webroot/index.php and app/config/core.php. See the migration
guide:

http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Call a method from different controller

2010-09-23 Thread Miles J
The controller just acts as the middle man between the database (modes
and business logic) and the templates (views and helpers).

I would suggest looking at some example apps/plugins. For example, my
forum plugin: http://github.com/milesj/cake-forum/tree/master/controllers/

On Sep 22, 5:08 am, Poliane Brito  wrote:
> Are u serious? GoD! I always did logic in controller and in model only
> gets/sets and validation data.
> wow, I have to go back to the MVC books o.o
>
> On Tue, Sep 21, 2010 at 5:13 PM, Miles J  wrote:
> > No because this is model (business) logic. The controller is only used
> > to validation specific data and to set data (from the model) to the
> > view.
>
> > On Sep 21, 6:55 am, Poliane Brito  wrote:
> > > Sorry guys, I'm relative new on CakePHP... but move a certain method to
> > > model, isn't hurt MVC rules?
> > > Regards...
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.comFor
> >  more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: acl and admin routing?

2010-09-23 Thread calzone
No takers?  I thought for sure there was a simple obvious answer I had
overlooked somehow.

On Sep 22, 1:36 pm, calzone  wrote:
> So I have acl and admin routing on a site.
>
> I'd like to create an aro-aco that blanket denies all admin actions to
> anyone who is not in group x.
>
> And vice versa, i'd like to blanket allow all admin actions to anyone
> who is in group x.
>
> After that I might fine tune access for certain subgroups or
> individuals, but as a starting point, is there a way to set this up or
> am I only able to allow or deny access on a controller or action basis?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Tooltip with Prototype

2010-09-23 Thread Mariano C.
there's a way (helpers or just howto) to use prototype based tooltip
inside my page?
Everything i've found is out of date

Regards

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin interface templates / themes for CakePHP

2010-09-23 Thread mufti ali
Another some free template,

http://blogfreakz.com/web-design/excellent-free-admin-template-for-web-applications/

Mufti Ali
http://webdev5.com
http://blogfreakz.com

On Thu, Sep 23, 2010 at 11:06 PM, Tilen Majerle wrote:

> Type in google simpla admin and modify template for cakePHP...its awesome
> design
>
> On Sep 23, 2010 1:31 PM, "Alex Bovey"  wrote:
>
> Hi all,
>
> Has anyone used any nice admin interface templates with CakePHP?
>
> I'm trying to choose one from this list, but wondering whether anyone
> has done anything similar and done the necessary work to get the
> templates working nicely with Cake?
>
>
> http://www.ourtuts.com/34-outstanding-admin-panels-for-your-web-applications/
>
> Thanks all,
>
> Alex
>
> --
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
>  Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



--

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin interface templates / themes for CakePHP

2010-09-23 Thread Tilen Majerle
Type in google simpla admin and modify template for cakePHP...its awesome
design

On Sep 23, 2010 1:31 PM, "Alex Bovey"  wrote:

Hi all,

Has anyone used any nice admin interface templates with CakePHP?

I'm trying to choose one from this list, but wondering whether anyone
has done anything similar and done the necessary work to get the
templates working nicely with Cake?

http://www.ourtuts.com/34-outstanding-admin-panels-for-your-web-applications/

Thanks all,

Alex

--
Alex Bovey
Web Developer | Alex Bovey Consultancy Ltd
Registered in England & Wales no. 6471391 | VAT no. 934 8959 65

Check out the new CakePHP Questions site http://cakeqs.org and help others
with their CakePHP related questions.

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+unsubscr...@googlegroups.comFor
more options, visit this group at
http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: CakePHP Gigya Social Network Plugin implementation

2010-09-23 Thread Foroct
Moxby,

That is what I thought too but it isn't working. I am wondering if
after the plugin verifies a user from a social site and returns the
user to my site do I then need to add some sort of function to have
the plugin check if the user is in the table then either run the
gigyaCreateUser function or the linkAccount function.

The instructions on setup were pretty solid but the usage info is
lacking.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Good Photo Carousels for CakePHP?

2010-09-23 Thread WhyNotSmile
Hi everyone, any chance someone can give me some pointers on creating
a photo carousel in cakePHP?

Basically I would like it to have a big image at the top, and then
thumbnails underneath, which the user can scroll through.  When a
thumbnail is clicked on, the corresponding image & caption should be
shown in the main image space.

I've been trying to integrate various open source carousels
(jMyCarousel, jCarousel and a few others), but can't seem to get them
working (basically, I create the image list, and then, instead of it
getting turned into a carousel, it just stays as a list).

Has anyone integrated a carousel (javascript, jQuery or mootools), and
if so, can you give me any advice?

Thanks!

Sharon

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


sending mail through Gmail SMTP by Email component?

2010-09-23 Thread pang
I met a strange problem while using gmail as SMTP server.

What I want to do is to send bulk email with my domain email
serv...@tagroup.se,

I used cakephp Email component to handle this , I followed exact
configuration as mentioned in links below (CakePHP official tutorial
site), but the email can't be sent

http://book.cakephp.org/view/1290/Sending-A-Message-Using-SMTP


My configuration is as follows:

'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.gmail.com',
'username'=>'serv...@tagroup.se',
'password'=>''

But mail can't be sent. Do I need to set any more parameters?

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


tree structure problem

2010-09-23 Thread marvelade
Dear all

For a documentation system we have a tree structure of key words (came
from an excel file).

it's now in a MySQL table with the following columns (field names are
pretty self-explanatory)

CREATE TABLE IF NOT EXISTS `keywords` (
`id` smallint(5) unsigned NOT NULL auto_increment,
`parent_id` int(10) unsigned default NULL,
`keyword` varchar(64) collate utf8_unicode_ci NOT NULL,
`approved` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`id`)
)

keywords at root level have parent_id NULL.



I want to have a system so each keyword can display its chain of
parents up to the root level

For example I have this chain:
"Nature sciences" -> "chemistry" -> "analysis methods" -> "gas
analysis"

When I view keyword "gas analysis" I want my code to display:

Parent chain : "Nature sciences" -> "chemistry" -> "analysis methods"


When I follow the procedure as described here:
http://bakery.cakephp.org/articles/view/threaded-lists

I can't get it to work. I keep getting the error:

1064: You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'findAllThreaded' at line 1

For some reason the function name findAllThreaded is passed as a SQL
statement :s


Can anyone please advise? I use CakePHP 1.3

Best regards,
Marvelade

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Cascaded associations

2010-09-23 Thread Andrei Mita
I don't know how your models are linked together but if "recursive" doesn't
get you all the data you need, "containable" will do the trick.

On Thu, Sep 23, 2010 at 2:09 PM, Chris  wrote:

> Hi there!
>
>
> I'm pretty new to CakePHP and I recently met a problem that I actually
> can not resolve by myself, so I would like some help understanding the
> source of the problem.
>
> I have an events table that contains, with others things, a
> 'location_id' field.
> I have a locations table containing a 'country_id' field.
> And I have a countries table that contains some data related to
> specific countries.
>
> Now, what I would like to get, is a page containing data for a
> specific event: it works. But my array looks like this:
>
>
> Array
> (
>[Event] => Array
>(
>[id] => 1
>[created] => 2010-09-22 23:57:39
>[modified] => 2010-09-22 23:57:39
>[name] => Test event
>[start_date] => 2010-09-23 20:00:00
>[end_date] => 2010-09-24 03:00:00
>[location_id] => 1
>)
>
>[Location] => Array
>(
>[id] => 1
>[name] => My home
>[street] => Here street
>[house_number] => 128
>[zip_code] => 7000
>[city] => Mons
>[country_id] => 1
>)
> )
>
> I'd like to append a branch related to the country. I thought it could
> be "automagically" did, but I probably made a mistake. For now, in my
> events_controller file, I do this to get the data related to the
> location's country:
>
>
>$data['Country'] =
> ClassRegistry::init('Countries')->find(
>'all', array(
>'conditions' => 'Countries.id =
> '.$data['Location']['country_id']
>)
>);
>$data['Country'] = $data['Country'][0]['Countries'];
>
>$this->set('data', $data);
>
> But It looks crap and I suppose that a "clean" way to to this exists.
> But I really do not know what to do with that.
>
>
> Please someone to help me? (-:
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to execute bash(.sh) files in cake php

2010-09-23 Thread Guru
Hi,

 How can we execute bash(.sh) files from controller?

 Example : I have a file abc.sh. Whose contents are
 #!/bin/bash
 # declare STRING variable
 STRING="Hello World"
 #print variable on a screen
 echo $STRING

 I need to execute abc.sh from controller.

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Cascaded associations

2010-09-23 Thread Chris
Hi there!


I'm pretty new to CakePHP and I recently met a problem that I actually
can not resolve by myself, so I would like some help understanding the
source of the problem.

I have an events table that contains, with others things, a
'location_id' field.
I have a locations table containing a 'country_id' field.
And I have a countries table that contains some data related to
specific countries.

Now, what I would like to get, is a page containing data for a
specific event: it works. But my array looks like this:


Array
(
[Event] => Array
(
[id] => 1
[created] => 2010-09-22 23:57:39
[modified] => 2010-09-22 23:57:39
[name] => Test event
[start_date] => 2010-09-23 20:00:00
[end_date] => 2010-09-24 03:00:00
[location_id] => 1
)

[Location] => Array
(
[id] => 1
[name] => My home
[street] => Here street
[house_number] => 128
[zip_code] => 7000
[city] => Mons
[country_id] => 1
)
)

I'd like to append a branch related to the country. I thought it could
be "automagically" did, but I probably made a mistake. For now, in my
events_controller file, I do this to get the data related to the
location's country:


$data['Country'] = 
ClassRegistry::init('Countries')->find(
'all', array(
'conditions' => 'Countries.id = 
'.$data['Location']['country_id']
)
);
$data['Country'] = $data['Country'][0]['Countries'];

$this->set('data', $data);

But It looks crap and I suppose that a "clean" way to to this exists.
But I really do not know what to do with that.


Please someone to help me? (-:

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Translation: finding records without a translation

2010-09-23 Thread tinytiger
Hi,
I am using the cakePHP translation behaviour for a project and after
my initial enthusiasm I encountered some of its shortcomings. For
instance, when I have a model, e.g. Article with a translated field
"description", querying the model I will always get an empty result
when there are no translations for this field. I guess this is because
of some inner joins in the sql query. For example in a controller
action:

$article = $this->Article->read(null, $id);

will get an empty result even if there is a record with the id, but no
translation for the field "description". Of course, I can always
unbind the translation like this:

$this->Article->unbindTranslation();
$article = $this->Article->read(null, $id);

getting the data of the untranslated article. But this leads to some
very complicated an lenghty code.

Is there any other way around this?

Greets,
mark

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Best Server Configuration

2010-09-23 Thread Anton
Hi

I saw this and it got me interested in the Amazon EC2. Could someone
please give a short explanation on how EC2 works and how to go about
setting it up.

Thanks
A

On Sep 22, 5:07 am, bowikaxu  wrote:
> How does Amazon EC2 works?
> Ive been checking the webpage and looks a great alternative, but i
> dont know what service to choose, will i have full server management,
> or how does it works?
> If you have any experience on this would be glad on any feedback.
>
> .. aad
>
> On Sep 21, 3:10 pm, dtemes  wrote:> Have you evaluated 
> putting your app on the cloud? amazon EC2 would be
> > a good option if you want to start small and scale as needed
>
> > On 21 sep, 20:03, andres amaya diaz  wrote:
>
> > > I am going to setup a dedicated server for a cakephp app, and i want
> > > to know any good tips about the configuration.
> > > - About php.ini best practices
> > > - MySQL best configuration values
> > > - What about Cache and performance?
> > > - Is it really a good idea to setup a MySQL Cluster (to boost
> > > performance), the app is intended to have 100,000 registered users,
> > > maybe 50 to 100 users at the same time.
>
> > > Thanks for any good advice?
> > > aad

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Checkbox not work fine

2010-09-23 Thread xamako
Hi,

The column type is correct: tinyint(1)

I assumed that if the field is needed only to type tinyint declare the
label and the field, correct?

 input ('active', array ('label' => 'Active'))?>

user_group_id is a combo, it works fine.

The only checkbox is the 'active' field

Thanks!

On 23 sep, 14:04, MissYeh  wrote:
> 2 things:
>
> 1) Is the column type in the table set to boolean or tinyint(1)?
>
> 2) There is no array with the options passed in for your checkbox:
> echo $this->Form->input('field', array('options' => array('option1',
> 'option2')));
>
> If user_group_id is supposed to be the checkbox then the type is
> wrong, which then should be checkbox.
>
> Take a look at this 
> example:http://book.cakephp.org/view/1390/Automagic-Form-Elements#options-mul...
>
> Hope this solves your issue, let us know! :)
>
> Kana
>
> On Sep 23, 12:26 pm, xamako  wrote:
>
> > Hi!
>
> > I have a problem with a checkbox.
>
> >  I always get value 0.
>
> > My code is this:http://bin.cakephp.org/view/1438225730
>
> > Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Não estou conseguindo enxergar o erro:

2010-09-23 Thread Poliane Brito
In 

Try do this:




link('Excluir', *array('controller' => 'controllerName',
action' => 'delete', `id` =>**
** $contrato['Contrato']['id'])*, null, 'Deseja realmente excluir
contrato?'); ?>

I haven't cake here to test, but try it...

http://book.cakephp.org/view/543/Passing-parameters-to-action



2010/9/22 Gilvan Jr. 

> Olá pessoal, vcs poderiam ver onde estou errando?
>
> a ação de adicionar cadastro está funcionando só que retorna esse
> erro:
>
> Warning (2): Cannot modify header information - headers already sent
> by (output started at D:\servidor\xampp\htdocs\cacex\app\controllers
> \contratos_controller.php:2) [CORE\cake\libs\controller
> \controller.php, line 746]
> Code | Context
> header - [internal], line ??
> Controller::header() - CORE\cake\libs\controller\controller.php, line
> 746
> Controller::redirect() - CORE\cake\libs\controller\controller.php,
> line 725
> ContratosController::add() - APP\controllers\contratos_controller.php,
> line 22
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
>
> a ação de deletar n funciona de jeito nenhum e está retornando este
> erro
>
> Warning (2): Missing argument 1 for ContratosController::delete() [APP
> \controllers\contratos_controller.php, line 27]
> Code
>}
>
>function delete($id) {
>
> ContratosController::delete() - APP\controllers
> \contratos_controller.php, line 27
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
> Notice (8): Undefined variable: id [APP\controllers
> \contratos_controller.php, line 28]
> Code
>
>function delete($id) {
>$this->Contrato->delete($id);
>
> ContratosController::delete() - APP\controllers
> \contratos_controller.php, line 28
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
> Notice (8): Undefined variable: id [APP\controllers
> \contratos_controller.php, line 29]
> Code
>function delete($id) {
>$this->Contrato->delete($id);
>$this->Session->setFlash('Contrato de No.: ' . $id . ' foi
> excluido.');
>
> ContratosController::delete() - APP\controllers
> \contratos_controller.php, line 29
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
>
> Warning (2): Cannot modify header information - headers already sent
> by (output started at D:\servidor\xampp\htdocs\cacex\app\controllers
> \contratos_controller.php:2) [CORE\cake\libs\controller
> \controller.php, line 746]
> Code | Context
>
> $status =   "Location: http://localhost/cacex/contratos";
>
> header - [internal], line ??
> Controller::header() - CORE\cake\libs\controller\controller.php, line
> 746
> Controller::redirect() - CORE\cake\libs\controller\controller.php,
> line 725
> ContratosController::delete() - APP\controllers
> \contratos_controller.php, line 30
> Dispatcher::_invoke() - CORE\cake\dispatcher.php, line 204
> Dispatcher::dispatch() - CORE\cake\dispatcher.php, line 171
> [main] - APP\webroot\index.php, line 83
>
> e abaixo segue o meu modelo, controller e view, respectivamente:
>
> 
>  class Contrato extends AppModel {
>var $name = 'Contrato';
>var $validate = array (
>'contrato' => array (
>'rule' => 'notEmpty'
>)
>);
> }
> ?>
>
> 
> 
> class ContratosController extends AppController {
>
>var $name = 'Contratos';
>
>function index() {
>$this->set('contratos',
>$this->Contrato->find('all'));
>}
>
>function view($id = null) {
>$this->Contrato->id = $id;
>$this->set('contrato', $this->Contrato->read());
>}
>
>function add() {
>if (!empty($this->data)) {
>if ($this->Contrato->save($this->data)) {
>$this->Session->setFlash('Contrato adicionado com
> sucesso.');
>$this->redirect(array('action' => 'index'));
>}
>}
>}
>
>function delete($id) {
>$this->Contrato->delete($id);
>$this->Session->setFlash('Contrato de No.: ' . $id . ' foi
> excluido.');
>$this->redirect(array('action' => 'index'));
>}
>
> }
> ?>
>
> 
> 
> 
>
> 
>
>link($contrato['Contrato']['contrato'], "/
> contratos/view/".$contrato['Contrato']['id']); ?>
>
>
> 
> 
>
> 
>
>
>
> 
>   h3>
> link('Excluir', array('action' => 'delete', `id` =>
> $contrato['Contrato']['id']), null, 'Deseja realmente excluir
> contrato?'); ?>
>
>
>
> 
> Adicionando Contrato:
>  echo $form->create('Contrato');
> echo $form->input('contrato');
> echo $form->end('Cadastrar Contato');
> ?>
>
> Sou novo no CakePHP e gostei muito de trabalhar com ele, só que
> empaquei aqui.
>
> Agradeço desde já a ajuda d

Re: Call a method from different controller

2010-09-23 Thread Poliane Brito
Are u serious? GoD! I always did logic in controller and in model only
gets/sets and validation data.
wow, I have to go back to the MVC books o.o

On Tue, Sep 21, 2010 at 5:13 PM, Miles J  wrote:

> No because this is model (business) logic. The controller is only used
> to validation specific data and to set data (from the model) to the
> view.
>
> On Sep 21, 6:55 am, Poliane Brito  wrote:
> > Sorry guys, I'm relative new on CakePHP... but move a certain method to
> > model, isn't hurt MVC rules?
> > Regards...
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Opening a preview window from Page Edit

2010-09-23 Thread WhyNotSmile
Thanks Euromark.  Could you point me to an example of what you mean
and how it works?

I can get the information to appear in a new page, I think, but it
needs to have the layout etc as well.

Thanks,
Sharon



On 22 Sep, 22:33, euromark  wrote:
> i use ajax and display it beneath the form
> with the same technique you can open it in a new window as well
>
> On 22 Sep., 22:56, WhyNotSmile  wrote:
>
> > My site has the usual Page Edit page in the administration area, but
> > I'd like to add a 'Preview' button, which will open the page in a new
> > tab or window.
>
> > I've added 2 buttons:
> >  Submit (the usual one), which saves the data and redirects back to
> > the pages index, and
> >  Preview, which should take the POST data and show the page in a new
> > window, but also leave the original form intact in the original
> > window.
>
> > Is there a way that I can get the Preview action in the controller to
> > render the view in a new window?
>
> > Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin interface templates / themes for CakePHP

2010-09-23 Thread Thrilller
yea i did used

some free templates from
http://www.mostinspired.com/blog/2008/10/11/admin-templates/

with cakephp forms on these looks great





On Sep 23, 4:31 pm, Alex Bovey  wrote:
> Hi all,
>
> Has anyone used any nice admin interface templates with CakePHP?
>
> I'm trying to choose one from this list, but wondering whether anyone
> has done anything similar and done the necessary work to get the
> templates working nicely with Cake?
>
> http://www.ourtuts.com/34-outstanding-admin-panels-for-your-web-appli...
>
> Thanks all,
>
> Alex
>
> --
> Alex Bovey
> Web Developer | Alex Bovey Consultancy Ltd
> Registered in England & Wales no. 6471391 | VAT no. 934 8959 65

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Checkbox not work fine

2010-09-23 Thread MissYeh
2 things:

1) Is the column type in the table set to boolean or tinyint(1)?

2) There is no array with the options passed in for your checkbox:
echo $this->Form->input('field', array('options' => array('option1',
'option2')));

If user_group_id is supposed to be the checkbox then the type is
wrong, which then should be checkbox.

Take a look at this example:
http://book.cakephp.org/view/1390/Automagic-Form-Elements#options-multiple-1395

Hope this solves your issue, let us know! :)

Kana



On Sep 23, 12:26 pm, xamako  wrote:
> Hi!
>
> I have a problem with a checkbox.
>
>  I always get value 0.
>
> My code is this:http://bin.cakephp.org/view/1438225730
>
> Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


How to cache Cake generated XML files?

2010-09-23 Thread MissYeh
Hi,

This is the class I have.

class ThingController extends AppController{

 public $helpers = array('Cache');
 public $cacheAction = array('config' => 36000);

 function config(){

  // code here

 }
}

It seems to work fine caching view files, but not xml files.

This is the file I want to cache.
/views/thing/xml/config.ctp

It is being called like this: http://website.com/thing/config.xml


I have read the cookbook and googled for this but no result.

How do I cache an XML file that is generated by CakePHP?

:)

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Auth component: login does not work anymore

2010-09-23 Thread Joshua Muheim
Yes, it's in the app_controller.php...

On Thu, Sep 23, 2010 at 1:49 PM, Jeremy Burns | Class Outfit
 wrote:
> Have you included the Session component and helper?
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.com
> http://www.classoutfit.com
>
> On 23 Sep 2010, at 12:44, psybear83 wrote:
>
>> Hi everybody
>>
>> After upgrading from 1.2 to 1.3 my login (using the Auth component)
>> doesn't work anymore. I'm trying to find the code where username and
>> password are checked, but I couldn't so far. Anybody can give me a
>> hint?
>>
>> Ah yeah, and the following errors/warnings occur now when trying to
>> log in:
>>
>> Notice (8): Undefined index:  Auth [CORE/cake/libs/controller/
>> components/cookie.php, line 286]
>> Code | Context
>>
>>        }
>>        $names = explode('.', $key, 2);
>>        $this->__values[$names[0]] = Set::remove($this-
>>> __values[$names[0]], $names[1]);
>>
>> $key  =       "Auth.User"
>> $names        =       array(
>>       "Auth",
>>       "User"
>> )
>>
>> CookieComponent::delete() - CORE/cake/libs/controller/components/
>> cookie.php, line 286
>> UsersController::beforeRender() - APP/controllers/
>> users_controller.php, line 225
>> Controller::render() - CORE/cake/libs/controller/controller.php, line
>> 867
>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
>> [main] - APP/webroot/index.php, line 83
>>
>> Warning (2): Cannot modify header information - headers already sent
>> by (output started at /Users/josh/Sites/ziviapps/cake/libs/controller/
>> components/auth.php:722) [CORE/cake/libs/controller/components/
>> cookie.php, line 381]
>> Code | Context
>>
>> $name =       "[Auth][User]"
>>
>> setcookie - [internal], line ??
>> CookieComponent::__delete() - CORE/cake/libs/controller/components/
>> cookie.php, line 381
>> CookieComponent::delete() - CORE/cake/libs/controller/components/
>> cookie.php, line 287
>> UsersController::beforeRender() - APP/controllers/
>> users_controller.php, line 225
>> Controller::render() - CORE/cake/libs/controller/controller.php, line
>> 867
>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
>> [main] - APP/webroot/index.php, line 83
>>
>> Notice (8): Undefined property: UsersController::$pageTitle [APP/
>> controllers/app_controller.php, line 447]
>>
>> Thanks,
>> Josh
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>> with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Admin interface templates / themes for CakePHP

2010-09-23 Thread Mike Karthauser
hi Alex

On Thu, September 23, 2010 12:31 pm, Alex Bovey wrote:
> Hi all,
>
> Has anyone used any nice admin interface templates with CakePHP?
>
> I'm trying to choose one from this list, but wondering whether anyone
> has done anything similar and done the necessary work to get the
> templates working nicely with Cake?
>
> http://www.ourtuts.com/34-outstanding-admin-panels-for-your-web-applications/

I tend to build admin styles off the back of cake.generic.css which has
improved no end on the recent versions of cake 1.3.*

i'm also using jquery ui themeroller styles for the rest of it as they are
pretty easy to integrate and useful depending on how much ajax you are
using.


-- 
Mike Karthauser
Managing Director - Brightstorm Ltd

Email: mi...@brightstorm.co.uk
Web: http://www.brightstorm.co.uk
Tel:  07939 252144 (mobile)
Fax: 0870 1320560

Address: 1 Brewery Court, North Street, Bristol, BS3 1JS

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Auth component: login does not work anymore

2010-09-23 Thread Jeremy Burns | Class Outfit
Have you included the Session component and helper?

Jeremy Burns
Class Outfit

jeremybu...@classoutfit.com
http://www.classoutfit.com

On 23 Sep 2010, at 12:44, psybear83 wrote:

> Hi everybody
> 
> After upgrading from 1.2 to 1.3 my login (using the Auth component)
> doesn't work anymore. I'm trying to find the code where username and
> password are checked, but I couldn't so far. Anybody can give me a
> hint?
> 
> Ah yeah, and the following errors/warnings occur now when trying to
> log in:
> 
> Notice (8): Undefined index:  Auth [CORE/cake/libs/controller/
> components/cookie.php, line 286]
> Code | Context
> 
>}
>$names = explode('.', $key, 2);
>$this->__values[$names[0]] = Set::remove($this-
>> __values[$names[0]], $names[1]);
> 
> $key  =   "Auth.User"
> $names=   array(
>   "Auth",
>   "User"
> )
> 
> CookieComponent::delete() - CORE/cake/libs/controller/components/
> cookie.php, line 286
> UsersController::beforeRender() - APP/controllers/
> users_controller.php, line 225
> Controller::render() - CORE/cake/libs/controller/controller.php, line
> 867
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> [main] - APP/webroot/index.php, line 83
> 
> Warning (2): Cannot modify header information - headers already sent
> by (output started at /Users/josh/Sites/ziviapps/cake/libs/controller/
> components/auth.php:722) [CORE/cake/libs/controller/components/
> cookie.php, line 381]
> Code | Context
> 
> $name =   "[Auth][User]"
> 
> setcookie - [internal], line ??
> CookieComponent::__delete() - CORE/cake/libs/controller/components/
> cookie.php, line 381
> CookieComponent::delete() - CORE/cake/libs/controller/components/
> cookie.php, line 287
> UsersController::beforeRender() - APP/controllers/
> users_controller.php, line 225
> Controller::render() - CORE/cake/libs/controller/controller.php, line
> 867
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> [main] - APP/webroot/index.php, line 83
> 
> Notice (8): Undefined property: UsersController::$pageTitle [APP/
> controllers/app_controller.php, line 447]
> 
> Thanks,
> Josh
> 
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
> 
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread Joshua Muheim
What a luck that weekend is coming soon...!

On Thu, Sep 23, 2010 at 12:40 PM, j.blotus  wrote:
> I think you have used up your question quota for the week. I would
> recommend spending some time learning how to debug basic php errors
> before going any further in your work.
>
> On Sep 23, 3:48 am, Joshua Muheim  wrote:
>> Another thing: now it tells me that $cakeDebug is not defined:
>>
>> Notice (8): Undefined variable: cakeDebug
>> [APP/views/layouts/default.ctp, line 124]
>>
>> I guess the solution is quite easy, again, but I just don't find it...
>>
>>
>>
>> On Thu, Sep 23, 2010 at 9:38 AM, Joshua Muheim  wrote:
>> > Thanks guys!
>>
>> > On Wed, Sep 22, 2010 at 5:49 PM, j.blotus  wrote:
>> >>http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>>
>> >> Session is no longer included by default. You have to put it into your
>> >> helpers/components array.
>>
>> >> On Sep 22, 11:16 am, psybear83  wrote:
>> >>> Hi everybody
>>
>> >>> I'm upgrading to v1.3 and have some problems I couldn't figure out
>> >>> yet...
>>
>> >>> In my layouts/default.ctp I have the following code:
>>
>> >>>                         > >>>                         if ($session->check('Message.flash')) {
>> >>>                                 $session->flash();
>> >>>                         }
>> >>>                         if ($session->check('Message.auth')) {
>> >>>                                 $session->flash('auth');
>> >>>                         }
>> >>>                         ?>
>>
>> >>> Sadly this raises the following error:
>>
>> >>> Notice (8): Undefined variable: session [APP/views/layouts/
>> >>> default.ctp, line 103]
>> >>> include - APP/views/layouts/default.ctp, line 103
>> >>> View::_render() - CORE/cake/libs/view/view.php, line 723
>> >>> View::renderLayout() - CORE/cake/libs/view/view.php, line 482
>> >>> View::render() - CORE/cake/libs/view/view.php, line 428
>> >>> Controller::render() - CORE/cake/libs/controller/controller.php, line
>> >>> 913
>> >>> AppController::__renderIndex() - APP/controllers/app_controller.php,
>> >>> line 602
>> >>> AppController::index() - APP/controllers/app_controller.php, line 545
>> >>> ApplicationsController::index() - APP/controllers/
>> >>> applications_controller.php, line 18
>> >>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
>> >>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
>> >>> [main] - APP/webroot/index.php, line 83
>>
>> >>> Fatal error: Call to a member function check() on a non-object in /
>> >>> Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103
>>
>> >>> Anyone knows why $session is not available here?
>>
>> >>> Thanks,
>> >>> Josh
>>
>> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
>> >> with their CakePHP related questions.
>>
>> >> 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+unsubscr...@googlegroups.com For more options, visit this group 
>> >> athttp://groups.google.com/group/cake-php?hl=en
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


1.2 to 1.3: Auth component: login does not work anymore

2010-09-23 Thread psybear83
Hi everybody

After upgrading from 1.2 to 1.3 my login (using the Auth component)
doesn't work anymore. I'm trying to find the code where username and
password are checked, but I couldn't so far. Anybody can give me a
hint?

Ah yeah, and the following errors/warnings occur now when trying to
log in:

Notice (8): Undefined index:  Auth [CORE/cake/libs/controller/
components/cookie.php, line 286]
Code | Context

}
$names = explode('.', $key, 2);
$this->__values[$names[0]] = Set::remove($this-
>__values[$names[0]], $names[1]);

$key=   "Auth.User"
$names  =   array(
"Auth",
"User"
)

CookieComponent::delete() - CORE/cake/libs/controller/components/
cookie.php, line 286
UsersController::beforeRender() - APP/controllers/
users_controller.php, line 225
Controller::render() - CORE/cake/libs/controller/controller.php, line
867
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 83

Warning (2): Cannot modify header information - headers already sent
by (output started at /Users/josh/Sites/ziviapps/cake/libs/controller/
components/auth.php:722) [CORE/cake/libs/controller/components/
cookie.php, line 381]
Code | Context

$name   =   "[Auth][User]"

setcookie - [internal], line ??
CookieComponent::__delete() - CORE/cake/libs/controller/components/
cookie.php, line 381
CookieComponent::delete() - CORE/cake/libs/controller/components/
cookie.php, line 287
UsersController::beforeRender() - APP/controllers/
users_controller.php, line 225
Controller::render() - CORE/cake/libs/controller/controller.php, line
867
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 207
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 83

Notice (8): Undefined property: UsersController::$pageTitle [APP/
controllers/app_controller.php, line 447]

Thanks,
Josh

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Admin interface templates / themes for CakePHP

2010-09-23 Thread Alex Bovey
Hi all,

Has anyone used any nice admin interface templates with CakePHP?

I'm trying to choose one from this list, but wondering whether anyone
has done anything similar and done the necessary work to get the
templates working nicely with Cake?

http://www.ourtuts.com/34-outstanding-admin-panels-for-your-web-applications/

Thanks all,

Alex

-- 
Alex Bovey
Web Developer | Alex Bovey Consultancy Ltd
Registered in England & Wales no. 6471391 | VAT no. 934 8959 65

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Checkbox not work fine

2010-09-23 Thread xamako
Hi!

I have a problem with a checkbox.

 I always get value 0.

My code is this: http://bin.cakephp.org/view/1438225730

Thanks

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread j.blotus
I think you have used up your question quota for the week. I would
recommend spending some time learning how to debug basic php errors
before going any further in your work.

On Sep 23, 3:48 am, Joshua Muheim  wrote:
> Another thing: now it tells me that $cakeDebug is not defined:
>
> Notice (8): Undefined variable: cakeDebug
> [APP/views/layouts/default.ctp, line 124]
>
> I guess the solution is quite easy, again, but I just don't find it...
>
>
>
> On Thu, Sep 23, 2010 at 9:38 AM, Joshua Muheim  wrote:
> > Thanks guys!
>
> > On Wed, Sep 22, 2010 at 5:49 PM, j.blotus  wrote:
> >>http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>
> >> Session is no longer included by default. You have to put it into your
> >> helpers/components array.
>
> >> On Sep 22, 11:16 am, psybear83  wrote:
> >>> Hi everybody
>
> >>> I'm upgrading to v1.3 and have some problems I couldn't figure out
> >>> yet...
>
> >>> In my layouts/default.ctp I have the following code:
>
> >>>                          >>>                         if ($session->check('Message.flash')) {
> >>>                                 $session->flash();
> >>>                         }
> >>>                         if ($session->check('Message.auth')) {
> >>>                                 $session->flash('auth');
> >>>                         }
> >>>                         ?>
>
> >>> Sadly this raises the following error:
>
> >>> Notice (8): Undefined variable: session [APP/views/layouts/
> >>> default.ctp, line 103]
> >>> include - APP/views/layouts/default.ctp, line 103
> >>> View::_render() - CORE/cake/libs/view/view.php, line 723
> >>> View::renderLayout() - CORE/cake/libs/view/view.php, line 482
> >>> View::render() - CORE/cake/libs/view/view.php, line 428
> >>> Controller::render() - CORE/cake/libs/controller/controller.php, line
> >>> 913
> >>> AppController::__renderIndex() - APP/controllers/app_controller.php,
> >>> line 602
> >>> AppController::index() - APP/controllers/app_controller.php, line 545
> >>> ApplicationsController::index() - APP/controllers/
> >>> applications_controller.php, line 18
> >>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
> >>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> >>> [main] - APP/webroot/index.php, line 83
>
> >>> Fatal error: Call to a member function check() on a non-object in /
> >>> Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103
>
> >>> Anyone knows why $session is not available here?
>
> >>> Thanks,
> >>> Josh
>
> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others 
> >> with their CakePHP related questions.
>
> >> 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+unsubscr...@googlegroups.com For more options, visit this group 
> >> athttp://groups.google.com/group/cake-php?hl=en

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Complex Images Route

2010-09-23 Thread Vivi Vivi
maybe this help you
http://bakery.cakephp.org/articles/view/cakephp-s-routing-explained


On Thu, Sep 23, 2010 at 11:23 AM, Vivi Vivi  wrote:

> No,
> You can mix them and get better results. From my point of view it's much
> easier to put some rules into .htaccess and after treat them into routes.php
>
> But we can made a controller to treat the images.
>
> in route.php add Router::connect("/img/*", array('controller' => 'image',
> 'action'=>'some action'));
>
> And in the controller make what you want. The controller is called only if
> the image doesn't exist.
>
>
>
> On Thu, Sep 23, 2010 at 10:16 AM, Kyle Decot  wrote:
>
>> Probably but then wouldn't that kind of defeat the purpose of using
>> Cake?
>>
>> On Sep 23, 1:34 am, Vivi Vivi  wrote:
>> > Maybe can be done within htaccess with rewrite rule.
>> >
>> >
>> >
>> >
>> >
>> > On Thu, Sep 23, 2010 at 8:28 AM, Kyle Decot 
>> wrote:
>> > > I've tried the following w/ no success
>> >
>> > > Router::connect('/:model/:size\_:filename.:extension',
>> > > array('controller' => 'images', 'action' => 'server'),array(
>> > >'model'=>'(blog|event|users)+',
>> > >'size'=>'(t|m|l|o){1,1}',
>> > >'filename'=>'[a-zA-Z0-9]+',
>> > >'extension'=>'.(gif|png|jpg){3,3}',
>> > >));
>> >
>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
>> others
>> > > with their CakePHP related questions.
>> >
>> > > 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+unsubscr...@googlegroups.com
>> For more options, visit this
>> group at
>> > >http://groups.google.com/group/cake-php?hl=en
>> >
>> > --
>> > Vivihttp://photos.vr-3d.net
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help
>> others with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.comFor
>>  more options, visit this group at
>> http://groups.google.com/group/cake-php?hl=en
>>
>
>
>
> --
> Vivi
> http://photos.vr-3d.net
>



-- 
Vivi
http://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Complex Images Route

2010-09-23 Thread Vivi Vivi
No,
You can mix them and get better results. From my point of view it's much
easier to put some rules into .htaccess and after treat them into routes.php

But we can made a controller to treat the images.

in route.php add Router::connect("/img/*", array('controller' => 'image',
'action'=>'some action'));

And in the controller make what you want. The controller is called only if
the image doesn't exist.


On Thu, Sep 23, 2010 at 10:16 AM, Kyle Decot  wrote:

> Probably but then wouldn't that kind of defeat the purpose of using
> Cake?
>
> On Sep 23, 1:34 am, Vivi Vivi  wrote:
> > Maybe can be done within htaccess with rewrite rule.
> >
> >
> >
> >
> >
> > On Thu, Sep 23, 2010 at 8:28 AM, Kyle Decot 
> wrote:
> > > I've tried the following w/ no success
> >
> > > Router::connect('/:model/:size\_:filename.:extension',
> > > array('controller' => 'images', 'action' => 'server'),array(
> > >'model'=>'(blog|event|users)+',
> > >'size'=>'(t|m|l|o){1,1}',
> > >'filename'=>'[a-zA-Z0-9]+',
> > >'extension'=>'.(gif|png|jpg){3,3}',
> > >));
> >
> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help
> others
> > > with their CakePHP related questions.
> >
> > > 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+unsubscr...@googlegroups.com
> For more options, visit this
> group at
> > >http://groups.google.com/group/cake-php?hl=en
> >
> > --
> > Vivihttp://photos.vr-3d.net
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Vivi
http://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread Joshua Muheim
Oh, yeah, found it now... ;-)

http://nuts-and-bolts-of-cakephp.com/2009/12/22/bye-bye-cakedebug/

On Thu, Sep 23, 2010 at 9:48 AM, Joshua Muheim  wrote:
> Another thing: now it tells me that $cakeDebug is not defined:
>
> Notice (8): Undefined variable: cakeDebug
> [APP/views/layouts/default.ctp, line 124]
>
> I guess the solution is quite easy, again, but I just don't find it...
>
> On Thu, Sep 23, 2010 at 9:38 AM, Joshua Muheim  wrote:
>> Thanks guys!
>>
>> On Wed, Sep 22, 2010 at 5:49 PM, j.blotus  wrote:
>>> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>>>
>>> Session is no longer included by default. You have to put it into your
>>> helpers/components array.
>>>
>>>
>>> On Sep 22, 11:16 am, psybear83  wrote:
 Hi everybody

 I'm upgrading to v1.3 and have some problems I couldn't figure out
 yet...

 In my layouts/default.ctp I have the following code:

                         >>>                         if ($session->check('Message.flash')) {
                                 $session->flash();
                         }
                         if ($session->check('Message.auth')) {
                                 $session->flash('auth');
                         }
                         ?>

 Sadly this raises the following error:

 Notice (8): Undefined variable: session [APP/views/layouts/
 default.ctp, line 103]
 include - APP/views/layouts/default.ctp, line 103
 View::_render() - CORE/cake/libs/view/view.php, line 723
 View::renderLayout() - CORE/cake/libs/view/view.php, line 482
 View::render() - CORE/cake/libs/view/view.php, line 428
 Controller::render() - CORE/cake/libs/controller/controller.php, line
 913
 AppController::__renderIndex() - APP/controllers/app_controller.php,
 line 602
 AppController::index() - APP/controllers/app_controller.php, line 545
 ApplicationsController::index() - APP/controllers/
 applications_controller.php, line 18
 Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
 Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
 [main] - APP/webroot/index.php, line 83

 Fatal error: Call to a member function check() on a non-object in /
 Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103

 Anyone knows why $session is not available here?

 Thanks,
 Josh
>>>
>>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>>> with their CakePHP related questions.
>>>
>>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>>> http://groups.google.com/group/cake-php?hl=en
>>>
>>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread Joshua Muheim
Another thing: now it tells me that $cakeDebug is not defined:

Notice (8): Undefined variable: cakeDebug
[APP/views/layouts/default.ctp, line 124]

I guess the solution is quite easy, again, but I just don't find it...

On Thu, Sep 23, 2010 at 9:38 AM, Joshua Muheim  wrote:
> Thanks guys!
>
> On Wed, Sep 22, 2010 at 5:49 PM, j.blotus  wrote:
>> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>>
>> Session is no longer included by default. You have to put it into your
>> helpers/components array.
>>
>>
>> On Sep 22, 11:16 am, psybear83  wrote:
>>> Hi everybody
>>>
>>> I'm upgrading to v1.3 and have some problems I couldn't figure out
>>> yet...
>>>
>>> In my layouts/default.ctp I have the following code:
>>>
>>>                         >>                         if ($session->check('Message.flash')) {
>>>                                 $session->flash();
>>>                         }
>>>                         if ($session->check('Message.auth')) {
>>>                                 $session->flash('auth');
>>>                         }
>>>                         ?>
>>>
>>> Sadly this raises the following error:
>>>
>>> Notice (8): Undefined variable: session [APP/views/layouts/
>>> default.ctp, line 103]
>>> include - APP/views/layouts/default.ctp, line 103
>>> View::_render() - CORE/cake/libs/view/view.php, line 723
>>> View::renderLayout() - CORE/cake/libs/view/view.php, line 482
>>> View::render() - CORE/cake/libs/view/view.php, line 428
>>> Controller::render() - CORE/cake/libs/controller/controller.php, line
>>> 913
>>> AppController::__renderIndex() - APP/controllers/app_controller.php,
>>> line 602
>>> AppController::index() - APP/controllers/app_controller.php, line 545
>>> ApplicationsController::index() - APP/controllers/
>>> applications_controller.php, line 18
>>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
>>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
>>> [main] - APP/webroot/index.php, line 83
>>>
>>> Fatal error: Call to a member function check() on a non-object in /
>>> Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103
>>>
>>> Anyone knows why $session is not available here?
>>>
>>> Thanks,
>>> Josh
>>
>> Check out the new CakePHP Questions site http://cakeqs.org and help others 
>> with their CakePHP related questions.
>>
>> 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+unsubscr...@googlegroups.com For more options, visit this group at 
>> http://groups.google.com/group/cake-php?hl=en
>>
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: 1.2 to 1.3: Notice (8): Undefined variable: session [APP/views/layouts/default.ctp, line 103]

2010-09-23 Thread Joshua Muheim
Thanks guys!

On Wed, Sep 22, 2010 at 5:49 PM, j.blotus  wrote:
> http://book.cakephp.org/view/1561/Migrating-from-CakePHP-1-2-to-1-3
>
> Session is no longer included by default. You have to put it into your
> helpers/components array.
>
>
> On Sep 22, 11:16 am, psybear83  wrote:
>> Hi everybody
>>
>> I'm upgrading to v1.3 and have some problems I couldn't figure out
>> yet...
>>
>> In my layouts/default.ctp I have the following code:
>>
>>                         >                         if ($session->check('Message.flash')) {
>>                                 $session->flash();
>>                         }
>>                         if ($session->check('Message.auth')) {
>>                                 $session->flash('auth');
>>                         }
>>                         ?>
>>
>> Sadly this raises the following error:
>>
>> Notice (8): Undefined variable: session [APP/views/layouts/
>> default.ctp, line 103]
>> include - APP/views/layouts/default.ctp, line 103
>> View::_render() - CORE/cake/libs/view/view.php, line 723
>> View::renderLayout() - CORE/cake/libs/view/view.php, line 482
>> View::render() - CORE/cake/libs/view/view.php, line 428
>> Controller::render() - CORE/cake/libs/controller/controller.php, line
>> 913
>> AppController::__renderIndex() - APP/controllers/app_controller.php,
>> line 602
>> AppController::index() - APP/controllers/app_controller.php, line 545
>> ApplicationsController::index() - APP/controllers/
>> applications_controller.php, line 18
>> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
>> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
>> [main] - APP/webroot/index.php, line 83
>>
>> Fatal error: Call to a member function check() on a non-object in /
>> Users/josh/Sites/ziviapps/app/views/layouts/default.ctp on line 103
>>
>> Anyone knows why $session is not available here?
>>
>> Thanks,
>> Josh
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others 
> with their CakePHP related questions.
>
> 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+unsubscr...@googlegroups.com For more options, visit this group at 
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en


Re: Complex Images Route

2010-09-23 Thread Kyle Decot
Probably but then wouldn't that kind of defeat the purpose of using
Cake?

On Sep 23, 1:34 am, Vivi Vivi  wrote:
> Maybe can be done within htaccess with rewrite rule.
>
>
>
>
>
> On Thu, Sep 23, 2010 at 8:28 AM, Kyle Decot  wrote:
> > I've tried the following w/ no success
>
> > Router::connect('/:model/:size\_:filename.:extension',
> > array('controller' => 'images', 'action' => 'server'),array(
> >                'model'=>'(blog|event|users)+',
> >                'size'=>'(t|m|l|o){1,1}',
> >                'filename'=>'[a-zA-Z0-9]+',
> >                'extension'=>'.(gif|png|jpg){3,3}',
> >                ));
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > 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+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en
>
> --
> Vivihttp://photos.vr-3d.net

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

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+unsubscr...@googlegroups.com For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en