Problem with association model

2009-10-22 Thread Wladiston Paiva
Hi friend,

i have a problem in the recovery of related objects.

exemple:

$this->Pessoa->find('all', array("fields" => array("codigo"), "conditions"
=> $a));

/* Return:

array(1) {
  [0]=>
  array(3) {
[0]=>
array(1) {
  ["codigo"]=>

  int(15)
}
["Areainteresse"]=>
array(0) {
}
["Listamailing"]=>
array(0) {
}
  }

If you perceive the object related to my search always returns empty.


["Listamailing"]=>
array(0) {
}

*/



This problem occurs only when using the Firebird.
Anybody know where I do a query of related objects in the core of cakephp?
Or know how to solve this problem, or if you already went through similar
problem, what is the best solution?

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

--~--~-~--~~~---~--~~
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: find with HABTM problem

2009-09-25 Thread Wladiston Paiva
unfortunately not always possible.
because the database already exists. I am only deploying the system in PHP
(currently Delphi). and the base is in Firebird.
I had problems with the Auth component because of the Firebird, I believe
the problem is the integration of the cake with the firebird.

I am installing ZendServer with ZendStudio to test via debugger with MySQL
to work the problem really is the cake.

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380


2009/9/25 brian 

> What does the find() code look like?
>
> It's possible that the problem is with your unconventional column
> names. It might work better if you use, eg. 'areainteresse_pessoa' for
> the join table and 'pessoa_id' for the key.
>
> Or it might be something else.
>

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



find with HABTM problem

2009-09-25 Thread Wladiston Paiva
hi peoples,

i have two models is cakephp:


class Pessoa extends AppModel {
var $name = 'Pessoa';
var $primaryKey = 'codigo';

var $hasAndBelongsToMany = array(
'Areainteresse' =>
array(
'className'=> 'Areainteresse',
'joinTable'  => 'areainteressepessoa',
'foreignKey' => 'codigopessoa',
'associationForeignKey'  => 'codigoareainteresse'
)
);
}


and

class Areainteresse extends AppModel {
var $name = 'Areainteresse';
var $useTable = 'areainteresse';
var $primaryKey = 'codigo';
}

when i run the $this-Pessoa->find(). he return me:

array(2) {
  [0]=>
  array(12) {
["codigo"]=>
int(6)
  }
  ["Areainteresse"]=>
  array(0) {
  }
}

the Pessoa entity is returned normally, however the entity Areainteresse not
returned.
This only for the find(). the save() work normally.
The data are in the table correctly.

Anyone have any solution?

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

--~--~-~--~~~---~--~~
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: "Login failed. Invalid username or password." in Auth Component

2009-09-21 Thread Wladiston Paiva
i found the solution.

thnx
---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380


2009/9/21 Wladiston Paiva 

> http://www.cakephpforum.net/index.php?showtopic=1709&st=0&#entry6282
>
> up!
>
> ---
> Wladiston Maurício de Paiva
> http://wladistonpaiva.com.br
> desenvolvedo...@gmail.com
> e...@wladistonpaiva.com.br
> +55 (31) 8435 - 5380
>
>
> 2009/9/16 Wladiston Paiva 
>
>  Friend, this table is a new.
>> the strange thing is that cakephp consulting in firebird works fine(1
>> query result), but something happens after the consultation that he loses
>> the password in $this->data.
>>
>> ---
>> Wladiston Maurício de Paiva
>> http://wladistonpaiva.com.br
>> desenvolvedo...@gmail.com
>> e...@wladistonpaiva.com.br
>> +55 (31) 8435 - 5380
>>
>>
>> 2009/9/15 Aivaras 
>>
>> Didn't you migrate to an existing database? Remember that Security::salt
>>> does not only use md5 or sha1 but also a Salt that you've filled in your
>>> core.php
>>>
>>> Faifas
>>> http://www.voveris.eu/
>>>
>>>
>>>
>>> On Tue, Sep 15, 2009 at 22:10, Wladiston Paiva <
>>> desenvolvedo...@gmail.com> wrote:
>>>
>>>> Hi guys!
>>>> I find a problem in auth component.
>>>>
>>>> *User Model:*
>>>> class User extends AppModel {
>>>> var $name = 'User';
>>>> }
>>>>
>>>>
>>>> *Users Controller:*
>>>> class UsersController extends AppController {
>>>> var $name = "Users";
>>>> var $uses = array('User');
>>>> var $components = array('Auth');
>>>>
>>>> function beforeFilter() {
>>>> parent::debugVar($_POST);
>>>> parent::beforeFilter();
>>>> }
>>>>
>>>> function login() {
>>>> //Auth Magic
>>>> parent::debugVar($this->data);
>>>> }
>>>>
>>>> function logout() {
>>>> $this->redirect($this->Auth->logout());
>>>> }
>>>> }
>>>>
>>>>
>>>> *App Controller:*
>>>> class AppController extends Controller {
>>>> var $components = array('Auth');
>>>>
>>>> function beforeFilter() {
>>>> //Security::setHash('md5'); // or sha1 or sha256.
>>>> //Configure AuthComponent
>>>> $this->Auth->loginAction = array('controller' => 'users',
>>>> 'action' => 'login');
>>>> $this->Auth->logoutRedirect = array('controller' => 'users',
>>>> 'action' => 'login');
>>>> $this->Auth->loginRedirect = array('controller' => 'usuarios',
>>>> 'action' => 'add');
>>>> }
>>>> }
>>>>
>>>>
>>>> When I run the debug, the sql is mounted correctly. but it returned the
>>>> error "Login failed. Invalid username or password."
>>>> I take the sql generated and run on the bank, and is returned correctly
>>>> the User.
>>>> If I print the $ _POST values come correctly, if I print the $ this->
>>>> data, the User is correct, but the password is NULL..
>>>>
>>>>
>>>> *POST:*
>>>> array(2) {
>>>> ["_method"]=>
>>>> string(4) "POST"
>>>> ["data"]=>
>>>> array(1) {
>>>> ["User"]=>
>>>> array(2) {
>>>>   ["username"]=>
>>>>   string(5) "admin"
>>>>   ["password"]=>
>>>>   string(6) "123456"
>>>> }
>>>> }
>>>> }
>>>>
>>>>
>>>> *this->data:*
>>>> array(1) {
>>>> ["User"]=>
>>>> array(2) {
>>>> ["username"]=>
>>>> string(5) "admin"
>>>> ["password"]=>
>>>> NULL
>>>> }
>>>> }
>>>>
>>>>
>>>> Does anyone have any idea how to solve this problem?
>>>> Thanks friends!
>>>>
>>>> ---
>>>> Wladiston Maurício de Paiva
>>>> http://wladistonpaiva.com.br
>>>> desenvolvedo...@gmail.com
>>>> e...@wladistonpaiva.com.br
>>>> +55 (31) 8435 - 5380
>>>>
>>>>
>>>>
>>>
>>> >>>
>>>
>>
>

--~--~-~--~~~---~--~~
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: "Login failed. Invalid username or password." in Auth Component

2009-09-21 Thread Wladiston Paiva
http://www.cakephpforum.net/index.php?showtopic=1709&st=0&#entry6282

up!

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380


2009/9/16 Wladiston Paiva 

> Friend, this table is a new.
> the strange thing is that cakephp consulting in firebird works fine(1 query
> result), but something happens after the consultation that he loses the
> password in $this->data.
>
> ---
> Wladiston Maurício de Paiva
> http://wladistonpaiva.com.br
> desenvolvedo...@gmail.com
> e...@wladistonpaiva.com.br
> +55 (31) 8435 - 5380
>
>
> 2009/9/15 Aivaras 
>
> Didn't you migrate to an existing database? Remember that Security::salt
>> does not only use md5 or sha1 but also a Salt that you've filled in your
>> core.php
>>
>> Faifas
>> http://www.voveris.eu/
>>
>>
>>
>> On Tue, Sep 15, 2009 at 22:10, Wladiston Paiva > > wrote:
>>
>>> Hi guys!
>>> I find a problem in auth component.
>>>
>>> *User Model:*
>>> class User extends AppModel {
>>> var $name = 'User';
>>> }
>>>
>>>
>>> *Users Controller:*
>>> class UsersController extends AppController {
>>> var $name = "Users";
>>> var $uses = array('User');
>>> var $components = array('Auth');
>>>
>>> function beforeFilter() {
>>> parent::debugVar($_POST);
>>> parent::beforeFilter();
>>> }
>>>
>>> function login() {
>>> //Auth Magic
>>> parent::debugVar($this->data);
>>> }
>>>
>>> function logout() {
>>> $this->redirect($this->Auth->logout());
>>> }
>>> }
>>>
>>>
>>> *App Controller:*
>>> class AppController extends Controller {
>>> var $components = array('Auth');
>>>
>>> function beforeFilter() {
>>> //Security::setHash('md5'); // or sha1 or sha256.
>>> //Configure AuthComponent
>>> $this->Auth->loginAction = array('controller' => 'users',
>>> 'action' => 'login');
>>> $this->Auth->logoutRedirect = array('controller' => 'users',
>>> 'action' => 'login');
>>> $this->Auth->loginRedirect = array('controller' => 'usuarios',
>>> 'action' => 'add');
>>> }
>>> }
>>>
>>>
>>> When I run the debug, the sql is mounted correctly. but it returned the
>>> error "Login failed. Invalid username or password."
>>> I take the sql generated and run on the bank, and is returned correctly
>>> the User.
>>> If I print the $ _POST values come correctly, if I print the $ this->
>>> data, the User is correct, but the password is NULL..
>>>
>>>
>>> *POST:*
>>> array(2) {
>>> ["_method"]=>
>>> string(4) "POST"
>>> ["data"]=>
>>> array(1) {
>>> ["User"]=>
>>> array(2) {
>>>   ["username"]=>
>>>   string(5) "admin"
>>>   ["password"]=>
>>>   string(6) "123456"
>>> }
>>> }
>>> }
>>>
>>>
>>> *this->data:*
>>> array(1) {
>>> ["User"]=>
>>> array(2) {
>>> ["username"]=>
>>> string(5) "admin"
>>> ["password"]=>
>>> NULL
>>> }
>>> }
>>>
>>>
>>> Does anyone have any idea how to solve this problem?
>>> Thanks friends!
>>>
>>> ---
>>> Wladiston Maurício de Paiva
>>> http://wladistonpaiva.com.br
>>> desenvolvedo...@gmail.com
>>> e...@wladistonpaiva.com.br
>>> +55 (31) 8435 - 5380
>>>
>>>
>>>
>>
>> >>
>>
>

--~--~-~--~~~---~--~~
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: "Login failed. Invalid username or password." in Auth Component

2009-09-16 Thread Wladiston Paiva
Friend, this table is a new.
the strange thing is that cakephp consulting in firebird works fine(1 query
result), but something happens after the consultation that he loses the
password in $this->data.

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380


2009/9/15 Aivaras 

> Didn't you migrate to an existing database? Remember that Security::salt
> does not only use md5 or sha1 but also a Salt that you've filled in your
> core.php
>
> Faifas
> http://www.voveris.eu/
>
>
>
> On Tue, Sep 15, 2009 at 22:10, Wladiston Paiva 
> wrote:
>
>> Hi guys!
>> I find a problem in auth component.
>>
>> *User Model:*
>> class User extends AppModel {
>> var $name = 'User';
>> }
>>
>>
>> *Users Controller:*
>> class UsersController extends AppController {
>> var $name = "Users";
>> var $uses = array('User');
>> var $components = array('Auth');
>>
>> function beforeFilter() {
>> parent::debugVar($_POST);
>> parent::beforeFilter();
>> }
>>
>> function login() {
>> //Auth Magic
>> parent::debugVar($this->data);
>> }
>>
>> function logout() {
>> $this->redirect($this->Auth->logout());
>> }
>> }
>>
>>
>> *App Controller:*
>> class AppController extends Controller {
>> var $components = array('Auth');
>>
>> function beforeFilter() {
>> //Security::setHash('md5'); // or sha1 or sha256.
>> //Configure AuthComponent
>> $this->Auth->loginAction = array('controller' => 'users', 'action'
>> => 'login');
>> $this->Auth->logoutRedirect = array('controller' => 'users',
>> 'action' => 'login');
>> $this->Auth->loginRedirect = array('controller' => 'usuarios',
>> 'action' => 'add');
>> }
>> }
>>
>>
>> When I run the debug, the sql is mounted correctly. but it returned the
>> error "Login failed. Invalid username or password."
>> I take the sql generated and run on the bank, and is returned correctly
>> the User.
>> If I print the $ _POST values come correctly, if I print the $ this->
>> data, the User is correct, but the password is NULL..
>>
>>
>> *POST:*
>> array(2) {
>> ["_method"]=>
>> string(4) "POST"
>> ["data"]=>
>> array(1) {
>> ["User"]=>
>> array(2) {
>>   ["username"]=>
>>   string(5) "admin"
>>   ["password"]=>
>>   string(6) "123456"
>> }
>> }
>> }
>>
>>
>> *this->data:*
>> array(1) {
>> ["User"]=>
>> array(2) {
>> ["username"]=>
>> string(5) "admin"
>> ["password"]=>
>> NULL
>> }
>> }
>>
>>
>> Does anyone have any idea how to solve this problem?
>> Thanks friends!
>>
>> ---
>> Wladiston Maurício de Paiva
>> http://wladistonpaiva.com.br
>> desenvolvedo...@gmail.com
>> e...@wladistonpaiva.com.br
>> +55 (31) 8435 - 5380
>>
>>
>>
>
> >
>

--~--~-~--~~~---~--~~
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." in Auth Component

2009-09-15 Thread Wladiston Paiva
Hi guys!
I find a problem in auth component.

*User Model:*
class User extends AppModel {
var $name = 'User';
}


*Users Controller:*
class UsersController extends AppController {
var $name = "Users";
var $uses = array('User');
var $components = array('Auth');

function beforeFilter() {
parent::debugVar($_POST);
parent::beforeFilter();
}

function login() {
//Auth Magic
parent::debugVar($this->data);
}

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


*App Controller:*
class AppController extends Controller {
var $components = array('Auth');

function beforeFilter() {
//Security::setHash('md5'); // or sha1 or sha256.
//Configure AuthComponent
$this->Auth->loginAction = array('controller' => 'users', 'action'
=> 'login');
$this->Auth->logoutRedirect = array('controller' => 'users',
'action' => 'login');
$this->Auth->loginRedirect = array('controller' => 'usuarios',
'action' => 'add');
}
}


When I run the debug, the sql is mounted correctly. but it returned the
error "Login failed. Invalid username or password."
I take the sql generated and run on the bank, and is returned correctly the
User.
If I print the $ _POST values come correctly, if I print the $ this-> data,
the User is correct, but the password is NULL..


*POST:*
array(2) {
["_method"]=>
string(4) "POST"
["data"]=>
array(1) {
["User"]=>
array(2) {
  ["username"]=>
  string(5) "admin"
  ["password"]=>
  string(6) "123456"
}
}
}


*this->data:*
array(1) {
["User"]=>
array(2) {
["username"]=>
string(5) "admin"
["password"]=>
NULL
}
}


Does anyone have any idea how to solve this problem?
Thanks friends!

---
Wladiston Maurício de Paiva
http://wladistonpaiva.com.br
desenvolvedo...@gmail.com
e...@wladistonpaiva.com.br
+55 (31) 8435 - 5380

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