hiding link from certain users.

2011-02-22 Thread Kid
Hello again. My web application has several group of users. 1. user 2. superuser I've created a page where only superuser can access and was successful. But my problem is the link in default.ctp that direct users to that page are still visible to normal user after login. I just want the link to b

help me in jqury validation.

2011-02-22 Thread andy_the ultimate baker
hi, friends, i m working on form where i need to give jquery validation. i googled all the possible searches but not getting. can any one suggest any link for jquery validation for specific element. *note: i m not giving validations to element like 'name','email', etc. these are the quantity based

Re: Problem with accessing form data

2011-02-22 Thread David Cole
$this->redirect(array('controller' => $controller, 'action' => $action, $id, 'named' => $named, 'named2' => $named2)); On Feb 22, 9:58 am, newguy wrote: > Hi > I have a simple form in my view where the user enters a 4 digit > numeral code, in the controller action am unable to access this code, >

Re: Creating Shell for cron job

2011-02-22 Thread Ryan Schmidt
On Feb 22, 2011, at 20:29, cake-learner wrote: > I am setting up the shell so that i can register as a cron job for > maintenance tasks. > > In the past i do it manually and need to check if there is the same > process running. > If I use the shell I don't need to consider that? Um... I don't s

Creating Shell for cron job

2011-02-22 Thread cake-learner
I am setting up the shell so that i can register as a cron job for maintenance tasks. In the past i do it manually and need to check if there is the same process running. If I use the shell I don't need to consider that? Thanks, -- Our newest site for the community: CakePHP Video Tutorials htt

Re: Changing hiddenField from 0

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 1:53 PM, Djonatan Buss wrote: > I'm using checkbox to check if the client agrees with the contract. > But I would like to have 'No' if it was not checked. > The problem is that I don't know how to change the hiddenField value. > Ok, I know that I can treat it before saving

Re: Relations between models

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 3:24 PM, dtemes wrote: > The classregistry way is the one I have seen as response to similar > questions. > > In your example you are talking about races, so probably your Race > model has many cars and also has many spectators, in that case models > A and B are linked thro

Re: Creating a Preview page

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 3:29 PM, WhyNotSmile wrote: > I've finally got back to this.  I just cannot get it to do anything > other than submit the form.  When I click the 'Preview' button, the > form submits, I get a success message, and go back to the index page - > which is exactly what happens i

Re: 1.2.8 cake console

2011-02-22 Thread cake-learner
Thanks i got it working. I just had to relogin. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email

Re: Creating a Preview page

2011-02-22 Thread WhyNotSmile
I've finally got back to this. I just cannot get it to do anything other than submit the form. When I click the 'Preview' button, the form submits, I get a success message, and go back to the index page - which is exactly what happens if I submit the form using the regular Submit button. I'd rea

Re: Relations between models

2011-02-22 Thread dtemes
The classregistry way is the one I have seen as response to similar questions. In your example you are talking about races, so probably your Race model has many cars and also has many spectators, in that case models A and B are linked throug model C, so you could code something like: $this->Car->

Re: 1.2.8 cake console

2011-02-22 Thread cake-learner
but I can call baker by 'cake bake' On Feb 22, 11:46 am, cake-learner wrote: > i can't get it workig the console. Everytime i typed in "cake -app / > home/myaccount/public_html/dev/app" it just gives me to error saying > like the following > > my app folder is "/home/myaccount/public_html/dev/app

Re: 1.2.8 cake console

2011-02-22 Thread cake-learner
but baker works by going "cake bake" On Feb 22, 11:46 am, cake-learner wrote: > i can't get it workig the console. Everytime i typed in "cake -app / > home/myaccount/public_html/dev/app" it just gives me to error saying > like the following > > my app folder is "/home/myaccount/public_html/dev/ap

1.2.8 cake console

2011-02-22 Thread cake-learner
i can't get it workig the console. Everytime i typed in "cake -app / home/myaccount/public_html/dev/app" it just gives me to error saying like the following my app folder is "/home/myaccount/public_html/dev/app". However I am not sure about "working" directory seems like as I change the -app path

Re: problems populating my select box

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 10:14 AM, barricades wrote: > Ok that worked (sort of), thanks! I also noticed that I had a typo in > the above that probably wasn't helping either. > > Your kind advice above turns the select box into a list of the > charities names ok, but when I create a campaign having

Re: problems populating my select box

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 9:57 AM, Stephen wrote: > try: > > $charities = $this->Campaign->Charity->find('list', array('fields' => > array('Charity.id', 'Charity.charity_name'))); > > And then > > echo $this->Form->input('Charity.charity_name', array('options' => > $charities)); > > (It would automa

Re: Question about how models using different datasources handle relationships

2011-02-22 Thread Stephen
I had an issue with an array style data source, hardcoded in the model, the only solution was to hack it to work. On 22 February 2011 18:57, cricket wrote: > On Tue, Feb 22, 2011 at 7:56 AM, Greg Skerman wrote: > > Hi, > > > > I'm curious as to how models which use different datasources handle

Re: Google Webmaster Tools show Cakephp Helpers

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 11:16 AM, nachtk...@bigfoot.com wrote: > Hi guys, anybody using Google Webmaster Tools with their cakephp site? > > I was wondering why Google Webmaster Tools shows keywords like > formhelper, sessionhelper and htmlhelper in the keywords section. > Usually this shouldn't be

Re: isAuthorized problem with mixed case actions

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 11:35 AM, chris wrote: > Whilst going through the security of my application, I've noticed a > flaw. I'm not sure if this is a cake issue, or just something I need > to be aware of however. > > I'm using code from the Bakery for the Sortable behaviour. So I've got > functio

Re: media view

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 8:55 AM, a17s wrote: > Hello, > I am trying to use the MediaView class to set a download of pdf file. > So far my attempts are not working and I can't seem to find any fault > in my code copied from the book.cakephp.org website. Any help or > thoughts will be appreciated.

Changing hiddenField from 0

2011-02-22 Thread Djonatan Buss
I'm using checkbox to check if the client agrees with the contract. But I would like to have 'No' if it was not checked. The problem is that I don't know how to change the hiddenField value. Ok, I know that I can treat it before saving changing 0 for 'No', but I would like to avoid this code and

Re: Possible Memory Leak

2011-02-22 Thread cricket
Really? You're using PHP--and through a webserver--to do month-long "simulation on the financial data" (is that the same as "Financial Data"?) that could result in 100 million DB queries? Pardon me if I'm skeptical of this post. On Mon, Feb 21, 2011 at 8:49 AM, ProFire wrote: > Hi fellow cakephp

Re: Question about how models using different datasources handle relationships

2011-02-22 Thread cricket
On Tue, Feb 22, 2011 at 7:56 AM, Greg Skerman wrote: > Hi, > > I'm curious as to how models which use different datasources handle > relationships? > > If i was to create a datasource to consume a web service, and I wanted it to > pick up related fields via a HasOne relationship to a model using a

RE: Problem with accessing form data

2011-02-22 Thread Krissy Masters
$this->data // holds form data Use debug! Make it your best friend. Don't know what data is held? Where it went? Even if there is any? if(!empty($this->data)){ Configure::write('debug', 2);//only if you need it for this action debug($this->data); exit(); } My guess is it should be an array si

Re: Possible Memory Leak

2011-02-22 Thread Miloš Vučinić
I totally agree with other guys about demonizing it and making the process being able to pause, maybe restart the computer and contine from where you have paused. So I am writting to express wory about a precision of your results. I am not an old cake user and I haven't had a chance to do complex

Re: Conneect with Oracle

2011-02-22 Thread Zaky Katalan-Ezra
Linux? windows? Do you see OCI in phpinfo()? -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to

isAuthorized problem with mixed case actions

2011-02-22 Thread chris
Whilst going through the security of my application, I've noticed a flaw. I'm not sure if this is a cake issue, or just something I need to be aware of however. I'm using code from the Bakery for the Sortable behaviour. So I've got functions named moveUp and moveDown in my controller. In isAuthor

Re: caching with pages and '/' route

2011-02-22 Thread designv...@gmail.com
Ok, So it's basically treating /home the same as /? So I need to NOT use the global Cache.check and setup the caching in each controller as I have done before? Does this mean that I will have to copy the pages class from the core to control the pages caching? d//t. On Feb 22, 3:39 pm, John Ande

Problem with accessing form data

2011-02-22 Thread newguy
Hi I have a simple form in my view where the user enters a 4 digit numeral code, in the controller action am unable to access this code, it would be great if some one could tell me how to access this code in the action and then pass this code as a parameter to another controller action. ***For

Re: problems populating my select box

2011-02-22 Thread barricades
Here's my function to register a campaign. I guess I need to somehow get the charity name from the form and with it find the charity id that corresponds with that name and then insert it into $this- >data['Campaign']['charity_id']. I'm not sure how to do that though :( function regcampaign

Google Webmaster Tools show Cakephp Helpers

2011-02-22 Thread nachtk...@bigfoot.com
Hi guys, anybody using Google Webmaster Tools with their cakephp site? I was wondering why Google Webmaster Tools shows keywords like formhelper, sessionhelper and htmlhelper in the keywords section. Usually this shouldn't be visible to the google bot, right? -- Our newest site for the community

Re: FCK editor filling textarea with home page

2011-02-22 Thread WhyNotSmile
I found the solution to this. The problem was that my site was in a subdirectory, but the fck helper file was just pointing to the webroot as if it was at the top level. Adding in the subdirectory to the fck basepath solved the problem. i.e. in the fck helper, in the constructor, I had $this->

Re: caching with pages and '/' route

2011-02-22 Thread John Andersen
The Dispatcher class has a method in which it checks for whether or not it should use a cached version of the URL, when the Cache.check configuration is set to true. So in your case it works as it should, you have told the Dispatcher to use cached versions. The Dispatcher uses "/home" whenever the

Re: problems populating my select box

2011-02-22 Thread barricades
Ok that worked (sort of), thanks! I also noticed that I had a typo in the above that probably wasn't helping either. Your kind advice above turns the select box into a list of the charities names ok, but when I create a campaign having selected a charity the controller doesn't save the charity_id

Re: media view

2011-02-22 Thread Sam Sherlock
check that you have no errors hidden away (you need debug to be off for media views to work) - this can be a cause of media views not working also check that $this->webroot . 'files' . DS is what you expect and that the pdf is there - S On 22 February 2011 13:55, a17s wrote: > $this->webr

Re: problems populating my select box

2011-02-22 Thread Stephen
try: $charities = $this->Campaign->Charity->find('list', array('fields' => array('Charity.id', 'Charity.charity_name'))); And then echo $this->Form->input('Charity.charity_name', array('options' => $charities)); (It would automatically select the columns "id" and "name" but I think if they are

problems populating my select box

2011-02-22 Thread barricades
Hi there, newbie here. I have a campaign model and a charity model. Campaign belongsTo Charity and Charity hasMany Campaigns. I have a form which creates a campaign and I need a select box to have the name of all the charities. What I have at the minute is what cake baked for me and it creates a

Re: caching with pages and '/' route

2011-02-22 Thread designv...@gmail.com
I have used caching before on controllers I have created and it's not been a problem, and it works fine for the controllers in this site. I am familiar with setting the cache configuration options and creating new ones in the core. I am just stumped over this issue regarding caching pages and the

Re: caching with pages and '/' route

2011-02-22 Thread John Andersen
Sounds like you need to start reading first about caching in the CakePHP book at: http://book.cakephp.org/view/1193/Caching as there are several possibilities for caching your information. I would not turn on caching, unless I understand what is being cached and for how long :) Enjoy, John On

media view

2011-02-22 Thread a17s
Hello, I am trying to use the MediaView class to set a download of pdf file. So far my attempts are not working and I can't seem to find any fault in my code copied from the book.cakephp.org website. Any help or thoughts will be appreciated. Find sample code below: $this->view = 'Media'; //set t

Re: caching with pages and '/' route

2011-02-22 Thread designv...@gmail.com
Haven't got anything apart from Configure::write('Cache.check', true); Currently... I have read I need to specify cacheAction for routes, but am unsure where I need to set that for routes/pages? TIA d//t. On Feb 22, 1:35 pm, John Andersen wrote: > Please show your cache configuration! > Enjo

Re: caching with pages and '/' route

2011-02-22 Thread John Andersen
Please show your cache configuration! Enjoy, John On 22 Feb., 13:49, "designv...@gmail.com" wrote: > Hi there, > > I have the following routes defined: > > Router::connect('/', array('controller' => 'splashes', 'action' => > 'index')); > Router::connect('/home', array('controller' => 'pages',

Re: Conneect with Oracle

2011-02-22 Thread Nguyễn Trịnh Hồng Ngọc
thanks for your helping, but I dont know why it does not work on my project :( On 18 Tháng Hai, 21:35, ojonam wrote: > Hi, > > I had a few issues with the configuration as well.  Try removing the > host name and adding it as a prefix to the database field. Also, > specify the 'connect' field. > >

Question about how models using different datasources handle relationships

2011-02-22 Thread Greg Skerman
Hi, I'm curious as to how models which use different datasources handle relationships? If i was to create a datasource to consume a web service, and I wanted it to pick up related fields via a HasOne relationship to a model using a mysql database table, will cake just automagically resolve this,

Re: Possible Memory Leak

2011-02-22 Thread Maurits van der Schee
Hi, > I use a single http request. Ah and that is your problem. PHP and web servers in general are not designed to execute long running tasks. I do batch processing in cakephp using a javascript timer that invokes an ajax call to cake every 2 seconds. Cake then executes a small portion of t

caching with pages and '/' route

2011-02-22 Thread designv...@gmail.com
Hi there, I have the following routes defined: Router::connect('/', array('controller' => 'splashes', 'action' => 'index')); Router::connect('/home', array('controller' => 'pages', 'action' => 'display', 'home')); And when I enable caching I get 1 cache file created when I hit the site index cal

Re: password hash in cake

2011-02-22 Thread Tilen Majerle
this is a code, which hash a password properly for Auth component Security::hash('yourpassword', "sha1", true); so when you save this, do this before you save {{{ $this->data['User']['password'] = Security::hash($this->data['User']['password'], 'sha1', true); }}} -- Lep pozdrav,

password hash in cake

2011-02-22 Thread Marne
Hi guys, newby here and the first time with CAKEPHP We have a site using cake and are having problems with password hashing, on the customer/user registration page when the register the password is not hashed when sent to the DB, therefor not allowing the customer/user to log in. When logged in an

Re: Change the Database at Login by user choice

2011-02-22 Thread John Andersen
You have to look into using the models attribute useDbConfig, see the CakePHP book at: http://book.cakephp.org/view/1058/useDbConfig and applying it in the controllers beforeFilter method depending on your requirement. Enjoy, John On 21 Feb., 12:19, andreguerreiro85 wrote: > Hi there, i'm usi

Re: Loading components inside components and keeping the initialize() stack order

2011-02-22 Thread Pixelastic
Because the SecondaryComponent::specialMethod() method is proper to the SecondaryComponent, I don't want to put code in MainComponent that should be be in SecondaryComponent. I would like to keep all code relating to SecondaryComponent inside SecondaryComponent. On 16 fév, 19:24, Miles J wrote: >

Re: Possible Memory Leak

2011-02-22 Thread Ryan Schmidt
On Feb 22, 2011, at 02:57, AD7six wrote: > On Feb 22, 1:07 am, ProFire wrote: >> I use a single http request. > > Why are you using a http request at all? > > I'd suggest: > > * use the cli - a month long http request? you're just asking for > trouble > * write your process such that it's resta

Re: Possible Memory Leak

2011-02-22 Thread AD7six
On Feb 22, 1:07 am, ProFire wrote: > I use a single http request. Why are you using a http request at all? I'd suggest: * use the cli - a month long http request? you're just asking for trouble * write your process such that it's restartable * daemonize it - a manager process that doesn't do

Re: How to determine specific rule that was triggered on validation?

2011-02-22 Thread John Andersen
You probably have to use a combination of defining your validation rules according to the CakePHP book at: http://book.cakephp.org/view/1151/Multiple-Rules-per-Field and then use the models invalidFields method to pass the errors on to the view, so that you may discern which error rule is being re

Re: Possible Memory Leak

2011-02-22 Thread Ryan Schmidt
I don't know about that. Years ago people might have said PHP isn't made for command-line scripting, but then PHP 4.3 came along and gave us a command-line PHP SAPI and it works great. PHP may have been initially designed for serving web pages, but it's a fine general-purpose language that can d