Re: Filtering on sub table

2008-09-28 Thread Mickael Gentil
I think I was not clear and I apologize or i'm not understanding and i
apologize too :)

In my view, i've some input on top of my list to filter datas helped with
Paginator helper and Filter component.

When i want to filter or sort on a field on 2nd model, i've no problems. But
when i want to filter or sort on a field on 3rd or more model, i don't know
how do that, and all my tests were been without success.

Ex. :
$array['Program']['ProgramBroadcaster']['id']; //No problem with it
$array['Program']['ProgramBroadcaster']['Broadcaster']['name']; //Not
working

Thanks.

Yudao.

On Mon, Sep 29, 2008 at 7:43 AM, glenda guo <[EMAIL PROTECTED]> wrote:

> In this case, you can add filter in models when you  create relation with
> models.
>
> If you don't know how to use the query result in view, you can use print_r
> function to print the results, then you can know how to use it.
> Also , you can reference this page
> http://book.cakephp.org/view/78/Associations-Linking-Models-Together
>
>
>
>
>
>
> On Sun, Sep 28, 2008 at 4:30 PM, Mickael Gentil <[EMAIL PROTECTED]>wrote:
>
>> Ok, but the conditions are for the select and not for filtering dataswich is 
>> the result from this select, no ?
>>
>> And on my view what name for my select i can use ?
>>
>> Because $this->ProgramBroadcaster->Program->ProgramFile->ProgramState is a
>> very deeper relationship.
>>
>> Thanks.
>>
>> Yudao.
>>
>>
>> On Sun, Sep 28, 2008 at 4:19 AM, glenda guo <[EMAIL PROTECTED]> wrote:
>>
>>> $this->set('programStateList', $this->ProgramBroadcaster->
>>> Program->ProgramFile->ProgramState->find('list'));
>>>
>>> You can add condition  in it.
>>>
>>>
>>>
>>>
>>> On Sat, Sep 27, 2008 at 10:43 PM, Mickael Gentil <
>>> [EMAIL PROTECTED]> wrote:
>>>
 Hi all,

 I need some help with a problem.

 This is my controller :

 >>> class ProgramBroadcastersController extends AppController {

 var $name = 'ProgramBroadcasters';
 var $components = array('Filter');

 var $paginate = array(
'limit'=>20,
'page'=>1,
'order'=>'ProgramBroadcaster.created DESC',

 'fields'=>array('id','broadcaster_id','program_id','play_date','delivery_date','case_number','video_tape_number'),
'contain'=>array(
'Broadcaster'=>array('fields'=>array('id','name')),
'Program'=>array(
'ProgramFile'=>array(

 'fields'=>array('id','program_id','program_state_id'),
'ProgramState',

 'User'=>array('fields'=>array('lastname','firstname'))
 )
 )
)
 );

 public function index()
 {
 $this->set('broadcasterList',
 $this->ProgramBroadcaster->Broadcaster->find('list'));
 $this->set('programStateList',
 $this->ProgramBroadcaster->Program->ProgramFile->ProgramState->find('list'));

 $filter = $this->Filter->process($this);
 $this->set('url',$this->Filter->url);
 $this->set('programs', $this->paginate(null, $filter));

 }
 }

 I need to filter datas on ProgramState.id, and i don't know how.

 Thanks a lot.

 Yudao.



>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: controller/view not found (probably apache config problem)

2008-09-28 Thread glenda guo
I met this problem. Because the version of Apache is lower than 2,
.htaccess file has no effect.
This problem was solved when I added  RewriteBase  to .htaccess file. So,
you can try it ...


On Mon, Sep 29, 2008 at 2:51 AM, paragjagdale <[EMAIL PROTECTED]>wrote:

>
> Hi,
> for me this works:
>
> http://www.myserver.com/~myusername/ae/app/webroot/index.php?pages/display/home
>
> but this does not:
> http://www.myserver.com/~myusername/ae/app/pages/display/home
>
> thus none of my controllers work.. the error message I get is:
>
> Not Found
>
> The requested URL /home/users/myusername/public_html/ae/app/webroot/
> index.php was not found on this server.
>
>
> The apache error.log says: File does not exist: /var/www/home
> thats my DocumentRoot
>
> My apache config:
>DocumentRoot /var/www/
>UserDir public_html
>
>
>Options FollowSymLinks
>AllowOverride All
>
>
>Options Indexes FollowSymLinks MultiViews
>AllowOverride None
>Order allow,deny
>allow from all
># This directive allows us to have apache2's default
> start page
># in /apache2-default/, but still have / go to the
> right place
>RedirectMatch ^/$ /apache2-default/
>
>
>
>Options Indexes FollowSymLinks MultiViews
>AllowOverride All
>Order allow,deny
>allow from all
># This directive allows us to have apache2's default
> start page
># in /apache2-default/, but still have / go to the
> right place
>#RedirectMatch ^/$ /apache2-default/
>
>
>
> Thanks
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Filtering on sub table

2008-09-28 Thread glenda guo
In this case, you can add filter in models when you  create relation with
models.

If you don't know how to use the query result in view, you can use print_r
function to print the results, then you can know how to use it.
Also , you can reference this page
http://book.cakephp.org/view/78/Associations-Linking-Models-Together





On Sun, Sep 28, 2008 at 4:30 PM, Mickael Gentil <[EMAIL PROTECTED]>wrote:

> Ok, but the conditions are for the select and not for filtering datas wich
> is the result from this select, no ?
>
> And on my view what name for my select i can use ?
>
> Because $this->ProgramBroadcaster->Program->ProgramFile->ProgramState is a
> very deeper relationship.
>
> Thanks.
>
> Yudao.
>
>
> On Sun, Sep 28, 2008 at 4:19 AM, glenda guo <[EMAIL PROTECTED]> wrote:
>
>> $this->set('programStateList', $this->ProgramBroadcaster->
>> Program->ProgramFile->ProgramState->find('list'));
>>
>> You can add condition  in it.
>>
>>
>>
>>
>> On Sat, Sep 27, 2008 at 10:43 PM, Mickael Gentil <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Hi all,
>>>
>>> I need some help with a problem.
>>>
>>> This is my controller :
>>>
>>> >> class ProgramBroadcastersController extends AppController {
>>>
>>> var $name = 'ProgramBroadcasters';
>>> var $components = array('Filter');
>>>
>>> var $paginate = array(
>>>'limit'=>20,
>>>'page'=>1,
>>>'order'=>'ProgramBroadcaster.created DESC',
>>>
>>> 'fields'=>array('id','broadcaster_id','program_id','play_date','delivery_date','case_number','video_tape_number'),
>>>'contain'=>array(
>>>'Broadcaster'=>array('fields'=>array('id','name')),
>>>'Program'=>array(
>>>'ProgramFile'=>array(
>>>
>>> 'fields'=>array('id','program_id','program_state_id'),
>>>'ProgramState',
>>>
>>> 'User'=>array('fields'=>array('lastname','firstname'))
>>> )
>>> )
>>>)
>>> );
>>>
>>> public function index()
>>> {
>>> $this->set('broadcasterList',
>>> $this->ProgramBroadcaster->Broadcaster->find('list'));
>>> $this->set('programStateList',
>>> $this->ProgramBroadcaster->Program->ProgramFile->ProgramState->find('list'));
>>>
>>> $filter = $this->Filter->process($this);
>>> $this->set('url',$this->Filter->url);
>>> $this->set('programs', $this->paginate(null, $filter));
>>>
>>> }
>>> }
>>>
>>> I need to filter datas on ProgramState.id, and i don't know how.
>>>
>>> Thanks a lot.
>>>
>>> Yudao.
>>>
>>>
>>>
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Any freelance jobs?

2008-09-28 Thread evert0n

Can you send me more details by mail please.

Thank you ;)

On 29 set, 08:19, cem <[EMAIL PROTECTED]> wrote:
> Hi if you can set me an ajax upload (not swf upload ) andwe can agree
> in the proce we can work together .
>
> On 28 Eylül, 11:33, evert0n <[EMAIL PROTECTED]> wrote:
>
> > Hi, guys anyone need a hand for cakephp projects?
>
> > I'm avaliable for any opportunities as freelance.
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Any freelance jobs?

2008-09-28 Thread evert0n

Thank you,

I'll contact you on gtalk

On 29 set, 00:07, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> hi c'mon on gtalk we have frelance team lowcy.com.pl contact with me
> [EMAIL PROTECTED] (gtalk too)
>
> On 28 Wrz, 10:33, evert0n <[EMAIL PROTECTED]> wrote:
>
> > Hi, guys anyone need a hand for cakephp projects?
>
> > I'm avaliable for any opportunities as freelance.
>
>
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: validate alphanumeric

2008-09-28 Thread JadB

add a new method in app_model (if you will use that validation in more
than one model) or in the model itself with the appropriate regex. i
have never played with hungarian chars or anything else than latin
actually, so I can't help more but that should get you on the right
track.

cheers

JadB
http://loudbaking.myeasyscripts.com

On Sep 26, 12:50 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hari,
>
> I would like to use validation with 1.2. I need something like
> alpanumeric, but it seems it does not accept non latin characters. I
> need it for a hungarian site, so I use utf-8. I searched the net, but
> did not find any useful information how to use validation with
> multibyte characters.
>
> Any suggestion?
>
> rrd

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Newbie Question on 'Views' on the Blog Tutorial

2008-09-28 Thread ManMetal

To resolve this issue I use the 1.2xxx and everything worked just
fine...

Jerry

On Sep 28, 12:19 pm, ManMetal <[EMAIL PROTECTED]> wrote:
> Hi There,
> I have been sucessful in configurating CakePHP and I have almost
> finished the Blog Tutorial. When I run the app I get an SQL error
> listed below. It appears there is some kind of error in the 'all LIMIT
> 1" at line 1 that mySQL does not like. I can't find where the SQL is
> located at nor do I know if I should edit it.
>
> Can someone help me to get the proper view or what to do next?
>
> Thanks,
> Jerry
>
> Query: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`,
> `Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` WHERE all
> LIMIT 1
> Warning: SQL 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 'all LIMIT 1' at line 1 in C:\wamp\www\cake\cake
> \libs\model\datasources\dbo_source.php on line 440
> CakePHP Rapid Development
> Blog posts
>
> Warning: Invalid argument supplied for foreach() in C:\wamp\www\cake
> \app\views\posts\index.thtml on line 11
> Id      Title   Created
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: saveAll() not inserting related id pt II

2008-09-28 Thread trustfundbaby

This is on a local machine.

On Sep 26, 4:00 am, Penfold <[EMAIL PROTECTED]> wrote:
> Are you hosting locally or with a web host?
>
> as some hosting providers turn transaction support off, so that can
> cram on more users per server.
>
> On 25 Sep, 18:53, trustfundbaby <[EMAIL PROTECTED]> wrote:
>
> > just took a look and the tables were already in innodb
>
> > On Sep 23, 10:05 am, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > It may work, but it may not work correctly.
> > > MyIsam tables do not support transactions, so there is not point in
> > > doing saveAll() for multiple models.
>
> > > On Sep 23, 5:59 am, trustfundbaby <[EMAIL PROTECTED]> wrote:
>
> > > > So why does it work in PHP5 with myisam tables?
>
> > > > On Sep 23, 4:34 am, Penfold <[EMAIL PROTECTED]> wrote:
>
> > > > > Hi,
>
> > > > > Your table needs to be innodb for the saveall function to work
> > > > > properly.
> > > > > as the auto insert id relies on transactions to work.
>
> > > > > On 23 Sep, 09:29, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
>
> > > > > > Thanks for bumping this, I never really got anywhere close to fixing
> > > > > > this and went back to old loop method.
>
> > > > > > I'll keep an eye on this now.
>
> > > > > > On Sep 23, 6:53 am, trustfundbaby <[EMAIL PROTECTED]> wrote:
>
> > > > > > > Okay ... I'll do that.
>
> > > > > > > On Sep 22, 11:46 pm, teknoid <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > You might want to create a bug report for this.
> > > > > > > > Be sure to include a test case illustrating your problem, and 
> > > > > > > > specify
> > > > > > > > the exact PHP version you are having trouble with.
>
> > > > > > > > Take a look at the existing test cases to see how to write one, 
> > > > > > > > if you
> > > > > > > > haven't done it before.
>
> > > > > > > > On Sep 22, 11:21 pm, trustfundbaby <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > bump?
>
> > > > > > > > > On Sep 22, 10:17 am, trustfundbaby <[EMAIL PROTECTED]> wrote:
>
> > > > > > > > > > Just wanted to follow up on this threadhttp://is.gd/2XoO, 
> > > > > > > > > > because I'm
> > > > > > > > > > having the same exact problem
> > > > > > > > > > I've been trying to figure this one out for the last 5 
> > > > > > > > > > hours (so no
> > > > > > > > > > sleep yet :] ... )
>
> > > > > > > > > > cakephp version: 1.2RC2
> > > > > > > > > > Mysql version: 4.1
>
> > > > > > > > > > PHP version: various (see post)
>
> > > > > > > > > > I have a 'Question' model that hasMany 'Answers' ... and 
> > > > > > > > > > I'm trying to
> > > > > > > > > > use $this->saveAll to save the Question and its possible 
> > > > > > > > > > answers
>
> > > > > > > > > > The data array from my form looks like this
> > > > > > > > > > -
> > > > > > > > > > Array
> > > > > > > > > > (
> > > > > > > > > >     [Question] => Array
> > > > > > > > > >         (
> > > > > > > > > >             [question_type_id] => 1
> > > > > > > > > >             [question] => question time
> > > > > > > > > >             [help_text] =>
> > > > > > > > > >         )
>
> > > > > > > > > >     [Answer] => Array
> > > > > > > > > >         (
> > > > > > > > > >             [1] => Array
> > > > > > > > > >                 (
> > > > > > > > > >                     [answer_text] => answer1
> > > > > > > > > >                 )
> > > > > > > > > >             [2] => Array
> > > > > > > > > >                 (
> > > > > > > > > >                     [answer_text] => answer2
> > > > > > > > > >                 )
> > > > > > > > > >             [3] => Array
> > > > > > > > > >                 (
> > > > > > > > > >                     [answer_text] => answer3
> > > > > > > > > >                 )
> > > > > > > > > >         )
> > > > > > > > > > )
> > > > > > > > > > -
> > > > > > > > > > and my create action in QuestionController looks like this
>
> > > > > > > > > > -
> > > > > > > > > >     function create(){
> > > > > > > > > >         if(!empty($this->data)):
> > > > > > > > > >             $this->Question->create();
> > > > > > > > > >             if($this->Question->saveAll($this->data)):
> > > > > > > > > >                 $this->Session->setFlash('Success', 
> > > > > > > > > > 'default',
> > > > > > > > > > array('class' => 'success'));
> > > > > > > > > >                 #clear out the data*/
> > > > > > > > > >                 //$this->data = array();
> > > > > > > > > >             else:
> > > > > > > > > >                 $this->Session->setFlash('Error');
> > > > > > > > > >             endif;
> > > > > > > > > >         endif;
> > > > > > > > > >     }
> > > > > > > > > > -
>
> > > > > > > > > > But just like in the thread I posted above, the question is 
> > > > > > > > > > inserted
> > > > > > > > > > and the an

controller/view not found (probably apache config problem)

2008-09-28 Thread paragjagdale

Hi,
for me this works:
http://www.myserver.com/~myusername/ae/app/webroot/index.php?pages/display/home

but this does not:
http://www.myserver.com/~myusername/ae/app/pages/display/home

thus none of my controllers work.. the error message I get is:

Not Found

The requested URL /home/users/myusername/public_html/ae/app/webroot/
index.php was not found on this server.


The apache error.log says: File does not exist: /var/www/home
thats my DocumentRoot

My apache config:
DocumentRoot /var/www/
UserDir public_html


Options FollowSymLinks
AllowOverride All


Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
# This directive allows us to have apache2's default
start page
# in /apache2-default/, but still have / go to the
right place
RedirectMatch ^/$ /apache2-default/



Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
# This directive allows us to have apache2's default
start page
# in /apache2-default/, but still have / go to the
right place
#RedirectMatch ^/$ /apache2-default/



Thanks

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



This Router test fails when using named parameters.

2008-09-28 Thread Mathew

I'm trying to create a custom route for my profiles controller located
in plugin. I need to pass the username as a named parameter, but it
doesn't seem to be working for me.

Router::connectNamed(array('username'));
Router::connect('/profiles/:username',
array('plugin'=>'gems','controller'=>'gemsProfiles','action'=>'show'),array('pass'=>array('username')));
$url =
Router::url(array('admin'=>false,'plugin'=>'gems','controller'=>'gemsProfiles','action'=>'show','username'=>'mustan9'));
$this->assertEqual( $url, '/profiles/mustan9' );

This assert fails because $url is "/gems/gemsProfiles/show/
username:mustan9", and as you can see I was expecting "/profiles/
mustan9"

Can anyone see what I've done wrong?

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to validate password length

2008-09-28 Thread jimbo

Hi,

I think the cleanest way to handle this issue is to use model's
beforeSave method to encrypt the plaintext password as this method is
called AFTER validation is done. This way you can maintain your
original validation code and it is more readable and understandable
and you do not have to mess with any view files either.

In your user model, specify the following:

function beforeSave() {
$this->data['User']['password'] = md5($this->data['User']
['password']);
return true;
}

And of course you need the original validation rule for the field
'password'.

Br,
Jani

On Sep 28, 3:05 pm, Smelly_Eddie <[EMAIL PROTECTED]> wrote:
> Mario:
>
> I wrote some code that not only checks for a min. length, but also
> requires a 'strong' password.
>
> This means i make users use at least 1 non-word character and a
> digit.   (ex. pas5_word). And I make them enter it twice!
>
> I use unique error messages to warn when they dont match, and when it
> is an invalid pattern. Helps eliminate user frustration.
>
> I would love to hear your thoughts on it, and i hope it at least gets
> you started if it doesn't meet your needs.
>
> http://edwardawebb.com/programming/php-programming/cakephp/heavy-duty...
>
> Best Regards,
>
> On Sep 27, 7:18 am, mario <[EMAIL PROTECTED]> wrote:
>
> > i already have a 'password2' in my form for password confirmation.
> > Can you please give me an example of what you are referring about?
>
> > Thanks.^_^
>
> > On Sep 27, 3:50 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > > >  >  I want to validate the length of my password using the cakephp 
> > > > model's
> > > >  >  validation. However, since the password is being hashed before it is
> > > >  >  saved on the database, my length validation criteria becomes void. 
> > > > We
> > > >  >  all know that a hashed password contains many characters.
>
> > > > I would make a copy of 'password' before it gets to the Auth
> > > >  component, and add a rule for that instead.
>
> > > hmm, might have been a little hasty there, as you won't have a field
> > > in your form for 'password_plain' and therefore won't ever see the
> > > error message. How about adding an extra field to your form of
> > > 'password_confirm', then adding the rule to that. If the confirmation
> > > fails you'll then see the error message (and you can check they are
> > > the same).
>
> > > hth
>
> > > jon
>
> > > --
>
> > > jon bennett
> > > w:http://www.jben.net/
> > > iChat (AIM): jbendotnet Skype: jon-bennett
>
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Saving user id into ingredients model

2008-09-28 Thread TeeMist

Hi guys I have a ingredient model which has a belongsTo relation to
the user model. No I have a view with an input field for the name of
an Ingredient. I want to add the user id of the logged in user to the
table of the ingredient. I use the Auth for user login. How can I do
this?

I can't find any info in the cookbook and google. Should be quite
simple for the experienced user, I just got started.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to validate password length

2008-09-28 Thread Mathew

Don't call your field "password" on the form, because the Auth
component always hashs posted data that has the field name as
"password".

For my user registration I created two fields called "secret" and
"confirmsecret", and I use this in the validate rules. It doesn't
matter that the secret fields don't exist in the table, but you should
define the validation rules for record creation only by adding
"on"=>"create" to the rule. You can then add minLength to the secret
field.

You then need to call $this->User->validate() before $this->User-
>save(), and if it validates then copy the secret field to password as
a hashed password. I do this in the controller like this.

if($this->data)
{
// Check for data validation
$this->User->set( $this->data );
if($this->User->validates())
{
// Hash the password, and save the new record
$this->data['User']['password'] = 
$this->Auth->password($this-
>data['User']['secret']);
$this->User->set( $this->data );
if($this->User->save())
{
$this->redirect( ... );
}
}
}

You don't need to validate the password field for user log in
attempts. Either the hash will match or it doesn't.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Newbie Question on 'Views' on the Blog Tutorial

2008-09-28 Thread ManMetal

Hi There,
I have been sucessful in configurating CakePHP and I have almost
finished the Blog Tutorial. When I run the app I get an SQL error
listed below. It appears there is some kind of error in the 'all LIMIT
1" at line 1 that mySQL does not like. I can't find where the SQL is
located at nor do I know if I should edit it.

Can someone help me to get the proper view or what to do next?

Thanks,
Jerry


Query: SELECT `Post`.`id`, `Post`.`title`, `Post`.`body`,
`Post`.`created`, `Post`.`modified` FROM `posts` AS `Post` WHERE all
LIMIT 1
Warning: SQL 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 'all LIMIT 1' at line 1 in C:\wamp\www\cake\cake
\libs\model\datasources\dbo_source.php on line 440
CakePHP Rapid Development
Blog posts

Warning: Invalid argument supplied for foreach() in C:\wamp\www\cake
\app\views\posts\index.thtml on line 11
Id  Title   Created


--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Any freelance jobs?

2008-09-28 Thread cem

Hi if you can set me an ajax upload (not swf upload ) andwe can agree
in the proce we can work together .


On 28 Eylül, 11:33, evert0n <[EMAIL PROTECTED]> wrote:
> Hi, guys anyone need a hand for cakephp projects?
>
> I'm avaliable for any opportunities as freelance.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Upload Iframe ajax

2008-09-28 Thread cem

Hi ;

   i want to use iframe and ajax in my form but it seems really
complicated . Because :

 - What happens if user uploads a file and does not submit the
form the file will be uploaded
 - How can I use an ajax progress bar in cake ? Not swf upload
please I sdont want flash in my site .
 - how can I pass data from form to the iframe because I will need
to record the file path to the database where they belong ?

  has anyone solved any ofthese issues  ?
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: email with link to mydomain.com

2008-09-28 Thread teknoid

FULL_BASE_URL constant contains the name of the host + http(s)://

On Sep 27, 1:16 pm, donnerbeil <[EMAIL PROTECTED]> wrote:
> Hi,
>
> When a user registers on my site, an email with an activation link is
> sent to him. In the email templates I would like to use something like
> echo $html->link('controller'=>'users','action'=>'activate',$key). But
> when this link is shown in the email it links to /users/activate/[key]
>
> How can I tell cakephp, that it has to puthttp://www.mydomain.comin
> front of the url, so that it works when someone clicks on the link in
> the email?
>
> any ideas?
>
> Thanks
>
> Donnerbeil
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: CHAR datatype problem

2008-09-28 Thread Donkeybob

Can cake use this datatype? VARCHAR(36)?

On Sep 27, 6:37 pm, Donkeybob <[EMAIL PROTECTED]> wrote:
> I'm using a CHAR(36) for my id fields and my dev machine is fine with
> that but when I move the table to the host server, the CHAR get
> changed to a VARCHAR. What do I do with the automatic ID creation for
> CHAR datatypes?
>
> Rich
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Any freelance jobs?

2008-09-28 Thread [EMAIL PROTECTED]

hi c'mon on gtalk we have frelance team lowcy.com.pl contact with me
[EMAIL PROTECTED] (gtalk too)

On 28 Wrz, 10:33, evert0n <[EMAIL PROTECTED]> wrote:
> Hi, guys anyone need a hand for cakephp projects?
>
> I'm avaliable for any opportunities as freelance.
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: email with link to mydomain.com

2008-09-28 Thread Sam Sherlock
"http://www.mydomain.com"; .
$html->link('controller'=>'users','action'=>'activate',$key).

2008/9/27 donnerbeil <[EMAIL PROTECTED]>

>
> Hi,
>
> When a user registers on my site, an email with an activation link is
> sent to him. In the email templates I would like to use something like
> echo $html->link('controller'=>'users','action'=>'activate',$key). But
> when this link is shown in the email it links to /users/activate/[key]
>
> How can I tell cakephp, that it has to put http://www.mydomain.com in
> front of the url, so that it works when someone clicks on the link in
> the email?
>
> any ideas?
>
> Thanks
>
> Donnerbeil
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Recursive Model association

2008-09-28 Thread [EMAIL PROTECTED]

Hey Bakers,

what is wrong in this association ? I can't get the recursive Relation
running.
I need the location name for routing the image.

It should be stored in. But is doesn'exists.
$data[Picture][Gallery][Location][location_name]

Here is the code:

 array('className' =>
'Location','foreignKey' => 'location_id'));
var $hasMany = array('Pictures' => array('className' =>
'Picture','foreignKey' => 'gallery_id','dependent' => false));
}

class Location extends AppModel {
var $name = 'Location';
var $hasMany = array('Gallery' => array('className' =>
'Gallery','foreignKey' => 'location_id','dependent' => false));
}

class Picture extends AppModel {
var $name = 'Picture';
var $belongsTo = array(
'Gallery' => array('className' => 
'Gallery','foreignKey' =>
'gallery_id'),
'User' => array('className' => 'User','foreignKey' => 
'user_id')
);
}

#Controller Action:
$this->Picture->findbyid($id);

?>

Regards
Markus
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Fatal error: Class 'Dispatcher' not found - please help

2008-09-28 Thread 3lancer.eu

> just clear your app/tmp/cache folder.always worked for me

I did, but it didn't set proper paths anyway, setting include_path did
it.

Regards,
Piotr
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: How to validate password length

2008-09-28 Thread Smelly_Eddie

Mario:

I wrote some code that not only checks for a min. length, but also
requires a 'strong' password.

This means i make users use at least 1 non-word character and a
digit.   (ex. pas5_word). And I make them enter it twice!

I use unique error messages to warn when they dont match, and when it
is an invalid pattern. Helps eliminate user frustration.

I would love to hear your thoughts on it, and i hope it at least gets
you started if it doesn't meet your needs.

http://edwardawebb.com/programming/php-programming/cakephp/heavy-duty-password-validation-cakephp


Best Regards,



On Sep 27, 7:18 am, mario <[EMAIL PROTECTED]> wrote:
> i already have a 'password2' in my form for password confirmation.
> Can you please give me an example of what you are referring about?
>
> Thanks.^_^
>
> On Sep 27, 3:50 am, "Jon Bennett" <[EMAIL PROTECTED]> wrote:
>
> > >  >  I want to validate the length of my password using the cakephp model's
> > >  >  validation. However, since the password is being hashed before it is
> > >  >  saved on the database, my length validation criteria becomes void. We
> > >  >  all know that a hashed password contains many characters.
>
> > > I would make a copy of 'password' before it gets to the Auth
> > >  component, and add a rule for that instead.
>
> > hmm, might have been a little hasty there, as you won't have a field
> > in your form for 'password_plain' and therefore won't ever see the
> > error message. How about adding an extra field to your form of
> > 'password_confirm', then adding the rule to that. If the confirmation
> > fails you'll then see the error message (and you can check they are
> > the same).
>
> > hth
>
> > jon
>
> > --
>
> > jon bennett
> > w:http://www.jben.net/
> > iChat (AIM): jbendotnet Skype: jon-bennett
--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



getting edit view of HABTM

2008-09-28 Thread jojiju

hi all,
I have  tables employees and accreditations and join table called
employees_accreditations. now I want to build the edit form which
should populate the information both from employees and
accreditations. its driving me crazy please help.






create('EmployeesAccreditation');
echo 
$form->input('id',array('type'=>'hidden'));
echo $form->input('card_no');
echo 
$form->input('card_expiry_date',array('type'=>'text'));
echo $form->input('first_name');
echo $form->input('surname');
echo $form->input('date_of_birth');
echo $form->input('street_no_and_name');
echo $form->input('suburb');
echo $form->input('state');
echo $form->input('post_code');
echo $form->input('telephone_number');
echo $form->input('mobile_number');
echo 
$form->input('driving_license_number');
echo $form->input('position_title');
echo 
$form->input('employer_company_name');
echo 
$form->input('employer_contact_person_name');
echo 
$form->input('employer_department');
echo 
$form->input('employer_telephone_number');
echo 
$form->input('employer_mobile_number');
echo 
$form->input('employer_fax_number');
echo 
$form->input('employer_email_address');
echo 
$form->input('employer_street_no_and_name');
echo $form->input('employer_po_box');
echo $form->input('employer_suburb');
echo $form->input('employer_state');
echo $form->input('employer_post_code');
echo 
$form->input('allergy_description');
echo $form->input('sub_category',
array('type'=>'select','options'=>array('M'=>'M')));?>

input('Accreditation.accreditation_id',
array('type'=>'select','options'=>$accreditationList,'selected' =>
$preferenceaccreditation,'label' => __('Accreditation Name', true)));
echo 
$form->input('Accreditation.certification_number');
echo $form-
>input('Accreditation.issue_date',array('type'=>'text'));
echo $form-
>input('Accreditation.expiry_date',array('type'=>'text'));
echo $form-
>input('Accreditation.due_date_assignments',array('type'=>'text'));
echo $form->submit('Edit');
echo $form->end();
?>




--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Any freelance jobs?

2008-09-28 Thread evert0n

Hi, guys anyone need a hand for cakephp projects?

I'm avaliable for any opportunities as freelance.






--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Filtering on sub table

2008-09-28 Thread Mickael Gentil
Ok, but the conditions are for the select and not for filtering datas wich
is the result from this select, no ?

And on my view what name for my select i can use ?

Because $this->ProgramBroadcaster->Program->ProgramFile->ProgramState is a
very deeper relationship.

Thanks.

Yudao.

On Sun, Sep 28, 2008 at 4:19 AM, glenda guo <[EMAIL PROTECTED]> wrote:

> $this->set('programStateList', $this->ProgramBroadcaster->
> Program->ProgramFile->ProgramState->find('list'));
>
> You can add condition  in it.
>
>
>
>
> On Sat, Sep 27, 2008 at 10:43 PM, Mickael Gentil <[EMAIL PROTECTED]
> > wrote:
>
>> Hi all,
>>
>> I need some help with a problem.
>>
>> This is my controller :
>>
>> > class ProgramBroadcastersController extends AppController {
>>
>> var $name = 'ProgramBroadcasters';
>> var $components = array('Filter');
>>
>> var $paginate = array(
>>'limit'=>20,
>>'page'=>1,
>>'order'=>'ProgramBroadcaster.created DESC',
>>
>> 'fields'=>array('id','broadcaster_id','program_id','play_date','delivery_date','case_number','video_tape_number'),
>>'contain'=>array(
>>'Broadcaster'=>array('fields'=>array('id','name')),
>>'Program'=>array(
>>'ProgramFile'=>array(
>>
>> 'fields'=>array('id','program_id','program_state_id'),
>>'ProgramState',
>>
>> 'User'=>array('fields'=>array('lastname','firstname'))
>> )
>> )
>>)
>> );
>>
>> public function index()
>> {
>> $this->set('broadcasterList',
>> $this->ProgramBroadcaster->Broadcaster->find('list'));
>> $this->set('programStateList',
>> $this->ProgramBroadcaster->Program->ProgramFile->ProgramState->find('list'));
>>
>> $filter = $this->Filter->process($this);
>> $this->set('url',$this->Filter->url);
>> $this->set('programs', $this->paginate(null, $filter));
>>
>> }
>> }
>>
>> I need to filter datas on ProgramState.id, and i don't know how.
>>
>> Thanks a lot.
>>
>> Yudao.
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



May or may not have one relationship

2008-09-28 Thread Novice Programmer
Hello All,

This might be an awkward situation but for my current project i am having a
situation where a table Entity may or not have a user. In the entities table
there is a field which tells me whether there is some user associated with
it or not. I want to handle the situation with cake php so that it tries to
join Entity with User only when that particular field in entity is set. Is
there some out there to help me?

-- 
Thanks & Regards,
Novice.

--~--~-~--~~~---~--~~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---