Irregularidade da palavra Conta

2008-01-18 Thread Marcus Reis
Saudações padeiros! Estou com problemas no bake, quando crio o model Lancamento que por sua vez pertence ao model Conta, aparece para mim desta forma: Bake Model Path: /var/www/app/models/ --- Possible Models based on your current

Re: Irregularidade da palavra Conta

2008-01-18 Thread Bill
Tive a mesma dificuldade, com uma tabela Ocorrencias, que virou ocorrencium. Pra resolver, eu gerei via bake de maneira errada mesmo, como se a tabela fosse ocorrencium, depois disto, alterei o inflections.php da seguinte maneira: $pluralRules = array('/(.*)ia$/i' = '\1ias',

Is it possible to display two view templates on one function?

2008-01-18 Thread Louie Miranda
Is it possible to display two view templates (*.ctp) on one function? example.. function view($id == null) { if ($id == 1) { // display page 1 } else { // id2 // display page 2 } } How could i do this? -- Louie Miranda ([EMAIL PROTECTED]) http://www.axishift.com

Xml and CAKE_ADMIN

2008-01-18 Thread [EMAIL PROTECTED]
Hi I have configurated CakePHP with webservice and CAKE_ADMIN enable. If I use them separately they work perfectly. But If I would use then together which url have I to use? http:www.mysite.com/xml/admin/controller/view doesn't work http:www.mysite.com/xml/controller/admin/view doesn't work

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread the_woodsman
Explicitly call the controller's render() function with the name of the view file. If no call to render() is made, the default view for this action will be used, unless turn off autoRender too. On Jan 18, 8:01 am, Louie Miranda [EMAIL PROTECTED] wrote: Is it possible to display two view

thoughts about elements

2008-01-18 Thread [EMAIL PROTECTED]
Hi everyone, I have been thinking a bit about how elements work and how to best make use of them. My starting-point is that I really don't like having to set a variable in the controller to get it to the view and then have to also pass it along to the element. This somehow feels redundant to me

Re: i don't know why

2008-01-18 Thread AD7six
On Jan 18, 10:03 am, MrTufty [EMAIL PROTECTED] wrote: You're not telling us anything about your specific situation, so it's unlikely anyone is going to be particularly helpful. I feel like being a bit particular :). My powers are telling me that allenxie should remove cake/ from the url

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread AD7six
On Jan 18, 10:06 am, Frobozz [EMAIL PROTECTED] wrote: In my opinion it's more correctly to keep one view template that contains both view templates and switches between them (so you'll got one one view file for controller/action - that is how CakePHP wants you to do this). Since when?

Re: i don't know why

2008-01-18 Thread MrTufty
You're not telling us anything about your specific situation, so it's unlikely anyone is going to be particularly helpful. Some things that would help: What version of Cake are you using? What environment are you running it in? Windows? Linux? Where do you have it installed? With that

Re: thoughts about elements

2008-01-18 Thread AD7six
On Jan 18, 9:43 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I have been thinking a bit about how elements work and how to best make use of them. My starting-point is that I really don't like having to set a variable in the controller to get it to the view and then have to

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread Frobozz
In my opinion it's more correctly to keep one view template that contains both view templates and switches between them (so you'll got one one view file for controller/action - that is how CakePHP wants you to do this). Louie Miranda: Is it possible to display two view templates (*.ctp) on one

Re: Differing Array structures with HABTM find requests? Multiple Views?

2008-01-18 Thread designvoid
Noone able to add any insight to this? Sorry to bump, I know its annoying, but I'm loathed push forward with this app if I'm unsure about cases like this... --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: afterFind() dillemna - eats memory for breakfast

2008-01-18 Thread grigri
Whether using database functions like CONCAT(), or php code, I agree it would be nice to handle fields in a simple, easy manner. In a project a while ago I was storing a comma-delimited list in a database field [I had my reasons] and explode()ing it in afterFind. The afterFind code, to handle all

Re: maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta

2008-01-18 Thread AD7six
On Jan 18, 10:39 am, Chaso [EMAIL PROTECTED] wrote: Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the children are missing in the threaded array (children is empty). I did a little further

Re: afterFind() dillemna - eats memory for breakfast

2008-01-18 Thread Flipflops
Hi AD7six I like you answer - letting the database use CONCAT leaves your code nice and clean, how exactly are you suggesting to do it though? Can you append it to the model in some way when you use a built in method (e.g. findAll) or were you suggesting creating a custom query function in

Re: Auth Component encrypting password before validation.

2008-01-18 Thread phpjoy
nate, someone could want to use other hashing methods and not the default one. i vote for enabling :) and adding the last crypt component to cake :D On Jan 18, 6:18 am, nate [EMAIL PROTECTED] wrote: No. Disabling password hashing is Evil with a capital E. That's why I don't let you do it.

Re: Dropdown without using generateList

2008-01-18 Thread grigri
How is the event_name stored in the database? As a numeric index or as a text field? The code you've written assumes it's a numeric index (value '2' is displayed as 'Anniversary', ...) If it's a text field then you need to have the same values as display fields; the easiest way to do this is:

Dropdown without using generateList

2008-01-18 Thread krr
I have an events table which has event_name as one of the fields. The value for this field is restricted (has to be a value from a set of values, like 'Birthday', 'Anniversary', etc). So it is better to have a dropdown instead of textbox in the views (add edit). Since these are not part of any

Re: Sharing Session across Different Applications

2008-01-18 Thread Kyo
Thanks Adam. I did the method you suggested and found it very nice, but I'm having another problem now. In my case, it works in two different cake applications within one domain, but it doesn't seem to work in two separate domains. I did the following: This does a redirect from

Re: Why do I get No id set for Library::view()?

2008-01-18 Thread powtac
Found the mistake: I redirected to the view controller and it requires an id! Fix: redirect to index: $this-redirect('index'); --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group,

Re: Why do I get No id set for Library::view()?

2008-01-18 Thread powtac
Other solution: In my controller after $this-Library-save($this-data); I now use $this-redirect('view/'.$this-Library-getLastInsertId()); to redirect to the view of the saved data... --~--~-~--~~~---~--~~ You received this message because you are subscribed to

Re: Auth Component encrypting password before validation.

2008-01-18 Thread djiize
You can already choose your hashing method, see in function Auth::hashPasswords If you define Auth-authenticate variable with the name of an object of your own that definse the function hashPasswords, this function will be called instead of the Auth default one If you just want md5 or sha256

Why do I get No id set for Library::view()?

2008-01-18 Thread powtac
When I save a new library I recieve this No id set for Library::view() flash message. The library has 3 database fields: id, content, timestamp. But in my controller I only fill content and save it. The field id is a auto_increment field, so do I have to fill it manually?

ACLs: ACO and ARO schema.

2008-01-18 Thread RichardAtHome
Could some kind soul please post (or point to a post of) the models that map to the baked acos, aros and aros_acos tables please? A minor side note: As these are baked tables, shouldn't bake 'know' about these tables and their relationships automatically or give you an option to bake them models

Re: maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta

2008-01-18 Thread Chaso
thanks! changeing the line works! On 18 Jan., 10:50, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 10:39 am, Chaso [EMAIL PROTECTED] wrote: Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the

Re: afterFind() dillemna - eats memory for breakfast

2008-01-18 Thread AD7six
On Jan 18, 10:16 am, Flipflops [EMAIL PROTECTED] wrote: Hi AD7six I like you answer - letting the database use CONCAT leaves your code nice and clean, how exactly are you suggesting to do it though? Add it to your field list. Can you append it to the model in some way when you use a

Re: Differing Array structures with HABTM find requests? Multiple Views?

2008-01-18 Thread designvoid
Excellent! Many thanks, I will search for more info on this and hopefully solve this! I had searched the group many times, in fact I read thru the group daily at the moment as I'm trying to learn as much as poss, its just trick sometimes knowing exactly what to search for as I'm still not 100%

Re: Differing Array structures with HABTM find requests? Multiple Views?

2008-01-18 Thread AD7six
On Jan 18, 10:29 am, designvoid [EMAIL PROTECTED] wrote: Noone able to add any insight to this? There is a lot of insight already listed on the frequent discussions page. The really really easy solution is to make a model of your join table and call

Re: Sessions, Webserivce and Ajax

2008-01-18 Thread lordG
Could you elaborate on this? Which unrelated things? I traced the issue to the __start function of the Session Component. function __start(){ if ($this-__started === false) { if ($this-__bare === 0) { if (!$this-id() parent::start()) {

maybe a bug in findAllThreaded() in version cake-1.2.0.6311-beta

2008-01-18 Thread Chaso
Hi! the following code works in cake-1.2.0.5875 $this-Modelname-findAllThreaded(null,null, '`order` ASC'); but in cake-1.2.0.6311-beta the children are missing in the threaded array (children is empty). I did a little further investigation on this: I compared cake/libs/ model.php in both

Re: Problem with Plugins Controller Missing?

2008-01-18 Thread NilsR
Yeah it was something like that ... but only worked with current version - my cake folder was more than 1 month old. Thanks anyway :D Nils On 17 Jan., 17:31, MrTufty [EMAIL PROTECTED] wrote: The problem here is the mismatch between the name of the plugin and the default controller name.

Re: Dropdown without using generateList

2008-01-18 Thread krr
That worked! The numeric index was the problem. The values are stored in db as displayed. Thanks. On Jan 18, 3:53 pm, grigri [EMAIL PROTECTED] wrote: How is the event_name stored in the database? As a numeric index or as a text field? The code you've written assumes it's a numeric index

Proper way to sanitize all data?

2008-01-18 Thread R. Rajesh Jeba Anbiah
Could anyone suggest the right approach to sanitize user inputs? Currently having $this-data = Sanitize::clean($this-data) in AppController. Is there any better option? TIA -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/

Re: Auth Component encrypting password before validation.

2008-01-18 Thread MrTufty
What he said ;) I've been working with overriding hashPasswords to provide a randomly salted sha256 implementation, but my brains leaked out of my ears (that'll teach me to code at 3am). Steve On Jan 18, 11:30 am, djiize [EMAIL PROTECTED] wrote: You can already choose your hashing method, see

Question about Set class

2008-01-18 Thread Fran Iglesias
Hi I have this array: Array ( [0] = Array ( [0] = Array ( [id] = 2 [task] = Circulares.Preparar ) ) [1] = Array ( [0] = Array (

Re: afterFind() dillemna - eats memory for breakfast

2008-01-18 Thread the_woodsman
Remember as well you could use an SQL view to achieve things like this, making your code lots cleaner. Remember you can also dynamically change the table used by a model, so you can switch from the real table to the view for particular queries, then switch back (No idea if that's considered good

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread Dardo Sordi Bogado
No, you can render any view you want, even you can render no view. if ($inGoodMood){ $this-render('happy_face'); } else { $this-render('grumpy_face'); } 2008/1/18 Frobozz [EMAIL PROTECTED]: Since you have to create one view for one controller/action, no? Maybe I'm wrong but I

Re: Question about Set class

2008-01-18 Thread Fran Iglesias
El 18/01/2008, a las 15:01, grigri escribió: debug(Set::extract($temp, '{n}.0.task')); Thanks. So simple... On Jan 18, 1:00 pm, R. Rajesh Jeba Anbiah [EMAIL PROTECTED] wrote: FWIW, when I profiled Set class last time, it was relatively huge hit. I agree, but performance is not

Only one register within a given set can be flagged: possible?

2008-01-18 Thread Jaime
Hello bakers! Imagine this (common) scenario: a photo album that HasMany photos. A user may select one of them as a cover or default photo to illustrate the cover of the album. So a boolean field called default is set in the Photo model. Of course one and only one photo within that album should

Re: Storing user group in appmodel?

2008-01-18 Thread RichardAtHome
$this-{$this-modelClass} Ahhh, I wondered what the syntax was for this! Up until now I've been using a temporary variable: $modelClass = $this-modelClass; $this-$modelClass; tyvm! On Jan 18, 3:12 pm, francky06l [EMAIL PROTECTED] wrote: Well if you you set in AppModel : static usergroup =

Re: Complete source code of any project with cakephp

2008-01-18 Thread Daniel Hofstetter
Hi Kishor, Maybe this article helps you to get started: http://facebook-developer.net/2007/10/18/building-your-first-facebook-application-with-cakephp/ Good luck! -- Daniel Hofstetter http://cakebaker.42dh.com --~--~-~--~~~---~--~~ You received this message

Re: Auth Component encrypting password before validation.

2008-01-18 Thread djiize
http://bin.cakephp.org/view/266619336 Quick test of what I said, you just need to modify User-password function to your needs. On 18 jan, 12:45, MrTufty [EMAIL PROTECTED] wrote: What he said ;) I've been working with overriding hashPasswords to provide a randomly salted sha256

Re: Storing user group in appmodel?

2008-01-18 Thread Andreas
Care to elaborate the session part? Didn't get that. On Jan 18, 2:38 pm, francky06l [EMAIL PROTECTED] wrote: You coul declare a static variable in appModel, and update it from session in beforeFilter ... just a hint .. hth On Jan 18, 2:25 pm, Andreas [EMAIL PROTECTED] wrote: Hi I've

Re: More then one view for same action

2008-01-18 Thread Frobozz
http://groups.google.com/group/cake-php/browse_frm/thread/ed7f7e12facfd83b/af42bbf0de33c3a0?#af42bbf0de33c3a0 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

column sorting...

2008-01-18 Thread bhushan A
Is there any class / library available to acieve column sorting in cake php.? please reply me on [EMAIL PROTECTED] bhushan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send

Complete source code of any project with cakephp

2008-01-18 Thread Kishor
Hi folks, Cakephp is new for me I go thr cake manual but i required source code of any project build on cake.I downloaded some project from cakeforge.org but it not run properly.Also i am facebook developer i find that myfacebook project on cakeforge.org but no source code found.Can any

Re: Question about Set class

2008-01-18 Thread grigri
$temp = Array( 0 = Array ( 0 = Array ( 'id' = 2, 'task' = 'Circulares.Preparar' ) ), 1 = Array ( 0 = Array ( 'id' = 5,

Re: Storing user group in appmodel?

2008-01-18 Thread francky06l
You coul declare a static variable in appModel, and update it from session in beforeFilter ... just a hint .. hth On Jan 18, 2:25 pm, Andreas [EMAIL PROTECTED] wrote: Hi I've been using a variable in my appcontrol that stores what group the user belongs to based on previous acl things done

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread Frobozz
Thanks for good example! I'm just newbie in CakePHP 8-) On 18 янв, 18:40, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: No, you can render any view you want, even you can render no view. if ($inGoodMood){       $this-render('happy_face');} else {       $this-render('grumpy_face'); }

Re: i don't know why

2008-01-18 Thread MrTufty
Indeed AD. I was just being picky, because we see so many requests for help here which don't give us any clues at all (and in most cases are a _demand_ for help rather than a request). Steve On Jan 18, 9:08 am, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 10:03 am, MrTufty [EMAIL PROTECTED]

Re: Differing Array structures with HABTM find requests? Multiple Views?

2008-01-18 Thread designvoid
Ok, I have had a good search on filtering HABTM and also found your earlier post on this, but haven't had any joy getting it working, is it possible you could give a slightly more detailed example? I really don't want to get beaten by this as I have pretty much everything else nailed, I've used

Re: thoughts about elements

2008-01-18 Thread [EMAIL PROTECTED]
I hadn't noticed. I had only checked view-element not controller- element. Thanks for the tip, Andy. On Jan 18, 10:04 am, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 9:43 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi everyone, I have been thinking a bit about how elements work and

Re: Is it possible to display two view templates on one function?

2008-01-18 Thread Frobozz
Since you have to create one view for one controller/action, no? Maybe I'm wrong but I always was thinking that this is paradigm of CakePHP. On 18 янв, 15:09, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 10:06 am, Frobozz [EMAIL PROTECTED] wrote: In my opinion it's more correctly to keep one

Dynamic form creation?

2008-01-18 Thread R. Rajesh Jeba Anbiah
Has anyone tried to implement dynamic form creation? I'm looking for a solution to implement dynamic form creations. -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/ --~--~-~--~~~---~--~~ You received

Re: Scriptaucolous effect.fade wont work

2008-01-18 Thread Novice Programmer
Hello David, Yes you are right.. This is what i am getting at. The rendering on the page starts before even the whole data has been fetched from teh database. I am looking at how do other sites such as youtube fix this situation. Thanks for your inputs. On 1/18/08, [EMAIL PROTECTED] [EMAIL

Re: ACLs: ACO and ARO schema.

2008-01-18 Thread Dardo Sordi Bogado
http://api.cakephp.org/1.2/cake_2libs_2model_2db__acl_8php-source.html On Jan 18, 2008 8:02 AM, RichardAtHome [EMAIL PROTECTED] wrote: Could some kind soul please post (or point to a post of) the models that map to the baked acos, aros and aros_acos tables please? A minor side note: As

Re: Paginate an array thats not from a model

2008-01-18 Thread Arne-Kolja Bachstein
@rtconner: Thanks, I'll take a look at this. @Michael: The project is much bigger, that's just one tricky part of it. On 18 Jan., 19:54, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: On Jan 18, 12:38 pm, Arne-Kolja Bachstein [EMAIL PROTECTED] wrote: Hi there, does anyone know if there is a

Re: Paginate an array thats not from a model

2008-01-18 Thread [EMAIL PROTECTED]
On Jan 18, 12:38 pm, Arne-Kolja Bachstein [EMAIL PROTECTED] wrote: Hi there, does anyone know if there is a chance to paginate data thats not fetched from the database/a model using the paginator component or something? The situation: I have a search form that fetches its hits from an

setting $this-layout not redirecting to the specified layout

2008-01-18 Thread Novice Programmer
Linux distribution : Redhat. Cake 1.1.x Is there something special that needs to be done when using another layout? Here is what i have done. In the default layout, the following code is written. a href=/uploads/index?php echo $html-image('topmast5.jpg', array('width'=86, 'height'=33,

Easy questions about directory structure

2008-01-18 Thread 1010011010
I'm very new to CakePHP and used to to use procedural code. I think I get the idea about MVC and the structure of CakePHP but I have a few questions. Say I have a page on my site that is a page with no content from a database (ie. about.php). In the old days the page would render the content

Re: FPDF and FPDI with CakePHP

2008-01-18 Thread Takuo SHIONO
Hello Gianluca, In may case, we put FPDF into vendors directory. Then we generate component php file, pdf_generator.php. In this php file, we define two classes. The first one is PdfGeneratorComponent class which is component class. The other is MyFPDF class which extends FPDF class. The

Re: setting $this-layout not redirecting to the specified layout

2008-01-18 Thread Novice Programmer
Wow.. Removing default.thtml from the layouts folder, fixes the problem. I am confused ... :( thanks. On 1/19/08, Novice Programmer [EMAIL PROTECTED] wrote: Linux distribution : Redhat. Cake 1.1.x Is there something special that needs to be done when using another layout? Here is what i

Re: Basic Question: Refining Queries

2008-01-18 Thread the_woodsman
Hi, I'm not sure I fully understand your problem, but: I'd like to figure out how to do something like: $this-set('friends', $this-User-Friends-Profiles-findAll()); This returns every profile in the system, not just those for the user's friends. Your controller isn't tied to usingjust one

Re: alphaNumeric validation in cakephp 1.2.0.6311-beta

2008-01-18 Thread Rajesh
I used custom validation and that worked. Is there any other rule available that is specific to a text area. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Simple binding question.

2008-01-18 Thread phpjoy
I wonder how I could make a simple query to work through bind(), and not use a custom query. I'm binding two models for a model: $this-Ticket-bindModel(array('belongsTo' = array('Deal' = array('foreignKey' = 'deal_id'; $this-Ticket-bindModel(array('belongsTo' = array('Item' =

Re: Easy questions about directory structure

2008-01-18 Thread Baz
You can do anything, but elements seems to be the best bet... u would have the model: /models/about.php controller: /controllers/controller_about.php view: /views/about/index.ctp then the elements: /views/elements/ header.ctp footer.ctp menu.ctp On Jan 18, 2008 3:07 PM, 1010011010

Re: Auth Component encrypting password before validation.

2008-01-18 Thread francky06l
Sorry to jump in the passionate discussion, I do not see any complex problem in all this. Just my few cents about this hashing story: - Auth component is fine hashing automatically password, it defaults it to sha1, now (as mentioned earlier) you can write your own authenticate object. This

Saving multiple localized entries for one field _at once_! (code inside!)

2008-01-18 Thread ruxkor
Hi everybody, AFAIK it is impossible, using the current TranslateBehavior, to insert multiple values of one field at once. Example. I have an article (with its fields like created, user_id etc) and define: var $actsAs = array('Translate' = array('content'='LocaleContents')); (to be able to

Re: Auth Component encrypting password before validation.

2008-01-18 Thread Chris Hartjes
On Jan 18, 2008 3:43 PM, rtconner [EMAIL PROTECTED] wrote: Ya I had this out with nate already. I've given up. I think my solution was to set the hash type to none. https://trac.cakephp.org/ticket/3364 Aha! So you did follow through. My most humble appologies. -- Chris Hartjes Internet

Re: Auth Component encrypting password before validation.

2008-01-18 Thread rtconner
Ya I had this out with nate already. I've given up. I think my solution was to set the hash type to none. https://trac.cakephp.org/ticket/3364 On Jan 18, 1:38 pm, Chris Hartjes [EMAIL PROTECTED] wrote: On Jan 18, 2008 3:32 PM, rtconner [EMAIL PROTECTED] wrote: This particular issue is the

Re: Auth Component encrypting password before validation.

2008-01-18 Thread Chris Hartjes
On Jan 18, 2008 3:32 PM, rtconner [EMAIL PROTECTED] wrote: This particular issue is the framework trying to baby it's users. Telling us that we can't implement our own security practices. It's not even that you can turn it off if you don't want it, you just can't turn it off. You literally

Re: Auth Component encrypting password before validation.

2008-01-18 Thread Baz
Now it's comments like this that help me understand why the developers sometimes get frustrated with this mailing list. This statement serves absolutely no purpose. It is a blind criticism without any productive alternative. Frameworks are developed for the mass, not individuals. Meaning, what's

Fatal Error (256): ConnectionManager::getDataSource - Non-existent data source

2008-01-18 Thread roliver
Hi all, I just changed my core.php use the database to store sessions. I made sure all the proper settings were correct for database, table and I created the table in my DB with the sessions.sql. Now when I hit my app I get the following error: Fatal Error (256):

Re: Auth Component encrypting password before validation.

2008-01-18 Thread rtconner
I'll just say, I love any and all complaints about that auto hashing thing. I think it's silly and annoying and shouldnt be part of cake. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Storing user group in appmodel?

2008-01-18 Thread Andreas
Ah. Understand now. However I don't save it in sessions. But the above easy to modify for my needs. Thanks for the help! Andreas On Jan 18, 4:12 pm, francky06l [EMAIL PROTECTED] wrote: Well if you you set in AppModel : static usergroup = null; function store($group) { self::$usergroup =

Re: i18n Translations

2008-01-18 Thread ruxkor
afaik every field is saved in the i18n table (in every language), if you declare it as translatable. so you should remove this field from the original table and only use the i18n table for it. eg if you have a model article and it should have fields as id,user_id,created,body,title and

Re: Storing user group in appmodel?

2008-01-18 Thread francky06l
Well if you you set in AppModel : static usergroup = null; function store($group) { self::$usergroup = $group; } function getgroup() { return self::$usergroup; } in AppController ( suppoisng you store the group in the Session), you can do function beforeFilter() {

i18n with DB?

2008-01-18 Thread R. Rajesh Jeba Anbiah
Lot of people/clients prefer to edit the language strings and have them in DB. As I understand, we cannot use TranslateBehavior to change the language of the UI; am I mistaken or is there any solution? TIA -- ?php echo 'Just another PHP saint'; ? Email: rrjanbiah-at-Y!comBlog:

Dynamic form validation rules?

2008-01-18 Thread R. Rajesh Jeba Anbiah
I'm searching to see if there is any dynamic form validation (dynamically change the validation for a particular form field from admin interface) implemented already. I hope, that is possible with Behavior; but like to know if any such implementation is already done. TIA -- ?php echo 'Just

Re: alphaNumeric validation in cakephp 1.2.0.6311-beta

2008-01-18 Thread aranworld
That is correct. alphanumeric only works on un broken strings of characters - presumably to test things like usernames. There is no built-in validation rule that checks to see if a phrase contains only letters or numbers. On Jan 17, 11:36 pm, AD7six [EMAIL PROTECTED] wrote: On Jan 18, 3:39

Re: Only one register within a given set can be flagged: possible?

2008-01-18 Thread grigri
Something like this? (This actually sets the others off AFTER setting this one on, but it makes little difference). If you put the login in beforeSave(), and the save fails, then the album won't have a default photo. (code not tested, might be typos) class Photo extends AppModel { var $name =

Plugin extension in Controller | Customizing app modules

2008-01-18 Thread Bruno Bergher
Okay, this might sound a bit crazy at first, but there's real reasons for doing this. We're a design firm that developed a CMS to handle the advanced layout requirement of our projects. The main thing is being able to build pages which content fields change in name, amount and type. And that's

Re: i don't know why

2008-01-18 Thread AD7six
On Jan 18, 12:46 pm, MrTufty [EMAIL PROTECTED] wrote: Indeed AD. I was just being picky, Keep it up - I just had a moment of bordom seeing yet another post without a question in it, and a blatant lack of looking for the answer. ;) AD --~--~-~--~~~---~--~~

mod_rewrite on AppServ

2008-01-18 Thread Raistlin Majere
AppServ 2.5.9 Apache 2.2.4 PHP 5.2.3 MySQL 5.0.45 phpMyAdmin-2.10.2 Make sure that an .htaccess override is allowed: in your httpd.conf, you should have a section that defines a section for each Directory on your server. Make sure the AllowOverride is set to All for the correct Directory.

Re: afterFind() dillemna - eats memory for breakfast

2008-01-18 Thread b logica
On Jan 18, 2008 2:46 AM, AD7six [EMAIL PROTECTED] wrote: 32MB of memory is a bit stingy. Sure. But it seems to be it should be more than enough to handle 1000 records. I can bump it up but I'd like to ensure I'm not doing so unnecessarily. How about 1) delete your afterFind method 2)

Basic Question: Refining Queries

2008-01-18 Thread Chris Wade
Hi All, I'm building my first site with cake, and am working my way through the documentation, but so far this part is confusing. I've got a page that shows a user's profile, the avatars of the user's friends, blog posts by the user, the number of comments for each blog post, and comments by

Re: Ajax help

2008-01-18 Thread jenson
Hi guy, Thanks a lot for ur help.. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP

Re: Auth Component encrypting password before validation.

2008-01-18 Thread nate
Right, we make it so you have to use an annoying and silly workaround *for a reason*. Because when it's annoying and silly, you have to stop and think about it, because whatever it is you're trying to do is probably wrong. Whatever problem you are trying to solve by accessing a plaintext

Re: Paginate an array thats not from a model

2008-01-18 Thread Chris Hartjes
On Jan 18, 2008 1:54 PM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Why are you using MVC if you aren't making models? It's not about not using models, it's about using non-database powered models. -- Chris Hartjes Internet Loudmouth Motto for 2008: Moving from herding elephants to handling

Re: Only one register within a given set can be flagged: possible?

2008-01-18 Thread Goranche
One way of doing this is to add a defaultPhotoID field to the photo gallery record... (and of course removing the default flag from the photos) a nice side effect is that it allows you to share photos between galleries... maybe not something that one would do, but replace the gallery with group

Re: Auth Component encrypting password before validation.

2008-01-18 Thread rtconner
This particular issue is the framework trying to baby it's users. Telling us that we can't implement our own security practices. It's not even that you can turn it off if you don't want it, you just can't turn it off. You literally have to deal with it with a little workaround of some sort. Not

Redirecting to another url in cake

2008-01-18 Thread Novice Programmer
Hello guys, What is the best way to handle the redirections such as a href = mypage.htm /a in cake php. Do i define new layout for the page mypage or should i have seperate view and load it in the exisiting layout only. The new page to be loaded is quite different from the another page. --

Re: Auth Component encrypting password before validation.

2008-01-18 Thread aranworld
Thanks for the example djiize. I'm curious if that is the SOLE intended use of the Auth::authenticate attribute? Right now it appears as if it is, but the description A reference to the object used for authentication suggests that it is intended to be used for more than just a way to override

Re: Ajax help

2008-01-18 Thread Novice Programmer
Hello Jenson, I suffered the same issue. Here is the link that helped me. http://www.reversefolds.com/articles/show/ajax Thanks. On 1/18/08, jenson [EMAIL PROTECTED] wrote: Hello guys, I need help regarding ajax with cake php ..I Can't really get a nice tutorial.. tutorial has

Re: ACLs: ACO and ARO schema.

2008-01-18 Thread RichardAtHome
Thanks Dardo, it's a start :-) On Jan 18, 12:47 pm, Dardo Sordi Bogado [EMAIL PROTECTED] wrote: http://api.cakephp.org/1.2/cake_2libs_2model_2db__acl_8php-source.html On Jan 18, 2008 8:02 AM, RichardAtHome [EMAIL PROTECTED] wrote: Could some kind soul please post (or point to a post of)

Paginate an array thats not from a model

2008-01-18 Thread Arne-Kolja Bachstein
Hi there, does anyone know if there is a chance to paginate data thats not fetched from the database/a model using the paginator component or something? The situation: I have a search form that fetches its hits from an XML file. That's done by first fetching the XML file, saving it to the tmp

Storing user group in appmodel?

2008-01-18 Thread Andreas
Hi I've been using a variable in my appcontrol that stores what group the user belongs to based on previous acl things done in the script. The thing is that now I need the information in one of my models for validation. Should i store the information in appmodel instead or is there any other

Re: Acl::Allow does not work

2008-01-18 Thread aranworld
In my script, I have a Users node which is a parent of an edit node. For each user, I create a permission to Users/edit/[user_id] by doing the following command (for a User with alias 'ripley' and user_id '23') $this-Acl-grant('ripley', 'Users/edit/23', '*'); This works for me. I am using

Re: Only one register within a given set can be flagged: possible?

2008-01-18 Thread RichardAtHome
I'd be tempted to unset them all THEN set the default (one less WHERE clause). You could override the default save in the Model with (untested) : function save($date) { if (!empty($this-data[$this-alias]['default'])) { $this-UpdateAll(array(default=0); } parent::save($data); } On

Re: Question about Set class

2008-01-18 Thread R. Rajesh Jeba Anbiah
On Jan 18, 5:01 pm, Fran Iglesias [EMAIL PROTECTED] wrote: snip ?'ve been trying several paths with Set::extract to get it but my best result is with '{n}.{n}.task', which produces snip FWIW, when I profiled Set class last time, it was relatively huge hit. -- ?php echo 'Just

  1   2   >