acl.php 1.1.14 release

2007-04-10 Thread Michael Tuzi

I was having problems running acl.php, so I set it up and stepped
through it yesterday. It was running without providing any results or
errors and I tracked the problem to the one discovered the day before
here:
https://trac.cakephp.org/ticket/2370
Which fixed the problem.

2z


--~--~-~--~~~---~--~~
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: Struggling greatly with validation

2007-04-05 Thread Michael Tuzi

I'm using CakePHP 1.1 and my call from the controller is:

if($this-Model-create()  $this-Model-validates($this-data))

I have also tried:
if($this-Model-create($this-data)  $this-Model-validates())
if($this-Model-validates())

And when I use this in my model:
function beforeValidate()
{
$this-log(model.php: beforeValidate());
$this-log($this-data);
return true;
}

I get this in my log every time:
2007-04-05 11:35:50 Error: model.php: beforeValidate()
2007-04-05 11:35:50 Error: Array
(
)

I checked, and $this-data is full prior to the call to both create()
and validates(). I have tried the call to validates() w/o $this-data
and the check didn't work for anything. That doesn't make sense to me
because the api shows that validates() calls invalidFields() which
assigns $this-data to a local $data variable before it calls
beforeValidate(). The create() unsets $this-data, yet I still get a
correct result when I use $this-data as an argument to validates().
If I skip the call to create(), I can invalidate the fields I want,
but I have to do it in the controller prior to the call to
validates(), because I'm not getting a $this-data in
beforeValidates(). I don't see what I'm doing wrong. Thanks for the
response. I'm starting to feel a bit lonely out here.

2z

On Apr 5, 4:44 am, Dia [EMAIL PROTECTED] wrote:
 in your controller :
 ...
 $this-MyModel-set($this-data);
 if ($this-MyModel-validates()) {
 ...

 or, if using CakePHP 1.2.x.x :
 if ($this-MyModel-create($this-data) and $this-MyModel-

 validates())

 the array shouldn't be empty any more in beforeValidate function


--~--~-~--~~~---~--~~
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: Struggling greatly with validation

2007-04-05 Thread Michael Tuzi

Well, I finally figured out my problem. You told me to $this-Model-
set($this-data), but I missed off the model. What a maroon!!! I just
upgraded my IDE and was stepping through the code. I couldn't figure
out how the model got the data from the controller. Now I do. Anyway,
I asked before about validation without saving, but you were the first
to tell me I needed to call Model-set(). I see that Model-save()
calls set, but Model-validates() doesn't (which is undoubtedly why
you told me to do so). It seems that most of the more experienced here
are using 1.2. I wonder how much my code will have to change with the
newer code? Earlier suggestions I received told me to do if($this-
Model-create($this-data)  $this-Model-validates()), but in 1.1,
$this-Model-creates() doesn't take any parameters and unsets it's
data array, while $this-Model-validates() requires the data array to
be set. I suppose I'll have to call $this-Model-set($this-data)
between the two calls (or modify create to take and use a parameter).
If anyone could suggest where I might want to leave some comments in
my code for future changes, I would be most appreciative.

Thank you very much again,

2z


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Struggling greatly with validation

2007-04-04 Thread Michael Tuzi

I am new to cake and have been working with it for over a month. I'm
trying to do form field validation and I keep running into
difficulties. I have one form that has fields that are not required
for submission, but some of the un-required fields are dependent on
other un-required fields. Because the fields are not required, I
didn't put them in the validate array in the model. I tried to use
beforeValidate in the model:

function beforeValidate() {
if( (isset($this-data[$this-name]['field1'])  !isset($this-
data[$this-name]['field2'])
$this-invalidate('field2');
}

First off, I get an error stating that $this-data[$this-name] is a
bad index. I put a check in the function to log the contents of $this-
data and it's empty? I have error messages setup in the view, but I
believe that since these fields aren't in the validate array, the call
to invalidate wouldn't work anyway. Any suggestions on how I might
approach this problem?

Everywhere I see beforeValidate examples, it's using $this-data. Any
ideas on why I don't have any data there?

I'll keep studying the code and the postings. A suggestion to use
http://bakery.cakephp.org/articles/view/55 looks promising, but I'd
really like to understand what's going on when the call to
beforeValidate happens.

Thanks.

2z


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



New PHP Bug Reporting Site

2007-04-03 Thread Michael Tuzi

Hello all,

For all of us interested in PHP's vulnerabilities, this site posts
monthly security bugs in PHP core.

http://www.php-security.org/

I hope it proves useful to all.

Michael Tuzi


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



phpGACL

2007-03-26 Thread Michael Tuzi

I'd like to use this, but I can't figure out how to access MySQL,
because the database is running on a non-standard port. With CakePHP,
I can define the host as hostname:port, but this doesn't work with the
plugin. It's using ADOdb, and I can't seem to define a port using any
of the included drivers.

Thanks,

Michael Tuzi


--~--~-~--~~~---~--~~
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: Data cleanup in Model

2007-03-26 Thread Michael Tuzi

@ianh

I followed your instructions, but I am now getting an SQL error during
validation! I don't understand how, why or where the query takes
place, but the error I get shows that a query ('__sanitize') is being
made to the db. I am using Zend's IDE that I purched a few years ago,
but it isn't possible for me to do much in the way of tracing when I'm
using CakePHP. I'll keep looking for why this call is made and where.
I have the standard code block:

if ( $this-Model-create()  $this-Model-save($this-data) )
{
$this-Session-setFlash('Message');
$this-redirect('url');
}
else {
$this-validateErrors($this-Model);
$this-Session-write('model', $this-data);
$this-set('model', $this-data);
$this-render();
exit();
}

so I don't believe my problem's in the controller.

Thanks,

Michael Tuzi


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Data cleanup in Model

2007-03-24 Thread Michael Tuzi

I thought that data cleaning should be done prior to a save, so I
tried using stripAll in the model as follows:

function beforeSave()
{
require_once('sanitize.php');
$cleaner = new Sanitize();

$profile = $this-data;
$fields['Profile'] = $this-getColumnTypes();
foreach ($fields['Profile'] as $k = $v)
{
if (isset($profile['Profile'][$k]))
{
if (($v == 'string') || ($v == 'text'))
{
$fields['Profile'][$k] = $this-RequestHandler-
stripAll[$profile['Profile'][$k]];
}
else
{
   $fields['Profile'][$k] = $profile['Profile'][$k];
}
}
else {
$fields['Profile'][$k] = '';
}
}
$cleaner-cleanArray($fields);
}

But I get this warning:
Undefined property: Profile::$RequestHandler, because the components
array isn't defined in the model. It's in the controller. Any
suggestions on how I might move some of this cleaning work out of the
controller?

Thanks in advance,

Michael Tuzi


--~--~-~--~~~---~--~~
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: dAuth: Login form on all pages

2007-03-16 Thread Michael Tuzi

I get the same error as Hubbo. I'm new to this, and I don't see how
the controller gets the component, unless the controller is supposed
to call the components start method. I modified the listed code in my
app_controller file as follows:

function beforeFilter()
{
$error = '';
$this-DAuth-controller = $this;
$this-DAuth-newSalt();
$this-set('error', $error);
$this-set('allowcleartext', $this-DAuth-allowClearText);
}

Assigning $this to the d_auth controller. I don't know if I'm doing
this correctly, but I don't get the error now.

Michael Tuzi


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



Form Cancel

2007-03-15 Thread Michael Tuzi

Is it possible to create a cancel button in a form that doesn't
require js using $html-submit? The submit button's value isn't
returned in the params array.


--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---