Re: Security Risks on gif image upload?

2010-12-02 Thread Ma'moon
You can easily remove the threat by using an image conversion, i use
`convert` to convert my images to a standard image type, the conversion
process changes the physical content of the uploaded file and destroys all
the threat that it might contain while maintaining the valid images if they
were valid from the first place!, its very important to `convert` the images
specially the ones uploaded from your side!

On Fri, Dec 3, 2010 at 6:15 AM, cricket  wrote:

> On Thu, Dec 2, 2010 at 8:25 PM, euromark 
> wrote:
> > Did anyone try this?
> > http://wafful.org/2007/08/04/php-code-in-gif-image-file/
> >
> > I am wondering if miles uploader script or any other uploader plugin
> > is aware of that risk yet.
> > Or how dangerous this actually is for "normal" cake apps.
> >
> > Anyone happen to have such a "bad" image at hand?
> > Drop me a line and I will report back with details.
> >
> > I think  would be a good script to include
>
> I never did look into that further to see if there's something that
> can easily be done to catch those. But I've never been too concerned,
> either. Notice that the code embedded in the image is triggered
> because the file is included inside a PHP script. The only other way
> that I know of to use this exploit is to upload an image named
> something.gif.php. I always check both the extension and file type. If
> there's something I'm missing, though, I'd like to hear more.
>
> 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: Using or not using PHP framework

2010-12-02 Thread Joshua Muheim
I have stopped working without a framework in the background years
ago, and I only can recommend it. There's SO much stuff you don't even
know about that's handled by a good framework in the background (all
sorts of hacking-attempts is taken care of, for example), and with a
good plugin system your application can probably use great blocks of
code you've developed before or somebody else has already developed.

I only know CakePHP in the PHP world, so I'm not up to date what else
is on the market there, but CakePHP really seems to be a good
framework to start with. And what can't hurt, too, is to check out a
framework in another language from time to time... I can only suggest
you check out Ruby on Rails (Ruby), Django (Python) or Seaside
(Smalltalk). You can learn A LOT from such "other worlds". You will be
quite embarassed and feel like you have been "naive" before after
having done it. It's clearly an enlighting... Somehow it can be
compared to taking a virtual drug that opens your consciousness. LSD
for programmers! ;-)

Give it a try, you won't regret it for sure!

On Thu, Dec 2, 2010 at 8:31 PM, huoxito  wrote:
> I worked with standard, procedural php for a year, still do on the
> company unfortunatly. But on the last three months I began to develop
> in cakephp and mvc and it's being great, i'm stunned how far better
> coded my projects can be with cakephp
>
> On 2 dez, 03:20, Jeremy Burns | Class Outfit
>  wrote:
>> I would thoroughly recommend/encourage/endorse making a contribution though. 
>> You'd normally pay for something this good, it'll be profitable for you and 
>> it will help keep it growing.
>>
>> Jeremy Burns
>> Class Outfit
>>
>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>>
>> On 2 Dec 2010, at 06:18, ambati kiran wrote:
>>
>> > no.
>> > Its free of cost. its open source.
>> > cakephp.org is where you can download cakephp and to get good information.
>>
>> > 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


Re: look & feel/ user interface with cakephp

2010-12-02 Thread Jeremy Burns | Class Outfit
Yes. The folders /app/webroot/css contains a generic Cake stylesheet, but 
obviously you don't have to use it. Create your own CSS files in this folder. 
The you include them in your layout using this code within the  tag:

echo $this->Html->css(array('stylesheet1', 'stylesheet2', ...etc...));

Jeremy Burns
Class Outfit

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

On 3 Dec 2010, at 07:34, Raj wrote:

> I am in confusion whether it is possible to customize the look and
> feel of my web application or rather say I would like to develop the
> look and feel myself using HTML/ CSS, while working with cakephp, is
> that possible?
> 
> Thanks in advance..
> 
> 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


look & feel/ user interface with cakephp

2010-12-02 Thread Raj
I am in confusion whether it is possible to customize the look and
feel of my web application or rather say I would like to develop the
look and feel myself using HTML/ CSS, while working with cakephp, is
that possible?

Thanks in advance..

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


Create a Mailbox for clients

2010-12-02 Thread Rez

Hi

I need to create a mailbox (a very simple version of Gmail for example with
inbox, reply, delete, forward etc.) Is there any cakephp code which can help
or I should write it from scratch?
thanks
Reza
-- 
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Create-a-Mailbox-for-clients-tp3290478p3290478.html
Sent from the CakePHP mailing list archive at Nabble.com.

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: UpdateAll strange behaviour

2010-12-02 Thread Bogdan Bursuc
You could also try $this->$ModelTabelA->recursive = -1; before the update

On Thu, Dec 2, 2010 at 6:01 PM, Adrian Arnautu  wrote:
> Hello again,
> I might found a part of the solution - unBindModel
> $ModelTableA->unBindModel(array(
>     'hasMany'   => array('C', 'D')
> ));
> This way the ActiveRecord manages to run only 2 queries, one which takes the
> primary keys and one doing the update itself.
> Close to the truth but not enough for me.
> Is there any other solution? How can I disable that extra query for
> retrieving the PKs?
> Thank you,
> Adrian
>
> On Thu, Dec 2, 2010 at 12:09 PM, Adrian Arnautu 
> wrote:
>>
>> Hi to all,
>> I'm currently encountering some strange behaviour when I'm using updateAll
>> method.
>> I'll explain my database schema
>> Table A
>>  - id as primary key
>>  - b_fk as foreign key to table B
>>  - bar as another field
>> Table B
>>  - id as primary key
>>  - foo as a column
>> Table C
>>  - id as primary key
>>  - a_fk as foreign key to table A
>> Table D
>>  - id as primary key
>>  - a_fk as foreign key to table A
>> As you can see, A has many C's (a C belongs to A), A has many D's (a D
>> belongs to A), an A has one (or none) B
>> I'm running 2 queries (in a transaction, of course)
>> $ModelTableA->updateAll(
>>   array('A.b_fk' => null),
>>   array(
>>     'OR' => array(
>>        'A.b_fk' => $values,
>>        'A.bar'   => $value
>>      )
>>   )
>> );
>> $ModelTableB->deleteAll(
>>   array('B.id' => $ids)
>> );
>> The problem is that updateAll triggers more than one query. First it
>> fetches some rows (from A table based on conditions from updateAll), then
>> all dependecies (from C and D tables) and then runs the update on the A
>> table based on primary keys not on the conditions I specified. The update
>> part is ok, it updates what I want to be updated
>> How can I disable this behavior?
>> I just want an atomic query, I don't want all the mambo-jambo, the C and D
>> tables will be populated heavily, a lookup on them for a simple update
>> action is not my intention.
>> Thank you for your help,
>> Adrian
>
> 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
>



-- 
Thanks,
Bogdan Iulian Bursuc

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: Custom helper in PagesController

2010-12-02 Thread Amit Badkas
Hi,

I think you should use $fxpage in view instead of $Fxpage, same like we use
$html or $form for Html or Form helpers respectively.

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 3, 2010 at 2:56 AM, qua...@gmail.com  wrote:

> I get this error in log:
>
> Undefined property: View::$Fxpage in [...]
>
> On Dec 2, 12:29 pm, "qua...@gmail.com"  wrote:
> > Hi all,
> >
> > I have a custom helper and like to use it in Pages Controller.
> >
> > I copied pages_controller.php to my app and have this line in it:
> >
> > var $helpers = array('Html', 'Session', 'Fxpage');
> >
> > However, the output of the pages stops at the call to any $this->Fxpage
> in the layout file. It just seems as if Pages can't see my
> >
> > helper.
> >
> > I have been stuck at this for hours now. Any advice is greatly
> > appreciated.
> >
> > 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.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: Validation based on another field

2010-12-02 Thread bujanga
For this case, I would do as cricket suggested but what you ask is
possible. Take a look at
http://book.cakephp.org/view/1181/Adding-your-own-Validation-Methods.
Note that "The full record being validated is stored in $this->data
member variable."

Gary

On Thu, Dec 2, 2010 at 2:05 PM, Dave Maharaj  wrote:
> I have a problem I cant seem to get.
>
>
>
> User has Location information (city, state, country) with the option to
> select “Hide my location”.
>
>
>
> So if hide location is selected ( $data[‘private’] => true ) then there is
> no need to enter City, State Country) I hide those fields with jquery on
> selecting the checkbox.
>
>
>
> But if not selected then they must be filled out.
>
>
>
> So how can I force / remove validation for those fields based on what the
> user has selected?
>
>
>
> 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
>

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: Validation based on another field

2010-12-02 Thread Zaky Katalan-Ezra
In the controller Before save set some default value like 'empty' or 'N/A'

On Thu, Dec 2, 2010 at 10:05 PM, Dave Maharaj  wrote:

>  I have a problem I cant seem to get.
>
>
>
> User has Location information (city, state, country) with the option to
> select “Hide my location”.
>
>
>
> So if hide location is selected ( $data[‘private’] => true ) then there is
> no need to enter City, State Country) I hide those fields with jquery on
> selecting the checkbox.
>
>
>
> But if not selected then they must be filled out.
>
>
>
> So how can I force / remove validation for those fields based on what the
> user has selected?
>
>
>
> 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
>



-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

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: Validation based on another field

2010-12-02 Thread Amit Badkas
Hi,

I think you need to use beforeValidate() model callback method to decide
which validation rules to apply, more help at
http://book.cakephp.org/view/1051/beforeValidate

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Dec 3, 2010 at 1:35 AM, Dave Maharaj  wrote:

>  I have a problem I cant seem to get.
>
>
>
> User has Location information (city, state, country) with the option to
> select “Hide my location”.
>
>
>
> So if hide location is selected ( $data[‘private’] => true ) then there is
> no need to enter City, State Country) I hide those fields with jquery on
> selecting the checkbox.
>
>
>
> But if not selected then they must be filled out.
>
>
>
> So how can I force / remove validation for those fields based on what the
> user has selected?
>
>
>
> 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: Validation based on another field

2010-12-02 Thread Dave Maharaj
Yes, not to display it on the profile when I say "hide it". I will just go
with collecting it, then they can decide to hide it. Much easier that way
and makes more sense.

Thanks,

DAve

-Original Message-
From: cricket [mailto:zijn.digi...@gmail.com] 
Sent: December-03-10 12:50 AM
To: cake-php@googlegroups.com
Subject: Re: Validation based on another field

On Thu, Dec 2, 2010 at 3:05 PM, Dave Maharaj  wrote:
> I have a problem I cant seem to get.
>
>
>
> User has Location information (city, state, country) with the option to
> select "Hide my location".
>
>
>
> So if hide location is selected ( $data['private'] => true ) then there is
> no need to enter City, State Country) I hide those fields with jquery on
> selecting the checkbox.
>
>
>
> But if not selected then they must be filled out.
>
>
>
> So how can I force / remove validation for those fields based on what the
> user has selected?

By "Hide my location" do you mean, "Don't display this publicly"? I do
the same thing, and also for email address, telephone, etc. but I
still collect the info (maybe not all fields in all cases). If the
field isn't mandatory, then just set required to false.

In any case, you can always check $this->data[$this->alias]['field']
as the data is already set on the model when validation occurs.

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: Validation based on another field

2010-12-02 Thread cricket
On Thu, Dec 2, 2010 at 3:05 PM, Dave Maharaj  wrote:
> I have a problem I cant seem to get.
>
>
>
> User has Location information (city, state, country) with the option to
> select “Hide my location”.
>
>
>
> So if hide location is selected ( $data[‘private’] => true ) then there is
> no need to enter City, State Country) I hide those fields with jquery on
> selecting the checkbox.
>
>
>
> But if not selected then they must be filled out.
>
>
>
> So how can I force / remove validation for those fields based on what the
> user has selected?

By "Hide my location" do you mean, "Don't display this publicly"? I do
the same thing, and also for email address, telephone, etc. but I
still collect the info (maybe not all fields in all cases). If the
field isn't mandatory, then just set required to false.

In any case, you can always check $this->data[$this->alias]['field']
as the data is already set on the model when validation occurs.

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: Security Risks on gif image upload?

2010-12-02 Thread cricket
On Thu, Dec 2, 2010 at 8:25 PM, euromark  wrote:
> Did anyone try this?
> http://wafful.org/2007/08/04/php-code-in-gif-image-file/
>
> I am wondering if miles uploader script or any other uploader plugin
> is aware of that risk yet.
> Or how dangerous this actually is for "normal" cake apps.
>
> Anyone happen to have such a "bad" image at hand?
> Drop me a line and I will report back with details.
>
> I think  would be a good script to include

I never did look into that further to see if there's something that
can easily be done to catch those. But I've never been too concerned,
either. Notice that the code embedded in the image is triggered
because the file is included inside a PHP script. The only other way
that I know of to use this exploit is to upload an image named
something.gif.php. I always check both the extension and file type. If
there's something I'm missing, though, I'd like to hear more.

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


Security Risks on gif image upload?

2010-12-02 Thread euromark
Did anyone try this?
http://wafful.org/2007/08/04/php-code-in-gif-image-file/

I am wondering if miles uploader script or any other uploader plugin
is aware of that risk yet.
Or how dangerous this actually is for "normal" cake apps.

Anyone happen to have such a "bad" image at hand?
Drop me a line and I will report back with details.

I think  would be a good script to include

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: Custom helper in PagesController

2010-12-02 Thread qua...@gmail.com
I get this error in log:

Undefined property: View::$Fxpage in [...]

On Dec 2, 12:29 pm, "qua...@gmail.com"  wrote:
> Hi all,
>
> I have a custom helper and like to use it in Pages Controller.
>
> I copied pages_controller.php to my app and have this line in it:
>
> var $helpers = array('Html', 'Session', 'Fxpage');
>
> However, the output of the pages stops at the call to any $this->Fxpage in 
> the layout file. It just seems as if Pages can't see my
>
> helper.
>
> I have been stuck at this for hours now. Any advice is greatly
> appreciated.
>
> 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


Custom helper in PagesController

2010-12-02 Thread qua...@gmail.com
Hi all,

I have a custom helper and like to use it in Pages Controller.

I copied pages_controller.php to my app and have this line in it:

var $helpers = array('Html', 'Session', 'Fxpage');

However, the output of the pages stops at the call to any $this-
>Fxpage in the layout file. It just seems as if Pages can't see my
helper.

I have been stuck at this for hours now. Any advice is greatly
appreciated.

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


Validation based on another field

2010-12-02 Thread Dave Maharaj
I have a problem I cant seem to get.

 

User has Location information (city, state, country) with the option to
select "Hide my location".

 

So if hide location is selected ( $data['private'] => true ) then there is
no need to enter City, State Country) I hide those fields with jquery on
selecting the checkbox.

 

But if not selected then they must be filled out.

 

So how can I force / remove validation for those fields based on what the
user has selected?

 

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: Using or not using PHP framework

2010-12-02 Thread huoxito
I worked with standard, procedural php for a year, still do on the
company unfortunatly. But on the last three months I began to develop
in cakephp and mvc and it's being great, i'm stunned how far better
coded my projects can be with cakephp

On 2 dez, 03:20, Jeremy Burns | Class Outfit
 wrote:
> I would thoroughly recommend/encourage/endorse making a contribution though. 
> You'd normally pay for something this good, it'll be profitable for you and 
> it will help keep it growing.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 2 Dec 2010, at 06:18, ambati kiran wrote:
>
> > no.
> > Its free of cost. its open source.
> > cakephp.org is where you can download cakephp and to get good information.
>
> > 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: Use CakePHP in NetBeans IDE 6.8

2010-12-02 Thread Miles J
Netbeans doesn't have CakePHP support, its just an IDE.

I also love how your asking for step by step images on how to do
everything, try to figure it out yourself.

On Dec 2, 5:48 am, Jeremy Burns | Class Outfit
 wrote:
> Sure - I'll drop everything and just knock you up a quick training course.
>
> NetBeans is just a glamourous text editor used for managing the text files 
> that make up CakePHP. It should be fairly elementary for even a novice 
> developer to work it out.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 2 Dec 2010, at 05:07, Seyed Mahmood Hosseini wrote:
>
> > Hello
> > Please Help Me To Use CakePHP  Famework In NetBeans IDE 6.8
> > Please Help Me Step-By-Step ( Training with images )
> > Thanks.
> > Bye.
>
> > Web Site : Http://WwW.NewAge.Ir
> > Mail : i...@newage.ir  &  web@gmail.com
>
> > 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: $scaffold: Display only certain fields to the user (index/view)? --psybear

2010-12-02 Thread Joshua Muheim
Thanks, Mark! I know that it's not supposed to be used in that way,
but I have my reasons why I'm asking it.

I noticed that I can unset keys in the
Controller::viewVars['scaffoldFields'] variable to get what I want.

On Thu, Dec 2, 2010 at 3:28 PM, euromark  wrote:
> in this case use "bake" scripts and customize it then
> scaffold is not supposed to be used in that way
>
> On 2 Dez., 12:50, psybear83  wrote:
>> Hey everybody
>>
>> I guess that's a newbie question, but I didn't find an answer yet...
>> So: is there a way to only show certain fields of a model to the user
>> when on the index or view page?
>>
>> 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: UpdateAll strange behaviour

2010-12-02 Thread Adrian Arnautu
Hello again,

I might found a part of the solution - unBindModel

$ModelTableA->unBindModel(array(
'hasMany'   => array('C', 'D')
));

This way the ActiveRecord manages to run only 2 queries, one which takes the
primary keys and one doing the update itself.
Close to the truth but not enough for me.
Is there any other solution? How can I disable that extra query for
retrieving the PKs?

Thank you,
Adrian


On Thu, Dec 2, 2010 at 12:09 PM, Adrian Arnautu wrote:

> Hi to all,
>
> I'm currently encountering some strange behaviour when I'm using updateAll
> method.
> I'll explain my database schema
>
> Table A
>  - id as primary key
>  - b_fk as foreign key to table B
>  - bar as another field
>
> Table B
>  - id as primary key
>  - foo as a column
>
> Table C
>  - id as primary key
>  - a_fk as foreign key to table A
>
> Table D
>  - id as primary key
>  - a_fk as foreign key to table A
>
> As you can see, A has many C's (a C belongs to A), A has many D's (a D
> belongs to A), an A has one (or none) B
> I'm running 2 queries (in a transaction, of course)
>
> $ModelTableA->updateAll(
>   array('A.b_fk' => null),
>   array(
> 'OR' => array(
>'A.b_fk' => $values,
>'A.bar'   => $value
>  )
>   )
> );
>
> $ModelTableB->deleteAll(
>   array('B.id' => $ids)
> );
>
> The problem is that updateAll triggers more than one query. First it
> fetches some rows (from A table based on conditions from updateAll), then
> all dependecies (from C and D tables) and then runs the update on the A
> table based on primary keys not on the conditions I specified. The update
> part is ok, it updates what I want to be updated
>
> How can I disable this behavior?
> I just want an atomic query, I don't want all the mambo-jambo, the C and D
> tables will be populated heavily, a lookup on them for a simple update
> action is not my intention.
>
> Thank you for your help,
> Adrian
>

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: $scaffold: Display only certain fields to the user (index/view)? --psybear

2010-12-02 Thread euromark
in this case use "bake" scripts and customize it then
scaffold is not supposed to be used in that way

On 2 Dez., 12:50, psybear83  wrote:
> Hey everybody
>
> I guess that's a newbie question, but I didn't find an answer yet...
> So: is there a way to only show certain fields of a model to the user
> when on the index or view page?
>
> 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


Re: Use CakePHP in NetBeans IDE 6.8

2010-12-02 Thread Jeremy Burns | Class Outfit
Sure - I'll drop everything and just knock you up a quick training course.

NetBeans is just a glamourous text editor used for managing the text files that 
make up CakePHP. It should be fairly elementary for even a novice developer to 
work it out.

Jeremy Burns
Class Outfit

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

On 2 Dec 2010, at 05:07, Seyed Mahmood Hosseini wrote:

> Hello
> Please Help Me To Use CakePHP  Famework In NetBeans IDE 6.8
> Please Help Me Step-By-Step ( Training with images )
> Thanks.
> Bye.
> 
> Web Site : Http://WwW.NewAge.Ir
> Mail : i...@newage.ir  &  web@gmail.com
> 
> 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: download file

2010-12-02 Thread Stephen
You may use mime_content_type to get the filetype of a file, this is now
depreciated for later versions of PHP in which it is best to use Fileinfo.

mime_content_type:
http://uk.php.net/manual/en/function.mime-content-type.php

Fileinfo: http://uk.php.net/manual/en/ref.fileinfo.php

Hope this helps

On 1 December 2010 10:57, Miqdad Ali  wrote:

> thank you 4 ur help
>
> but,i don't know which type of file user will upload , so i want to
> download file which user uploaded my be pdf ,doc or any image
>
> 
> Miqdad Ali
> http://www.miqdadali.co.cc
>
>
>
>
> On Tue, Nov 30, 2010 at 2:37 PM, Stephen 
> wrote:
>
>> If you mean you want to your users to be prompted with a download window
>> use readfile, otherwise I don't think I understand the question.
>>
>> Here's something I did for pdf files.
>>
>> http://pastie.org/private/igu2zad2lasz4vjowvdya
>>
>>
>>
>> On 29 November 2010 06:42, Miqdad Ali  wrote:
>>
>>> friends,
>>> I want code for downloading image files in cakephp
>>> 
>>> Miqdad Ali
>>> http://www.miqdadali.co.cc
>>>
>>>
>>>  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
>>>
>>
>>
>>
>> --
>> Kind Regards
>>  Stephen
>>  www.ninjacodermonkey.co.uk
>>
>>
>>  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
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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


Use CakePHP in NetBeans IDE 6.8

2010-12-02 Thread Seyed Mahmood Hosseini
Hello
Please Help Me To Use CakePHP  Famework In NetBeans IDE 6.8
Please Help Me Step-By-Step ( Training with images )
Thanks.
Bye.

Web Site : Http://WwW.NewAge.Ir
Mail : i...@newage.ir  &  web@gmail.com

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: dynamically changing the type in form helper

2010-12-02 Thread John Andersen
You should never change the core code (my earlier message used code
from 1.3.5)! Instead you should debug your own code, to ensure that
what you pass on to the core code is correct, that you haven´t shown
us yet! Please show the debug messages for the values that you pass on
to the core code?
Enjoy,
   John

On Dec 1, 10:17 pm, mochaman  wrote:
> Correction...I shouldn't need to change it to {$type} so I will leave
> it as is.  Please let me know how else I can get this corrected.
>
> Thanks again.  Erik
>
[snip]

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


$scaffold: Display only certain fields to the user (index/view)? --psybear

2010-12-02 Thread psybear83
Hey everybody

I guess that's a newbie question, but I didn't find an answer yet...
So: is there a way to only show certain fields of a model to the user
when on the index or view page?

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


Re: Have my own Controller::var variable that is not overridden by descending AnotherController::var (but merged)? --psybear

2010-12-02 Thread Joshua Muheim
Thanks for pointing me into the right direction! :-)

On Thu, Dec 2, 2010 at 11:56 AM, Amit Badkas  wrote:
> Hi,
> Controller does merging of 'uses', 'helpers' and 'components' only by
> default, please have a look at __mergeVars() method in
> cake/libs/controller/controller.php
> Amit Badkas
> PHP Applications for E-Biz: http://www.sanisoft.com
>
>
> On Thu, Dec 2, 2010 at 3:53 PM, psybear83  wrote:
>>
>> Hey everybody
>>
>> I know that CakePHP applies some magic to inheritance. So when having
>> a class...
>>
>> class AppController extends Controller {
>>  var $uses = array('Model', 'AnotherModel');
>> }
>>
>> ...and then extending another one from it...
>>
>> class AnotherController extends AppController {
>>  var $uses = array('YetAnotherModel');
>> }
>>
>> ...we don't end up with AnotherController::uses being...
>>
>> array('YetAnotherModel')
>>
>> ...(as PHP would normally do it), but with
>>
>> array('Model', 'AnotherModel', 'YetAnotherModel')
>>
>> This is very nice! But I wonder how I can use this magic for my own
>> class variables? E.g. I want AppController::filters to be
>> array('Filter1', 'Filter2') and then for UsersController I want to add
>> 'Filter3', then normally I would have to use the beforeFilter:
>>
>> UsersController extends AppController {
>>  function beforeFilter() {
>>    $this->filters[] = 'Filter3';
>>  }
>> }
>>
>> But this isn't very beautiful, so I'd rather use the CakePHP magic
>> mentioned above. But how could I do this? Is there an easy way to tell
>> CakePHP to treat "filters" the same way as "uses" etc.?
>>
>> Thanks a lot for help
>> 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: Have my own Controller::var variable that is not overridden by descending AnotherController::var (but merged)? --psybear

2010-12-02 Thread Amit Badkas
Hi,

Controller does merging of 'uses', 'helpers' and 'components' only by
default, please have a look at __mergeVars() method in
cake/libs/controller/controller.php

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Thu, Dec 2, 2010 at 3:53 PM, psybear83  wrote:

> Hey everybody
>
> I know that CakePHP applies some magic to inheritance. So when having
> a class...
>
> class AppController extends Controller {
>  var $uses = array('Model', 'AnotherModel');
> }
>
> ...and then extending another one from it...
>
> class AnotherController extends AppController {
>  var $uses = array('YetAnotherModel');
> }
>
> ...we don't end up with AnotherController::uses being...
>
> array('YetAnotherModel')
>
> ...(as PHP would normally do it), but with
>
> array('Model', 'AnotherModel', 'YetAnotherModel')
>
> This is very nice! But I wonder how I can use this magic for my own
> class variables? E.g. I want AppController::filters to be
> array('Filter1', 'Filter2') and then for UsersController I want to add
> 'Filter3', then normally I would have to use the beforeFilter:
>
> UsersController extends AppController {
>  function beforeFilter() {
>$this->filters[] = 'Filter3';
>  }
> }
>
> But this isn't very beautiful, so I'd rather use the CakePHP magic
> mentioned above. But how could I do this? Is there an easy way to tell
> CakePHP to treat "filters" the same way as "uses" etc.?
>
> Thanks a lot for help
> 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.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


Have my own Controller::var variable that is not overridden by descending AnotherController::var (but merged)? --psybear

2010-12-02 Thread psybear83
Hey everybody

I know that CakePHP applies some magic to inheritance. So when having
a class...

class AppController extends Controller {
  var $uses = array('Model', 'AnotherModel');
}

...and then extending another one from it...

class AnotherController extends AppController {
  var $uses = array('YetAnotherModel');
}

...we don't end up with AnotherController::uses being...

array('YetAnotherModel')

...(as PHP would normally do it), but with

array('Model', 'AnotherModel', 'YetAnotherModel')

This is very nice! But I wonder how I can use this magic for my own
class variables? E.g. I want AppController::filters to be
array('Filter1', 'Filter2') and then for UsersController I want to add
'Filter3', then normally I would have to use the beforeFilter:

UsersController extends AppController {
  function beforeFilter() {
$this->filters[] = 'Filter3';
  }
}

But this isn't very beautiful, so I'd rather use the CakePHP magic
mentioned above. But how could I do this? Is there an easy way to tell
CakePHP to treat "filters" the same way as "uses" etc.?

Thanks a lot for help
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


UpdateAll strange behaviour

2010-12-02 Thread Adrian Arnautu
Hi to all,

I'm currently encountering some strange behaviour when I'm using updateAll
method.
I'll explain my database schema

Table A
 - id as primary key
 - b_fk as foreign key to table B
 - bar as another field

Table B
 - id as primary key
 - foo as a column

Table C
 - id as primary key
 - a_fk as foreign key to table A

Table D
 - id as primary key
 - a_fk as foreign key to table A

As you can see, A has many C's (a C belongs to A), A has many D's (a D
belongs to A), an A has one (or none) B
I'm running 2 queries (in a transaction, of course)

$ModelTableA->updateAll(
  array('A.b_fk' => null),
  array(
'OR' => array(
   'A.b_fk' => $values,
   'A.bar'   => $value
 )
  )
);

$ModelTableB->deleteAll(
  array('B.id' => $ids)
);

The problem is that updateAll triggers more than one query. First it fetches
some rows (from A table based on conditions from updateAll), then all
dependecies (from C and D tables) and then runs the update on the A table
based on primary keys not on the conditions I specified. The update part is
ok, it updates what I want to be updated

How can I disable this behavior?
I just want an atomic query, I don't want all the mambo-jambo, the C and D
tables will be populated heavily, a lookup on them for a simple update
action is not my intention.

Thank you for your help,
Adrian

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: Auth set up

2010-12-02 Thread Jeremy Burns | Class Outfit
My bad. I was not returning 'true' from isAuthorized.

Jeremy Burns
Class Outfit

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

On 2 Dec 2010, at 07:48, Jeremy Burns wrote:

> I feel like I ought to know this, but am struggling .
> 
> I am using the Auth component (not Acl). I have an isAuthorized
> function in app_controller and another in my users_controller. The one
> in users fires whenever someone calls an action in the users
> controller; otherwise the one in app_controller is called.
> 
> I have allowed access to the 'create' and 'logout' actions in the
> users_controller.
> 
> Here's my problem: if I allow access to the 'view' action, any user
> can see any user record without being challenged even when not logged
> in. If I leave 'view' out of $this->Auth->allow, no user has access to
> it (not even the currently logged in user). Going to /users/view/1
> simply redirects to the home page (saying I do not have sufficient
> rights). Also, if I don't specifically allow access to 'logout', the
> logout actions fails. I thought this was allowed by default?
> 
> I'm on version 1.3.6  Anyone got any hints?
> 
> Code>>>
> 
> I have this in my app_controller:
> 
>   var $components = array(
>   ...,
>   'Auth' => array(
>   'authorize' => 'controller',
>   'loginError' => 'Your username and/or password are 
> incorrect.
> Please try again.',
>   'authError' => 'You do not have sufficient privileges 
> to view that
> page.',
>   'logoutRedirect' => array(
>   'prefix' => false,
>   'controller' => 'about'
>   )
>   )
>   );
> 
> I have this in my users_controller:
> 
>   function beforeFilter() {
>   parent::beforeFilter();
> 
>   $this->Auth->allow(
>   'create',
>   'logout'
>   );
>   }
> 
>   function isAuthorized() {
> 
>   if (isset($this->params['pass'][0])):
>   if (!$this->Auth->user()):
>   $this->Session->setFlash('You must be logged to 
> view that
> record.', 'default', array('class' => 'no_entry'));
>   $this->redirect($this->Auth->loginAction());
>   else:
>   if ($this->Auth->user('id') == 
> $this->params['pass'][0]):
>   $this->Session->setFlash('Welcome 
> back', 'default',
> array('class' => 'success'));
>   else:
>   $this->Session->setFlash('You do not 
> have permission to view that
> record.', 'default', array('class' => 'no_entry'));
>   $this->redirect('/');
>   endif;
>   endif;
> 
>   else:
>   $this->redirect('/');
>   endif;
>   }
> 
> 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: Console bake - modify templates

2010-12-02 Thread LACH Dalina
Dear Sophy,

Please kindly help me. I would like to set javascript variable to view. Is
that possible?
If yes please guide me.

Dalina

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


cakephp baking both in windows and linux / Ubuntu

2010-12-02 Thread Yasir Arafat Hasib
Hello cakephp learners. I think you will get some cake bake help from the
post

Cake bake in ubuntu
http://arafats.info/cake-bake-in-ubuntu/

Cake bake in windows
http://arafats.info/cake-bake-in-windows/

-- 
Thanks & regards.

Yasir Arafat (Hasib)
Software Engineer
Epsilon Consulting and Development Services (ECDS)
Contact Information:
Cell : +8801816536901
Web: http://arafats.info

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: PHPCake: trouble with Controllers

2010-12-02 Thread Stephen
See the following example.

http://pastie.org/private/l9gabbwtk7m6jdqtv1cq

This is a very basic example, it requires that the table for "profiles"
contains the field 'user_id int (or mediumint).

For more info on relationships go here

http://book.cakephp.org/view/78/Associations-Linking-Models-Together

Hope this helps

On 1 December 2010 20:34, Carachi  wrote:

> Hi Jeremy,
> I have the same problem of bobaso
> But I don't understand How can I do to solve the problem.
>
> How I can edit my model to do it?
>
> Thank you
>
> On Nov 17, 8:31 pm, Jeremy Burns | Class Outfit
>  wrote:
> > The syntax you are using relates to models, not to controllers. So within
> the users_controller you can do:
> >
> > $result = $this->User->Profile->find(...);
> >
> > ...so long as the Profile model is related to the User model.
> >
> > If you want to do the same but from within the User model, you'd do this:
> >
> > $result = $this->Profile->find(...);
> >
> > Jeremy Burns
> > Class Outfit
> >
> > jeremybu...@classoutfit.comhttp://www.classoutfit.com
> >
> > On 17 Nov 2010, at 10:20,bobasowrote:
> >
> >
> >
> >
> >
> >
> >
> > > I'm having some troubles with PHP while working with Controllers.
> > > If i want to create and then use 2 controllers,when using this syntax
> > > it doesn't work:
> >
> > > $this->Controller1->Controller2->find("all"...)
> >
> > > Instead this works:
> >
> > > $this->Controller1->find("all"...)
> >
> > > I was thinking that maybe i need to initialise first the Controller2
> > > in this way:
> >
> > > var $users="Controller2"
> >
> > > and then maybe the first syntax may work,but i'm not sure.Any advice?
> >
> > > Thank you in advance for your help =)
> >
> > > 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 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.comFor
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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: download file

2010-12-02 Thread Stephen
I've never heard of Media Views, that's even better, I will use this
instead.

On 1 December 2010 19:20, cricket  wrote:

> On Wed, Dec 1, 2010 at 5:57 AM, Miqdad Ali wrote:
>
>> thank you 4 ur help
>>
>> but,i don't know which type of file user will upload , so i want to
>> download file which user uploaded my be pdf ,doc or any image
>>
>
> Have a look at MediaView
> http://book.cakephp.org/view/1094/Media-Views
>
>  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
>



-- 
Kind Regards
 Stephen @ NinjaCoderMonkey

 www.ninjacodermonkey.co.uk

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