RE: Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Advantage+
Why not from the controller? Sure from model makes more sense but you can
still do it from the controller

 

$this->alias->saveField()

 

 

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Chetan Varshney
Sent: Sunday, April 28, 2013 3:02 PM
To: cake-php@googlegroups.com
Subject: Re: Is it possible to add any date for saving in beforeSave method
in app_controller.php

 

Please ignore previous reply-
Now
You cannot do save these fields from app controller rather than you can do
it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman 
wrote:

Hi Experts,

I have almost 23 table in which i have added created_by and modified_by
field. Is there any way to save these two field from app_controller.php. I
mean i dont want to add those field in eash method where i am saving. I want
to do it from app_controller.php. Please let me know it is possible or not.

 

Thanks

Zahid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com
 .
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 




-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Security Release - CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4

2013-04-28 Thread mark_story
If you are using CakePHP's PaginatorComponent without whitelisted sort 
fields you should upgrade as soon as possible to prevent
possible SQL injections.

CakePHP 1.2.12, 1.3.16, 2.2.8 and 2.3.4 have just been released to fix a 
critical issue with how pagination & PaginatorComponent handle sort 
criteria. When paginating without a sort column whitelist it was possible 
to execute arbitrary SQL by manipulating the sort conditions. In the 
following days we will offer a full description of the vulnerability and 
how it can be exploited, after some reasonable time has passed for our 
users to upgrade.

In addition to the security fix 2.3.4 contains fixes for the following 
issues:

* Support for HTTP code 505 was added.
* Router::currentRoute() returns false when there is no current route.
* Writing to file cache after clearing a group now works as expected.
* Asset URLS using fullBase are now generated correctly when not using URL 
re-writing.

There are no additional fixes outside the security fix in 2.2.8.

In addition to the security fix 1.3.16 contains fixes for the following 
issues:

* Databases is now singularized correctly.
* Saving translations with saveAll() now works better.
* Oracle listSources() no longer reads from the global table namespace.
* The cake console command now works on MacOS properly.
* Mixing query[contain] and contain() now interact properly.

In addition to the security fix 1.2.12 contains fixes for the following 
issues:

* umask is now set when creating cache files.
* Boundaries for multipart email messages are now generated correctly.
* Compatibility with PHP 5.4 has been improved.

We recommend all users of 1.2, 1.3, and 2.x release series upgrade as soon 
as possible to the new releases.

Links
--

* Download a packaged release http://github.com/cakephp/cakephp/tags
* View the changelogs http://cakephp.org/changelogs

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Problem with Pagination of search results

2013-04-28 Thread Lilit
I see nobody knows...



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Problem-with-Pagination-of-search-results-tp5714685p5714690.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




General Search on Every Page - CakeDC Search

2013-04-28 Thread Brett Forath
Hello,

I'm very new to CakePHP and I'm liking it so far, but I'm running into some 
trouble when searching the database.  I'm using the CakeDC Search plugin 
and I'm able to search on a particular page, but I'm not sure how I would 
implement it so that I have access to search on every page.  Also, I want 
to have one search bar that searches for anything about the user or product.

Here's what I would like to do:
- On the top right of any page have a search bar
- I want the user to be able to type anything pertaining to a product or 
user in the search bar.
- I also want to have filters such as: zip code, city, state, address, etc.

I've been looking for some examples and just can't find anything that 
covers what I'm looking for.  Any help would be greatly appreciated.  

Thank You,
Brett

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: about "Notice (8): Undefined index:"

2013-04-28 Thread Khánh Vương
Hi, I have same error. Please let me know way to solve this problem. Thanks!

On Tuesday, April 2, 2013 11:26:14 PM UTC+7, wen ger0606 wrote:
>
> I'm using 2.3.1 cakephp.
> When you run the following simple code, "Notice (8): Undefined index: 
> User [APP / View / Users / index.ctp, line 6]" occurs.
> If you run in cakephp 2.3.1 on another server the same code, the error 
> does not occur.
>
> - UsersController.php ---
> class UsersController extends AppController {
> public $ uses = array ('User');
> public $ layout = 'default';
> public function index () {
>   $ userData = $ this-> User-> find ('all');
>   $ this-> set ('userData', $ userData);
> }
> }
>
> - User.php ---
> class User extends AppModel {
> public $ name = 'User';
> }
>
> - Index.ctp ---
> 
> 
> 
>  
> 
> 
> 
>
> - Debug ($ userData) ---
> $ userData = array (
>(int) 0 => array (
>  (int) 0 => array (
>  'id' => '1 ',
>  'name' => 'suzuki'
>  )
>)
> )
>
> Set so the server, I think that there is such a phenomenon occur?
> If there is a point that I noticed something, please advice.
> *best regards*
>

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




New to CakePHP having some trouble.

2013-04-28 Thread Dean Lundy
Hello, I am trying to get started with this framework and having problems 
getting a basic index page to load. I am using DHTMLX Scheduler to make a 
simple scheduling system which I would like to then add to. Right now I am 
just trying to get a blank schedule loaded for the index page with no data. 
Looking at the page source all the javascript files and css files I am 
using are linking properly, however the actual init function for the 
scheduler is never being used and I am unsure how to fix this. Coming from 
java the way cakePHP loads its scripts is a little weird to me. 


On a side note I have the controller setup but the index method is blank as 
I am not loading anything from the database yet.



Here is my view, let me know if you guys need anything else and thanks for 
looking at my issue.


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
http://www.w3.org/1999/xhtml";>

  Html->script('jquery'); ?>  
  Html->script('/dhtmlx/dhtmlxscheduler'); ?>  
  Html->css('/dhtmlx/dhtmlxscheduler'); ?>   
  


  

 
 








   


scheduler.config.multi_day = true;
scheduler.config.xml_date="%Y-%m-%d %H:%i";
scheduler.config.first_hour = 5;
scheduler.init('scheduler_here',new Date(2010,7,5),"week");




-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Paginate search results

2013-04-28 Thread Lilit
Hi people.
I'm new to cakephp and need your help. I have this search function in my
UsersController, so there's a problem with search result pagination. The
first page shows first five names properly, but next pages does not show
anything. I need that this session save all my users, then check and
basically read it in next pages.
so how it should be?
th error message 

*Undefined index: pageCount [CORE\Cake\View\Helper\PaginatorHelper.php, line
702]*

and the
public function search() {

if (!empty($this -> data)) {
$keyword = $this -> data['User']['search'];
$this -> Session -> write('users', $keyword);

if ($this -> Session -> check('users')) {
$keyword = $this -> Session -> read('users');

} elseif (isset($keyword, $this -> 
data['User']['search'])) {
$this -> paginate = array('conditions' => 
array('OR' =>
array("User.first_name LIKE" => "$keyword%", "User.last_name LIKE" =>
"$keyword%")), 'limit' => 5);
$this -> set('users', $this -> 
paginate('User'));

}
}

pls helpp
Thanks in advance :)



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Paginate-search-results-tp5714685.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Paginate component fetches all data not paged data

2013-04-28 Thread cyletech
Hello all,

I have a model and i want to paginate its data. all i do is, creating a
model, something like this,

and include Paginator component in my controller and use it, something like
this,


And I have a table with "my_controllers" name and it has 10 records. if
everything was fine, the paginator component must give me 5 records for page
one and 5 records for page 2. but it gives me 10 records without any paging.

What is the problem? :( 


Thank you



--
View this message in context: 
http://cakephp.1045679.n5.nabble.com/Paginate-component-fetches-all-data-not-paged-data-tp5714688.html
Sent from the CakePHP mailing list archive at Nabble.com.

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Chetan Varshney
*Please ignore previous reply-*
Now
You *cannot* do save these fields from app controller rather than you can
do it from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman wrote:

> Hi Experts,
> I have almost 23 table in which i have added created_by and modified_by
> field. Is there any way to save these two field from app_controller.php. I
> mean i dont want to add those field in eash method where i am saving. I
> want to do it from app_controller.php. Please let me know it is possible or
> not.
>
> Thanks
> Zahid
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Re: Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Chetan Varshney
You can do save these fields from app controller rather than you can do it
from app_model.

override beforeSave function and modify query for changed_by and modified_by

On Sun, Apr 28, 2013 at 10:56 PM, Zahidur Rahman wrote:

> Hi Experts,
> I have almost 23 table in which i have added created_by and modified_by
> field. Is there any way to save these two field from app_controller.php. I
> mean i dont want to add those field in eash method where i am saving. I
> want to do it from app_controller.php. Please let me know it is possible or
> not.
>
> Thanks
> Zahid
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscr...@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>



-- 
Chetan Varshney
Ektanjali Softwares Pvt Ltd

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




Is it possible to add any date for saving in beforeSave method in app_controller.php

2013-04-28 Thread Zahidur Rahman
Hi Experts,
I have almost 23 table in which i have added created_by and modified_by
field. Is there any way to save these two field from app_controller.php. I
mean i dont want to add those field in eash method where i am saving. I
want to do it from app_controller.php. Please let me know it is possible or
not.

Thanks
Zahid

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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




RE: Deletion Simulation

2013-04-28 Thread Advantage+
Its still in dev stage so I want to make sure when its live ther are no dead
records. I might just end up using the database to cascade and run it that
way.

 

I was just hoping cake had a way to see the delete cascade.

 

I might work on a beforeDelete() type thing to pull the delete query and
follow all relations and echo it out.

 

From: cake-php@googlegroups.com [mailto:cake-php@googlegroups.com] On Behalf
Of Jeremy Burns : Class Outfit
Sent: Sunday, April 28, 2013 4:11 AM
To: cake-php@googlegroups.com
Subject: Re: Deletion Simulation

 

Is this for development of production? I'd say use a transaction for
starters (http://book.cakephp.org/2.0/en/models/transactions.html) whether
in dev or prod mode, then either commit on success or rollback on failure or
in dev mode. You could then use some debug or log statements at various
points to see what data is affected.


Jeremy Burns

Class Outfit

http://www.classoutfit.com 

 

On 24 Apr 2013, at 12:32, godjen99  wrote:





I would recommend using Unit Tests. It will take some time to set up the
data (fixtures) and write the tests and such, but it will benefit your whole
project too. 

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
--- 
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to cake-php+unsubscr...@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

-- 
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

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