Re: secure link using hmtl->link helper..

2009-10-05 Thread iFeghali
that is the only solution i found so far: http://bakery.cakephp.org/articles/view/component-for-forcing-a-secure-connection --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

schema for multiple database connections

2009-10-04 Thread iFeghali
Hello All, I have two connections defined "default" and "auth". Some models belongs to one of them and others to the other one. This brings only the tables for model in the default connection : $ cake schema generate Schema file: schema.php generated While that fails: $ cake schema generate -

Re: Find Value in $this->data

2009-09-25 Thread iFeghali
> So, if it is not in the array I wanted to give a message out. This > does not work for some reason, did I missunderstand the in_array > function? Any idea to achieve it otherwise? yes. in_array should be used with a scalar array. you have got a multi- dimensional array (matrix in your case). tr

Re: secure link using hmtl->link helper..

2009-09-25 Thread iFeghali
Anyone found the solution ? I am on the same boat. Best, ~IF. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this g

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
I will totally ignore the value of primary and try the "guess" the format of the results array by its contents. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cak

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Ok more feedback on this in the same scenario described above, for the same Machine->afterFind() defined as: === /services/view/ABC: === true Array ( [0] => Array ( [id] => [category_id] => etc. [MachinesService] => Array

Re: Cake 1.2.5

2009-09-17 Thread iFeghali
Subversion, buddy. http://svnbook.red-bean.com/en/1.5/svn.advanced.props.special.keywords.html On Sep 17, 2:01 pm, brian wrote: > Your latest message could use some expansion. What do you mean? --~--~-~--~~~---~--~~ You received this message because you are subsc

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Hello vb13, > Cake processes hasMany and hasOne, belongsTo differently. In the case > of hasOne and belongsTo, when, say, 2 models are involved, they > generate 1 query with a join, and then retrieve data in one shot. > > In the case  when model A hasMany Model B (for example Machine and > Machin

Re: afterFind() inconsistencies ?

2009-09-17 Thread iFeghali
Hello vb13, Thank you for the point but I am already aware of $primary. It does not help me with this issue though, as for all the cases described here $primary was set to the default value. Best, ~IF. --~--~-~--~~~---~--~~ You received this message because you ar

Re: Dynamic Menu

2009-09-17 Thread iFeghali
Yes, I did in cake. I am no expert, so be aware that my solution can have some flaws. so in app_controller.php : Auth->user()) { $controllerList = Configure::listObjects('controller'); $permittedControllers = array(); foreach ($controllerList as $controllerI

Re: displayField is not in the database (mixed models?)

2009-09-17 Thread iFeghali
Hello Walther, A good suggestion indeed. Before I go into that direction I would like to confirm there isn't anything less "painful" (i mean more simple). Best, ~IF. On Sep 16, 5:44 am, Walther wrote: > I have no experience in this, but a custom data source might be the > way to go. --~--~

Re: Iphone Detect

2009-09-15 Thread iFeghali
in the default view of your site or maybe the default template ? but you'd better save the answer in a cookie or something. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send

Re: displayField is not in the database (mixed models?)

2009-09-15 Thread iFeghali
e FormHelper do it. Just make sure the name attribute is as > Cake expects it to be. > > On Tue, Sep 15, 2009 at 8:00 AM, iFeghali wrote: > > > Hello All, > > > I just got stuck with a little issue that I would appreciate any help. > > I have got a Model that is pa

displayField is not in the database (mixed models?)

2009-09-15 Thread iFeghali
Hello All, I just got stuck with a little issue that I would appreciate any help. I have got a Model that is partially stored in a database, and the other attributes are gathered in the "afterFind" time. For instance, given a model "User" the username is in the database but all the user data (ful

Re: afterFind() inconsistencies ?

2009-09-02 Thread iFeghali
anyone got a clue ? I am still very confused on this matter. I have tried moving from "recursive" to "containable" with no luck. Thank you. On Jul 28, 5:31 pm, iFeghali wrote: > Hello All, > > I found myself stuck for a week in an issue that I would really > ap

Re: afterFind() inconsistencies ?

2009-07-31 Thread iFeghali
On 30 jul, 13:07, "Dr. Loboto" wrote: > Post your controller code. afterFind will be called as much times as > much you call find. function view($id = null) { if (!$id) { $this->Session->setFlash(__('Invalid Type.', true)); $this->redirect(array('action'=>'index')

Re: afterFind() inconsistencies ?

2009-07-29 Thread iFeghali
anyone ? On 28 jul, 17:31, iFeghali wrote: > Hello All, > > I found myself stuck for a week in an issue that I would really > appreciate any kind of help. Thats my scenario: > > Machine HABTM Service > Machine belongsTo Type > Type hasOne Machine > Machine hasMany Mach

Re: afterFind() inconsistencies ?

2009-07-28 Thread iFeghali
sorry, Type *hasMany* Machine. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+un

afterFind() inconsistencies ?

2009-07-28 Thread iFeghali
Hello All, I found myself stuck for a week in an issue that I would really appreciate any kind of help. Thats my scenario: Machine HABTM Service Machine belongsTo Type Type hasOne Machine Machine hasMany MachineContact MachineContact belongsTo Machine Now I have Machine->afterFind() hypothetica

Re: Searching non existent related models

2009-07-27 Thread iFeghali
Thank you Jaydeep. Now how do I do the same for a HABTM ? It is not joined in the query by default. On 27 jul, 05:25, Jaydeep Dave wrote: > try: > > $this->paginate['conditions'] = array( >      'OR' => array ( >          'User.name IS' => 'NULL', >          'Recipe.id IS' => ' NULL' >      ) >

Searching non existent related models

2009-07-23 Thread iFeghali
Hello All, Say I have a User hasMany Recipes. Now I want to search for all users with an empty name OR users that doesn't have any recipe. How do I turn that piece of code in what I want: $this->paginate['conditions'] = array('User.name' => 'IS NULL'); $this->set('users', $this->paginate()); Ca

Re: How to prevent circular relationships ?

2009-07-08 Thread iFeghali
On Jul 8, 1:35 pm, Mike Bates wrote: > Is there a reason for Machine and Service to have many to many relationships > (machine with Type and category, Service with customer)? There are often perhaps I misunderstand you but those relationships are defined as "one to many". e.g. a machine has only

Re: How to prevent circular relationships ?

2009-07-08 Thread iFeghali
"Without Containable, you'd end up needing to use the unbindModel() method of the model, multiple times if you're paring off multiple models. Containable creates a cleaner way to accomplish this same task." seems a good alternative for me :) thank you On Jul 8, 1:35 pm, brian wrote: > Have you

How to prevent circular relationships ?

2009-07-08 Thread iFeghali
Hello All, I am stuck at a circular relationship problem. This is my scenario: - Machine HABTM Service HABTM Machine - Machine belongsTo Type hasMany Machine - Machine belongsTo Category hasMany Machine - Service belongsTo Customer hasMany Service So far so good. When the user goes to /machine/

Re: Association problems

2009-06-21 Thread iFeghali
you also have to set $recursive = 1 in the model. On Jun 21, 9:21 pm, David wrote: > I've tried using both hasOne and belongsTo and neither works.  I was > initially using belongsTo but that didn't work so I switched to > hasOne.  I just tried it again to be sure, and it still isn't > working.  

Re: Share a hasMany association ?

2009-06-08 Thread iFeghali
ok this is similar to that question: http://groups.google.com/group/cake-php/browse_thread/thread/1d24a16fde2990c9 but the suggested solution is to add a forth model in the top which i prefer not to do for now. any other feedback on this ? --~--~-~--~~~---~--~~ Yo

Share a hasMany association ?

2009-06-08 Thread iFeghali
Hello All, I would love some feedback in the following design: Model Customers hasMany Telephones Model Suppliers hasMany Telephones Table telephones alternative (a): customer_id, supplier_id, phone# Table telephones alternative (b): foreign_key, phone# Given that all my keys are UIDS, AFAIK

Re: How to silently redirects to login page ?

2009-03-31 Thread iFeghali
Hello All, Many thanks for the help so far. Let's try to be a bit more clear... that's my scenario: 1) only authenticated users have access to the site (but the login form, of course) for a visitor (non auth user): 2) example.com should redirect to example.com/users/login with no error message

Re: How to silently redirects to login page ?

2009-03-30 Thread iFeghali
Hi Martin, Yes I am talking exactly about that message. Changing it the way you suggest would make it very weird to users already logged in that are trying to access resources they are not allowed to. Also, I would like to have no message at all... just the login form. Thank you. On 30 mar, 15:

Re: How to silently redirects to login page ?

2009-03-30 Thread iFeghali
Hello John, Thanks for the answer but I don't see how it could help me. Can you please clarify ? On 30 mar, 15:13, John Andersen wrote: > Use thishttp://book.cakephp.org/view/385/logoutas the redirect! --~--~-~--~~~---~--~~ You received this message because you a

How to silently redirects to login page ?

2009-03-30 Thread iFeghali
Hello, I have followed [1] to get a simple login form working. Currently when a visitor tries to reach '/' one is redirected to the login form, which is desirable, but an error message is displayed "You are not authorized to access that location.", which is not desirable. Any clue how do I preven

Re: Auth Component Custom Login

2009-03-23 Thread iFeghali
Hello Martin, Thank you for you answer. I had to implement my custom methods find() and hashPassword() in the user model. I end up with: hashPasswords: 1) find username in database 2) if username not found, fail 3) check user type. if type = "local" then return Security::hash() 4) if type = "nis

Re: my date field is not blank, but cake thinks it is

2009-03-23 Thread iFeghali
On 20 mar, 11:53, GrantB wrote: > Why would this date field fail validation?  All of the dropdowns are here is the place to look at: http://api.cakephp.org/view_source/validation/#line-395 regards, ~IF. --~--~-~--~~~---~--~~ You received this message because you

Re: Auth Component Custom Login

2009-03-20 Thread iFeghali
Ok just took a look again at Auth source code. $authorize is not useful for me for the reason said in the last email. $authenticate is used only for the hashPasswords() method so its not helpful in my case too. Perhaps I am looking for a way of changing the method Auth::identify() but I don't want

Re: Auth Component Custom Login

2009-03-20 Thread iFeghali
Hello Martin, Thank you for your answer. Yes I did found the LDAP examples around the Net and Bakery but still I can't understand how the whole thing works. I also read about the isAuthorized() method but as far as i understand it its just supposed to do the "authorization" stuff and not "authent

Re: my date field is not blank, but cake thinks it is

2009-03-19 Thread iFeghali
I faced the same problem with the alphanumeric validation that seems to be buggy [1]. remove the line: > 'creationDate' => array('date') from your model and your form should submit ok. the problem is when you don't specify the error message cake just trows "this filed cannot be

Auth Component Custom Login

2009-03-19 Thread iFeghali
Hello There, I want to authenticate my users against a database table or a NIS domain, depending on a flag set in the user record. I have noticed that Auth already did the form processing in the time the login() method of users controller is called so i guess its not the right place to digg into.