Re: Detect cookies

2008-07-03 Thread francky06l
You can use javascript for this. A quick google search gave me this: http://www.tec-i.com/gEwCart/HowToEnableJavascriptAndCookies.htm Of course, if you have also to check if javascript is enabled .. :-) On Jul 4, 2:24 am, dandreta <[EMAIL PROTECTED]> wrote: > any solution, please? > > On 26 jun

Re: Retrieving User Information with Auth/Acl

2008-07-03 Thread francky06l
The native Auth has got this functionnality. If you use the Auth in mode "actions", you would create - Aro for each user - Aco for controller/actions pairs in this way : an Aco for the controller name with no parent, and an Aco per action of the controller having the Aco controller as parent. Yo

Re: HABTM Relations and additional info in the rlation table

2008-07-03 Thread XuMiX
thx, i'll have a try On 2 июл, 23:23, James K <[EMAIL PROTECTED]> wrote: > CakePHP has no problem reading extra fields in your join table. As > long as you're naming your join table correctly and have a > hasAndBelongsToMany relationship to the model on the other side of the > join table, it'll p

Re: trouble with isAuthorized()

2008-07-03 Thread b logica
Thanks. I did eventually figure out what was going on. But not before killing a couple of hours. Yuck! On Thu, Jul 3, 2008 at 7:19 PM, francky06l <[EMAIL PROTECTED]> wrote: > > @b logica > change the $this->Auth->loginAction in before filter when ($this- >>action == 'login' && empty($this->data))

Re: Retrieving User Information with Auth/Acl

2008-07-03 Thread Tony Thomas
On Jul 3, 6:23 pm, francky06l <[EMAIL PROTECTED]> wrote: > I do not understand the "on the fly" there .. Meaning I don't want to have to statically define who can do what. Instead of something like: if ($this->Auth->user('username') == 'User1') { // allow them to do stuff } else { //

Re: changing links according to selected language

2008-07-03 Thread K3
OK, i have written following code and it seems to work: 0) { // to avoid external links, mailto etc... $new_url=parent::url($url, $full); } else { $new_url=str_replace($url_array['controller'], 'en/'. $url_a

Re: Detect cookies

2008-07-03 Thread dandreta
any solution, please? On 26 jun, 09:42, dandreta <[EMAIL PROTECTED]> wrote: > Hi! > > I have used the OthAuth component for the access to my application, > defining the groups and permissions. If in the browser thecookiesare > not activated, on login the user cannot enter to the restricted > func

Re: Retrieving User Information with Auth/Acl

2008-07-03 Thread francky06l
I do not understand the "on the fly" there .. You are wanted to check a permission on an action regarding a user, but is this User "logged- in" ? I mean a member of a User model or something similar ?? On Jul 3, 5:07 pm, Tony Thomas <[EMAIL PROTECTED]> wrote: > I've been trying to get Acl working

Re: trouble with isAuthorized()

2008-07-03 Thread francky06l
@b logica change the $this->Auth->loginAction in before filter when ($this- >action == 'login' && empty($this->data)) .. set it to any action you want (except null).. hth On Jul 3, 8:32 pm, "b logica" <[EMAIL PROTECTED]> wrote: > On Thu, Jul 3, 2008 at 2:24 PM, mbavio <[EMAIL PROTECTED]> wrote: >

Re: Quick informal poll

2008-07-03 Thread John David Anderson
On Jul 3, 2008, at 4:38 PM, NOSLOW wrote: > >> The "Lord of the rings" Example shows us how powerful ACL in cake can >> be, and helped me a lot to get in touch with ACL. > > So that's where that came from. The "Lord of the rings" references > just confused me even more because I'm not familiar wi

Re: Quick informal poll

2008-07-03 Thread NOSLOW
> The "Lord of the rings" Example shows us how powerful ACL in cake can > be, and helped me a lot to get in touch with ACL. So that's where that came from. The "Lord of the rings" references just confused me even more because I'm not familiar with it. You should at least mention that's where it c

Re: Model association question

2008-07-03 Thread francky06l
@Jonathan, yes it always a bit "confusing" the hasOne (in Cake).. because a Task hasOne priority, no matter if this priority is shared .. but for cake it'a a belongsTo .. :-) Even after using for few months (years)... hasOne always make me think twice (actually I use it very rarely).. On Jul 3,

Re: Ajax

2008-07-03 Thread francky06l
Attach an onClik event with ajax to the id of the checbox.. On Jul 3, 9:02 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi again. > > Can anyone tell how do I can make a checkbox fire an ajax event? I've > tryed with $ajax->observeField but I must be using it wrong because > nothing happe

Re: how to intercept login() to add to session?

2008-07-03 Thread francky06l
Actually, if you do not set $autoRedirect to false, you will never reached the loginAction you defined. If you want to be able to "cheat" the Auth and get the login method handling empty($this->data), you have to set the the loginAction to something else when in beforeFilter you detect the control

Re: ACL in Cake 1.2

2008-07-03 Thread francky06l
@Stinkbug parent, as far as I know should be passed with model.id. However did you check the ACL behavior that can do this automatically if you implement the parentNode() method in the model (be aware of updating the parent though..) ? On Jul 3, 5:01 pm, Stinkbug <[EMAIL PROTECTED]> wrote: > To e

Re: HABTM Query: use containable or not?

2008-07-03 Thread DaveMahon
Yesterday I started a blog for my CakePHP frustrations and joys. While I haven't done any customization and I'll probably murder my future PageRank by doing this so early, I posted an article that I think might help. http://lampable.blogspot.com/2008/07/taming-containables-in-cakephp-12.html On

Re: Subversion merge causing syntax errors - why?

2008-07-03 Thread AD7six
On Jul 3, 10:48 pm, keymaster <[EMAIL PROTECTED]> wrote: > Thanks Samuel and the_woodsman, > > I went through the svn book chapter (wish that section would have come > up in my prior google searches...). > > Yup, those markings are internal svn conflict markers enabling it to > determine your ol

Re: Subversion merge causing syntax errors - why?

2008-07-03 Thread keymaster
Thanks Samuel and the_woodsman, I went through the svn book chapter (wish that section would have come up in my prior google searches...). Yup, those markings are internal svn conflict markers enabling it to determine your old stuff from the stuff you are merging against. SVN will cause you tro

Re: Getting associated models with $this->Auth->user()

2008-07-03 Thread DaveMahon
I haven't tested this, but... Auth->user() is really just a call to Session->read(), which is Model- >read() which is actually Model->find('first') in 1.2.7692. So in theory, adding var $recursive = 2; to the User class definition might do the trick without having to write a wrapper component fo

Re: how to intercept login() to add to session?

2008-07-03 Thread b logica
I was staring right at the problem! I had to set $autoRedirect = false hours later ... On Thu, Jul 3, 2008 at 3:31 PM, b logica <[EMAIL PROTECTED]> wrote: > I realise that my earlier post (re: isAuthorized) had a misleading > subject so I'm re-phrasing here. > > I need to perform some stuff and

Re: Model association question

2008-07-03 Thread John David Anderson
I always remember it like this: If a table contains a foreign key, it's like a little label that another object has put on it... i.e. it belongsTo something else. hth/fwiw, John On Jul 3, 2008, at 1:38 PM, Jonathan Snook wrote: > > A priority hasMany tasks. > A task belongsTo a priority. >

Re: Model association question

2008-07-03 Thread Jonathan Snook
A priority hasMany tasks. A task belongsTo a priority. It's a little weird, I know because in English you'd normally say: A task has a priority. A priority belongs to many tasks. And belongsTo is used if: A priority has one task. A task has one priority. At least, that's how I've considered it

how to intercept login() to add to session?

2008-07-03 Thread b logica
I realise that my earlier post (re: isAuthorized) had a misleading subject so I'm re-phrasing here. I need to perform some stuff and add some info to the session upon successful login. However, the login() method in UsersController seems to be ignored completely. That is, it doesn't need to be pr

Ajax

2008-07-03 Thread [EMAIL PROTECTED]
Hi again. Can anyone tell how do I can make a checkbox fire an ajax event? I've tryed with $ajax->observeField but I must be using it wrong because nothing happens. Is there any other way to do this? Thanks. --~--~-~--~~~---~--~~ You received this message because

Re: Email component won't send

2008-07-03 Thread Jonathan Snook
> But there is other annoying moment with this - email headers are shown > in email body I suspect with the safe mode, custom headers are no longer possible, leaving you to send messages using plain syntax. Considering your environment, the built-in EmailComponent probably won't solve your needs.

Re: Subversion merge causing syntax errors - why?

2008-07-03 Thread the_woodsman
I'm pretty sure (althoughI've not done much branching) that the status you're talking about is Conflicted, as generally with SVN, a Merge won't insert >>> etc. On Jul 3, 7:06 pm, "Samuel DeVore" <[EMAIL PROTECTED]> wrote: > http://svnbook.red-bean.com/en/1.4/svn.tour.cycle.html#svn.tour.cycle..

Re: trouble with isAuthorized()

2008-07-03 Thread b logica
On Thu, Jul 3, 2008 at 2:24 PM, mbavio <[EMAIL PROTECTED]> wrote: > > The login method is called automatically by Auth Component, if you > redirect to there and you have $this->data filled with the right info, > it will login. A way to solve this? I really dont know, I´ve never > tried to not use

Re: trouble with isAuthorized()

2008-07-03 Thread mbavio
The login method is called automatically by Auth Component, if you redirect to there and you have $this->data filled with the right info, it will login. A way to solve this? I really dont know, I´ve never tried to not use this function Let´s hear Cake gurus now! Cheers, mbavio On Jul 3, 2:0

Re: need some help in data saving using cake's own functions.

2008-07-03 Thread Samuel DeVore
before each save use create $this->ModelName->create(); $this->ModelName->save($data); see the section in the manual on saving data http://book.cakephp.org/view/75/saving-your-data sam d -- (the old fart) the advice is free, the lack of crankiness will cost you - its a fine line between a re

Re: changing links according to selected language

2008-07-03 Thread K3
@leo: i need to include lang code in the url, request from the client. I also am not sure about other possible (IMO) disadventages using your method (caching pages, unable to send url that will point to the right page) @gjiize: yes i read them and they also suggest overriding htmlhelpers methods.

Re: changing links according to selected language

2008-07-03 Thread b logica
On Thu, Jul 3, 2008 at 11:50 AM, leo <[EMAIL PROTECTED]> wrote: > > We do not, however, include the language string, i.e. en/es/fr/de > instead, the domain remains the same but the page names themselves are > translated, e.g. > > http://univerd.com/construccio-jardins [catalan] & > http://univerd

Re: changing links according to selected language

2008-07-03 Thread K3
@leo: maybe that will work for the search engine but i have specific instructions to include it in the URL. @djiize: yes, but they suggest overriding htmlhelper::link but i dont know how(and where) to override it. i tried to override with following code, but didnt work: any help/hints? On Jul 3

Re: Subversion merge causing syntax errors - why?

2008-07-03 Thread Samuel DeVore
http://svnbook.red-bean.com/en/1.4/svn.tour.cycle.html#svn.tour.cycle.resolve you might want to read up on resolving merges with subversion On Thu, Jul 3, 2008 at 9:12 AM, keymaster <[EMAIL PROTECTED]> wrote: > > I was doing a vendor branching type merge (from cake 1.2 beta to cake > 1.2 RC2,

Model association question

2008-07-03 Thread jhicks
OK, so I've got two tables: tasks and priorities. Many tasks can share the same priority. So is this a HABTM relationship? With HABTM, you usually have a join table but in my situation I don't need one. I just have a foreign key in my tasks table (priority_id) which points to the index of the pri

Re: Email component won't send

2008-07-03 Thread senser
After a lot of debugging I found the problem - it's my hosting provider related I suppose. The problem is the fifth parameter of PHP mail() function called "additional_parameters" - if is passed to the function it fails. So now I can send email with Cake only if set safe_mode to 1 with ini_set('sa

need some help in data saving using cake's own functions.

2008-07-03 Thread KiANIi
Hi, I'm trying to save data using $this->modelName->save(data) in a loop but after the end of each iteration when I'm trying to find the data that I've inserted I could not find that data. Can anyone tell me how i can save data in table in loop. the code is: $this-model = $this->control

Re: possible bug? validation URL rule

2008-07-03 Thread Marcin Domanski
Hey, ww can as well be a subdomain... It's hard to do a good email/www regexp ( ive seen some couple pages monsters) On Thu, Jul 3, 2008 at 5:58 PM, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > Hi to all, > > strings like ww.domain.com or ww.domain passing de URL validation > rule: > > var $

Re: changing links according to selected language

2008-07-03 Thread leo
@K3: We get the SE language-specific indexing by changing the page header language. The search engines read the headers: http://www.w3.org/1999/xhtml"; xml:lang="es"> http://www.w3.org/1999/xhtml"; xml:lang="ca"> --~--~-~--~~~---~--~~ You received this mes

Re: trouble with isAuthorized()

2008-07-03 Thread b logica
More and more bizarre. When I removed the isAuthorized() *and* the login() methods, I can still log in. AppController: function beforeFilter() { $this->Auth->fields = array('username' => 'email', 'password' => 'password'); //$this->Auth->authorize = 'controller'; $this->

Re: changing links according to selected language

2008-07-03 Thread djiize
Did your read the 2 links I sent you ? On 3 juil, 18:52, K3 <[EMAIL PROTECTED]> wrote: > Yes, i was asked to include language string so the search engine can > better index the pages. > > @leo: we dont need high rating, just want both language versions t be > indexed by the search engine. So we c

Re: changing links according to selected language

2008-07-03 Thread K3
Yes, i was asked to include language string so the search engine can better index the pages. @leo: we dont need high rating, just want both language versions t be indexed by the search engine. So we can not define such subdomains for each page. thats why the easiest way i can see so far is to ov

Re: Preparing for the Digg Effect

2008-07-03 Thread Hermann wacker
Maybe it's obvious, but the best way to find out what to do to make your wepage faster is to get it under load (with "ab" for example) and raise the load until your server gives up. Now find out why he gave up and fix it. Do this as long you think you need more pageviews per second... On Mon, Jun

Re: Fetching approved comments only

2008-07-03 Thread Cody Sortore
Thank you kind sir! Worked perfectly and I didn't even have to modify anything. I was just missing the 'conditions' statement, tried it with 'limit' and it wasn't working figured I was on the right track, just using the wrong wording. Thanks again! On Jul 2, 7:30 pm, "b logica" <[EMAIL PROTECT

Re: ACL in Cake 1.2

2008-07-03 Thread leo
Can't help you there as I eventually wrote my own ACL system. Sorry. On 3 Jul, 17:01, Stinkbug <[EMAIL PROTECTED]> wrote: > To expand on this... > > I almost figured out everything that I need to do to get my stuff > working.  The major problem I'm having now is with the parent_id.  Is > there an

Re: changing links according to selected language

2008-07-03 Thread leo
> In SEO point of view, it's better to have language in the URL : the 2 > languages will be indexed with each its own URL > How search engines will deal with 1 URL with different content ? We have had phenomenal success with this, getting 2nd positions after wikipaedia for a lot of pages (provide

trouble with isAuthorized()

2008-07-03 Thread b logica
I'm having some trouble figuring out how to log in. I thought I had this working but it turns out not to be the case. >From what I understand, the isAuthorized() method is called *after* a successful login. But it seems that its presence causes login() to be skipped entirely. My AppController has

Subversion merge causing syntax errors - why?

2008-07-03 Thread keymaster
I was doing a vendor branching type merge (from cake 1.2 beta to cake 1.2 RC2, into my trunk). After I did the merge, nothing worked. I found that SVN inserted commands (?) or tracking info (?) into into all my files. At the beginning of the file, it put in a line: <<< .working At the mi

possible bug? validation URL rule

2008-07-03 Thread [EMAIL PROTECTED]
Hi to all, strings like ww.domain.com or ww.domain passing de URL validation rule: var $validate = array( 'website' => array('rule' => 'url', 'required' => true, 'allow

View.ctp bug resolved

2008-07-03 Thread Luis ortiz
Hi! I've been using CakePHP for a couple of days. I'm testing the scaffolding function and I've found and resolved a bug. I have a model with a hasOne relation. When I access to the view of a example instance of the model I saw a orange "Notice": "Notice (8): Undefined variable: details

Re: Preparing for the Digg Effect

2008-07-03 Thread Jonathan Snook
> Am I correct in assuming file caching doesn't happen unless you have > debug=0? I believe that to be a correct assumption. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, se

Re: Preparing for the Digg Effect

2008-07-03 Thread RichardAtHome
Thanks for all the feedback :-) I've since got APC running on my dev box and haven't noticed any real difference. Perhaps the difference will show under load. Am I correct in assuming file caching doesn't happen unless you have debug=0? On Jul 2, 5:25 am, "Dr. Tarique Sani" <[EMAIL PROTECTED]>

Re: changing links according to selected language

2008-07-03 Thread djiize
In SEO point of view, it's better to have language in the URL : the 2 languages will be indexed with each its own URL How search engines will deal with 1 URL with different content ? For routes magic, see this article from Nate : http://c7y.phparch.com/c/entry/1/art,cake-seo This one too: http:

Retrieving User Information with Auth/Acl

2008-07-03 Thread Tony Thomas
I've been trying to get Acl working for a long time now. I think I'm very close, but I'm tired of doing endless Google searches for an answer, so I'm just going to ask. My Acl is all set up in the database, and Auth is working. It's the Acl check that I'm not getting. This article got me close:

Re: ACL in Cake 1.2

2008-07-03 Thread Stinkbug
To expand on this... I almost figured out everything that I need to do to get my stuff working. The major problem I'm having now is with the parent_id. Is there anyway to retrieve the id by passing something like Department.1 (this would be the model and foreign_key, or alias)? In the 1.1 vers

Re: changing links according to selected language

2008-07-03 Thread b logica
IMO, you're better off not relying on the language being in the URL. Set it in the session when the user switches and check that. On Thu, Jul 3, 2008 at 10:04 AM, K3 <[EMAIL PROTECTED]> wrote: > > Hi, > im using i18n and i can switch language wihtout problems. However, the > links in the URL bar

changing links according to selected language

2008-07-03 Thread K3
Hi, im using i18n and i can switch language wihtout problems. However, the links in the URL bar remain the same, for example site.com/controller/ action. Is it possible to "patch" THTML helper somehow so i can automatically change links to current_lang/controller/action, for example when i write e

Re: Bake

2008-07-03 Thread [EMAIL PROTECTED]
Thanks!! Problem solved:) On 3 Jul, 13:58, davidpersson <[EMAIL PROTECTED]> wrote: > Cake caches your model schema. > > A: > Clear your cache by deleting all files in your app's tmp/cache/models/ > and tmp/cache/persistent/ > > B: > Disable caching in your app's config/core.php (make sure you ena

Getting associated models with $this->Auth->user()

2008-07-03 Thread marikka
Hi! I have a User model which hasOne Role model. When using $this->Auth->user() I get the User model find, but I'd need to get the related Role model as well. Is it possible somehow? First thing that comes to my mind is to extend AuthComponent and write my own method that returns the User model

Re: Bake

2008-07-03 Thread davidpersson
Cake caches your model schema. A: Clear your cache by deleting all files in your app's tmp/cache/models/ and tmp/cache/persistent/ B: Disable caching in your app's config/core.php (make sure you enable it again for production setup!) /** * Turn off all caching application-wide. * */

Re: Use models/views object from other controllers/models/views ?

2008-07-03 Thread the_woodsman
There are various approaches. One is to create a view called default_index.ctp, which refers to generic names, i.e $mainModel, or something similar. Then in your controllers, make sure you pass the data in a similar format to the view, with the correct generic names, i.e $this->set('mainModel',

Re: Email component won't send

2008-07-03 Thread senser
Thank you Marc, I'll give a try. I cannot use SMTP because my hosting provider rejects it, so the only way is to send with php mail() function On Jul 3, 11:12 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > hey, > $method is for ex. 'smtp' sosendcalls __smtp function. > Can't help you with th

Bake

2008-07-03 Thread [EMAIL PROTECTED]
Hi all. I'm trying to make an app with cake 1.2. I'm using bake to generate all the models, controllers and views. But when I make changes in the DB bake doesn't those changes. For example if I alter a table to add a new field bake doens't see that change. Is there a way to resolve this problem?

setFlash extended parameters

2008-07-03 Thread Marc George
Hi I'm a new Cake user, cutting my teeth on 1.2. Forgive me if I'm being stupid here but I'm finding the documentation a little unclear on the use of SessionComponent::setFlash() in its extended form. i.e: SessionComponent::setFlash ($message, $layout = 'default', $params = array(),$key = 'flas

Re: Email component won't send

2008-07-03 Thread senser
Thank you Marc, I'll give a try. I cannot use SMTP because my hosting provider rejects it, so the only way is to send with php mail() function On Jul 3, 11:12 am, "Marcin Domanski" <[EMAIL PROTECTED]> wrote: > hey, > $method is for ex. 'smtp' sosendcalls __smtp function. > Can't help you with th

Application access problem

2008-07-03 Thread Ifti Khan
I baked an application. Now i can only access through url http://myweb.com/myapplication/index.php/controller/action. i want to use remove index.php off. i changed .htaccess files and add RewriteBase /myapplication/ to all, but it does not work. Any one can help. Thanks and regards, Ifti Khan.

Re: Save / saving records with extra fields in a HABTM join table ( possibly using 'with' parameter ?)

2008-07-03 Thread luke BAKING barker
thanks James, yes I have got a solution with a model I created for the join and I simply edit and add the entries on that form. The 'with' parameter has certainly proved useful to read out the data simply , I still think the way I have saved it is not the most cake way, which is what I am still i

Use models/views object from other controllers/models/views ?

2008-07-03 Thread FluF
Hello, I'm working on a project to display many statistics from many Models( clients, phonecalls, benefits, ..). Those statistics have the same presentation : - html table with different CSS but the same HTML code - ordonnable columns (not all) - tooltips for columns ... - graphics using GD2

Re: Email component won't send

2008-07-03 Thread Marcin Domanski
hey, $method is for ex. 'smtp' so send calls __smtp function. Can't help you with the quotes but ive built a little component that uses swiftmailer library and - its a drop in replacement - you use can use it the same like the built in one. It needs just a tiny bit of code in your AppController::b

Re: Dynamic drop down

2008-07-03 Thread dr. Hannibal Lecter
In addition to what Chris said, you will need to tell cake how to fill your drop down in your view like this: # echo $form->input # ( # 'Product.categoryId', # array # ( # 'options' => $categories # ) # ); On Jul 2, 4:08 pm, "Chris Hartjes" <[E

Re: Access a controller inside another controller?

2008-07-03 Thread Rodrigo
thank you, that did it! On 3 jul, 00:31, Matt Huggins <[EMAIL PROTECTED]> wrote: > Check out admin routing. Here are a few links to help get you > started. > > Read about the "Routing.admin" configuration variable > here:http://manual.cakephp.org/view/44/cakephp-core-configuration-var > > Read

Re: Analyze Code Coverage xdebug error

2008-07-03 Thread Renan Gonçalves
XDebug 2.0.1 >= is bugged. I've tried to run on Windows Vista, Windows XP and Debian with version 2.0.3. Only 2.0.0 works on Debian. I've not found 2.0.0 DLL for Windows and PECL does not works to install. Any ideas? On Wed, Jul 2, 2008 at 3:33 PM, Duncan <[EMAIL PROTECTED]> wrote: > > Hi, >