Login form in an element using Auth component

2010-09-06 Thread Wim Olivier
Hi all,

I have a login form which I include from an element on /pages/home.

How do I tell the Auth component that it must use that Login element (/
app/views/elements/sidebar.ctp) as its view, instead of the default /
app/views/customers/login.ctp view?

Thanks!
Wim

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: liner array

2010-09-06 Thread Jeremy Burns | Class Outfit
What are you tying to achieve? Overriding the find method sounds a bit heavy 
handed. Post your objective here - there's probably a simple solution.

Jeremy Burns
Class Outfit

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

On 6 Sep 2010, at 23:32, butterCake wrote:

> I'm trying to some experiment. But  you are correct. I should use the
> database. My next step is trying to overwrite find method.
> 
> On Sep 6, 1:48 am, Maurits van der Schee  wrote:
>> Hi,
>> 
>> You could write your own Model and override the find() method.
>> 
>> But why would you not use the database?
>> 
>> Regards,
>> 
>> Maurits
>> 
>> On 09/06/2010 07:31 AM, butterCake wrote:
>> 
>>> Sorry for not being clear. What I'm trying to do is making my Model to
>>> be an array only. In otherwords I don't want my Model to be pointing
>>> to a data table.
>> 
>>> tks
>>> Anton
>> 
>>> On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
>>>   wrote:
 Can you explain this a bit more clearly? Do you mean that you want to do a 
 find that returns a data array ready for populating a select list (id + 
 name columns)? If so, check out 
 find('list'):http://book.cakephp.org/view/1022/find-list
>> 
 Jeremy Burns
 Class Outfit
>> 
 jeremybu...@classoutfit.comhttp://www.classoutfit.com
>> 
 On 4 Sep 2010, at 16:58, butterCake wrote:
>> 
> I'm new to cakePHP. What if I want my model to contain only an array
> of list. How to do this ?
>> 
> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 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: Problems with two hasOne-relationed models: no vice versa

2010-09-06 Thread Jeremy Burns | Class Outfit
Also your foreign keys are different - is that significant (modelA_id and id)?

Jeremy Burns
Class Outfit

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

On 7 Sep 2010, at 03:04, Dr. Loboto wrote:

> The pair to hasOne is belongsTo.
> 
> On Sep 7, 4:08 am, DerBjörn  wrote:
>> Hi,
>> 
>> i have 2 models that are connected between each other with hasOnes:
>> 
>> - ModelA
>> 
>> var $hasOne = array(
>>  'ModelsB' => array(
>>  'classname' => 'ModelsB',
>>  'foreignKey' => modelA_id,
>> ...
>> 
>> - ModelB
>> 
>> var $hasOne = array(
>>  'ModelsA' => array(
>>  'classname' => 'ModelsA',
>>  'foreignKey' => id,
>> ...
>> 
>> If i now make a read($id, null) in modelA_controller i get an array
>> with the data of modelA and the data of its modelB. Looks correct.
>> But vice versa it doesn't work: I get the data of modelB, but not of
>> its modelA, but data of a modelA with the same id as modelB has.
>> The query explains why: ... LEFT JOIN modelA AS modelsA ON (ModelA.id
>> = ModelB.id) ...
>> I have to change something in the hasOne-Relation of ModelB? But why
>> it works then in one direction?
>> 
>> Thanks for your help :)
> 
> 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: ACL and permissions arent working properly

2010-09-06 Thread Rob
Im still struggling with this, today I tried doing some testing by
using Acl->check

When I ran this to see
e($this->Acl->check('admin', 'Campaigns'));
it returned 1, which was correct, but when I checked any other group
e($this->Acl->check('mod', 'Campaigns'));
e($this->Acl->check('clients', 'Campaigns'));
nothing was returned, no errors, no value, and nothing in the log,
just a blank screen.  I don't understand what this means though.

On Sep 2, 1:30 pm, Rob  wrote:
> Nope, just regular id's
>
> On Sep 2, 12:18 pm, Anthony  wrote:
>
> > Are you useing UUID keys for the users or groups id?  If so you need
> > to modify one of the three tables but I don't know which off the top
> > of my head.
>
> > On Sep 1, 2:27 pm, Rob  wrote:
>
> > > Yes, that's it.
>
> > > Just a quick update, I rebuilt my ACO table and aco_aro table seeing
> > > if I might have fouled something up when tinkering around, but it
> > > still has the same results.
> > > Auth seems to work just fine, users are required to login on pages
> > > where they should have to, and I can get things like user group and
> > > user id from $this->Auth->user
> > > I don't understand what could have gone wrong with acl though.
>
> > > -Rob
>
> > > On Sep 1, 12:10 pm, Anthony  wrote:
>
> > > > If you followed the Auth and ACL examples from the handbook hes
> > > > referring to the build_acl action.
>
> > > >http://book.cakephp.org/view/1549/An-Automated-tool-for-creating-ACOs
>
> > > > On Sep 1, 10:54 am, Rob  wrote:
>
> > > > > Hey,
> > > > > This is my AppController
>
> > > > > class AppController extends Controller{
> > > > >         var $components = array('Acl', 'Auth', 'Session');
> > > > >         function beforeFilter(){
> > > > >                 $this->Auth->Authorize = 'actions';
> > > > >                 $this->Auth->loginAction = array('controller' => 
> > > > > 'users', 'action'
> > > > > => 'login');
> > > > >                 $this->Auth->logoutRedirect = array('controller' => 
> > > > > 'users',
> > > > > 'action' => 'login');
> > > > >                 $this->Auth->loginRedirect = array('controller' => 
> > > > > 'cps', 'action'
> > > > > => 'panel');
> > > > >                 $this->Auth->actionPath = 'controllers/';
> > > > >                 $this->Auth->allowedActions = array('display');
> > > > >         }
>
> > > > > }
>
> > > > > and I don't have an initACL function, it wasn't mentioned at all in
> > > > > the tutorial I followed...I have initDB where I set allow and deny, is
> > > > > that similar?
>
> > > > >         function initDB(){
> > > > >                 $group =& $this->User->Group;
>
> > > > >                 $group->id = 2;
> > > > >                 $this->Acl->deny($group, 'controllers');
>
> > > > >                 $group->id = 3;
> > > > >                 $this->Acl->deny($group, 'controllers');
> > > > >                 $this->Acl->allow($group, 
> > > > > 'controllers/Campaigns/add');
> > > > >                 $this->Acl->allow($group, 
> > > > > 'controllers/Campaigns/index');
> > > > >                 $this->Acl->allow($group, 'controllers/Ads/view');
> > > > >                 $this->Acl->allow($group, 'controllers/Users/view');
> > > > >                 $this->Acl->allow($group, 'controllers/Cps/panel');
> > > > >                 $this->Acl->allow($group, 'controllers/Pages');
>
> > > > >                 echo "done";
> > > > >                 exit;
>
> > > > >         }
>
> > > > > On Sep 1, 2:39 am, "gome$"  wrote:
>
> > > > > > hi,
> > > > > > It won't affect auth permanently.
> > > > > > Show me your AppControler source code and initACL function.

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: Preserving value in dependent select list after validation

2010-09-06 Thread aveev
I think you misunderstood my question. What I'm talking about is if
the validation fails.
In controller I don't do any redirect if validation fails. It simply
sets errors variable to be passed to add view and the view is rendered
with previously entered values along with error messages. This works
ok except for dependent select list (id= appilcation) which is
displayed without any option. It is because the options in dependent
select list is created with jquery when there is a change in another
select list  (id=document) (I set onChange event to document select
list).
I can get the value of previously entered value for dependent select
list option in controller.
So my question is, how can I display options in dependent select list
with correctly selected value  if validation fails ?

What I'm thinking now is that I set a variable  in controller when
validation fails. This variable will be passed to jquery.(this creates
another problem that I don't quite understand, which is passing
variable from controller to javascript/jquery) In jquery, we will
check if this variable is set. If it is, then create options for
dependent select list and select an option with previously selected
value. Otherwise create options with no selection.
Or maybe anyone has another ideas ??
Thanks..

On Sep 5, 4:38 pm, Jeremy Burns | Class Outfit
 wrote:
> You're doing a redirect, which effectively clears down the values in the 
> $this->data array, which the form will look for to get previously entered 
> data. Set $this->data to $this->Session->read('applicantdata') before you go 
> back to the form. Should work.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 3 Sep 2010, at 05:14, aveev wrote:
>
>
>
> > Hi, I'm new to cakephp
> > I'm trying to create an applicant add form with validation..
> > If validation fails, it should return to the add page with previously
> > entered values.
> > Here's the code snippet
> > //applicant controller
> > function add() {
>
> >            $docTypes = $this->DocumentType->find('list');
> >            $states = $this->State->find('list', array ('fields' => array
> > ('name',
> > 'name')));
> >            $this->set('states',$states);
> >            $this->set(compact('docTypes','states'));
>
> >            if (!empty($this->data)) {
> >                            $this->Applicant->set($this->data);
> >                            if($this->Applicant->validates()) {
>
> >                                    
> > $this->Session->write('applicantdata',$this->data);
> >                                    
> > $this->redirect(array('controller'=>'uploads','action' =>
> > 'add'));
> >                            } else {
> >                                    //grab options for select list with 
> > application id
> >                                    $this->set('errors', 
> > $this->Applicant->validationErrors);
> >                            }
> >                    }
> >    }
>
> > //applicant model
> > class Applicant extends AppModel {
>
> >    var $name = 'Applicant';
> >     var $validate = array('name'=>array('rule'=>'alphaNumeric',
> > 'allowEmpty'=>false,'message'=>'This field is required'));
> > }
>
> > //applicant view
> >    $javascript->link('jquery/jquery-1.4.1', false);
> >   $javascript->link('jquery/applicants_ajax', false);
>
> >    echo $form->create('Applicant');
> > echo $form-
> >> select('document_type_id',array($docTypes),null,array('id'=>'document'),tru
> >>  e);
> > echo $form->select('application_type_id', array(),null,
> > array('id'=>'application'),true );
> >    echo $form->input('name');
> >    echo $form->input('pob');
>
> >    echo $form->end('Save');
>
> > //jquery
> > //if validation fails create options for select list with id =
> > application, and select value based
> > //on previously entered one
>
> > $('#document').change( function () {
> >             $.post('http://localhost/doc_apps/documents/
> > ajax_search_app_type', {app_type_select: $(this).val()},function(data)
> > {
> >                            
> > $('#application').find('option').remove().end().append(' > option>');
> >                            var obj = jQuery.parseJSON(data);
> >                                    $.each(obj, function(key, value)
> >                                    {
> >                                             $('#application').
> >                                                      
> > append($("").
> >                                                      attr("value",key).
> >                                                      text(value));
> >                                    });
>
> >                            $.each(obj, function(key, value)
> >                                    {
> >                                            var strToAdd = " > type='hidden' value='helo'/>" ;
> >                                            $('form').append(strToAdd);
> >                                    });
>
> >              

Password Protecting a Directory

2010-09-06 Thread Arak Tai'Roth
So, I am aware this question has been asked and answered in a variety
of different ways in a variety of different places. I have already
spent way too much time trying to find a solution, so I'm hoping to
find a solution here by just asking myself.

I am using CakePHP 1.2.5 in this case if that makes a difference. I'm
hoping not, because I'm hoping to use whatever solution I get on a few
different installations, all of which use different versions.

Anyways, the issue is this. I have setup a directory inside /homePath/
app/webroot/, the directory is called admin, so the full path looks
like /homePath/app/webroot/admin. Now getting to this directory works
great. Until I password protect it using a .htaccess and .htpasswd
file.

After I implement the password protection, I get this error, "Error:
The requested address '/failed_auth.html' was not found on this
server."

My .htaccess file looks like this:
AuthType Basic
AuthUserFile /homePath/app/webroot/admin/.htpasswd
AuthName "Precision Laser Therapy Administrators"
require valid-user

I am using Dreamhost and have generated this using their panel, so I
am pretty positive the /homePath/ portion is correct.

I have already tried the solutions on
http://groups.google.ca/group/cake-php/browse_thread/thread/9054f372db1638bd/fc63892f3ae768f3?lnk=gst&q=password+protecting+a+directory#fc63892f3ae768f3,
and
http://groups.google.ca/group/cake-php/browse_thread/thread/30ea77cad33d87d7/4f2308c938067eec?lnk=gst&q=password+protecting+a+directory#4f2308c938067eec

I couldn't get them to work, that could be because I'm dumb and missed
something that they didn't explicitly say or they just simply won't
work in my case. Does someone have a solution for this issue? Assume
that the only thing I have changed to a static Cake install, is the
addition of the admin directory in /app/webroot, and the addition of
the .htaccess and .htpasswd files inside of it. Any help is extremely
appreciated.

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: Facebook Plugin Help

2010-09-06 Thread Dave Maharaj
Ok I figured out the scriptBlock() error. Whoever started the site had the
Html helper inside the app/views/helpers so that's solved.

Now the $session = json_encode( $this->Session->read( 'FB.Session' ) );

Where is this session data coming from?

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: Problems with two hasOne-relationed models: no vice versa

2010-09-06 Thread Dr. Loboto
The pair to hasOne is belongsTo.

On Sep 7, 4:08 am, DerBjörn  wrote:
> Hi,
>
> i have 2 models that are connected between each other with hasOnes:
>
> - ModelA
>
> var $hasOne = array(
>      'ModelsB' => array(
>      'classname' => 'ModelsB',
>      'foreignKey' => modelA_id,
> ...
>
> - ModelB
>
> var $hasOne = array(
>      'ModelsA' => array(
>      'classname' => 'ModelsA',
>      'foreignKey' => id,
> ...
>
> If i now make a read($id, null) in modelA_controller i get an array
> with the data of modelA and the data of its modelB. Looks correct.
> But vice versa it doesn't work: I get the data of modelB, but not of
> its modelA, but data of a modelA with the same id as modelB has.
> The query explains why: ... LEFT JOIN modelA AS modelsA ON (ModelA.id
> = ModelB.id) ...
> I have to change something in the hasOne-Relation of ModelB? But why
> it works then in one direction?
>
> Thanks for your help :)

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: Facebook Plugin Help

2010-09-06 Thread Dave Maharaj
Yeah I am using 1.3.2 and I just get the same error. Weird as I get the FB
options (like share comments) but the error shows above / below when I test
it out with debug 1. Debug 0 and no FB stuff works.

Will re-upload my CORE cake and see what happens

Keep you postedgreat plugin though! Excellent work.

But 1 last question.

$session = json_encode($this->Session->read('FB.Session'));

But were is it written to? What page action actually writes the session? I
did a search / find and did not see a $this->Session->write('FB.Session' ,
$???)

Is that just the Auth.User.id?

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: Facebook Plugin Help

2010-09-06 Thread nurvzy
Hi Dave,

  Thanks for using my plugin.  The plugin takes advantage of the new
HtmlHelper::scriptBlock method that is new in 1.3.x.  Make sure you're
running the latest version of CakePHP 1.3.

Hope that helps,
Nick

On Sep 6, 3:11 pm, "Dave Maharaj"  wrote:
> I am using the Facebook Plugin by Nick Baker and following thru the
> instruction but all I get is
>
> Warning (512): Method HtmlHelper::scriptBlock does not exist
> [CORE/cake/libs/view/helper.php, line 154]
>
> where I add in the init(); ?>
>
> I view the source and I see the jvascript there but its not doing anything
> just the error
>
> I created the facebook acct / api / key / appID and all that set up.
>
> Just not sure why it is throwing the error.
>
> Any ideas if anyone has used this plug in nd got it working?
>
> 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: liner array

2010-09-06 Thread butterCake
I'm trying to some experiment. But  you are correct. I should use the
database. My next step is trying to overwrite find method.

On Sep 6, 1:48 am, Maurits van der Schee  wrote:
> Hi,
>
> You could write your own Model and override the find() method.
>
> But why would you not use the database?
>
> Regards,
>
> Maurits
>
> On 09/06/2010 07:31 AM, butterCake wrote:
>
> > Sorry for not being clear. What I'm trying to do is making my Model to
> > be an array only. In otherwords I don't want my Model to be pointing
> > to a data table.
>
> > tks
> > Anton
>
> > On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
> >   wrote:
> >> Can you explain this a bit more clearly? Do you mean that you want to do a 
> >> find that returns a data array ready for populating a select list (id + 
> >> name columns)? If so, check out 
> >> find('list'):http://book.cakephp.org/view/1022/find-list
>
> >> Jeremy Burns
> >> Class Outfit
>
> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >> On 4 Sep 2010, at 16:58, butterCake wrote:
>
> >>> I'm new to cakePHP. What if I want my model to contain only an array
> >>> of list. How to do this ?
>
> >>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 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: liner array

2010-09-06 Thread butterCake
Thanks that worked.

On Sep 6, 3:37 am, Jeremy Burns | Class Outfit
 wrote:
> You could tell the Model that it doesn't relate to a table:
>
> var $useTable = false;
>
> Or, you could place the code in app_model.php, which would mean it is 
> available to any model function. Depending on your requirements, this might 
> be more efficient, else you'll need to load your model whenever you need to 
> access your list function.
>
> Jeremy Burns
> Class Outfit
>
> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> On 6 Sep 2010, at 09:48, Maurits van der Schee wrote:
>
> > Hi,
>
> > You could write your own Model and override the find() method.
>
> > But why would you not use the database?
>
> > Regards,
>
> > Maurits
>
> > On 09/06/2010 07:31 AM, butterCake wrote:
> >> Sorry for not being clear. What I'm trying to do is making my Model to
> >> be an array only. In otherwords I don't want my Model to be pointing
> >> to a data table.
>
> >> tks
> >> Anton
>
> >> On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
> >>   wrote:
> >>> Can you explain this a bit more clearly? Do you mean that you want to do 
> >>> a find that returns a data array ready for populating a select list (id + 
> >>> name columns)? If so, check out 
> >>> find('list'):http://book.cakephp.org/view/1022/find-list
>
> >>> Jeremy Burns
> >>> Class Outfit
>
> >>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>
> >>> On 4 Sep 2010, at 16:58, butterCake wrote:
>
>  I'm new to cakePHP. What if I want my model to contain only an array
>  of list. How to do this ?
>
>  Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp 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 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 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


Facebook Plugin Help

2010-09-06 Thread Dave Maharaj
I am using the Facebook Plugin by Nick Baker and following thru the
instruction but all I get is

Warning (512): Method HtmlHelper::scriptBlock does not exist
[CORE/cake/libs/view/helper.php, line 154]

where I add in the init(); ?>

I view the source and I see the jvascript there but its not doing anything
just the error

I created the facebook acct / api / key / appID and all that set up.

Just not sure why it is throwing the error.

Any ideas if anyone has used this plug in nd got it working?

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


Problems with two hasOne-relationed models: no vice versa

2010-09-06 Thread DerBjörn
Hi,

i have 2 models that are connected between each other with hasOnes:

- ModelA

var $hasOne = array(
 'ModelsB' => array(
 'classname' => 'ModelsB',
 'foreignKey' => modelA_id,
...

- ModelB

var $hasOne = array(
 'ModelsA' => array(
 'classname' => 'ModelsA',
 'foreignKey' => id,
...

If i now make a read($id, null) in modelA_controller i get an array
with the data of modelA and the data of its modelB. Looks correct.
But vice versa it doesn't work: I get the data of modelB, but not of
its modelA, but data of a modelA with the same id as modelB has.
The query explains why: ... LEFT JOIN modelA AS modelsA ON (ModelA.id
= ModelB.id) ...
I have to change something in the hasOne-Relation of ModelB? But why
it works then in one direction?

Thanks for your help :)

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


SQL Error?

2010-09-06 Thread Rodrigo Cortés
Nice tool but i have a problem:

The app works fine on cakeapp but when i download the sql code and try
to execute it on my local server i get this error:

"consulta SQL:
ALTER TABLE  `torneos` ADD FOREIGN KEY ( id ) REFERENCES  `matchups`
(  `torneo_id` ) ;

MySQL ha dicho:
#1005 - Can't create table 'sc2la.#sql-84c_1f2' (errno: 150)"

this is my app:
http://cakeapp.com/sqldesigners/sql/roco3d

it seems that is trying to create a foreign key from a parent table
instead from a child.

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


Login form in an element using Auth component

2010-09-06 Thread Wim Olivier
Hi all,

I have a login form which I include from an element on /pages/home.

How do I tell the Auth component that it must use that Login element
(/app/views/elements/sidebar) as its view, instead of the default
/app/views/elements/customers/login view?

Thanks!
Wim

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


Login failed. Invalid username or password

2010-09-06 Thread arro
hello everybody...I'm newbie here
I want to ask about auth components...
I try to use it but when I login there was message "Login failed.
Invalid username or password" even my username and password are
right...
I don't know how to solve this problem..thank you so much

this is my users_controller.php :

User->recursive = 0;
$this->set('users', $this->paginate());
}

function view($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid user', true));
$this->redirect(array('action' => 'index'));
}
$this->set('user', $this->User->read(null, $id));
}

function add() {
if (!empty($this->data)) {
$this->User->create();
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The user has been 
saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not 
be saved. Please,
try again.', true));
}
}
}

function edit($id = null) {
if (!$id && empty($this->data)) {
$this->Session->setFlash(__('Invalid user', true));
$this->redirect(array('action' => 'index'));
}
if (!empty($this->data)) {
if ($this->User->save($this->data)) {
$this->Session->setFlash(__('The user has been 
saved', true));
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash(__('The user could not 
be saved. Please,
try again.', true));
}
}
if (empty($this->data)) {
$this->data = $this->User->read(null, $id);
}
}

function delete($id = null) {
if (!$id) {
$this->Session->setFlash(__('Invalid id for user', 
true));
$this->redirect(array('action'=>'index'));
}
if ($this->User->delete($id)) {
$this->Session->setFlash(__('User deleted', true));
$this->redirect(array('action'=>'index'));
}
$this->Session->setFlash(__('User was not deleted', true));
$this->redirect(array('action' => 'index'));
}

function login() {
if ($this->Session->read('Auth.User')) {
$this->Session->setFlash('You are logged in!');
$this->redirect('/posts/index', null, false);
}
}

function logout(){
$this->redirect($this->Auth->logout());
}
}
?>

---

this is my app_controller.php


---
this is my users/login.ctp

Login
Session->flash('auth');
echo $form->create('User', array('url' => array('controller' =>
'users', 'action' =>'login')));
echo $form->input('User.username');
echo $form->input('User.password');
echo $form->end('Login');
?>



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


$this->Auth->loginAction not redirecting as requested

2010-09-06 Thread Wim Olivier
Hi everyone,

I need the Auth component to redirect to /customers/login and not to
/users/login, but cannot get it to work.
Any ideas?


*app_controller.php:
*
class AppController extends Controller {

var $components = array('Auth', 'Acl');

function beforeFilter() {

$this->Auth->userModel = 'Customer';
$this->Auth->fields = array('username' => 'email', 'password' =>
'password');
$this->Auth->loginAction = array('admin' => false, 'controller' =>
'customers', 'action' => 'login');
}

}
?>

Thanks,
Wim

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


Session Is not carrying to my other controllers

2010-09-06 Thread EASWAR CHOWDARY
Hi All,

   I have a users controller and teachers controller. I have to
login as user and he wil act as teacher and i need to check the user session
in every controller the user session . But the user session is nulled in the
teachers controller. Please help

Thanks In Advance

Regards,
Easwar A,
PHP Programmer

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: password field gets md5-hashed values

2010-09-06 Thread Simon
Thank you for your help. I got it fixed now.

Simon

On 6 sep, 10:40, jodator  wrote:
> Instead of 'password' use 'new_password' and hash it manually in
> controller's register action:
>
> $this->data['User']['password'] = Security::hash(
>     $this->data['User']['new_password'],
>      null, true);
>
> Then you should save data with option 'validate' => first
> if ($this->User->saveAll($this->data, array('validate' => 'first')))
> { /* it validates */} else { unset $this->data['User']
> ['new_password']; }
>
> And you validate unexisting in db field 'new_password' insted of
> password,
> so in UserModel :
>
>   var $validate = array(
>     'new_password' => array(
>       'between' => array(
>         'rule' => array('between', 6, 20),
>         'message' => 'Hasło musi mieć od 6 do 20 znaków'
>       ),
>       'notEmpty' => array(
>         'rule' => 'notEmpty',
>         'message' => 'Podaj hasło'
>       )
>     ),
> );
>
> I think there should be also in $validate array, option to validate
> only on create, ('on' => 'create') but check it in book
>
> On Sep 5, 10:11 pm, Simon  wrote:
>
>
>
> > In my register-form I have a passwordfield and i use Auth-component.
> > If I fill in an incorrrect form and press 'submit', there are some
> > validation errors who are nicely shown. That's perfectly great but my
> > passwordfield gets the value of the hashed string who was filled in.
> > It looks like Auth hashes the field and then puts this data back into
> > the value-atribute. Is there some way to prevent that?

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: isAuthorized seems not to be called

2010-09-06 Thread Simon
thanks for the answer.

I added a deny-action to the beforeFilter function now. But now I get
the error that the isAuthorized function is missing.

Warning (512): Members::isAuthorized() is not defined. [CORE/cake/libs/
controller/controller.php, line 808]

I looked in the book and I tried it this way too 
http://book.cakephp.org/view/1258/deny
but I keep getting the same answer.


On 6 sep, 14:26, "Max Dörfler"  wrote:
> Hi,
>
> Since it's the login and register action, I bet you have them in
> allow(). So the Auth component is disabled for those actions and
> isAuthorized is never called. You need to check it somewhere else (e.g.
> beforeFilter).
>
> Max
>
> Am 05.09.2010 22:28, schrieb Simon:
>
>
>
> > I have a isAuthorized function in my controller because $this->Auth-
>
> >> authorize is set to 'controller'.
>
> > This is my function (the comments explains everything):
> > function isAuthorized()
> > {
> >    parent::isAuthorized();
>
> >    //if the user is logged in. He cannot access the register and login
> > function
> >            if( ($this->action == 'registreren') || ($this->action ==
> > 'login') )
> >    {
> >              if( $this->Auth->user() )
> >        {
> >                     return false;
> >              }
> >        else
> >        {
> >               return true;
> >        }
> >          }
>
> >          //other actions are available for everyone
> >          return true;
> > }
>
> > The problem is that it seems that this function is not called because
> > when I'm logged in, I still can access the registreren action.
>
> > Is there something I'm doing wrong. Or have I misunderstood the
> > meaning of this function?
>
> > 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


CKeditor and ajax->submit(...)

2010-09-06 Thread Jacob
Hello,

Today I tried to implement in a full ajax CRUD system in an existing
app of mine. It all worked fine untill I discovered that my data that
I submitted into a CKeditor field wasn't saved. I use $ajax->submit()
to post the data.
Is there a specific reason for this? (like confilcting javascript or
so)

regards Jacob

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: passing array as parameters of redirect function

2010-09-06 Thread j.blotus
array_merge()

On Sep 6, 12:15 pm, "Mariano C."  wrote:
> Can I resolve serializing the array()?
> And if I could how should I code the things?
>
> On 6 Set, 18:12, euromark  wrote:
>
>
>
> > you cannot put another array into the url array
>
> > On 6 Sep., 17:52, "Mariano C."  wrote:
>
> > > This is the error (line 121 in users_controller.php is "));" that
> > > closed redirect() function inside removeFromCollection()).
>
> > > Array to string conversion [CORE/cake/libs/router.php, line 1556]
> > > Context:
> > > $params =       array(
> > >         "controller" => "users",
> > >         "action" => "collection",
> > >         "plugin" => null,
> > >         "pass" => array(
> > >         "admin",
> > >         "1",
> > >         array(),
> > >         array()
> > > ),
> > >         "named" => array()
> > > )
>
> > > Code:
> > > Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
> > > implode - [internal], line ??
> > > CakeRoute::_writeUrl() - CORE/cake/libs/router.php, line 1556
> > > CakeRoute::match() - CORE/cake/libs/router.php, line 1538
> > > Router::url() - CORE/cake/libs/router.php, line 838
> > > RequestHandlerComponent::beforeRedirect() - CORE/cake/libs/controller/
> > > components/request_handler.php, line 274
> > > Component::beforeRedirect() - CORE/cake/libs/controller/component.php,
> > > line 143
> > > Controller::redirect() - CORE/cake/libs/controller/controller.php,
> > > line 682
> > > UsersController::removeFromCollection() - APP/controllers/
> > > users_controller.php, line 121
> > > Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
> > > Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> > > [main] - APP/webroot/index.php, line 83
>
> > > On 6 Set, 05:37, "j.blotus"  wrote:
>
> > > > No array to string conversion errors? What kind of E_NOTICE error are
> > > > you getting.
>
> > > > On Sep 5, 3:27 pm, "Mariano C."  wrote:
>
> > > > > I haven't error message, line 106 and 107 are just the line of
> > > > > collection() function with debug instructions.
>
> > > > > On 5 Set, 21:04, "j.blotus"  wrote:
>
> > > > > > what is the specific error message you are getting. check lines 106
> > > > > > and 107 of your users_controller.php
>
> > > > > > On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
> > > > > > > Then I've a method called collection
>
> > > > > > > function collection($username = null,
> > > > > > >                            $page = 1,
> > > > > > >                            $sort = array('Artist.name',
> > > > > > > 'Album.year'),
> > > > > > >                            $direction = array('ASC', 'ASC')
> > > > > > >                            )
> > > > > > > {
> > > > > > >         debug(is_array($sort));
> > > > > > >         debug($sort);
>
> > > > > > > }
>
> > > > > > > it's fully working, matter of fact:
> > > > > > > app/controllers/users_controller.php (line 106)
> > > > > > > 1
>
> > > > > > > app/controllers/users_controller.php (line 107)
> > > > > > > Array
> > > > > > > (
> > > > > > >     [0] => Artist.name
> > > > > > >     [1] => Album.year
> > > > > > > )
>
> > > > > > > Now I've remove() function, something like that:
> > > > > > > function removeFromCollection($album_user_id = null)
> > > > > > > {
> > > > > > >         $this->redirect(array(
> > > > > > >                           'controller'=>'users',
> > > > > > >                           'action'=>'collection',
> > > > > > >                           $param['username'],
> > > > > > >                           $param['page'],
> > > > > > >                           array('Album.year', 'Artist.name'),
> > > > > > >                           array('ASC', 'ASC')
> > > > > > >        ));
>
> > > > > > > }
>
> > > > > > > but when I call removeFromCollection() and redirect to collection 
> > > > > > > is
> > > > > > > performed debug() output is:
> > > > > > > app/controllers/users_controller.php (line 106)
>
> > > > > > > app/controllers/users_controller.php (line 107)
> > > > > > > Array
>
> > > > > > > How can resolve this issue? How can I send array of element as
> > > > > > > parameter?

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: passing array as parameters of redirect function

2010-09-06 Thread Mariano C.
Can I resolve serializing the array()?
And if I could how should I code the things?

On 6 Set, 18:12, euromark  wrote:
> you cannot put another array into the url array
>
> On 6 Sep., 17:52, "Mariano C."  wrote:
>
>
>
> > This is the error (line 121 in users_controller.php is "));" that
> > closed redirect() function inside removeFromCollection()).
>
> > Array to string conversion [CORE/cake/libs/router.php, line 1556]
> > Context:
> > $params =       array(
> >         "controller" => "users",
> >         "action" => "collection",
> >         "plugin" => null,
> >         "pass" => array(
> >         "admin",
> >         "1",
> >         array(),
> >         array()
> > ),
> >         "named" => array()
> > )
>
> > Code:
> > Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
> > implode - [internal], line ??
> > CakeRoute::_writeUrl() - CORE/cake/libs/router.php, line 1556
> > CakeRoute::match() - CORE/cake/libs/router.php, line 1538
> > Router::url() - CORE/cake/libs/router.php, line 838
> > RequestHandlerComponent::beforeRedirect() - CORE/cake/libs/controller/
> > components/request_handler.php, line 274
> > Component::beforeRedirect() - CORE/cake/libs/controller/component.php,
> > line 143
> > Controller::redirect() - CORE/cake/libs/controller/controller.php,
> > line 682
> > UsersController::removeFromCollection() - APP/controllers/
> > users_controller.php, line 121
> > Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
> > Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> > [main] - APP/webroot/index.php, line 83
>
> > On 6 Set, 05:37, "j.blotus"  wrote:
>
> > > No array to string conversion errors? What kind of E_NOTICE error are
> > > you getting.
>
> > > On Sep 5, 3:27 pm, "Mariano C."  wrote:
>
> > > > I haven't error message, line 106 and 107 are just the line of
> > > > collection() function with debug instructions.
>
> > > > On 5 Set, 21:04, "j.blotus"  wrote:
>
> > > > > what is the specific error message you are getting. check lines 106
> > > > > and 107 of your users_controller.php
>
> > > > > On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
> > > > > > Then I've a method called collection
>
> > > > > > function collection($username = null,
> > > > > >                            $page = 1,
> > > > > >                            $sort = array('Artist.name',
> > > > > > 'Album.year'),
> > > > > >                            $direction = array('ASC', 'ASC')
> > > > > >                            )
> > > > > > {
> > > > > >         debug(is_array($sort));
> > > > > >         debug($sort);
>
> > > > > > }
>
> > > > > > it's fully working, matter of fact:
> > > > > > app/controllers/users_controller.php (line 106)
> > > > > > 1
>
> > > > > > app/controllers/users_controller.php (line 107)
> > > > > > Array
> > > > > > (
> > > > > >     [0] => Artist.name
> > > > > >     [1] => Album.year
> > > > > > )
>
> > > > > > Now I've remove() function, something like that:
> > > > > > function removeFromCollection($album_user_id = null)
> > > > > > {
> > > > > >         $this->redirect(array(
> > > > > >                           'controller'=>'users',
> > > > > >                           'action'=>'collection',
> > > > > >                           $param['username'],
> > > > > >                           $param['page'],
> > > > > >                           array('Album.year', 'Artist.name'),
> > > > > >                           array('ASC', 'ASC')
> > > > > >        ));
>
> > > > > > }
>
> > > > > > but when I call removeFromCollection() and redirect to collection is
> > > > > > performed debug() output is:
> > > > > > app/controllers/users_controller.php (line 106)
>
> > > > > > app/controllers/users_controller.php (line 107)
> > > > > > Array
>
> > > > > > How can resolve this issue? How can I send array of element as
> > > > > > parameter?

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: passing array as parameters of redirect function

2010-09-06 Thread euromark
you cannot put another array into the url array

On 6 Sep., 17:52, "Mariano C."  wrote:
> This is the error (line 121 in users_controller.php is "));" that
> closed redirect() function inside removeFromCollection()).
>
> Array to string conversion [CORE/cake/libs/router.php, line 1556]
> Context:
> $params =       array(
>         "controller" => "users",
>         "action" => "collection",
>         "plugin" => null,
>         "pass" => array(
>         "admin",
>         "1",
>         array(),
>         array()
> ),
>         "named" => array()
> )
>
> Code:
> Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
> implode - [internal], line ??
> CakeRoute::_writeUrl() - CORE/cake/libs/router.php, line 1556
> CakeRoute::match() - CORE/cake/libs/router.php, line 1538
> Router::url() - CORE/cake/libs/router.php, line 838
> RequestHandlerComponent::beforeRedirect() - CORE/cake/libs/controller/
> components/request_handler.php, line 274
> Component::beforeRedirect() - CORE/cake/libs/controller/component.php,
> line 143
> Controller::redirect() - CORE/cake/libs/controller/controller.php,
> line 682
> UsersController::removeFromCollection() - APP/controllers/
> users_controller.php, line 121
> Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
> Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
> [main] - APP/webroot/index.php, line 83
>
> On 6 Set, 05:37, "j.blotus"  wrote:
>
> > No array to string conversion errors? What kind of E_NOTICE error are
> > you getting.
>
> > On Sep 5, 3:27 pm, "Mariano C."  wrote:
>
> > > I haven't error message, line 106 and 107 are just the line of
> > > collection() function with debug instructions.
>
> > > On 5 Set, 21:04, "j.blotus"  wrote:
>
> > > > what is the specific error message you are getting. check lines 106
> > > > and 107 of your users_controller.php
>
> > > > On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
> > > > > Then I've a method called collection
>
> > > > > function collection($username = null,
> > > > >                            $page = 1,
> > > > >                            $sort = array('Artist.name',
> > > > > 'Album.year'),
> > > > >                            $direction = array('ASC', 'ASC')
> > > > >                            )
> > > > > {
> > > > >         debug(is_array($sort));
> > > > >         debug($sort);
>
> > > > > }
>
> > > > > it's fully working, matter of fact:
> > > > > app/controllers/users_controller.php (line 106)
> > > > > 1
>
> > > > > app/controllers/users_controller.php (line 107)
> > > > > Array
> > > > > (
> > > > >     [0] => Artist.name
> > > > >     [1] => Album.year
> > > > > )
>
> > > > > Now I've remove() function, something like that:
> > > > > function removeFromCollection($album_user_id = null)
> > > > > {
> > > > >         $this->redirect(array(
> > > > >                           'controller'=>'users',
> > > > >                           'action'=>'collection',
> > > > >                           $param['username'],
> > > > >                           $param['page'],
> > > > >                           array('Album.year', 'Artist.name'),
> > > > >                           array('ASC', 'ASC')
> > > > >        ));
>
> > > > > }
>
> > > > > but when I call removeFromCollection() and redirect to collection is
> > > > > performed debug() output is:
> > > > > app/controllers/users_controller.php (line 106)
>
> > > > > app/controllers/users_controller.php (line 107)
> > > > > Array
>
> > > > > How can resolve this issue? How can I send array of element as
> > > > > parameter?

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: passing array as parameters of redirect function

2010-09-06 Thread Mariano C.
This is the error (line 121 in users_controller.php is "));" that
closed redirect() function inside removeFromCollection()).

Array to string conversion [CORE/cake/libs/router.php, line 1556]
Context:
$params =   array(
"controller" => "users",
"action" => "collection",
"plugin" => null,
"pass" => array(
"admin",
"1",
array(),
array()
),
"named" => array()
)

Code:
Debugger::handleError() - CORE/cake/libs/debugger.php, line 306
implode - [internal], line ??
CakeRoute::_writeUrl() - CORE/cake/libs/router.php, line 1556
CakeRoute::match() - CORE/cake/libs/router.php, line 1538
Router::url() - CORE/cake/libs/router.php, line 838
RequestHandlerComponent::beforeRedirect() - CORE/cake/libs/controller/
components/request_handler.php, line 274
Component::beforeRedirect() - CORE/cake/libs/controller/component.php,
line 143
Controller::redirect() - CORE/cake/libs/controller/controller.php,
line 682
UsersController::removeFromCollection() - APP/controllers/
users_controller.php, line 121
Dispatcher::_invoke() - CORE/cake/dispatcher.php, line 204
Dispatcher::dispatch() - CORE/cake/dispatcher.php, line 171
[main] - APP/webroot/index.php, line 83

On 6 Set, 05:37, "j.blotus"  wrote:
> No array to string conversion errors? What kind of E_NOTICE error are
> you getting.
>
> On Sep 5, 3:27 pm, "Mariano C."  wrote:
>
>
>
> > I haven't error message, line 106 and 107 are just the line of
> > collection() function with debug instructions.
>
> > On 5 Set, 21:04, "j.blotus"  wrote:
>
> > > what is the specific error message you are getting. check lines 106
> > > and 107 of your users_controller.php
>
> > > On Sep 5, 12:38 pm, "Mariano C."  wrote:
>
> > > > Then I've a method called collection
>
> > > > function collection($username = null,
> > > >                            $page = 1,
> > > >                            $sort = array('Artist.name',
> > > > 'Album.year'),
> > > >                            $direction = array('ASC', 'ASC')
> > > >                            )
> > > > {
> > > >         debug(is_array($sort));
> > > >         debug($sort);
>
> > > > }
>
> > > > it's fully working, matter of fact:
> > > > app/controllers/users_controller.php (line 106)
> > > > 1
>
> > > > app/controllers/users_controller.php (line 107)
> > > > Array
> > > > (
> > > >     [0] => Artist.name
> > > >     [1] => Album.year
> > > > )
>
> > > > Now I've remove() function, something like that:
> > > > function removeFromCollection($album_user_id = null)
> > > > {
> > > >         $this->redirect(array(
> > > >                           'controller'=>'users',
> > > >                           'action'=>'collection',
> > > >                           $param['username'],
> > > >                           $param['page'],
> > > >                           array('Album.year', 'Artist.name'),
> > > >                           array('ASC', 'ASC')
> > > >        ));
>
> > > > }
>
> > > > but when I call removeFromCollection() and redirect to collection is
> > > > performed debug() output is:
> > > > app/controllers/users_controller.php (line 106)
>
> > > > app/controllers/users_controller.php (line 107)
> > > > Array
>
> > > > How can resolve this issue? How can I send array of element as
> > > > parameter?

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


ACL Behavior Bug?

2010-09-06 Thread euromark
What the ... is the acl behavior doing?

The user just updates his password (nothing else)
after that he cannot log in anymore because the aro/aco table gets
messed up really bad

Cake1.3.3 HEAD

Any ideas?


23  SELECT COUNT(*) AS `count` FROM `users` AS `User`   WHERE
`User`.`id` = '499949c6-c204-4c89-8dce-1918ab957338'  
1   1
0
24  UPDATE `users` SET `password` =
'651220fc90f09cdc7de34b3b2b5b6a9b91ed0031', `modified` =
'2010-09-06 15:13:03'  WHERE `users`.`id` = '499949c6-
c204-4c89-8dce-1918ab957338'   1   1
25  SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`model`,
`Aro`.`foreign_key`, `Aro`.`alias` FROM `aros` AS `Aro` LEFT JOIN
`aros` AS `Aro0` ON (`Aro`.`lft` <= `Aro0`.`lft` AND `Aro`.`rght`
>= `Aro0`.`rght`)  WHERE `Aro0`.`model` = 'User' AND
`Aro0`.`foreign_key` = '499949c6-
c204-4c89-8dce-1918ab957338'   ORDER BY `Aro`.`lft` DESC   2   
2   1
26  SELECT COUNT(*) AS `count` FROM `aros` AS `Aro`   WHERE `Aro`.`id`
= 129   1   1   0
27  SELECT `Aro`.`parent_id` FROM `aros` AS `Aro`   WHERE `Aro`.`id` =
129LIMIT 1  1   1   0
28  SELECT COUNT(*) AS `count` FROM `aros` AS `Aro`   WHERE `Aro`.`id`
= 129   1   1   0
29  UPDATE `aros` SET `parent_id` = NULL, `model` = 'User',
`foreign_key` = '499949c6-c204-4c89-8dce-1918ab957338', `id`
= 129  WHERE `aros`.`id` = 129  1   0
30  SELECT `Aro`.`id`, `Aro`.`parent_id`, `Aro`.`lft`, `Aro`.`rght`
FROM `aros` AS `Aro`   WHERE 1 = 1 AND `Aro`.`id` = 129LIMIT 1  
1
1   0
31  SELECT MAX(`Aro`.`rght`) AS `rght` FROM `aros` AS `Aro`   WHERE 1 =
1LIMIT 11   1   0
32  UPDATE `aros` AS `Aro`  SET `Aro`.`lft` = `Aro`.`lft` + 31  WHERE
`Aro`.`lft` BETWEEN 104 AND 105 1   0
33  UPDATE `aros` AS `Aro`  SET `Aro`.`rght` = `Aro`.`rght` + 31  WHERE
`Aro`.`rght` BETWEEN 104 AND 1051   0
34  UPDATE `aros` AS `Aro`  SET `Aro`.`lft` = `Aro`.`lft` - 2  WHERE
`Aro`.`lft` > 10414  1
35  UPDATE `aros` AS `Aro`  SET `Aro`.`rght` = `Aro`.`rght` - 2  WHERE
`Aro`.`rght` > 104   15  1

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: SimpleTest: $this->getUrl() results in "Call to a member function getUrl() on a non-object"

2010-09-06 Thread Joshua Muheim
Ooops, my fault, I called it at the wrong place. :-)

On Mon, Sep 6, 2010 at 3:30 PM, psybear83  wrote:
> Hi everybody
>
> I want to get the URL of the current page of my SimpleTest browser,
> and according to the manual that's done using getUrl():
>
> http://www.simpletest.org/en/browser_documentation.html
>
> So I do the following:
>
> $this->getUrl()
>
> But this results in the following error:
>
> Fatal error: Call to a member function getUrl() on a non-object in C:
> \xampp\htdocs\josh\ziviapps\app\vendors\simpletest\web_tester.php on
> line 526
>
> Anybody has an idea what's the problem here?
>
> Thanks a lot,
> 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


SimpleTest: $this->getUrl() results in "Call to a member function getUrl() on a non-object"

2010-09-06 Thread psybear83
Hi everybody

I want to get the URL of the current page of my SimpleTest browser,
and according to the manual that's done using getUrl():

http://www.simpletest.org/en/browser_documentation.html

So I do the following:

$this->getUrl()

But this results in the following error:

Fatal error: Call to a member function getUrl() on a non-object in C:
\xampp\htdocs\josh\ziviapps\app\vendors\simpletest\web_tester.php on
line 526

Anybody has an idea what's the problem here?

Thanks a lot,
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


How to extend CakeWebTestCase?

2010-09-06 Thread psybear83
Hi all

I want to extend CakeWebTestCase with some methods that have proven
useful to me. But where should I do this best - where to place the
file and where to import it? In Rails I would put it: just in the lib
and extend the class itself, but in PHP I guess I have to create a new
class (e.g. BetterCakeWebTestCase) and extend it?

Thanks 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


Re: Webtesting using SimpleTest: How to reset database?

2010-09-06 Thread Joshua Muheim
Thank you, but this looks like an article that only tells how to use
fixtures with unit (model) tests. I need this kind of stuff for web
(view) tests...

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: isAuthorized seems not to be called

2010-09-06 Thread Max Dörfler

Hi,

Since it's the login and register action, I bet you have them in 
allow(). So the Auth component is disabled for those actions and 
isAuthorized is never called. You need to check it somewhere else (e.g. 
beforeFilter).


Max

Am 05.09.2010 22:28, schrieb Simon:

I have a isAuthorized function in my controller because $this->Auth-
   

authorize is set to 'controller'.
 

This is my function (the comments explains everything):
function isAuthorized()
{
parent::isAuthorized();

//if the user is logged in. He cannot access the register and login
function
if( ($this->action == 'registreren') || ($this->action ==
'login') )
{
 if( $this->Auth->user() )
{
return false;
 }
else
{
   return true;
}
 }

 //other actions are available for everyone
 return true;
}

The problem is that it seems that this function is not called because
when I'm logged in, I still can access the registreren action.

Is there something I'm doing wrong. Or have I misunderstood the
meaning of this function?

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: ACL problem of the different kind: it allows too much!

2010-09-06 Thread nils
solved.

Stupid me, but maybe me reporting this helps others: I overwrote
beforefilter in my controller and didn't add auth to it.

Including "parent::beforeFilter();" in beforeFilter() in said
controllers fixed all issues.

:/



On 1 Sep., 12:04, nils  wrote:
> Hi gomes, thanks for your reply
>
> acos are updated, components registered and I put in those lines in
> beforeFilter.
>
> Auth *does* work on other controllers/actions, it just doesn't on that
> one!
>
> Anyone got some spare clue?
>
> tia,nils
>
> On 1 Sep., 09:51, "gome$"  wrote:
>
> > HiNils,
>
> > Have you updated ACOs table before restricting actions (build_acl)?
> > Make shure you have included Acl and Auth components in your
> > AppController  ?
> > ( var $components = array('Acl', 'Auth', 'Session'); )
> > and you have following lines in beforeFilter:
> > $this->Auth->actionPath = 'controllers/';
> > $this->Auth->authorize = 'actions';
>
> > regards
> > gomes
>
> > On 31 Sie, 16:58,nils wrote:
>
> > > btw: no, I didn't leave any
>
> > > $this->Auth->allow('*');
>
> > > in there.. - It works fine on *some* methods, but not on all! :(
>
> > > On 31 Aug., 16:51,nils wrote:
>
> > > > Hi all,
>
> > > > got a bit of an acl/auth problem here...:
>
> > > > my usergroup with very few rights should be restricted to few methods.
> > > > Thus I defined:
>
> > > >                 $group->id = 7;
> > > >                 $this->Acl->deny($group, 'controllers');
> > > >                 $this->Acl->deny($group, 'controllers/Messages/index'); 
> > > > // this just
> > > > because I thought that might help!
> > > >                 $this->Acl->allow($group, 'controllers/Messages/inbox');
> > > >                 $this->Acl->allow($group, 
> > > > 'controllers/Messages/outbox');
>
> > > > But still: all methods are still "allowed" for users of that group
> > > > (e.g. index, view, add)!
>
> > > > I checked: there's no manual override put in place by me, neither in
> > > > the messages controller, nor in app controller.
>
> > > > (Certainly, I could put a manual check in each method, checking wether
> > > > a user belongs to the admin group, but that's all a bit beside the
> > > > point now, isn't it?)
>
> > > > Can anyone shed some light on this, pretty please?
>
> > > > Everything else is mostly doing fine. I copied the auth part from the
> > > > cookbook and am using cake 1.3 fwiw
>
> > > > Thanks for your help 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


Re: Session get deleted with chrome browser

2010-09-06 Thread Sanza
Hi!
I had already the security.level setted to medium and also setting to
"low" don't work.
Thank you for your suggestion but the problem persist!
Massimo


On 6 Set, 01:52, Kamal deol  wrote:
> hi i read your problem
>
> my email is kamal.d...@gmail.com
>
> try the
> Configure::write('Security.level', 'low');
> in the app/cofig/core.php
>
> first try Configure::write('Security.level', 'medium'); if prob solved then
> ok other wise try
> low
>
>
>
> On Sun, Sep 5, 2010 at 7:15 AM, Sanza  wrote:
> > I have the same problem! Only with the cakephp 1.3.+
> > With firefox works perfectly, but with Safari, Internet Explorer and
> > Chrome don't work and lost the session or don't store the cookie.
>
> > I did a little step setting a different Session.cookie (core.php) and
> > setting the Cookie name on a component i28n wich use the session and
> > cookie, but I have get others misterious errors like "array to string
> > conversion" on session_start() and an other error on cookie system
> > component.
>
> > The strange this is that on firefox all work perfectly!
>
> > Any suggestion will be appreciated
> > Massimo
>
> > On 3 Set, 13:18, Amjed  wrote:
> > > Hi,
> > > I have an application which works fine in Firefox.
> > > But when I use chrome, session gets deleted/new session is created for
> > > every page
> > > it is not the the problem of security.level or "php" sessions. I have
> > > check all forums.
>
> > > In one forum it says that chrome changes HTTP_REFERER, due to this
> > > behaviour new sessions is created.
> > > Any help in this regard will be appreciated.
>
> > > Thanks,
> > > Amjed
>
> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others
> > with their CakePHP related questions.
>
> > You received this message because you are subscribed to the Google Groups
> > "CakePHP" group.
> > To post to this group, send email to cake-php@googlegroups.com
> > To unsubscribe from this group, send email to
> > cake-php+unsubscr...@googlegroups.com > om>For more options, visit this group at
> >http://groups.google.com/group/cake-php?hl=en

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

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


SimpleTest: Core tests don't run green!

2010-09-06 Thread psybear83
Hi all

I'm just wondering - I have installed SimpleTest and clicked on the
core tests, and nearly none of them are "all passed"? Is this normal?
Should they all pass?

It's a CakePHP application that I've not built on my own and that I
want to add tests to, so I'm not quite sure about that...

Thanks 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


Starting tests from command line: "Error: Sorry, Simpletest could not be found."

2010-09-06 Thread psybear83
Hello everybody

I tried to run my tests using:

$ cake testsuite help

But this resulted in an:

Error: Sorry, Simpletest could not be found. Download it from
http://simpletest.org and install it to your vendors directory.

I have SimpleTest installed to vendors (the one in /, not the one in
app/ - what's the difference between the two, anyway??), and I can run
my tests without a problem using my browser...

Thanks for help

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


Attendance

2010-09-06 Thread Miqdad Ali
Dear Experts,

 I am Working in a Collage administration software and now I am doing module
attendance

What way I can store attendance in table for each student in different
semester and batch

how i can implement this,their will not be any slow in site
please help >

Miqdad Ali

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: liner array

2010-09-06 Thread Jeremy Burns | Class Outfit
You could tell the Model that it doesn't relate to a table:

var $useTable = false;

Or, you could place the code in app_model.php, which would mean it is available 
to any model function. Depending on your requirements, this might be more 
efficient, else you'll need to load your model whenever you need to access your 
list function.

Jeremy Burns
Class Outfit

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

On 6 Sep 2010, at 09:48, Maurits van der Schee wrote:

> Hi,
> 
> You could write your own Model and override the find() method.
> 
> But why would you not use the database?
> 
> Regards,
> 
> Maurits
> 
> 
> On 09/06/2010 07:31 AM, butterCake wrote:
>> Sorry for not being clear. What I'm trying to do is making my Model to
>> be an array only. In otherwords I don't want my Model to be pointing
>> to a data table.
>> 
>> tks
>> Anton
>> 
>> On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
>>   wrote:
>>> Can you explain this a bit more clearly? Do you mean that you want to do a 
>>> find that returns a data array ready for populating a select list (id + 
>>> name columns)? If so, check out 
>>> find('list'):http://book.cakephp.org/view/1022/find-list
>>> 
>>> Jeremy Burns
>>> Class Outfit
>>> 
>>> jeremybu...@classoutfit.comhttp://www.classoutfit.com
>>> 
>>> On 4 Sep 2010, at 16:58, butterCake wrote:
>>> 
 I'm new to cakePHP. What if I want my model to contain only an array
 of list. How to do this ?
>>> 
 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

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: Model validation for multiple actions

2010-09-06 Thread Maurits van der Schee

Hi,

You need to look into the Auth component, validation has nothing to do 
with it.


Validation is about accepting data for save in the database
Authenthication is about finding out who the user is
Authorization is about telling what actions may be executed.

So you want authentication and authorization. Check out the Auth component.

Read about it in the auth component tutorial at:

http://www.jbcrawford.net/archives/45

Regards,

Maurits

On 09/06/2010 11:48 AM, amin wrote:

Hi,

Can u plz help me out, how to call validation for multiple actions of
a controller

E.g. a user controller, in user controller add, signup, forgot
password .. etc are actions

now in model class User extends AppModel{

}

how to validate mentioned actions validation in User model 

I have tried $validate method but it only allow for only one action

so plz help me out.

thnks 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


Re: Model validation for multiple actions

2010-09-06 Thread AD7six


On Sep 6, 11:40 am, amin  wrote:
> Hi,
>
> Can u plz help me out, how to call validation for multiple actions of
> a controller

The action and validation are not dependent - related.

>
> E.g. a user controller, in user controller add, signup, forgot
> password .. etc are actions
>
> now in model class User extends AppModel{
>
> }
>
> how to validate mentioned actions validation in User model 

You don't validate actions, you validate data.

>
> I have tried $validate method but it only allow for only one action

the validate array contains fields, not actions.

>
> so plz help me out.
>
> thnks in advance

AD

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: Downgrade from 1.3 to 1.2 Question

2010-09-06 Thread AD7six


On Sep 2, 6:44 pm, zuha  wrote:
> Does anyone think it might be possible to selectively downgrade, most
> specifically the routing updates made to 1.3?   For our use it seems
> the fixes Cake put into the router are worse than the problems the
> changes were trying to fix, and we're considering dropping back to 1.2
> if we can't get it to work better soon.

Maybe - doesn't sound like a very productive activity though.

I think you're asking the wrong question.

AD

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: demande d'info

2010-09-06 Thread AD7six


On Sep 2, 4:09 pm, adrien tchuya  wrote:
> je suis entrain de créer un site de réservation de véhicules et
> d'avions.
> Puis je avoir une proposition des constituants de la base de données?
> En plus quand j'installe cakephp dans le serveur wamp  et que je passe
> en ligne de commande pour générer l'application,cela ne marche pas. J
> e ne comprends Pas. Quelqu'un peut-il m'aider?

Please write in english or use the french google group

http://www.google.es/#hl=en&q=cakephp+google+group+french

You might want to edit this page if it's where you came from too :)
http://book.cakephp.org/fr/view/881

AD

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: SimpleTest: "You need a new test.php. Try this one: cake\console\libs\templates\skel\webroot\test.php"

2010-09-06 Thread AD7six


On Sep 6, 10:47 am, psybear83  wrote:
> OK, I figured it out myself. I had to replace the test.php file in app/
> webroot/ with *a new version* of test.php which I got from the newest
> 1.2.8 release of CakePHP! I also had to copy the cake.generic.css file
> from the 1.2.8 release to app/webroot/css to make the test.php site
> look good in the browser.
>
> I'm glad I could figure this one out, but it has been very
> frustrating, and I wasted many hours for this... Thanks anyway for
> your help, guys.

Sorry you had problems.

Perhaps you can suggest (ticket) a better error message since your
actions are exactly what the error message was telling you to do
(you're running test.php and it's telling you to overwrite the file
with the suggested file). 
http://github.com/cakephp/cakephp/blob/1.2.8/cake/tests/lib/test_manager.php#L591

"Even when there is *no* test.php file in the webroot I get this
error."
What conclusion can you draw from that ;).

AD

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


Model validation for multiple actions

2010-09-06 Thread amin
Hi,

Can u plz help me out, how to call validation for multiple actions of
a controller

E.g. a user controller, in user controller add, signup, forgot
password .. etc are actions

now in model class User extends AppModel{

}

how to validate mentioned actions validation in User model 

I have tried $validate method but it only allow for only one action

so plz help me out.

thnks 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


Model validation for multiple actions

2010-09-06 Thread amin
Hi,

Can u plz help me out, how to call validation for multiple actions of
a controller

E.g. a user controller, in user controller add, signup, forgot
password .. etc are actions

now in model class User extends AppModel{

}

how to validate mentioned actions validation in User model 

I have tried $validate method but it only allow for only one action

so plz help me out.

thnks 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


Re: Webtesting using SimpleTest: How to reset database?

2010-09-06 Thread Maurits van der Schee

Hi,

Have you read this?

http://bakery.cakephp.org/articles/view/testing-models-with-cakephp-1-2-test-suite

It seems to explain how to use fixtures.

Regards,

Maurits

On 09/06/2010 09:01 AM, psybear83 wrote:

So I'm the only one who needs such functionality? Does CakePHP simply
ignore this great functionality in Rails, or does it offer in a
different way or paradigm?

I guess for the sake of simplicity I will just write a small script
which deletes all tables when starting the tests and inserts some
basic data into it... Not beautiful, but it will be enough for my
purposes.

On 2 Sep., 15:25, psybear83  wrote:

Hi all

 From Ruby on Rails I know web testing, and there it is really great.
But sadly I see that CakePHP offers only some basic web testing by
integrating SimpleTest and not enhancing it.

So is there any way to reset my database tables when starting my test
suite? Or even to insert some startup data (fixtures)? Without this
functionality web testing for CakePHP seems really weak to me...

Thank you.
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: liner array

2010-09-06 Thread Maurits van der Schee

Hi,

You could write your own Model and override the find() method.

But why would you not use the database?

Regards,

Maurits


On 09/06/2010 07:31 AM, butterCake wrote:

Sorry for not being clear. What I'm trying to do is making my Model to
be an array only. In otherwords I don't want my Model to be pointing
to a data table.

tks
Anton

On Sep 5, 1:30 am, Jeremy Burns | Class Outfit
  wrote:

Can you explain this a bit more clearly? Do you mean that you want to do a find 
that returns a data array ready for populating a select list (id + name 
columns)? If so, check out 
find('list'):http://book.cakephp.org/view/1022/find-list

Jeremy Burns
Class Outfit

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

On 4 Sep 2010, at 16:58, butterCake wrote:


I'm new to cakePHP. What if I want my model to contain only an array
of list. How to do this ?



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: SimpleTest: "You need a new test.php. Try this one: cake\console\libs\templates\skel\webroot\test.php"

2010-09-06 Thread psybear83
OK, I figured it out myself. I had to replace the test.php file in app/
webroot/ with *a new version* of test.php which I got from the newest
1.2.8 release of CakePHP! I also had to copy the cake.generic.css file
from the 1.2.8 release to app/webroot/css to make the test.php site
look good in the browser.

I'm glad I could figure this one out, but it has been very
frustrating, and I wasted many hours for this... Thanks anyway for
your help, guys.

On 1 Sep., 10:21, Joshua Muheim  wrote:
> I just upgraded to v1.2.8, but still the same error. Very, very
> frustrating, I have absolutely no idea what could be the problem...
>
> On Tue, Aug 31, 2010 at 4:04 PM, Joshua Muheim  wrote:
> > Thank you. If there's no other way, I will have to do that, but I'd
> > rather not before I have my tests up and running...
>
> > On Tue, Aug 31, 2010 at 3:26 PM, Fran Iglesias  
> > wrote:
> >> Hi
> >> El 31/08/2010, a las 14:41, Joshua Muheim escribió:
>
> >>> Still the same error. Even when there is *no* test.php file in the
> >>> webroot I get this error. Very frustrating. Any other help?
>
> >> I remember having the very same error, and the solution was to update cake 
> >> 1.2 to final.
> >> ---
> >> Fran Iglesias 
> >>http://cakephpilia.blogspot.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: a simple problem-pls help

2010-09-06 Thread Maurits van der Schee

hi,

on http://api13.cakephp.org/class/auth-component:

# loginAction mixed

A URL (defined as a string or array) to the controller action that 
handles logins.


This defaults to the users controller login action

Set it using $this->Auth->loginAction = 
array('controller'=>'tests','action'=>'login')


check out: http://www.jbcrawford.net/archives/45

Regards,

Maurits

On 08/26/2010 10:58 AM, cake fan wrote:

i have the following controller implementing auth:
redirect($this->Auth->logout());
}
function welcome(){
$this->autoRender = false;
echo 'welcome';
//print_r($_SESSION);
}
function allowed(){
$this->autoRender=false;
echo 'in allowed function';
}
function denied(){
$this->autoRender=false;
echo 'in denied function';
}
}
?>
i also have a view for the login action:
flash('auth');
 echo $form->create('User', array('action' =>  'login'));
 echo $form->input('username');
 echo $form->input('password');
 echo $form->end('Login');
?>
but the authentication doesnt work. it allows access to all the
actions. but if i copy the Tests controller's code to a controller
named 'Users' it works. can u help me pls?

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: password field gets md5-hashed values

2010-09-06 Thread jodator
Instead of 'password' use 'new_password' and hash it manually in
controller's register action:

$this->data['User']['password'] = Security::hash(
$this->data['User']['new_password'],
 null, true);

Then you should save data with option 'validate' => first
if ($this->User->saveAll($this->data, array('validate' => 'first')))
{ /* it validates */} else { unset $this->data['User']
['new_password']; }

And you validate unexisting in db field 'new_password' insted of
password,
so in UserModel :

  var $validate = array(
'new_password' => array(
  'between' => array(
'rule' => array('between', 6, 20),
'message' => 'Hasło musi mieć od 6 do 20 znaków'
  ),
  'notEmpty' => array(
'rule' => 'notEmpty',
'message' => 'Podaj hasło'
  )
),
);

I think there should be also in $validate array, option to validate
only on create, ('on' => 'create') but check it in book

On Sep 5, 10:11 pm, Simon  wrote:
> In my register-form I have a passwordfield and i use Auth-component.
> If I fill in an incorrrect form and press 'submit', there are some
> validation errors who are nicely shown. That's perfectly great but my
> passwordfield gets the value of the hashed string who was filled in.
> It looks like Auth hashes the field and then puts this data back into
> the value-atribute. Is there some way to prevent that?

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: Webtesting using SimpleTest: How to reset database?

2010-09-06 Thread psybear83
So I'm the only one who needs such functionality? Does CakePHP simply
ignore this great functionality in Rails, or does it offer in a
different way or paradigm?

I guess for the sake of simplicity I will just write a small script
which deletes all tables when starting the tests and inserts some
basic data into it... Not beautiful, but it will be enough for my
purposes.

On 2 Sep., 15:25, psybear83  wrote:
> Hi all
>
> From Ruby on Rails I know web testing, and there it is really great.
> But sadly I see that CakePHP offers only some basic web testing by
> integrating SimpleTest and not enhancing it.
>
> So is there any way to reset my database tables when starting my test
> suite? Or even to insert some startup data (fixtures)? Without this
> functionality web testing for CakePHP seems really weak to me...
>
> Thank you.
> 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