cakephp

How to limit data to users who own it without limiting admin users in CakePHP?

Currently I am writing an application where I have multiple users. They have data that should only be visible to them and not the other authenticated users in the system. I also have administrators who manage the system and have access to all of the information. What is the best way to limit users to their data without limiting admin use...

What's the correct way to use Cakephp urls?

Hello all, it's my first post here :) I'm having some difficulties with dealing with urls and parameters. I've gone through the router class api documentation over and over again and found nothing useful. First of all, I'd like to know if there is any 'universal' format in CakePHP(1.3) for handling urls. I'm currently handling all my u...

Routing configuration in cakephp

Hello all I am trying to implement routing in cakephp. I want the urls to mapped like this... www.example.com/nodes/main -> www.example.com/main www.example.com/nodes/about -> www.example.com/about So for this I wrote in my config/routes.php file.. Router::connect('/:action', array('controller' => 'nodes')); Now, I got the thing go...

Problem using HTML Link Helper in Cakephp 1.3.1

Hello all I am having a problem using $html->link helper in my view. Consider this snippet... /views/nodes/packages.ctp <li><?php echo $html->link( "Package 1", array( "packages", "package1" ) )?></li> Now when I click on the link, the address in address bar appears like http://www.server.com/nodes/packages/packages/package1 Why i...

cakephp: Warning (2): mysql_connect()

Using cakephp: I create a website & after upload my site to main server when I browse index page of my website it shows me cakephp: Warning (2): mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 111 [CORE/cake/libs/model/datasources/dbo/dbo_mysql can anyone...

Error loading il8n console in CakePHP 1.3

I'm trying to generate the .po files for the site I'm working with. When I run this command from within the console directory: Warning: strtotime(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those meth...

CakePHP dynamic element

I am trying to create a message-board type element in a CakePHP app. This element will be displayed on all pages and views that use a particular layout. I want it to display all the messages in the model, then show the add form when a link is clicked, then return to the updated message list when submitted. All this without affecting the ...

Want to save data field from form into two columns of two models.

I have a Profile model with a hasOne relationship to a Detail model. I have a registration form that saves data into both model's tables, but I want the username field from the profile model to be copied over to the usernamefield in the details model so that each has the same username. function new_account() { if(!empty($this->data)...

Specify database engine to use in fixtures

Is there a way to specify the database engine to be used for fixtures in CakePHP test fixtures? Some of my models depend on database transactions, and I would like to write some tests for their correct behavior. Currently I'm simply auto-importing the schema, but the tables get created with MySQL's standard MyISAM engine, which doesn't s...

Looking for a way to get HTTP Digest Authentication headers from incoming http requests

I've been working on a REST implementation with my existing Cake install, and it's looking great except that I want to use HTTP Digest Authentication for all requests (Basic Auth won't cut it). So great, I'll generate a header in the client app (which is not cake) and send it to my cake install. Only problem is, I can't find a method f...

Cakephp file upload problem.

I am using Cakephp as my framework. I have a problem in uploading my files through a form. I am using an Uploader plugin from THIS website. My php ini file has this piece of code. upload_max_filesize = 10M post_max_size = 8M this is from uploader.php --> plugin file has var $maxFileSize = '5M'; //default max file size In my co...

how to prevent an element to validate

hi to all i am using cakephp framework for my project. in on of my form i take a checkbox on click on this two other text box are shown. by using cakephp validates method i validate the form data but i want that when the checkbox is not checked then it avoid the validation for that text box. it check only when the checkbox is checked. ...

Accessing individual HABTM records in a form

I'm building a form in my CakePHP project that lets you edit a company's information. Among all other things, every company has at least one geographical area in which the company operates, but it may have more. The areas are selected individually using select dropdowns. The relationship between companies and areas is HABTM, because I n...

CakePHP ACL use case(s)

I have got a simple web app in development, i want to establish a couple of user groups; Admin, Doctors & Patients. Each group would have their access restricted to particular controller actions rather than individual content. So for example, Doctors can view patient records (index & view actions), but cannot delete them. Usually i wou...

Is there a CakePHP offline manual

There used to be, but there don't seem to be any direct links. A little digging around revealed some answers which I thought it would be useful to share. These are links to the manual in one page - useful for offline use or creating a PDF using Dardo Sordi Bogado's build script: http://rapidshare.com/files/218826372/manual-builder.zip ...

Cake PHP tutorials

I want to know is there any cake php tutorial for beginners. I searched for it but I didn't get a good one. ...

To retrieve value from a text box in a form (view) to controller in cake php

How to o retrieve value from a text box in a form (view) to controller in cake php? ...

Best IDE for debugging and Code Completion in CakePHP

Hi, I am new to CakePHP framework. Does anybody have any experience with a free IDE for Uuntu which can perform code completion and most importantly ability to debug CakePHP code? Any responses would be greatly appreciated. Thanks ...

CakePHP Routing Problem

I suffered a CakePHP Route Problem. I can only access the root "/" and it shows the CakePHP default welcome home page. Later I try to write my controller (icons_controller.php) and views (views/icons/index.ctp), it has problem. I typed in http://localhost:8080/myapp/icons/ It always says "Not Found The requested URL /myapp/icons/ was not...

CakePHP 1.3.0 Cookie Component destroy() then read() odd behavior

I found some interesting behavior with the CakePHP Cookie Component in my app today. It all started with a logout bug. My app was essentially allowing users to refresh the page and be re-logged-in if they had opted to "Remember me" (sets cookie). But it was only for that session. Next visit (new session), the bug would not appear - i.e. ...