Re: Cake 2.2 Can't save/update database

2012-09-17 Thread Max Dörfler
A few Ideas: * set your primaryKey attribute to 'ID' in the model: http://book.cakephp.org/2.0/en/models/model-attributes.html#primarykey * debug the return value of your save($data) call * debug $this->Player->validationErrors after the save call * try setting the model ID ($this->Player->id =

Re: Problem with adding records

2012-07-11 Thread Max Dörfler
Is the Auto Increment attribute set for the ID column? On 07/11/2012 03:39 PM, mohit kumar wrote: Hi Folks, I created an add action for users, I am trying to register them using this action. Everything is going fine, the data is being submitted, the passwords are being hash and if I check the

Re: Edit User on second submit

2012-07-11 Thread Max Dörfler
I guess in your view you have to pass in the id (echo $this->Form->input('id');). This should include a hidden id field. I wonder why it works the first time (without leaving a field blank). Are you sure the user gets edited and not a new user created? Because when you save $this->request->data,

Re: Is there a way to override CakeRequest.php (and for that matter any other Lib file) at the App level?

2012-07-03 Thread Max Dörfler
Hi, have you tried copying the core "CakeRequest.php" to "app/Lib/Cake/Network/CakeRequest.php" and do your changes there? I think I remeber doing something like this with the Dispatcher and cake automagically used the one from the app. The problem I had back then was that I had to copy the w

Re: User Info from Auth Component

2012-06-20 Thread Max Dörfler
rote: This could be the case - a wrongly implemented Authentication system. @Joey Hauschildt $this->Auth->user() and the "Auth.User" Session key should both return/contain the full user information - i.e. all fields from the users DB table. This behaviour is stra

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 fi

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

2012-06-18 Thread Max Dörfler
You could get the size of $result['Post'] if you already have the $result like you wrote. See count() or sizeof(). Or you could do a find('count') on the Post Model like $this->User->Post->find('count', array('conditions' => array('Post.user_id' => 2))); On 06/19/2012 12:24 AM, JonStark wrote:

Re: RSS in the Bakery broken

2010-10-27 Thread Max Dörfler
Am 27.10.2010 12:19, schrieb Max D: Hey, the RSS feed in the bakery seems to be broken. I worked a while ago, but now http://bakery.cakephp.org/articles/rss throws an error: Error: The requested address '/articles/rss' was not found on this server. I didn't know who to contact with this issue.

Re: where can i find permissions to delete folders?

2010-09-07 Thread Max Dörfler
ee for deletion? On 7 Sep., 14:19, "Max Dörfler" wrote: rmdir just works on emty directories NAME rmdir - remove empty directories SYNOPSIS rmdir [OPTION]... DIRECTORY... DESCRIPTION Remove the DIRECTORY(ies), if they

Re: where can i find permissions to delete folders?

2010-09-07 Thread Max Dörfler
rmdir just works on emty directories NAME rmdir - remove empty directories SYNOPSIS rmdir [OPTION]... DIRECTORY... DESCRIPTION Remove the DIRECTORY(ies), if they are empty. "rm -r" would recursively delete a nonempty directory, but it's a dangerous c

Re: isAuthorized seems not to be called

2010-09-06 Thread Max Dörfler
Hi, Since it's the login and register action, I bet you have them in allow(). So the Auth component is disabled for those actions and isAuthorized is never called. You need to check it somewhere else (e.g. beforeFilter). Max Am 05.09.2010 22:28, schrieb Simon: I have a isAuthorized functio

Re: CakePHP site, all pages locked out to non-admins

2010-09-01 Thread Max Dörfler
This sounds like the default deny message by the Auth component. (http://book.cakephp.org/view/1250/Authentication) Putting Auth in the components array locks you out of every action by default. Look if the Auth component is in your app_controller or some other controller. To disable Auth for a

Re: after adding an hasOne relation to model it is not available in my view anymore

2010-08-19 Thread Max Dörfler
Hi, whats the find call for $user? what does debug($user); spit out? Greetings Max Am 19.08.2010 20:58, schrieb Tomfox Wiranata: hi, weird thing. i declare a hasOne relation: class User extends AppModel { var $name = 'User'; var $hasOne = array( 'Link' => array(

Re: Save moltiple fields at once

2010-08-17 Thread Max Dörfler
Hi, see saveAll http://book.cakephp.org/view/1031/Saving-Your-Data You can create the form which generates the needed output to feed saveAll like the following: Form->create('Setting'); foreach ($settings as $key => $setting) { echo $this->Form->input('Setting.'.$key.'.id', array('value' =

Re: auth component issue

2010-08-12 Thread Max Dörfler
Hi, that is beacuse when you create the user, the plaintext password gets encrypted. When you now edit the user, the encrypted password gets loaded and when you save your user, the encrypted password gets encrypted again. (so the already encrypted password is handled as if it's a plaintext pa

Re: hasMany Problem

2010-08-11 Thread Max Dörfler
Hi, ich bin mir nicht sicher, ob ich das alles richtig verstehe, kannst du vielleicht den Code deiner Models (den ganzen hasOne, hasMany, belongsTo Kram) schicken? Da du dich scheinbar auch nicht so richtig an die Namenskonventionen hältst, ist das übersichtlicher. :) Weil z.B. eine "Friend" R

Custom find Methods in Behavior

2010-08-11 Thread Max Dörfler
Hey, I heard of this cool method of writing custom find methods in tehtreags's bakery post (http://bakery.cakephp.org/articles/view/model-repletion) and now tried to use it in a Behavior, but failed. Im using cake 1.3.0 The Code: http://pastebin.com/92753BmZ The Problem: - I have an articl

Re: Upload Photo Using PHP

2010-07-22 Thread Max Dörfler
Hi, have a look at File Fields: http://book.cakephp.org/view/1411/File-Fields and the FileUpload Component, which does pretty much everything for you. http://github.com/webtechnick/CakePHP-FileUpload-Plugin It works with or without a model, but it's all explained in the readme. Am 22.07.2010 11

saveAll and validation Error on associated Model

2010-07-19 Thread Max Dörfler
Hi Folks, I Have the following: Transaction hasMany ArticlesTransaction Transaction belongsTo Address ArticlesTransaction belongsTo Article ArticlesTransaction belongsTo Transaction ArticlesTransaction belongsTo Shipping (and some other Associations) and want to save the following with Transa

Re: Cakephp and XAMPP installation nightmare, Can't get cake to understand root

2010-07-12 Thread Max Dörfler
And try "registration" in the url, not "registeration" cheers Am 12.07.2010 10:30, schrieb nini: Try http://localhost/cake1.3.2/users/registeration and please read manual. On Jul 12, 1:20 am, Dinu464 wrote: 1) XAMPP 1.7.3 setup and workinghttp://localhost/xampp/-> success 2) Unpacked c