Re: Caching part of view and user-specific sidebar problem

2012-06-19 Thread thanat
Yes, you can use requestAction from within an element. in your element you can write $data = $this-requestAction(array('controller' = 'test', 'action' = 'getdataforelementaction' )); and in your controller public function getdataforelementaction() { if (isset($this-params['requested'])) {

Re: Problem with CakeEmail - rewrite default config and bcc delivery does not work

2012-06-19 Thread Anna P
I managed to switch to a newsletter layout by creating another config in app/Config/Email.php : public $newsletter = array( 'transport' = 'Mail', 'charset' = 'utf-8', 'headerCharset' = 'utf-8', 'layout' = 'default',

Using a plugin behaviour

2012-06-19 Thread Jeremy Burns
I'm just breaking my way into CakePHP 2. I'm trying to attach the SluggableBehavior from the CakeDC Utils Plugin to a model and am really struggling to find any decent resource that outlines the steps to do this. The official documentation on the usage of plugins, and specifically the usage of

Re: Using a plugin behaviour

2012-06-19 Thread Tilen Majerle
you need to activate plugin CakePlugin::load('Utils'); -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/6/19 Jeremy Burns jeremybu...@classoutfit.com I'm just breaking my way into CakePHP 2. I'm trying to attach the SluggableBehavior from the CakeDC Utils Plugin to a model and am really

Re: Count (return as a number) associated data.

2012-06-19 Thread Steve Found
You would probably be better off having a countPosts() function in your User model which is... public function countPosts( $userId ){ $count = $this-Post-find('count', array( 'condition' = array('user_id' = $userId) ) ); return $count; } That way you can add in more conditions later,

Re: Using a plugin behaviour

2012-06-19 Thread Jeremy Burns | Class Outfit
Yup - all plugins are loaded in bootstrap... Jeremy Burns Class Outfit http://www.classoutfit.com On 19 Jun 2012, at 10:59:11, Tilen Majerle wrote: you need to activate plugin CakePlugin::load('Utils'); -- Lep pozdrav, Tilen Majerle http://majerle.eu 2012/6/19 Jeremy Burns

Re: Using a plugin behaviour

2012-06-19 Thread Steve Found
On 19/06/12 09:49, Jeremy Burns wrote: I'm just breaking my way into CakePHP 2. I'm trying to attach the SluggableBehavior from the CakeDC Utils Plugin to a model and am really struggling to find any decent resource that outlines the steps to do this. The official documentation on the usage of

Re: how to generate this sql

2012-06-19 Thread dogmatic69
Cake does not support HAVING but you can put it in the group as a string. Something like the following: $this-Timesheet-virtualFields = array( 'count_name' = 'COUNT(id)' ); $this-Timesheet-find( 'all', array( 'fields' = array( 'Timesheet.user_id', 'Timesheet.date', 'count_name' ), 'group' =

Cake 2.1.3 bake error class appmodel not found

2012-06-19 Thread li9ht
http://stackoverflow.com/questions/11095805/cake-bake-2-1-3-appmodel-not-found http://stackoverflow.com/questions/11095805/cake-bake-2-1-3-appmodel-not-found got this error when baking Fatal error: Class 'AppModel' not found in C:\xampp\htdocs\cakephp\lib\Cake\Model\CakeSchema.php on line 308

User Info from Auth Component

2012-06-19 Thread Joey Hauschildt
debug($this-Session-read('Auth.User')); and debug($this-Auth-User()); both return: array( 'User' = array( 'password' = '*', 'email' = 't...@example.com' ) ) These are the fields that the user uses to log in. The password isn't even hashed. When I print_r, it displays the actual password. I

Re: User Info from Auth Component

2012-06-19 Thread Jeremy Burns | Class Outfit
You should be hashing the password before saving it. Jeremy Burns Class Outfit http://www.classoutfit.com On 19 Jun 2012, at 19:41:30, Joey Hauschildt wrote: debug($this-Session-read('Auth.User')); and debug($this-Auth-User()); both return: array( 'User' = array(

Re: User Info from Auth Component

2012-06-19 Thread Joey Hauschildt
I am. All passwords in the db are hashed. The problem seems to be that instead of getting info from the users table, it is only filling debug($this-Session-read('Auth.User')); and debug($this-Auth-User()) with data from the form. Otherwise the password would be hashed. It has nowhere else to

Re: User Info from Auth Component

2012-06-19 Thread Max Dörfler
http://book.cakephp.org/2.0/en/core-libraries/components/authentication.html#identifying-users-and-logging-them-in In 2.0 $this-Auth-login($this-request-data) will log the user in with whatever data is posted, whereas in 1.3 $this-Auth-login($this-data) would try to identify the user first and

Re: how to generate this sql

2012-06-19 Thread Adam Symonds
Thanks, This is what I ended up doing in my records controller function but I get the following error:* Column not found: 1054 Unknown column 'count_name' in 'having clause' * $this-Timesheet-virtualFields = array( 'count_name' =

Re: how to generate this sql

2012-06-19 Thread dogmatic69
Sorry Cake creates the fields as Model__filed so it should be 'group' = 'Timesheet.user_id, Timesheet.date HAVING Timesheet__count_name 1', On Tuesday, 19 June 2012 23:52:43 UTC+1, elogic wrote: Thanks, This is what I ended up doing in my records controller function but I get the

Re: how to generate this sql

2012-06-19 Thread Adam Symonds
Thanks, worked perfectly. On Wed, Jun 20, 2012 at 9:17 AM, dogmatic69 dogmati...@gmail.com wrote: Sorry Cake creates the fields as Model__filed so it should be 'group' = 'Timesheet.user_id, Timesheet.date HAVING Timesheet__count_name 1', On Tuesday, 19 June 2012 23:52:43 UTC+1, elogic

url=controller/function appears now in my url address bar

2012-06-19 Thread elogic
Hi All, I moved a site from one server and upgraded it from 1.3.x to 2.x and now in the url I am getting something like this: /units/staffindex?url=units%2Fstaffindex The url=units%2Fstaffindex part is new to me. Any idea why it is now there and how do I get rid of it? Everything works as