Inserting record with id

2009-06-30 Thread Roman Brunnemann
Hi, i have a table products with the following columns ( simplified ) id shop_id name id and shop_id are the primary key. Now I have some kind of importer and want to insert data preparing my array like $i['Product']['id'] = $id; $i['Product']['shop_id'] = $shop_id; $i['Product']['name'] = $n

.htaccess password protect admin routes

2009-05-26 Thread Roman Brunnemann
Hi, I want to use the admin routes (this works) and protect the requests to e.g. admin/products/edit with .htaccess Given that everything is rewrited there is no real admin folder, so where do I have to place my .htaccess to tell, that users accessing a admin path have to make a normal authen

Re: Using Auth: Access denied even when I allow everything

2009-05-24 Thread Roman Brunnemann
Ricky Paz wrote: > If I were you, I would use $this->Auth->allowedActions(' * ') instead > of $this->Auth->allow. It works > > > Hi, thanks for your answer, but I got a *Fatal error*: Call to undefined method AuthComponent::allowedActions() in when calling $this->Auth->allowedActions(' * ');

Using Auth: Access denied even when I allow everything

2009-05-22 Thread Roman Brunnemann
Hi, I am using Auth and most of it works fine. But when I want to call a page directly as http://localhost/products/show/ it says ""You are not authorized to access that location.". So I went in the products controller and made a function beforeFilter() { $this->Auth->allow('show

CakePHP validates invalid data

2009-05-16 Thread Roman Brunnemann
Hi, strange behaviour I got in my register-form. I have a form that collect some basic data: Sourcecode: when I submit the form, the output of print_r($this->data) is the following: Array ( [Users] => Array ( [title] => Mr [firstname] => test

Re: Customizing auth flash messages

2009-05-15 Thread Roman Brunnemann
Perfect!!! Many thanks. This is what I was looking for. Best regards, Roman brian wrote: > Set $this->Auth->loginError in AppController::beforeFilter(). > > On Fri, May 15, 2009 at 10:57 AM, Roman Brunnemann > wrote: > >> Hi, >> >> short question and

Customizing auth flash messages

2009-05-15 Thread Roman Brunnemann
Hi, short question and I guess pretty easy for Pros. How can I customize the message from the Auth component. Everything works fine but in case the login fails I got "Login failed. Invalid username or password". But I need to change this message. I have to make it shorter to fit in my layout.

Append something to the Flash message

2009-05-11 Thread Roman Brunnemann
Hi, short question. I call different methods of a controller on one page request. Most of the functions should write something to the view. I use setFlash for this. But it only shows me the message from the last "setFlash" call. Is there a way to append something to the existing value? Thanks

Get autoincrement ID after save (insert)

2009-05-07 Thread Roman Brunnemann
Hi, quick question from a newbie. After saving data that will result in a create, I'd like to retrieve the ID from the auto increment field in the database. e.g. I have a database table "person" with columns id, name, city. Now I create an array $array['Person'] = array( "name" => "John Smith

find with group and two tables

2009-05-05 Thread Roman Brunnemann
Hi, first of all I am a newbie so this might be a very easy question. But not for me ;-) How can I retrieve data with the find method while grouping and retrieving the maximum value of a second table? The beginning of the Controller class: class InvoicesController extends AppController {