Re: display validation error messages for textarea?

2007-11-08 Thread Radish

maybe instead of

echo $form->textarea('Article.contenu');

use

echo $form->input('Article.contenu', array(
   'type' => 'textarea'
));


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Regex validation question (might be a bug)

2007-06-08 Thread Radish

Oh! that's right! didn't though of that :D
thanks, this is much more versatile.

On Jun 8, 2:37 am, Grant Cox <[EMAIL PROTECTED]> wrote:
> I think you've just got your rule wrong - this looks like the expected
> result to me.  Your test string does have valid characters in it...
>
> Do you want your rule to match strings which only have lowercase,
> numeric, or space characters (no uppercase / other stuff)?  In that
> case you have to indicate the start and end points in your regexp, ie
> '/^[a-z0-9 ]+$/' .


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Regex validation question (might be a bug)

2007-06-07 Thread Radish

Hi all,

i had some problems with the validation mechanism in cake 1.2, so i
went right into the code.
i learned that there is something that don't work as it supposed to
work.

if i have a model with the member

   var $validate = array(
'alias' => array(
array(
'rule'  => '/[a-z0-9 ]+/',
'message'   => 'some error message'
)
)
);

you would assume that it would not accept something like: "FSD fsdf"
but it does!!

i don't only point to the problem but offer solution as well...

in model.php (cake core of course) line ~ 1744
now the code is:

$valid = preg_match($rule, $data[$fieldName]);

it should be something like:

$matches = array();
$valid = preg_match($rule, $data[$fieldName], $matches);
if($valid) {
$valid = strlen($matches[0]) == strlen($data[$fieldName]);
}

even optimized not to calculate string length if we didn't found any
matches :)

and to my question...
what is the expected functionality of the above code?
i'm not sure it's a bug. it all depends on what you expect of you app.
to me, this is the logical approach.
(I didn't find how to add a ticket so help on this issue is most
appreciated as well.)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: File download authorization

2007-03-07 Thread Radish

I think you should make your files hidden or not accessible by web
(with the help of .htaccess) and then make a controller that will
return the file's data (with a new layout of course)
which will return the file's mime and other good headers you like to
send.
the auth code should be on that controller too

i don't know if there are performance issues with this method but it
is a sulotion

On Mar 7, 10:32 am, "Alain Martini" <[EMAIL PROTECTED]> wrote:
> Hello,
> I have created a site that works with the oth authentication. I have a
> "media" directory that contains medias that only authenticated users
> should download.
> I have created a controller wich read the directory (through the
> "Folder" class) and a view that publish the file contents.
> Now, how can i limit the download to the authenticated users only?
>
> Security by hiding the files is no security.
> If i put an .htaccess in the media directoy can stop the downloads but
> for everyone. And i dont want to add an extra .htaccess login
> mechanism.
>
> Maybe someone has already solved that problem and can point me in the
> right direction :-)


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: installation issues

2007-02-27 Thread Radish

hi,

i think you should try using the "base" directive
http://httpd.apache.org/docs/1.3/mod/mod_rewrite.html#RewriteBase

add something like:
RewriteBase   /mysite

On Feb 27, 8:22 pm, "bingo" <[EMAIL PROTECTED]> wrote:
> Hello Bakers,
>
> I have a working version of my website running on my laptop. However,
> now I am trying to get my website running on my hostserver. The
> problem is I cannot change the DocumentRoot.
>
> I tried putting my website on the server with the following
> configuration
>
> mysite
>+ app
>   + webroot
>+ cake
>
> I am able to load the website but cakephp is not able to set webroot
> properlyfor instance when loading an image the webroot is set 
> towww.hostserver.com/img/logo.pnginstead 
> ofwww.hostserver.com/mysite/img/logo.png
>
> I read many post on installation issues but only got more
> confused. ...
>
> Regards,
> bingo


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---



Re: Pulling just name data

2007-02-27 Thread Radish

Try: http://manual.cakephp.org/chapter/models
search the "Retrieving Your Data" section.
it is something to do with $recursive.

On Feb 27, 8:00 pm, "Dave" <[EMAIL PROTECTED]> wrote:
> For the life of me I can't find anywhere how to pull data without all
> the associations. For example, I've set up a DB with the table "tags"
> and it contains an ID and NAME fields only. The HABTM associations get
> pulled. I only want a list of the names of all tags.
>
> $this->Tag->findAll();
>
> pulls all the associated records as well. I just want a list of the
> tag names plopped into an array.
>
> $this->Tag->read();
>
> maybe? I'm lost on this one.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---