Re: $_POST populated, but not $this->data
Is the form created through Html helper? Also have you tried $this- >Form->input ? On Oct 19, 5:59 am, tekomp wrote: > When trying to login to my app using auth component and form helper in > 1.3.4, the password value is not being populated in $this->data for > some reason, even though it's set in $_POST fine. Here's debug from > $_POST (first array) and $this->data: > > Array > ( > [_method] => POST > [data] => Array > ( > [User] => Array > ( > [username] => myusername > [password] => password > ) > > ) > > ) > > Array > ( > [User] => Array > ( > [username] => myusername > [password] => > ) > > ) > > The form is very basic with just these inputs: > > echo $form->input('username'); > echo $form->input('password'); > > Any ideas? > > Thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: $_POST populated, but not $this->data
Nevermind folks - turned out to be an issue with userScope that I didn't have configured properly. On Oct 18, 7:59 pm, tekomp wrote: > When trying to login to my app using auth component and form helper in > 1.3.4, the password value is not being populated in $this->data for > some reason, even though it's set in $_POST fine. Here's debug from > $_POST (first array) and $this->data: > > Array > ( > [_method] => POST > [data] => Array > ( > [User] => Array > ( > [username] => myusername > [password] => password > ) > > ) > > ) > > Array > ( > [User] => Array > ( > [username] => myusername > [password] => > ) > > ) > > The form is very basic with just these inputs: > > echo $form->input('username'); > echo $form->input('password'); > > Any ideas? > > Thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
$_POST populated, but not $this->data
When trying to login to my app using auth component and form helper in 1.3.4, the password value is not being populated in $this->data for some reason, even though it's set in $_POST fine. Here's debug from $_POST (first array) and $this->data: Array ( [_method] => POST [data] => Array ( [User] => Array ( [username] => myusername [password] => password ) ) ) Array ( [User] => Array ( [username] => myusername [password] => ) ) The form is very basic with just these inputs: echo $form->input('username'); echo $form->input('password'); Any ideas? Thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
App::import bug with vendors?
For some reason App::import('Vendor', 'SomeVendor'); doesnt't look (and doesnt't find anything) in root/app vendors if called within a plugin i would have expected App::import('Vendor', 'PluginName.SomeVendor'); to look in the plugin similar to any other lookup (libs, component, ...) and the above call to find my app vendor stuff. Is this a cake1.3 bug? Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: default checkbox state still not fixed
On Oct 17, 4:41 pm, cricket wrote: > 1.3.4 > > How are others dealing with the broken checkbox implementation? > Situation: I want a checkbox to have a default state, checked or > unchecked. To have the former: > > echo $this->Form->input( > 'Model.foo', > array( > 'label' => 'foo', > 'checked' => 1 > ) > ); > > However, if the value in the DB is 0 the checkbox will be displayed > checked. It seems to me that the default should only be used if the > value in $data is empty or the key doesn't exist. Bug reports > explaining this have been ignored. How are others handling this > situation? I disagree that, that is how it should work. If you put checked, you should get checked. Being specific gets specific behavior, leaving things undefined gets you magic. If you want default values, the populate $this->data in your controller, when the action has no POST data. This will get you the behaviour you want. -Mark Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Query count function
On Mon, Oct 18, 2010 at 4:18 AM, Rocco Luca wrote: > Hello everyone, I state that I am new to the world of cakephp. > I'm rewriting a program from a php to MVC. I need > add a function that checks mean it is booked in a > range of time from the input fields "from" and "until". > > In PHP also make a query like: > > $query = "SELECT * FROM calendar WHERE id='$id_mean' AND > confirm='1' AND ( > ('".$from."' <= from AND '".$until."' >= until) OR > ('".$from."' <= from AND '".$until."'<= until AND '".$until."' >= > from) OR > ('".$from."' >= from AND '".$until."'<= until)OR > ('".$from."' >= from AND '".$from."' <= until AND '".$until."'>= > until))"; > $results = mysql_query($query) or die (mysql_error()); > $num = mysql_num_rows($results); > > If the result is 0, then arming otherwise get an error message flash. > > How can I do the same in cakephp? It's a bit tricky in that you've got the variable on the left and the table column on the right. For Cake, you'll need to reverse that, so the operators will have to change (as I've done below). Your query also doesn't make sense because you are fetching a record with a specific id. You should either fetch by id OR by the rest of the criteria here. But, if we leave out id it would be something like: $data = $this->find( // assuming query is from inside Calendar model 'all', array( 'conditions' => array( 'Calendar.confirm' => 1, array( 'OR' => array( array( 'Calendar.from >=' => $from, 'Calendar.until <=' => $until ), array( 'Calendar.from >=' => $from, 'Calendar.until >=' => $until, 'Calendar.from <=' => $until ), array( 'Calendar.from <=' => $from, 'Calendar.until >=' => $until ), array( 'Calendar.from <=' => $from, 'Calendar.until >=' => $from, 'Calendar.until <=' => $until ) ) ) ) ) ); So, the record must have confirm == 1 AND at least one of the subsequent groups must evaluate true. Each of the groups, because they're in their own array, will use AND, so all tests within a particular group must be true.. This could probably be tightened up a bit by using BETWEEN in places, and, if you took care (in record creation) not to allow Calendar.from to ever be greater than Calendar.until, you wouldn't need to test for it in find(), which would simplify this more. It might help to draw this out on paper. Draw a line and place an F and a U somewhere along it. This will be C.from and C.until (for any record. Below that, in 4 steps below each other, place a $f and $u to represent your vars, either to the left or right of F and U. So, given the above, you have 2 options where $from is less than C.from: one where $until is greater than C.until, and one where it's less. Next, you have 2 options where $until is greater than C.until: one where $from is less than C.from and one where it's greater. The only things you don't want are $from > C.until and $until < C.from, which makes sense. So the query can then be simplified to: $data = $this->find( 'all', array( 'conditions' => array( 'Calendar.confirm' => 1, array( 'Calendar.from <' => $until, 'Calendar.until >' => $from ) ) ) ); > Sorry for bad English. It's far better than my Italian. :-) Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
MySQL Access from Shell
Hi everybody, i have a web app running beautiful, i needed a MySQL table to be updated everyday at 2 am so i created the table, the model and a Shell, the shell retrieves a csv from an FTP server and then i do a truncate to the model table and then a load data infile to load the csv to the table/model. The thing is that i got this error when i run the Shell: PHP Warning: SQL Error: 1045: Access denied for user 'MYDBUSERNAME'@'localhost' (using password: YES) in /var/www/cdf/cake/libs/model/datasources/dbo_source.php on line 681 I tested and retested, and REtested the MySQL access, and actually the web app is running correct using those same database configuration set in the $default Hope someone can help me ... aad Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: PersistModel problem
I ran into this problem many times and never found a solution. It only seemed to happen on apps with large sets of models and relations, so I am assuming that the serialization of the objects is causing the model relations to break or not work properly. I had to disable persistModel and just stich with caching. On Oct 18, 7:27 am, sherzo wrote: > Hi all > > Today I noticed that the registration part of my web site stopped working! I > turned on the debug mode and I saw this error message: > "The script tried to execute a method or access a property of an incomplete > object. Please ensure that the class definition "Registration" of the object > you are trying to operate on was loaded _before_ unserialize() gets called > or provide a __autoload() function to load the class definition in xxx" > I google it and I found out its related to the persistModel. I deleted the > whole cache and nothing changed! the I change the persistModel value from > true to false and then the site started to work! > but I need the persistModel to be on! > Any one knows how can I solve this problem? > > Thanks > Sherry > -- > View this message in > context:http://cakephp.1045679.n5.nabble.com/PersistModel-problem-tp3217510p3... > Sent from the CakePHP mailing list archive at Nabble.com. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
Sorry. Included almost everything else. Is always the last thing to you think of, eh? ;o) Toby On 18 October 2010 15:17, Tilen Majerle wrote: > ouu...why u didn't say this before :Dyes maybe, i'm using 1.3.4 and > there it works > -- > Tilen Majerle > http://majerle.eu > > > > 2010/10/18 Toby Griffiths > >> Nope. Still not working. >> >> It's not because I've not upgraded to 1.3 yet is it? Still running on >> 1.2.7. >> >> Toby >> >> >> >> On 18 October 2010 14:18, Tilen Majerle wrote: >> >>> do just thisopen this model and in class this: >>> >>> var $useTable = "table_name"; //probaby users_users >>> >>> -- >>> Tilen Majerle >>> http://majerle.eu >>> >>> >>> >>> 2010/10/18 Toby Griffiths >>> Thanks for the advice. Tried to rename my model, but there's a lot of associated changes that would need to be made & can't do that easily now, so will try again when I have a little more time. Toby On 18 October 2010 13:34, Tilen Majerle wrote: > hmm...maybe because of tables or what... > > i have Gallery Plugin and GalleryCategory and GalleryImage models and > tables gallery_images and gallery_categories and it works perfect! > > so problem is maybe recognizing tables...make tables in > pluginname_controllername so users_users and then try again... :D > > 2010/10/18 Toby G > >> Thanks for that, but it's still producing an empty schema file. >> >> Here's the command I'm running... >> >> cake schema generate -plugin Users -file users-schema.php >> >> ... and here's my folder structure... >> >> config >> controllers >> locale >> models >> plugins >> users >>controllers >>views >>models >>tests >>users_app_controller.php >>users_app_model.php >>vendors >> tests >> tmp >> vendors >> views >> webroot >> >> ... and this is what I'm getting out... >> >> > /* SVN FILE: $Id$ */ >> /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ >> class SosSchema extends CakeSchema { >>var $name = 'Sos'; >> >>function before($event = array()) { >>return true; >>} >> >>function after($event = array()) { >>} >> >> } >> ?> >> >> What am I doing wrong? >> >> Thanks, >> >> Toby >> >> >> >> >> On Oct 17, 8:25 pm, Tilen Majerle wrote: >> > cake schema generate -plugin plugin_name >> > -- >> > Tilen Majerlehttp://majerle.eu >> > >> > 2010/10/17 Toby G >> > >> > >> > >> > > Hi all, >> > >> > > I've recently created a Users plugin to manage all my user logins, >> > > however I would now like to create a migration schema for the >> users >> > > table, but running the... >> > >> > > cake schema generate >> > >> > > ... on the app ignores the models in the plugin. >> > >> > > Does anyone know a way of generating schemas for plugin models? >> > >> > > Thanks, >> > >> > > Toby >> > >> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help >> others >> > > with their CakePHP related questions. >> > >> > > 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+unsubscr...@googlegroups.com >> For more options, visit >> this group at >> > >http://groups.google.com/group/cake-php?hl=en >> >> Check out the new CakePHP Questions site http://cakeqs.org and help >> others with their CakePHP related questions. >> >> 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+unsubscr...@googlegroups.comFor >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > > > -- > -- > Tilen Majerle > http://majerle.eu > > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > TGPromotions.com is a limited company registered in England and Wales. Registered number: 714271
Re: Find Max/Min value of fields from associated models.
Hi, Thanks for the reply, I've other fields in the price table and i'm just showing a couple of fields here. On Oct 18, 10:43 pm, Andrei Mita wrote: > First, make sure your db design is good. For instance, I don't think you > need model_id in the price table as model is linked to price through > variant. Actually, I don't see the use for the price table in your example. > Why don't you just put another column in your variant table for price? > > > > > > > > On Mon, Oct 18, 2010 at 2:41 PM, mobz wrote: > > Hi guys! > > > I'm very new to cakephp and i'm working on my first cake project and i > > would really appreciate if someone can point me in the right > > direction! > > > the basic structure of my models: > > > model->variant->price > > > model (id, name) > > variant (id, name, model_id) > > price (id,price,model_id, variant_id) > > > i'm trying to create a car site > > > For example, there are 3 models and each model has a couple of > > variants and each variant has its own price > > > models => BMW 3 Series, Audi A4, Golf GTi > > > variants => BMW 3 Series -> 2.0, 3.0, 4.0 > > Audi A4 -> 5.0, 6.0 > > Golf Gti -> 2.0, 4.0 > > > prices => BMW 3 Series -> 2.0 -> 2 > > BMW 3 Series -> 3.0 -> 3 > > BMW 3 Series -> 4.0 -> 4 > > Audi A4 -> 5.0 -> 3 > > Audi A4 -> 6.0 -> 4 > > Golf Gti -> 2.0 -> 24000 > > Golf GTi -> 4.0 -> 29000 > > > my question is how can i calculate the max and min price of each > > model? For example, on the model index page, i want to display the > > price range of BMW 3 series, eg, BMW 3 Series ($2 - $4)? > > > I can do this in sql by selecting the MAX and MIN value of the prices, > > joining the price and model tables and group by the model, so how can > > i do this is cakephp? > > > thanks in advance > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > 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+unsubscr...@googlegroups.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cake-php@googlegroups.com
Okies guy I think u all here rock ..but sleepy :P I've done the translation my way So I gave the Admin the possiblity to change the language from the BO Wot I've done is creating a table configuration with 3 column TABLE:CONFIGURATIONS ID - COLUMN - VALUE The in my admin_editlanguage I set the column to the language selected from the editlanguage form! Next easy as a piece of cake read the value in the BeforeFilter and set the current language to the one read from the database :) This is the source code in case this can help someone else somewhere :) //ADMIN EDIT LANGUAGE CONTROLLER ACTION function admin_editlanguage() { if (!empty($this->data)) { $data['Configuration']['value']=$this->data['User']['lang']; $data['Configuration']['id']=1; $this->loadModel('Configuration'); if($this->Configuration->save($data)){ $this->Session->setFlash(__('The user interface language has been changed!', true)); $this->redirect($this->referer()); }else{ $this->Session->setFlash(__('The user interface language couldn \'t be changed!', true)); $this->redirect($this->referer()); } }} //ADMIN EDIT LANGUAGE FORM Form- >create('User',array('action'=>'editlanguage'));?> '. __('Interface Language',true).''.$this->Form->select('lang',array('fre'=> __('French',true),'ita'=> __('Italian',true),'eng'=> __('English',true)),null,array('empty'=> __('Select a language',true),'class'=>'fullwidth')).''; ?> Form->end(__('Submit', true));?> Html->link(__('List Users', true), array('action' => 'index'));?> //BEFORE FILTER function beforeFilter() { $this->loadModel('Configuration'); $id=$this->Configuration->read(null,1); Configure::write('Config.language',$id['Configuration']['value']);} Regards Abraham Boray {A|B} On Oct 18, 1:40 pm, Abraham Boray wrote: > Thank uu :) that's does help a little bit :) butt I'm seekin' more > explanation .. thank uu > > On Oct 18, 1:31 pm, Tilen Majerle wrote: > > > > > > > > > yes, the best way in cakephp and settings is settings table in mysql and > > Setting model, then from there modify, add, delete settings...i think the > > best solution :D > > -- > > Tilen Majerlehttp://majerle.eu > > > 2010/10/18 Abraham Boray > > > > I'm workin' on a web site that requires an implementation of different > > > languages > > > I've done that using pot files .. for french and english > > > version..works perfect! > > > > Wot I'm not able to do is to give the administrator the choice to > > > change the web Site language from the back office; > > > using : > > > Configure::write('Config.language', 'fre'); //to change the lang to > > > french > > > > Any ideas how to do this ..maybe a database driven solution ... or > > > session ...! > > > I'm thinkin' a database driven solution can be much easier 2 > > > implement ... > > > still I'm seekin' some of u guys who have had experience with this! > > > > Thank u > > > Regards > > > Abraham Boray {A|B} > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others > > > with their CakePHP related questions. > > > > You received this message because you are subscribed to the Google > > > Groups> > "CakePHP" group.> To post to this group, send > > > emailtocake-...@googlegroups.com> > To unsubscribe from this group, send > > > email > > > to>cake-php+unsubscr...@googlegroups.com > > s.com>For more options, visit this group at > > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Find Max/Min value of fields from associated models.
First, make sure your db design is good. For instance, I don't think you need model_id in the price table as model is linked to price through variant. Actually, I don't see the use for the price table in your example. Why don't you just put another column in your variant table for price? On Mon, Oct 18, 2010 at 2:41 PM, mobz wrote: > Hi guys! > > I'm very new to cakephp and i'm working on my first cake project and i > would really appreciate if someone can point me in the right > direction! > > the basic structure of my models: > > model->variant->price > > model (id, name) > variant (id, name, model_id) > price (id,price,model_id, variant_id) > > > i'm trying to create a car site > > For example, there are 3 models and each model has a couple of > variants and each variant has its own price > > models => BMW 3 Series, Audi A4, Golf GTi > > variants => BMW 3 Series -> 2.0, 3.0, 4.0 > Audi A4 -> 5.0, 6.0 > Golf Gti -> 2.0, 4.0 > > prices => BMW 3 Series -> 2.0 -> 2 >BMW 3 Series -> 3.0 -> 3 >BMW 3 Series -> 4.0 -> 4 >Audi A4 -> 5.0 -> 3 >Audi A4 -> 6.0 -> 4 >Golf Gti -> 2.0 -> 24000 >Golf GTi -> 4.0 -> 29000 > > > my question is how can i calculate the max and min price of each > model? For example, on the model index page, i want to display the > price range of BMW 3 series, eg, BMW 3 Series ($2 - $4)? > > I can do this in sql by selecting the MAX and MIN value of the prices, > joining the price and model tables and group by the model, so how can > i do this is cakephp? > > thanks in advance > > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Block every http connection except mine using .htaccess mod_rewrite?
On Oct 18, 2:57 pm, euromark wrote: > using IPs is not very smart > they can change every now and then. and then you would have blocked > yourself as well. You talk as if the OP asked for a permanent access solution. Updating your own ip address in a .htaccess file would take about 30s. Throughout the day entering a password a few times, if your in the process of updating the site's contents, adds up to a fair bit more. Personally even if you password protect something (as I also suggested), I'd rather not see the form myself and just get let in. Especially if your site is made up of multiple subdomains as otherwise you'll get a password prompt for each domain - probably not relevant to the case at hand but it certainly demonstrates the inconvenience of the technique when you get n password prompts for the n subdomains your site uses. Josh if you /want/ to use an IP filter and exclude your own co workers, you could use X-Forwarded-For restricted to your internal ip. But given you'd already added a custom header, it's probably simpler to just use that. You would only need to edit your webroot/.htaccess file because given you used a production install for a production site (didn't you ;) ) the other two .htaccess files are irrelevant. AD Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
PersistModel problem
Hi all Today I noticed that the registration part of my web site stopped working! I turned on the debug mode and I saw this error message: "The script tried to execute a method or access a property of an incomplete object. Please ensure that the class definition "Registration" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in xxx" I google it and I found out its related to the persistModel. I deleted the whole cache and nothing changed! the I change the persistModel value from true to false and then the site started to work! but I need the persistModel to be on! Any one knows how can I solve this problem? Thanks Sherry -- View this message in context: http://cakephp.1045679.n5.nabble.com/PersistModel-problem-tp3217510p3217510.html Sent from the CakePHP mailing list archive at Nabble.com. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Find Max/Min value of fields from associated models.
Hi guys! I'm very new to cakephp and i'm working on my first cake project and i would really appreciate if someone can point me in the right direction! the basic structure of my models: model->variant->price model (id, name) variant (id, name, model_id) price (id,price,model_id, variant_id) i'm trying to create a car site For example, there are 3 models and each model has a couple of variants and each variant has its own price models => BMW 3 Series, Audi A4, Golf GTi variants => BMW 3 Series -> 2.0, 3.0, 4.0 Audi A4 -> 5.0, 6.0 Golf Gti -> 2.0, 4.0 prices => BMW 3 Series -> 2.0 -> 2 BMW 3 Series -> 3.0 -> 3 BMW 3 Series -> 4.0 -> 4 Audi A4 -> 5.0 -> 3 Audi A4 -> 6.0 -> 4 Golf Gti -> 2.0 -> 24000 Golf GTi -> 4.0 -> 29000 my question is how can i calculate the max and min price of each model? For example, on the model index page, i want to display the price range of BMW 3 series, eg, BMW 3 Series ($2 - $4)? I can do this in sql by selecting the MAX and MIN value of the prices, joining the price and model tables and group by the model, so how can i do this is cakephp? thanks in advance Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Query count function
Hello everyone, I state that I am new to the world of cakephp. I'm rewriting a program from a php to MVC. I need add a function that checks mean it is booked in a range of time from the input fields "from" and "until". In PHP also make a query like: $query = "SELECT * FROM calendar WHERE id='$id_mean' AND confirm='1' AND ( ('".$from."' <= from AND '".$until."' >= until) OR ('".$from."' <= from AND '".$until."'<= until AND '".$until."' >= from) OR ('".$from."' >= from AND '".$until."'<= until)OR ('".$from."' >= from AND '".$from."' <= until AND '".$until."'>= until))"; $results = mysql_query($query) or die (mysql_error()); $num = mysql_num_rows($results); If the result is 0, then arming otherwise get an error message flash. How can I do the same in cakephp? Sorry for bad English. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
ouu...why u didn't say this before :Dyes maybe, i'm using 1.3.4 and there it works -- Tilen Majerle http://majerle.eu 2010/10/18 Toby Griffiths > Nope. Still not working. > > It's not because I've not upgraded to 1.3 yet is it? Still running on > 1.2.7. > > Toby > > > > On 18 October 2010 14:18, Tilen Majerle wrote: > >> do just thisopen this model and in class this: >> >> var $useTable = "table_name"; //probaby users_users >> >> -- >> Tilen Majerle >> http://majerle.eu >> >> >> >> 2010/10/18 Toby Griffiths >> >>> Thanks for the advice. Tried to rename my model, but there's a lot of >>> associated changes that would need to be made & can't do that easily now, so >>> will try again when I have a little more time. >>> >>> Toby >>> >>> >>> >>> On 18 October 2010 13:34, Tilen Majerle wrote: >>> hmm...maybe because of tables or what... i have Gallery Plugin and GalleryCategory and GalleryImage models and tables gallery_images and gallery_categories and it works perfect! so problem is maybe recognizing tables...make tables in pluginname_controllername so users_users and then try again... :D 2010/10/18 Toby G > Thanks for that, but it's still producing an empty schema file. > > Here's the command I'm running... > > cake schema generate -plugin Users -file users-schema.php > > ... and here's my folder structure... > > config > controllers > locale > models > plugins > users >controllers >views >models >tests >users_app_controller.php >users_app_model.php >vendors > tests > tmp > vendors > views > webroot > > ... and this is what I'm getting out... > > /* SVN FILE: $Id$ */ > /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ > class SosSchema extends CakeSchema { >var $name = 'Sos'; > >function before($event = array()) { >return true; >} > >function after($event = array()) { >} > > } > ?> > > What am I doing wrong? > > Thanks, > > Toby > > > > > On Oct 17, 8:25 pm, Tilen Majerle wrote: > > cake schema generate -plugin plugin_name > > -- > > Tilen Majerlehttp://majerle.eu > > > > 2010/10/17 Toby G > > > > > > > > > Hi all, > > > > > I've recently created a Users plugin to manage all my user logins, > > > however I would now like to create a migration schema for the users > > > table, but running the... > > > > > cake schema generate > > > > > ... on the app ignores the models in the plugin. > > > > > Does anyone know a way of generating schemas for plugin models? > > > > > Thanks, > > > > > Toby > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help > others > > > with their CakePHP related questions. > > > > > 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+unsubscr...@googlegroups.com > For more options, visit this > group at > > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- -- Tilen Majerle http://majerle.eu Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en >>> >>> TGPromotions.com is a limited company registered in England and Wales. >>> Registered number: 7142712. Registered office: 6 Irby Walk, Cheadle, >>> Cheshire SK8 2LU. >>> >>> >>> >>> >>> Check out the new CakePHP Questions site http://cakeqs.org and help others >>> with their CakePHP related questions. >>> >>> >>> >>> You received this message because you are subscribed to the Google Groups >>> "CakePHP" group. >>> >>> To post to this group
Re: Schema generation for plugins
Nope. Still not working. It's not because I've not upgraded to 1.3 yet is it? Still running on 1.2.7. Toby On 18 October 2010 14:18, Tilen Majerle wrote: > do just thisopen this model and in class this: > > var $useTable = "table_name"; //probaby users_users > > -- > Tilen Majerle > http://majerle.eu > > > > 2010/10/18 Toby Griffiths > >> Thanks for the advice. Tried to rename my model, but there's a lot of >> associated changes that would need to be made & can't do that easily now, so >> will try again when I have a little more time. >> >> Toby >> >> >> >> On 18 October 2010 13:34, Tilen Majerle wrote: >> >>> hmm...maybe because of tables or what... >>> >>> i have Gallery Plugin and GalleryCategory and GalleryImage models and >>> tables gallery_images and gallery_categories and it works perfect! >>> >>> so problem is maybe recognizing tables...make tables in >>> pluginname_controllername so users_users and then try again... :D >>> >>> 2010/10/18 Toby G >>> Thanks for that, but it's still producing an empty schema file. Here's the command I'm running... cake schema generate -plugin Users -file users-schema.php ... and here's my folder structure... config controllers locale models plugins users controllers views models tests users_app_controller.php users_app_model.php vendors tests tmp vendors views webroot ... and this is what I'm getting out... >>> /* SVN FILE: $Id$ */ /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ class SosSchema extends CakeSchema { var $name = 'Sos'; function before($event = array()) { return true; } function after($event = array()) { } } ?> What am I doing wrong? Thanks, Toby On Oct 17, 8:25 pm, Tilen Majerle wrote: > cake schema generate -plugin plugin_name > -- > Tilen Majerlehttp://majerle.eu > > 2010/10/17 Toby G > > > > > Hi all, > > > I've recently created a Users plugin to manage all my user logins, > > however I would now like to create a migration schema for the users > > table, but running the... > > > cake schema generate > > > ... on the app ignores the models in the plugin. > > > Does anyone know a way of generating schemas for plugin models? > > > Thanks, > > > Toby > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > 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+unsubscr...@googlegroups.com For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.comFor more options, visit this group at http://groups.google.com/group/cake-php?hl=en >>> >>> >>> >>> -- >>> -- >>> Tilen Majerle >>> http://majerle.eu >>> >>> Check out the new CakePHP Questions site http://cakeqs.org and help >>> others with their CakePHP related questions. >>> >>> 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+unsubscr...@googlegroups.comFor >>> more options, visit this group at >>> http://groups.google.com/group/cake-php?hl=en >>> >> >> TGPromotions.com is a limited company registered in England and Wales. >> Registered number: 7142712. Registered office: 6 Irby Walk, Cheadle, >> Cheshire SK8 2LU. >> >> >> >> >> Check out the new CakePHP Questions site http://cakeqs.org and help others >> with their CakePHP related questions. >> >> >> >> 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+unsubscr...@googlegroups.com >> For more options, visit this group >> at http://groups.google.com/group/cake-php?hl=en >> >> >> >> > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP re
cake-php@googlegroups.com
Thank uu :) that's does help a little bit :) butt I'm seekin' more explanation .. thank uu On Oct 18, 1:31 pm, Tilen Majerle wrote: > yes, the best way in cakephp and settings is settings table in mysql and > Setting model, then from there modify, add, delete settings...i think the > best solution :D > -- > Tilen Majerlehttp://majerle.eu > > 2010/10/18 Abraham Boray > > > > > > > > > I'm workin' on a web site that requires an implementation of different > > languages > > I've done that using pot files .. for french and english > > version..works perfect! > > > Wot I'm not able to do is to give the administrator the choice to > > change the web Site language from the back office; > > using : > > Configure::write('Config.language', 'fre'); //to change the lang to > > french > > > Any ideas how to do this ..maybe a database driven solution ... or > > session ...! > > I'm thinkin' a database driven solution can be much easier 2 > > implement ... > > still I'm seekin' some of u guys who have had experience with this! > > > Thank u > > Regards > > Abraham Boray {A|B} > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > You received this message because you are subscribed to the Google Groups > > "CakePHP" group.> To post to this group, send email > > tocake-...@googlegroups.com > > To unsubscribe from this group, send email > > to>cake-php+unsubscr...@googlegroups.comFor > > more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cake-php@googlegroups.com
yes, the best way in cakephp and settings is settings table in mysql and Setting model, then from there modify, add, delete settings...i think the best solution :D -- Tilen Majerle http://majerle.eu 2010/10/18 Abraham Boray > I'm workin' on a web site that requires an implementation of different > languages > I've done that using pot files .. for french and english > version..works perfect! > > Wot I'm not able to do is to give the administrator the choice to > change the web Site language from the back office; > using : > Configure::write('Config.language', 'fre'); //to change the lang to > french > > Any ideas how to do this ..maybe a database driven solution ... or > session ...! > I'm thinkin' a database driven solution can be much easier 2 > implement ... > still I'm seekin' some of u guys who have had experience with this! > > Thank u > Regards > Abraham Boray {A|B} > > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
cake-php@googlegroups.com
I'm workin' on a web site that requires an implementation of different languages I've done that using pot files .. for french and english version..works perfect! Wot I'm not able to do is to give the administrator the choice to change the web Site language from the back office; using : Configure::write('Config.language', 'fre'); //to change the lang to french Any ideas how to do this ..maybe a database driven solution ... or session ...! I'm thinkin' a database driven solution can be much easier 2 implement ... still I'm seekin' some of u guys who have had experience with this! Thank u Regards Abraham Boray {A|B} Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
do just thisopen this model and in class this: var $useTable = "table_name"; //probaby users_users -- Tilen Majerle http://majerle.eu 2010/10/18 Toby Griffiths > Thanks for the advice. Tried to rename my model, but there's a lot of > associated changes that would need to be made & can't do that easily now, so > will try again when I have a little more time. > > Toby > > > > On 18 October 2010 13:34, Tilen Majerle wrote: > >> hmm...maybe because of tables or what... >> >> i have Gallery Plugin and GalleryCategory and GalleryImage models and >> tables gallery_images and gallery_categories and it works perfect! >> >> so problem is maybe recognizing tables...make tables in >> pluginname_controllername so users_users and then try again... :D >> >> 2010/10/18 Toby G >> >>> Thanks for that, but it's still producing an empty schema file. >>> >>> Here's the command I'm running... >>> >>> cake schema generate -plugin Users -file users-schema.php >>> >>> ... and here's my folder structure... >>> >>> config >>> controllers >>> locale >>> models >>> plugins >>> users >>>controllers >>>views >>>models >>>tests >>>users_app_controller.php >>>users_app_model.php >>>vendors >>> tests >>> tmp >>> vendors >>> views >>> webroot >>> >>> ... and this is what I'm getting out... >>> >>> >> /* SVN FILE: $Id$ */ >>> /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ >>> class SosSchema extends CakeSchema { >>>var $name = 'Sos'; >>> >>>function before($event = array()) { >>>return true; >>>} >>> >>>function after($event = array()) { >>>} >>> >>> } >>> ?> >>> >>> What am I doing wrong? >>> >>> Thanks, >>> >>> Toby >>> >>> >>> >>> >>> On Oct 17, 8:25 pm, Tilen Majerle wrote: >>> > cake schema generate -plugin plugin_name >>> > -- >>> > Tilen Majerlehttp://majerle.eu >>> > >>> > 2010/10/17 Toby G >>> > >>> > >>> > >>> > > Hi all, >>> > >>> > > I've recently created a Users plugin to manage all my user logins, >>> > > however I would now like to create a migration schema for the users >>> > > table, but running the... >>> > >>> > > cake schema generate >>> > >>> > > ... on the app ignores the models in the plugin. >>> > >>> > > Does anyone know a way of generating schemas for plugin models? >>> > >>> > > Thanks, >>> > >>> > > Toby >>> > >>> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help >>> others >>> > > with their CakePHP related questions. >>> > >>> > > 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+unsubscr...@googlegroups.com >>> For more options, visit this >>> group at >>> > >http://groups.google.com/group/cake-php?hl=en >>> >>> Check out the new CakePHP Questions site http://cakeqs.org and help >>> others with their CakePHP related questions. >>> >>> 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+unsubscr...@googlegroups.comFor >>> more options, visit this group at >>> http://groups.google.com/group/cake-php?hl=en >>> >> >> >> >> -- >> -- >> Tilen Majerle >> http://majerle.eu >> >> Check out the new CakePHP Questions site http://cakeqs.org and help >> others with their CakePHP related questions. >> >> 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+unsubscr...@googlegroups.comFor >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > TGPromotions.com is a limited company registered in England and Wales. > Registered number: 7142712. Registered office: 6 Irby Walk, Cheadle, Cheshire > SK8 2LU. > > > > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > > > 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+unsubscr...@googlegroups.com > For more options, visit this group > at http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
Thanks for the advice. Tried to rename my model, but there's a lot of associated changes that would need to be made & can't do that easily now, so will try again when I have a little more time. Toby On 18 October 2010 13:34, Tilen Majerle wrote: > hmm...maybe because of tables or what... > > i have Gallery Plugin and GalleryCategory and GalleryImage models and > tables gallery_images and gallery_categories and it works perfect! > > so problem is maybe recognizing tables...make tables in > pluginname_controllername so users_users and then try again... :D > > 2010/10/18 Toby G > >> Thanks for that, but it's still producing an empty schema file. >> >> Here's the command I'm running... >> >> cake schema generate -plugin Users -file users-schema.php >> >> ... and here's my folder structure... >> >> config >> controllers >> locale >> models >> plugins >> users >>controllers >>views >>models >>tests >>users_app_controller.php >>users_app_model.php >>vendors >> tests >> tmp >> vendors >> views >> webroot >> >> ... and this is what I'm getting out... >> >> > /* SVN FILE: $Id$ */ >> /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ >> class SosSchema extends CakeSchema { >>var $name = 'Sos'; >> >>function before($event = array()) { >>return true; >>} >> >>function after($event = array()) { >>} >> >> } >> ?> >> >> What am I doing wrong? >> >> Thanks, >> >> Toby >> >> >> >> >> On Oct 17, 8:25 pm, Tilen Majerle wrote: >> > cake schema generate -plugin plugin_name >> > -- >> > Tilen Majerlehttp://majerle.eu >> > >> > 2010/10/17 Toby G >> > >> > >> > >> > > Hi all, >> > >> > > I've recently created a Users plugin to manage all my user logins, >> > > however I would now like to create a migration schema for the users >> > > table, but running the... >> > >> > > cake schema generate >> > >> > > ... on the app ignores the models in the plugin. >> > >> > > Does anyone know a way of generating schemas for plugin models? >> > >> > > Thanks, >> > >> > > Toby >> > >> > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help >> others >> > > with their CakePHP related questions. >> > >> > > 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+unsubscr...@googlegroups.com >> For more options, visit this >> group at >> > >http://groups.google.com/group/cake-php?hl=en >> >> Check out the new CakePHP Questions site http://cakeqs.org and help >> others with their CakePHP related questions. >> >> 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+unsubscr...@googlegroups.comFor >> more options, visit this group at >> http://groups.google.com/group/cake-php?hl=en >> > > > > -- > -- > Tilen Majerle > http://majerle.eu > > Check out the new CakePHP Questions site http://cakeqs.org and help > others with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > TGPromotions.com is a limited company registered in England and Wales. Registered number: 7142712. Registered office: 6 Irby Walk, Cheadle, Cheshire SK8 2LU. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Block every http connection except mine using .htaccess mod_rewrite?
using IPs is not very smart they can change every now and then. and then you would have blocked yourself as well. use passwords and htaccess - this way nobody except for you can visit it until it can go live. On 18 Okt., 09:46, Joshua Muheim wrote: > Hey guys > > Blocking IP's doesn't make too much sense, because I'm behind a proxy, > like 100s of other co-workers in my company. So I guess this won't > work, because we all have the same IP - or don't we? I'm no big > network specialist, as you see.. ;-) > > Setting a password is a possibility, though. I will consider this. > > And yes, I didn't do the change for all the files, Michael. I will > check this possibility out, too. > > Thanks! > > > > On Sun, Oct 17, 2010 at 11:23 PM, Michael T wrote: > > Hey Josh, > > > Maybe the reason why your original attempt didn't work is because you > > didn't modify all 3 of the .htaccess files that are required in a Cake > > app? The files are in: > > > /your_cake_dir/.htaccess > > /your_cake_dir/app/.htaccess > > /your_cake_dir/app/webroot/.htaccess > > > Give that a try. > > > Cheers, > > > On Oct 15, 9:11 pm, psybear83 wrote: > >> Hi everybody > > >> I have to deploy a new version of my CakePHP application today. Sadly > >> I don't really have control over the server it is deployed to, and I > >> can't guarantee that nobody will try to use the website while I'm > >> trying to deploy the new version (it's the first time I deploy, so I > >> will need some time to try and fail until I succeed). > > >> So I thought I could manage this using .htaccess and mod_rewrite by > >> defining a RewriteRule that only passes my connection and forwards > >> every other connection to a "not available" page. > > >> I did some searching and figured out the following, but it doesn't > >> really work too well: > > >> > >> RewriteEngine on > > >> # Set your HTTP_USER_AGENT header to > >> "I_am_the_only_allowed_person_yeah" to gain access! > >> # Everybody else will see access_denied.php. > >> # > >> # Use ModifyHeaders Firefox > >> extension:https://addons.mozilla.org/en-US/firefox/addon/967/ > >> # Add a "User-Agent" entry using "Modify". > >> RewriteCond %{HTTP_USER_AGENT} ^I_am_the_only_allowed_person_yeah$ > >> RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] > > >> RewriteRule ^.*$ access_denied.php [L] > >> > > >> (I guess the trick using a faked User-Agent is not too secure, but it > >> will work for my purposes.) > > >> Sadly this doesn't really work for everything: I can access my CakePHP > >> app's homepage, but when I'm clicking any other link, I'm getting an > >> "Could not find XXX controller" error. > > >> Anybody got a working solution, or a better idea on how to accomplish > >> this? As said before, I can't map my app's domain to another folder or > >> something like that; I will have to do it another way... > > >> Thanks > >> Josh > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > 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+unsubscr...@googlegroups.com For more options, visit this group > > athttp://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
hmm...maybe because of tables or what... i have Gallery Plugin and GalleryCategory and GalleryImage models and tables gallery_images and gallery_categories and it works perfect! so problem is maybe recognizing tables...make tables in pluginname_controllername so users_users and then try again... :D 2010/10/18 Toby G > Thanks for that, but it's still producing an empty schema file. > > Here's the command I'm running... > > cake schema generate -plugin Users -file users-schema.php > > ... and here's my folder structure... > > config > controllers > locale > models > plugins > users >controllers >views >models >tests >users_app_controller.php >users_app_model.php >vendors > tests > tmp > vendors > views > webroot > > ... and this is what I'm getting out... > > /* SVN FILE: $Id$ */ > /* Sos schema generated on: 2010-10-18 11:10:58 : 1287399538*/ > class SosSchema extends CakeSchema { >var $name = 'Sos'; > >function before($event = array()) { >return true; >} > >function after($event = array()) { >} > > } > ?> > > What am I doing wrong? > > Thanks, > > Toby > > > > > On Oct 17, 8:25 pm, Tilen Majerle wrote: > > cake schema generate -plugin plugin_name > > -- > > Tilen Majerlehttp://majerle.eu > > > > 2010/10/17 Toby G > > > > > > > > > Hi all, > > > > > I've recently created a Users plugin to manage all my user logins, > > > however I would now like to create a migration schema for the users > > > table, but running the... > > > > > cake schema generate > > > > > ... on the app ignores the models in the plugin. > > > > > Does anyone know a way of generating schemas for plugin models? > > > > > Thanks, > > > > > Toby > > > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help > others > > > with their CakePHP related questions. > > > > > 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+unsubscr...@googlegroups.com > For more options, visit this > group at > > >http://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- -- Tilen Majerle http://majerle.eu Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Schema generation for plugins
Thanks for that, but it's still producing an empty schema file. Here's the command I'm running... cake schema generate -plugin Users -file users-schema.php ... and here's my folder structure... config controllers locale models plugins users controllers views models tests users_app_controller.php users_app_model.php vendors tests tmp vendors views webroot ... and this is what I'm getting out... What am I doing wrong? Thanks, Toby On Oct 17, 8:25 pm, Tilen Majerle wrote: > cake schema generate -plugin plugin_name > -- > Tilen Majerlehttp://majerle.eu > > 2010/10/17 Toby G > > > > > Hi all, > > > I've recently created a Users plugin to manage all my user logins, > > however I would now like to create a migration schema for the users > > table, but running the... > > > cake schema generate > > > ... on the app ignores the models in the plugin. > > > Does anyone know a way of generating schemas for plugin models? > > > Thanks, > > > Toby > > > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others > > with their CakePHP related questions. > > > 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+unsubscr...@googlegroups.com > om>For more options, visit this group at > >http://groups.google.com/group/cake-php?hl=en Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: p28n & multiple languages
i need pro cakephp user idea about better way for multiple languages i am new in cakephp Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
session_start() can not retrieved session id from cookie
Hi everybody First at all, I'm using a rather old version of cakePHP (1.1 ?) without Config:write() functionality. I'm facing strange behavior on a server that I can not explain in 'cake/libs/session.php'. in the __construct() method, session_start() can not retrieved the session from the cookie value. Before calling 'session_start', the session's id is well known from cookie $_COOKIE[session_name()] but not the id (session_id()) After the call to session_start(), a new session's id is generated, as session_start() can not retrieved the session's ID from cookie. CAKE_SESSION_SAVE 'php' mode or 'cake' mode makes not change. Somebody has a idea to explain this strange behavior ? Thanks.. Marc. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: default checkbox state still not fixed
exactly On 18 Okt., 04:26, cricket wrote: > On Sun, Oct 17, 2010 at 8:13 PM, cricket wrote: > > On Sun, Oct 17, 2010 at 5:23 PM, euromark > > wrote: > >>http://www.dereuromark.de/2010/06/23/working-with-forms/ > > > Thanks, that looks good. And pretty obvious! I think it would be > > better to get the values from the model, though: > > > $this->data['Country']['active'] = $this->Country->default_active; > > > I prefer something like this than a function in bootstrap, which > > worked fine before but seems a bit unseemly with Cake. > > Although, surely you'd only want to do this in add()? In edit() > $this->data would be set with the record's values. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Block every http connection except mine using .htaccess mod_rewrite?
Hey guys Blocking IP's doesn't make too much sense, because I'm behind a proxy, like 100s of other co-workers in my company. So I guess this won't work, because we all have the same IP - or don't we? I'm no big network specialist, as you see.. ;-) Setting a password is a possibility, though. I will consider this. And yes, I didn't do the change for all the files, Michael. I will check this possibility out, too. Thanks! On Sun, Oct 17, 2010 at 11:23 PM, Michael T wrote: > Hey Josh, > > Maybe the reason why your original attempt didn't work is because you > didn't modify all 3 of the .htaccess files that are required in a Cake > app? The files are in: > > /your_cake_dir/.htaccess > /your_cake_dir/app/.htaccess > /your_cake_dir/app/webroot/.htaccess > > Give that a try. > > Cheers, > > On Oct 15, 9:11 pm, psybear83 wrote: >> Hi everybody >> >> I have to deploy a new version of my CakePHP application today. Sadly >> I don't really have control over the server it is deployed to, and I >> can't guarantee that nobody will try to use the website while I'm >> trying to deploy the new version (it's the first time I deploy, so I >> will need some time to try and fail until I succeed). >> >> So I thought I could manage this using .htaccess and mod_rewrite by >> defining a RewriteRule that only passes my connection and forwards >> every other connection to a "not available" page. >> >> I did some searching and figured out the following, but it doesn't >> really work too well: >> >> >> RewriteEngine on >> >> # Set your HTTP_USER_AGENT header to >> "I_am_the_only_allowed_person_yeah" to gain access! >> # Everybody else will see access_denied.php. >> # >> # Use ModifyHeaders Firefox >> extension:https://addons.mozilla.org/en-US/firefox/addon/967/ >> # Add a "User-Agent" entry using "Modify". >> RewriteCond %{HTTP_USER_AGENT} ^I_am_the_only_allowed_person_yeah$ >> RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] >> >> RewriteRule ^.*$ access_denied.php [L] >> >> >> (I guess the trick using a faked User-Agent is not too secure, but it >> will work for my purposes.) >> >> Sadly this doesn't really work for everything: I can access my CakePHP >> app's homepage, but when I'm clicking any other link, I'm getting an >> "Could not find XXX controller" error. >> >> Anybody got a working solution, or a better idea on how to accomplish >> this? As said before, I can't map my app's domain to another folder or >> something like that; I will have to do it another way... >> >> Thanks >> Josh > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: Is there an easy way to tell CakePHP to use another db setting instead of $default?
Thanks, guys! I will take a look at these links. On Fri, Oct 15, 2010 at 1:28 PM, euromark wrote: > this is nothing compared to not using lazyloading on models > like 0.001% :) > so I wouldn't bother > > i am sure it can be slightly optimized (caching?), though. > > > On 15 Okt., 13:02, Jeremy Burns | Class Outfit > wrote: >> I have thought of doing something like before, but I can't help thinking >> that adding in a 'check which environment this is and change some settings' >> process is a tiny yet present overhead in the production instance. Maybe I'm >> just a coding skin flint ;-) >> >> Jeremy Burns >> Class Outfit >> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com >> >> On 15 Oct 2010, at 11:58, euromark wrote: >> >> >> >> > you may also setup something like this >> >http://www.dereuromark.de/2010/08/17/development-vs-productive-setup/ >> > it will automatically switch to the setting of the current environment >> >> > On 15 Okt., 11:19, Jeremy Burns | Class Outfit >> > wrote: >> >> From the 1.3 guide:http://book.cakephp.org/view/922/Database-Configuration >> >> >> Jeremy Burns >> >> Class Outfit >> >> >> jeremybu...@classoutfit.comhttp://www.classoutfit.com >> >> >> On 15 Oct 2010, at 10:04, MissYeh wrote: >> >> >>> You can do that by setting the dbconfig in a specific model that needs >> >>> another db using the var $useDbConfig >> >> >>> See for more infohttp://book.cakephp.org/view/310/Configuration >> >> >>> Or here is an article about changing database configuration on the >> >>> fly: >> >>>http://insanityville.com/2010/04/how-to-switch-between-databases-in-c... >> >> >>> Hope this helps! >> >> >>> Kana >> >> >>> On Oct 15, 9:49 am, psybear83 wrote: >> Hi everybody >> >> Is there an easy way to tell CakePHP to use another db setting instead >> of $default? Maybe something like >> >> Configure::write('please.let.me.use.this.database', 'test'); >> >> Thanks a lot >> Josh >> >> >>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others >> >>> with their CakePHP related questions. >> >> >>> 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+unsubscr...@googlegroups.com For more options, visit this group >> >>> athttp://groups.google.com/group/cake-php?hl=en >> >> > Check out the new CakePHP Questions sitehttp://cakeqs.organd help others >> > with their CakePHP related questions. >> >> > 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+unsubscr...@googlegroups.com For more options, visit this group >> > athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.com For more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
Re: p28n & multiple languages
Try !!! I successfully do. On Mon, Oct 18, 2010 at 8:35 AM, hoss7 wrote: > can i use p28n > > http://bakery.cakephp.org/articles/p0windah/2007/09/12/p28n-the-top-to-bottom-persistent-internationalization-tutorial > in cakephp 1.3.4? > is better idea about multiple languages for cakephp ? > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > 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+unsubscr...@googlegroups.comFor > more options, visit this group at > http://groups.google.com/group/cake-php?hl=en > -- Regards, Zaky Katalan-Ezra QA Administrator www.IGeneriX.com Sites.IGeneriX.com 054-7762312 Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en