cakephp-1.3

CakePHP ACL - How to get Group-only permissions?

I just want group only permissions - I don't need user based permissions. The cake 1.3 manual (http://book.cakephp.org/view/1646/x11-2-4-1-Group-only-ACL) says: In case we want simplified per-group only permissions, we need to implement bindNode() in User model. function bindNode($user) { return array('Group' => array('id' ...

Habtm find with a condition

I have two tables which are related as HABTM Groups (id, name) Streams(id, Stream) connecting table groups_streams(id, group_id, stream_id) there is another model called Users which HasOne Group. From User controller i am trying to get the streams related to the Users GRoup. i am doing this but getting a Mysql Error $streams = $thi...

Deleting Habtm Relation Record

I have two models Posts and Tags Posts HasManyBelongsToMany Tags lets say a post 1 has tags world, news, paper now in the joining table i wanna remove the relation between tag paper with the post 1. but the tag paper should be there in the tags table. just in the joining table the relation should be deleted. how to do this in CakePHP...

check auth session in controller

Hi there, I have used Auth component in my cakephp site. I want to check whether auth session is there or not from controller. Please help. ...

How to include associations in find() with fieldlist

Hello. I want to receive model data by find(all), but the user should get only a restricted set of table fields. That's easy: $ret = $this->find('all',array('fields'=>array( 'Employee.id','Employee.address_id' ))); But this model (Employees model) also has a belongsTo association: var $belongsTo = array( 'Address' => array( ...

Get the last insert id

Hello I am using cakePHP 1.3 and I am unable to retreive the last inserted row's id. I actually am using $this->Model->id to retreive the last inserted id but I am unable to get the id. When tried to check what is return type, it says as bool(false), which means nothing is returned. Here I am loading a different model in a different con...

from where to get wheather Rss feeds of all over the world?

Hi, Currently I am working on Weather Rss Feeds In which I have to get the information of region wise country's and their city's Weather. I searched Many sides but not get proper web-link to get weather Rss feeds. Please .. Help me. ...

Cakephp Relationships

I have a few models which are not in the default cakephp format user(id, name....) 1 Harsha ... 2 John .... dishes(id, name, price ...) 1 "Cheese Pizza" 6 2 "Zinger Burger" 3 restaurants (id, name, .....) 1 "KFC" ... 2 "Pizza Hut" ... module(id, name) values (User, Dishes, Restaurants) 1 "Users" 2 "Dishes" 3 "Restaurant" i...

cakephp behavior afterFind not called on related models

I am using an afterFind function to modify data from a find function. It works fine. If I move the afterFind function into a behavior (in a plugin) it still works, but only when the model of interest is the primary model, i.e. it isn't called when the model belongsTo another model. Is there any way round this? I'm using cake 1.3.4. This ...

Cakephp afterFind() help

i have a Search Result like this in an array Array ( [0] => Array ( [StatusMessage] => Array ( [id] => 1 [pid] => 0 [message] => First Status Message [item_id] => 1 [commenters_item_id] => 2 ...

cakePHP: Can you query the database from a helper class?

Hi just need to know whether you can query the database from inside a helper class, whether you should and how you do it. Thanks ...

Cakephp Validation

I am using an Account Controller which doesnt have its own table but uses User Model. All works fine except - when I validate any form. It says validation fails (when I try to fail the validation to check) but doesnt throw the error below the field View <?php echo $this->Form->input('id'); ?> <label for="UserPassword">Ne...

Cakephp Complex Relation Find

I have a little complex Database model on which i am not able to make a proper find user(id, name...) 1 Harsha 2 Jasmine modules (id, name ) 1 Users 2 Restaurants 3 Dishes restaurant (id, name.... ) 1 KFC 2 Pizza Hut dishes (id, name, restaurant_id .. ) 1 Cheese Pizza 2 items (id, module_id, item_id) 1 1 1 (refers to U...

Having actions/pages without requiring a login

Hello, I am building an application using cakePHP. Do we have a method where we can allow public users access to certain pages without logging in. There would be a few pages such as about us regarding the whole organisation or a contact us page. Is there a method to avoid login access, something similar to how we have ways to add compone...