Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread John Andersen
Please tell us how you defined the new column in your table - ie. what
type and lenght?
Also show the code where you call the save method of your model as
well as any before methods that may relate to this issue.
Enjoy,
   John

On 10 Aug., 07:57, abhimanyu bv vmabhi...@gmail.com wrote:
 Hi all,
 I added a new column into existing users table. whenever i saving a
 record, the column with other than 0, it  is saving with 0. i used
 print_r(this-data) to check the value of that column, it showing as
 the entered value,but in db it is stoed as 0. can anyone tell me what
 i did wrong?
 thanks

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread John Andersen
Please explain how it doesn't work - ie. you get an error (show that
to us); the download counter doesn't increase; or other information
that you can provide us, then maybe we will better be able to help you
along :)

Turn on debug, copy/paste the SQL statements into this correspondance
also.

Enjoy,
   John

On 9 Aug., 12:54, taqman filler taqman...@gmail.com wrote:
 I need to count download cakebaker guide me to use

 $this-MyFile-updateAll(array('Script.download_counter'='Script.download_­counter+1'),
 array('Script.id'=40));

 I put it in

    if ($id != null) {
             $file = $this-Script-findByid($id);
 $this-MyFile-updateAll(array('Script.download_counter'='Script.download_­counter+1'),
 array('Script.id'=40));
             header('Content-type: ' . 
 $file['Attachment']['file_content_type']);
             header('Content-length: ' .
 $file['Attachment']['file_size']); // some people reported problems
 with this line (see the comments), commenting out this line helped in
 those cases
             header('Content-Disposition: attachment; filename=' .
 $file['Attachment']['file_name'] . '');
             echo $file['Attachment']['file_object'];

             exit();

 It's doesn't work

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread abhimanyu bv
Hi john,new column has tinyint(4) and it has an index. and my code is
if ($this-Deal-validates()) {
$this-data['Deal']['admin_id'] = $this-Auth-user('admin_id');
 $this-Deal-create($this-data);
if ($this-Deal-save($this-data)) {
//my logic
}
}

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


small bug in auth components

2011-08-10 Thread muslimbit
There is an error in the auth components when i init the username auth
field only in beforfilter function :

$this-Auth-fields = array(
'username' = 'email'
);

i get a notice :

Notice (8): Undefined index:  password [CORE\cake\libs\controller
\components\auth.php, line 382]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Nested table update

2011-08-10 Thread LJgato
I have the following models:


Profile

Image

Post belongsTo Profile

Profile hasOne Image

When creating a post, a profile and its image can be created
dynamically at the same time. When this occurs, I need to insert into
post, profile and image. Using the relationships, Post-saveAll()
inserts into Post and Profile, but not into Image. I have verified
that the data posted from my form is all there and correct.

Is there a way have the entire nested insert performed using the Post-
saveAll() and relationships between the models/tables?

Thank you.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


how to run script if a field in database table becomes 0

2011-08-10 Thread abhimanyu bv
hi all, i encountered a problem.i have a table deals and a column name
is coupons in that table.if coupons(initialy) it will be greater than
0, if after some trasactions,if it becomes 0,i want to call a function
in the deals controller.how to do this?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to run script if a field in database table becomes 0

2011-08-10 Thread abhimanyu bv
The function should automatically called when coupons becomes 0.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread John Andersen
The issue could be that you have defined the column as tinyint, which
CakePHP consider as a boolean column, see the CakePHP book at:
http://book.cakephp.org/view/1390/Automagic-Form-Elements
In the table it is shown that tinyint is used for checkbox values,
thus only 0 or 1 :)

Suggest you alter your column to be an integer instead.
Enjoy,
   John

On 10 Aug., 08:34, abhimanyu bv vmabhi...@gmail.com wrote:
 Hi john,new column has tinyint(4) and it has an index. and my code is
 if ($this-Deal-validates()) {
 $this-data['Deal']['admin_id'] = $this-Auth-user('admin_id');
  $this-Deal-create($this-data);
 if ($this-Deal-save($this-data)) {
 //my logic



 }
 }- Skjul tekst i anførselstegn -

 - Vis tekst i anførselstegn -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: small bug in auth components

2011-08-10 Thread John Andersen
I understand that you get an error in your case - my question is, do
you want to authenticate a user only by the user entering his/her e-
mail address? For that is what you are trying to do!
Auth is supposed to have to field names in the fields variable, but
you are only giving it one! See the CakePHP book for a short
description of the fields variable at:
http://book.cakephp.org/#!/view/1267/fields

Please clarify what you are trying to do :)
Enjoy,
   John

On 10 Aug., 00:58, muslimbit muslim...@gmail.com wrote:
 There is an error in the auth components when i init the username auth
 field only in beforfilter function :

 $this-Auth-fields = array(
             'username' = 'email'
             );

 i get a notice :

 Notice (8): Undefined index:  password [CORE\cake\libs\controller
 \components\auth.php, line 382]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread taqman filler
yes  the download counter doesn't increase
why in debukit not show insert or delete log
2011/8/10 John Andersen j.andersen...@gmail.com:
 Please explain how it doesn't work - ie. you get an error (show that
 to us); the download counter doesn't increase; or other information
 that you can provide us, then maybe we will better be able to help you
 along :)

 Turn on debug, copy/paste the SQL statements into this correspondance
 also.

 Enjoy,
   John

 On 9 Aug., 12:54, taqman filler taqman...@gmail.com wrote:
 I need to count download cakebaker guide me to use

 $this-MyFile-updateAll(array('Script.download_counter'='Script.download_­counter+1'),
 array('Script.id'=40));

 I put it in

    if ($id != null) {
             $file = $this-Script-findByid($id);
 $this-MyFile-updateAll(array('Script.download_counter'='Script.download_­counter+1'),
 array('Script.id'=40));
             header('Content-type: ' . 
 $file['Attachment']['file_content_type']);
             header('Content-length: ' .
 $file['Attachment']['file_size']); // some people reported problems
 with this line (see the comments), commenting out this line helped in
 those cases
             header('Content-Disposition: attachment; filename=' .
 $file['Attachment']['file_name'] . '');
             echo $file['Attachment']['file_object'];

             exit();

 It's doesn't work

 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to run script if a field in database table becomes 0

2011-08-10 Thread Zaky Katalan-Ezra
1. A database trigger ca be a option.
2. Fetching the row after successful update and check for copun=0;
3. afterSave call back http://book.cakephp.org/view/1053/afterSave
4. If $this-data['deals']['coupon'] == 0 before you save you know you
should run the method.

On Wed, Aug 10, 2011 at 11:32 AM, abhimanyu bv vmabhi...@gmail.com wrote:

 The function should automatically called when coupons becomes 0.

 --
 Our newest site for the community: CakePHP Video Tutorials
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help
 others with their CakePHP related questions.


 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




-- 
Regards,
Zaky Katalan-Ezra
QA Administrator
www.IGeneriX.com
Sites.IGeneriX.com
054-7762312

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread euromark
@john
only tinyint(1) is boolean
tinyint(2/3) is fine

@abhimanyu bv
but 4 usually doesnt exist (tinyint has 255 values)

use int(4)!


On 10 Aug., 10:34, John Andersen j.andersen...@gmail.com wrote:
 The issue could be that you have defined the column as tinyint, which
 CakePHP consider as a boolean column, see the CakePHP book 
 at:http://book.cakephp.org/view/1390/Automagic-Form-Elements
 In the table it is shown that tinyint is used for checkbox values,
 thus only 0 or 1 :)

 Suggest you alter your column to be an integer instead.
 Enjoy,
    John

 On 10 Aug., 08:34, abhimanyu bv vmabhi...@gmail.com wrote:







  Hi john,new column has tinyint(4) and it has an index. and my code is
  if ($this-Deal-validates()) {
  $this-data['Deal']['admin_id'] = $this-Auth-user('admin_id');
   $this-Deal-create($this-data);
  if ($this-Deal-save($this-data)) {
  //my logic

  }
  }- Skjul tekst i anførselstegn -

  - Vis tekst i anførselstegn -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread abhimanyu bv
Thanks for the suggestions.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread John Andersen
Look in the CakePHP book at:
http://book.cakephp.org/#CakePHP-Core-Configuration-Variables-931

In the table, read what is stated for debug. Then you will be able
to see the SQL dump also :)
Enjoy,
   John

On 10 Aug., 11:02, taqman filler taqman...@gmail.com wrote:
 yes  the download counter doesn't increase
 why in debukit not show insert or delete log
 2011/8/10 John Andersen j.andersen...@gmail.com:


[snip]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread John Andersen
Thanks euromark :)
Always good to be clear on such things! I am just restarting CakePHP
development, so I am not completely up to facts :D
Enjoy,
   John

On 10 Aug., 11:28, euromark dereurom...@googlemail.com wrote:
 @john
 only tinyint(1) is boolean
 tinyint(2/3) is fine

 @abhimanyu bv
 but 4 usually doesnt exist (tinyint has 255 values)

 use int(4)!

 On 10 Aug., 10:34, John Andersen j.andersen...@gmail.com wrote:



  The issue could be that you have defined the column as tinyint, which
  CakePHP consider as a boolean column, see the CakePHP book 
  at:http://book.cakephp.org/view/1390/Automagic-Form-Elements
  In the table it is shown that tinyint is used for checkbox values,
  thus only 0 or 1 :)

  Suggest you alter your column to be an integer instead.
  Enjoy,
     John

  On 10 Aug., 08:34, abhimanyu bv vmabhi...@gmail.com wrote:

   Hi john,new column has tinyint(4) and it has an index. and my code is
   if ($this-Deal-validates()) {
   $this-data['Deal']['admin_id'] = $this-Auth-user('admin_id');
    $this-Deal-create($this-data);
   if ($this-Deal-save($this-data)) {
   //my logic

   }
   }- Skjul tekst i anførselstegn -

   - Vis tekst i anførselstegn -- Skjul tekst i anførselstegn -

 - Vis tekst i anførselstegn -

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread abhimanyu bv
Hi euromark, can you please tell me how to configure cron jobs in windows,
so that i can run php script every 10 minutes.

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread taqman filler
I set debug = 2 the counter doesn't write to db

2011/8/10 John Andersen j.andersen...@gmail.com:
 Look in the CakePHP book at:
 http://book.cakephp.org/#CakePHP-Core-Configuration-Variables-931

 In the table, read what is stated for debug. Then you will be able
 to see the SQL dump also :)
 Enjoy,
   John

 On 10 Aug., 11:02, taqman filler taqman...@gmail.com wrote:
 yes  the download counter doesn't increase
 why in debukit not show insert or delete log
 2011/8/10 John Andersen j.andersen...@gmail.com:


 [snip]

 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.


 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


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread taqman filler
I found solution
set  field initial value = 0

2011/8/10 taqman filler taqman...@gmail.com:
 I set debug = 2 the counter doesn't write to db

 2011/8/10 John Andersen j.andersen...@gmail.com:
 Look in the CakePHP book at:
 http://book.cakephp.org/#CakePHP-Core-Configuration-Variables-931

 In the table, read what is stated for debug. Then you will be able
 to see the SQL dump also :)
 Enjoy,
   John

 On 10 Aug., 11:02, taqman filler taqman...@gmail.com wrote:
 yes  the download counter doesn't increase
 why in debukit not show insert or delete log
 2011/8/10 John Andersen j.andersen...@gmail.com:


 [snip]

 --
 Our newest site for the community: CakePHP Video Tutorials 
 http://tv.cakephp.org
 Check out the new CakePHP Questions site http://ask.cakephp.org and help 
 others with their CakePHP related questions.


 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



-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: how to make download counter ?

2011-08-10 Thread John Andersen
Good! I am happy that you found a solution :)
Keep up the good work, enjoy,
   John

On 10 Aug., 13:05, taqman filler taqman...@gmail.com wrote:
 I found solution
 set  field initial value = 0

 2011/8/10 taqman filler taqman...@gmail.com:



  I set debug = 2 the counter doesn't write to db

  2011/8/10 John Andersen j.andersen...@gmail.com:
  Look in the CakePHP book at:
 http://book.cakephp.org/#CakePHP-Core-Configuration-Variables-931

  In the table, read what is stated for debug. Then you will be able
  to see the SQL dump also :)
  Enjoy,
    John

[snip]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread vcrack
Hello all, my name Jan.. I'm Indonesian..
I've used cake in my projects.. I've following cake since in cake
1.1.8 till now.

currently, I'm develop project which a lot of feature and I think in
plugin.. cause, plugin is more independent, I guess.
But, I have a question..

Why cake doesn't make a function  to hook Components, Helpers,
Behaviour?
Why only create a attribute var $components, var $helpers , var
$actsAs ?
it's likely will override with child class..

for example, in my project. I have a AutoLogin Component.. I wanna use
this components to all controllers.
So, in AppController I have var $components =
array('AutoLogin','Another', .);

afterwards, my patner make calendar plugin in my project, and in
calendar plugin, he make CalendarFilter Components. and it's will use
in all controllers calendar plugin. so he make var $components =
array('CalendarFilter','Another');

Well, it's will be override my AutoLogin Component.
Okey, why he don't copy var $components from my AppController?
oh, it's okey.. but do you think if my project is a CMS project?
and users isn't a programmers ?
and users install more than one plugin?

so, Why cake doesn't make a function to Hook components, helpers, and
behaviors?

Please excuse my poor English..  thanks in advance..

Jan

http://jan.web.id
http://idcakephp.org

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: cakephp select option stored as 0 in database instead of selected value

2011-08-10 Thread Ryan Schmidt

On Aug 10, 2011, at 04:44, abhimanyu bv wrote:

 Hi euromark, can you please tell me how to configure cron jobs in windows, so 
 that i can run php script every 10 minutes.

That really doesn't have anything to do with this thread, or this discussion 
group. I'm sure typing cron windows into Google will give you some ideas.

If you're specifically interested in how to run a CakePHP script from the 
command line, then you'll want to read in the CakePHP book about shells, 
specifically this section about running CakePHP shells from cron:

http://book.cakephp.org/view/1110/Running-Shells-as-cronjobs

The information there is UNIX-centric, but hopefully your Google search for 
information about how to use cron from Windows can help you translate it.


-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread euromark
as far as I know, this is already done this way.
they will be joined between AppController PluginAppController
Controller in this order
or did you experience it otherwise?
it would surprise me because it works this way since several years in
my apps.


On 10 Aug., 15:01, vcrack vcrack.0...@gmail.com wrote:
 Hello all, my name Jan.. I'm Indonesian..
 I've used cake in my projects.. I've following cake since in cake
 1.1.8 till now.

 currently, I'm develop project which a lot of feature and I think in
 plugin.. cause, plugin is more independent, I guess.
 But, I have a question..

 Why cake doesn't make a function  to hook Components, Helpers,
 Behaviour?
 Why only create a attribute var $components, var $helpers , var
 $actsAs ?
 it's likely will override with child class..

 for example, in my project. I have a AutoLogin Component.. I wanna use
 this components to all controllers.
 So, in AppController I have var $components =
 array('AutoLogin','Another', .);

 afterwards, my patner make calendar plugin in my project, and in
 calendar plugin, he make CalendarFilter Components. and it's will use
 in all controllers calendar plugin. so he make var $components =
 array('CalendarFilter','Another');

 Well, it's will be override my AutoLogin Component.
 Okey, why he don't copy var $components from my AppController?
 oh, it's okey.. but do you think if my project is a CMS project?
 and users isn't a programmers ?
 and users install more than one plugin?

 so, Why cake doesn't make a function to Hook components, helpers, and
 behaviors?

 Please excuse my poor English..  thanks in advance..

 Jan

 http://jan.web.idhttp://idcakephp.org

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Automatic filter by site

2011-08-10 Thread João Rodrigues
I want to make my application be aware of the url.
I have created a table of sites (id, url) and a table of news (id, site_id,
etc.)
so I can get different news depending on the subdomain.
For example, economy news go in economy,example.com, sports news go in
sports.example.com
I also have more tables that have a site_id, for example, subscriptions (id,
site_id, email, etc.)

So I have lots of models that I always want to filter by site_id. Do I have
to explicitly put the condition on every find or is a way to automatically
filter by site_id?
Something like django's CurrentSiteManager?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Error The requested document was not found on this server

2011-08-10 Thread hiepsykhongdau
Hi all,
I just installed a CakePHP app on server of Plesk 9.0.1 for Microsoft
window and a strange thing happened.
 When  i tried to click any link in my site on a new browser window
and it said Not Found - The requested document was not found on this
server.
Besides, webroot  does n't work ( no CSS, JS and img).
I tested code on free host Byethost and runs good and updated data are
generally used to be.
I  loged into Plesk control panel and enable  permission for Plesk
IIS User  to full control but error above still appears.
Does anybody have an idea why this is happening and how I can resolve
it?

Thanks in advance for your nice help

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: small bug in auth components

2011-08-10 Thread Inteiro
Try

$this-Auth-fields['username'] = 'email';



On 10 aug, 00:58, muslimbit muslim...@gmail.com wrote:
 There is an error in the auth components when i init the username auth
 field only in beforfilter function :

 $this-Auth-fields = array(
             'username' = 'email'
             );

 i get a notice :

 Notice (8): Undefined index:  password [CORE\cake\libs\controller
 \components\auth.php, line 382]

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Why cake not build a good procedure for load components behaviour , help ?

2011-08-10 Thread vcrack
I known it's possible.. but, do you think that your plugin is
dependent with AppController ?
and you must know the AppController if you would make a
PLuginAppController ?

If CMS projects plugin develop by others and core by authors...
So if PluginOneAppController joined with AppController.. developer
plugin never know my AppController?

it's will be loss couple if cake create a function for Hook
components, helper..
and each plugin never have dependent with core app.. :-)

thanks in advance..

Jan

On Aug 10, 10:08 pm, euromark dereurom...@googlemail.com wrote:
 as far as I know, this is already done this way.
 they will be joined between AppController PluginAppController
 Controller in this order
 or did you experience it otherwise?
 it would surprise me because it works this way since several years in
 my apps.

 On 10 Aug., 15:01, vcrack vcrack.0...@gmail.com wrote:

  Hello all, my name Jan.. I'm Indonesian..
  I've used cake in my projects.. I've following cake since in cake
  1.1.8 till now.

  currently, I'm develop project which a lot of feature and I think in
  plugin.. cause, plugin is more independent, I guess.
  But, I have a question..

  Why cake doesn't make a function  to hook Components, Helpers,
  Behaviour?
  Why only create a attribute var $components, var $helpers , var
  $actsAs ?
  it's likely will override with child class..

  for example, in my project. I have a AutoLogin Component.. I wanna use
  this components to all controllers.
  So, in AppController I have var $components =
  array('AutoLogin','Another', .);

  afterwards, my patner make calendar plugin in my project, and in
  calendar plugin, he make CalendarFilter Components. and it's will use
  in all controllers calendar plugin. so he make var $components =
  array('CalendarFilter','Another');

  Well, it's will be override my AutoLogin Component.
  Okey, why he don't copy var $components from my AppController?
  oh, it's okey.. but do you think if my project is a CMS project?
  and users isn't a programmers ?
  and users install more than one plugin?

  so, Why cake doesn't make a function to Hook components, helpers, and
  behaviors?

  Please excuse my poor English..  thanks in advance..

  Jan

 http://jan.web.idhttp://idcakephp.org

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


Re: Non-Cake form, PagesController and Auth

2011-08-10 Thread BrendonKoz
I've checked the rendering of the form. There are no hidden form fields 
related to the security component since I'm not using the form helper. I'm 
not sure how to check which components are loaded during the rendering of a 
view (any ideas?). There are (found from a pr($this)) session limitations, 
but from what I can see the expiration time when security is set to medium 
on my site is approximately 1hr 40m. The user's session should not expire 
for 3hr 50m. According to employees, it was failing after 20-30 minutes.

It was described that upon submitting the form that the user would be 
forcefully logged out and sent back to the login page. This is the only page 
on the entire site that seems to have generated this type of issue.

I've been unable to reproduce this in any tests.

Does anyone have any ideas as to where I could look?

-- 
Our newest site for the community: CakePHP Video Tutorials 
http://tv.cakephp.org 
Check out the new CakePHP Questions site http://ask.cakephp.org and help others 
with their CakePHP related questions.


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


REMOVE ME

2011-08-10 Thread János Vasbányai
2011/8/11 cake-php+nore...@googlegroups.com

   Today's Topic Summary

 Group: http://groups.google.com/group/cake-php/topics

- Non-Cake form, PagesController and 
 Auth#131b6fb9c5b3381c_group_thread_0[1 Update]
- Why cake not build a good procedure for load components behaviour ,
help ? #131b6fb9c5b3381c_group_thread_1 [2 Updates]
- Error The requested document was not found on this 
 server#131b6fb9c5b3381c_group_thread_2[1 Update]
- small bug in auth components #131b6fb9c5b3381c_group_thread_3 [1
Update]
- Automatic filter by site #131b6fb9c5b3381c_group_thread_4 [1
Update]
- cakephp select option stored as 0 in database instead of selected
value #131b6fb9c5b3381c_group_thread_5 [1 Update]

   Topic: Non-Cake form, PagesController and 
 Authhttp://groups.google.com/group/cake-php/t/853a7891d495fe0e

BrendonKoz brendon...@hotmail.com Aug 10 02:34PM -0700 
 ^#131b6fb9c5b3381c_digest_top

I've checked the rendering of the form. There are no hidden form fields

related to the security component since I'm not using the form helper.
I'm
not sure how to check which components are loaded during the rendering
of a
view (any ideas?). There are (found from a pr($this)) session
limitations,
but from what I can see the expiration time when security is set to
medium
on my site is approximately 1hr 40m. The user's session should not
expire
for 3hr 50m. According to employees, it was failing after 20-30
minutes.

It was described that upon submitting the form that the user would be
forcefully logged out and sent back to the login page. This is the only
page
on the entire site that seems to have generated this type of issue.

I've been unable to reproduce this in any tests.

Does anyone have any ideas as to where I could look?



   Topic: Why cake not build a good procedure for load components behaviour
 , help ? http://groups.google.com/group/cake-php/t/17736169caa94e2b

euromark dereurom...@googlemail.com Aug 10 08:08AM -0700 
 ^#131b6fb9c5b3381c_digest_top

as far as I know, this is already done this way.
they will be joined between AppController PluginAppController
Controller in this order
or did you experience it otherwise?
it would surprise me because it works this way since several years in
my apps.






vcrack vcrack.0...@gmail.com Aug 10 10:31AM -0700 
 ^#131b6fb9c5b3381c_digest_top

I known it's possible.. but, do you think that your plugin is
dependent with AppController ?
and you must know the AppController if you would make a
PLuginAppController ?

If CMS projects plugin develop by others and core by authors...
So if PluginOneAppController joined with AppController.. developer
plugin never know my AppController?

it's will be loss couple if cake create a function for Hook
components, helper..
and each plugin never have dependent with core app.. :-)

thanks in advance..

Jan




   Topic: Error The requested document was not found on this 
 serverhttp://groups.google.com/group/cake-php/t/a17e8552cc0599eb

hiepsykhongdau phamthunga.lavender1...@gmail.com Aug 10 04:29AM -0700
^ #131b6fb9c5b3381c_digest_top

Hi all,
I just installed a CakePHP app on server of Plesk 9.0.1 for Microsoft
window and a strange thing happened.
When i tried to click any link in my site on a new browser window
and it said Not Found - The requested document was not found on this
server.
Besides, webroot does n't work ( no CSS, JS and img).
I tested code on free host Byethost and runs good and updated data are
generally used to be.
I loged into Plesk control panel and enable permission for Plesk
IIS User to full control but error above still appears.
Does anybody have an idea why this is happening and how I can resolve
it?

Thanks in advance for your nice help



   Topic: small bug in auth 
 componentshttp://groups.google.com/group/cake-php/t/72fff2451dc31117

Inteiro j...@inteiro.be Aug 10 12:51AM -0700 
 ^#131b6fb9c5b3381c_digest_top

Try

$this-Auth-fields['username'] = 'email';






   Topic: Automatic filter by 
 sitehttp://groups.google.com/group/cake-php/t/e68c5834d4496798

João Rodrigues jvrodrig...@gmail.com Aug 10 04:26PM +0100 
 ^#131b6fb9c5b3381c_digest_top

I want to make my application be aware of the url.
I have created a table of sites (id, url) and a table of news (id,
site_id,
etc.)
so I can get different news depending on the subdomain.
For example, economy news go in economy,example.com, sports news go in
sports.example.com
I also have more tables that have a site_id, for example, subscriptions
(id,
site_id, email, etc.)

So I have lots of models that I always want to filter by site_id. Do I
have
to explicitly put the condition on every find or is a way to
automatically
filter 

USE THE UNSUBSCRIBE LINK Re: REMOVE ME

2011-08-10 Thread Robert Maiolo
2011/8/10 János Vasbányai vasbanya...@gmail.com



 2011/8/11 cake-php+nore...@googlegroups.com

   Today's Topic Summary

 Group: http://groups.google.com/group/cake-php/topics

- Non-Cake form, PagesController and 
 Auth#131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_0[1 Update]
- Why cake not build a good procedure for load components behaviour ,
help ? #131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_1 [2 Updates]
- Error The requested document was not found on this 
 server#131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_2[1 Update]
- small bug in auth 
 components#131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_3[1 Update]
- Automatic filter by 
 site#131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_4[1 Update]
- cakephp select option stored as 0 in database instead of selected
value #131b73aa808ca5f0_131b6fb9c5b3381c_group_thread_5 [1 Update]

   Topic: Non-Cake form, PagesController and 
 Authhttp://groups.google.com/group/cake-php/t/853a7891d495fe0e

BrendonKoz brendon...@hotmail.com Aug 10 02:34PM -0700 
 ^#131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

I've checked the rendering of the form. There are no hidden form
fields
related to the security component since I'm not using the form helper.
I'm
not sure how to check which components are loaded during the rendering
of a
view (any ideas?). There are (found from a pr($this)) session
limitations,
but from what I can see the expiration time when security is set to
medium
on my site is approximately 1hr 40m. The user's session should not
expire
for 3hr 50m. According to employees, it was failing after 20-30
minutes.

It was described that upon submitting the form that the user would be
forcefully logged out and sent back to the login page. This is the
only page
on the entire site that seems to have generated this type of issue.

I've been unable to reproduce this in any tests.

Does anyone have any ideas as to where I could look?



   Topic: Why cake not build a good procedure for load components
 behaviour , help 
 ?http://groups.google.com/group/cake-php/t/17736169caa94e2b

euromark dereurom...@googlemail.com Aug 10 08:08AM -0700 
 ^#131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

as far as I know, this is already done this way.
they will be joined between AppController PluginAppController
Controller in this order
or did you experience it otherwise?
it would surprise me because it works this way since several years in
my apps.






vcrack vcrack.0...@gmail.com Aug 10 10:31AM -0700 
 ^#131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

I known it's possible.. but, do you think that your plugin is
dependent with AppController ?
and you must know the AppController if you would make a
PLuginAppController ?

If CMS projects plugin develop by others and core by authors...
So if PluginOneAppController joined with AppController.. developer
plugin never know my AppController?

it's will be loss couple if cake create a function for Hook
components, helper..
and each plugin never have dependent with core app.. :-)

thanks in advance..

Jan




   Topic: Error The requested document was not found on this 
 serverhttp://groups.google.com/group/cake-php/t/a17e8552cc0599eb

hiepsykhongdau phamthunga.lavender1...@gmail.com Aug 10 04:29AM
-0700 ^ #131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

Hi all,
I just installed a CakePHP app on server of Plesk 9.0.1 for Microsoft
window and a strange thing happened.
When i tried to click any link in my site on a new browser window
and it said Not Found - The requested document was not found on this
server.
Besides, webroot does n't work ( no CSS, JS and img).
I tested code on free host Byethost and runs good and updated data are
generally used to be.
I loged into Plesk control panel and enable permission for Plesk
IIS User to full control but error above still appears.
Does anybody have an idea why this is happening and how I can resolve
it?

Thanks in advance for your nice help



   Topic: small bug in auth 
 componentshttp://groups.google.com/group/cake-php/t/72fff2451dc31117

Inteiro j...@inteiro.be Aug 10 12:51AM -0700 
 ^#131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

Try

$this-Auth-fields['username'] = 'email';






   Topic: Automatic filter by 
 sitehttp://groups.google.com/group/cake-php/t/e68c5834d4496798

João Rodrigues jvrodrig...@gmail.com Aug 10 04:26PM +0100 
 ^#131b73aa808ca5f0_131b6fb9c5b3381c_digest_top

I want to make my application be aware of the url.
I have created a table of sites (id, url) and a table of news (id,
site_id,
etc.)
so I can get different news depending on the subdomain.
For example, economy news go in economy,example.com, sports news go in
sports.example.com
I also have more tables that have a