Re: Pretty URLs don't work without .htaccess ?
Some web hosting companies do not allow the use of htaccess on shared servers, and sometimes they allow you to use it on linux machines not windows! I think Marcelo has the right answer for this kind of situation 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: Trigger howto
AFAIK, triggers in MySQL do not behave like a bomb(timer), I may be wrong, but this is what I know so far! As for the solution of your problem, I think every time a new user registers, do a simple query to delete the old registered users that are not activated yet and where there registration date is more than 24 hours ago... just keep it simple man. have a nice baking day On Jan 20, 9:08 am, amarradi wrote: > Hello, > > i need nelp by development an trigger. > I've an app were you can get an registration. So if you ask for one > you get an email with a link an the status is reserve. If you don't > click the link in the next 24h you will no be registrated. Your > reservation is killed ;) > The first time i think i do the job direct on the MySQL Database. But > the Problem i don't have rights on the webspace from my shared hoster. > What can i do to trigger it? > > many greetings > Marcus Radisch 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: CakePHP 1.3-beta has landed
It takes very few minutes to upgrade from 1.3-alfa to 1.3-beta. On Jan 17, 3:15 pm, red wrote: > As always, thank you and keep up good work! > > On 17 Sty, 05:25, mark_story wrote: > > > The CakePHP development team is happy to announce the release the > > CakePHP 1.3-beta. We've been hard at work implementing new features > > and fixing issues in existing features in the 1.3 branch. Since 1.3- > > alpha there have been more than 600 commits and more than 43 tickets > > have been closed. A number of new features have been implemented most > > notably, Model virtualFields[1], changes to the plugin and theme assets > > [2], improvements to TimeHelpers ability to output i18n friendly > > formats, and a refactored test suite harness[3]. When upgrading to > > 1.3-beta it is recommended that you replace app/webroot/test.php with > > the one in the repository and check out the Migration Guide[4] as well > > as the new features guides [5] for changed and new features in 1.3. > > > In other project news, all the previous stable release points for 1.2 > > have been retagged and are available in github. We've brought on two > > new team members in the past few months as well, both ADmad, and > > jose_zap have joined the CakePHP team and are helping with all aspects > > of the project. Moving forward with 1.3 we are not planning on adding > > changes that break backwards compatibility. Any methods currently > > generating errors will be removed in the first Release Candidate. It > > is important that you listen to the warnings, as they will become > > fatal errors in the future. > > > If you would like to help with the ongoing development of 1.3, you can > > do so in a number of ways. Firstly, filing clear and concise tickets > > for any issues helps get the issues resolved quickly. Secondly, you > > can also contribute by forking the CakePHP project on github and > > implementing fixes, tests cases and features on your forks. You can > > use pull requests or tickets to notify core team members about your > > changes. > > > Finally, we'd like to thank you the community for the their greatly > > increased and ongoing support and contributions. Since our move to > > github and lighthouse the volume of community contributions has had a > > dramatic increase, and we'd like to thank the many contributors for > > their help in improving CakePHP. > > > Download a packaged release [6] > > > View the changelog [7] > > > [1]http://cakephp.lighthouseapp.com/projects/42648/13-new-features-virtu... > > [2]http://cakephp.lighthouseapp.com/projects/42648/13-new-features-plugi... > > [3]http://cakephp.lighthouseapp.com/projects/42648/1-3-new-features-test... > > [4]http://cakephp.lighthouseapp.com/projects/42648/13-migration-guide > > [5]http://cakephp.lighthouseapp.com/projects/42648/13-new-features > > [6]http://github.com/cakephp/cakephp1x/downloads > > [7]http://cakephp.lighthouse.com/projects/42648/changelog-1-3-0-beta 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: highest traffic cakePHP 1.2 sites?
just trust cake... because it deserves On Jan 17, 7:38 am, keymaster wrote: > So far, the short list of cake's absolutely largest known sites, is: > > addons.mozilla.com > ==> ranked 308 worldwide by > alexa:http://www.alexa.com/siteinfo/mozilla.org#trafficstats > (rumored to be changing to a python based platform). > > hotscripts.com > ==> ranked 2,022 worldwide by > alexa:http://www.alexa.com/siteinfo/hotscripts.com > > mitfahrgelegenheit.de > ==> averaging over 1.1 million page views/day- not ranked by alexa > since it's in Germany > > rekentuin.nl > ==> averaging over 600K page views/day > > Any other takers? > > On Jan 15, 12:58 am, Miles J wrote: > > > Oh I also forgot, Hotscripts runs Cake. > > >http://hotscripts.com > > > On Jan 14, 12:19 am, Matt Bianco wrote: > > > > It's a German car pooling / ride sharing > > > platform:www.mitfahrgelegenheit.de > > > Thanks to cake we can easily do our roll outs to other countries > > > (e.g.www.pamemazi.grwhereweare already live), others will follow in the > > > next weeks. > > > > On 13 Jan., 13:41, Jon Bennett wrote: > > > > > > We serve >35M PVs (>2M visits) per month. > > > > > Who/what is 'we'? > > > > > j > > > > > -- > > > > jon bennett -www.jben.net-blog.jben.net 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: Auth Permission Based System
Solution is not very simple like 5 min minimal setup, and is not really complex as ACL is! 5 min is very weak because it is hard-coded (bad coding) ACL is an overkill as you know, especially if it is not for a record- level-based permission system 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: A simple User Management Plugin
Azril, believe me you did a very good job. just keep trusting yourself / be yourself and you are the winner soon or later Dear BrendonKoz, I agree with you, some points are application specific. On Jan 13, 5:04 pm, BrendonKoz wrote: > I disagree with 1-3, 5, and 8. These are all project specific > requirements that may change depending on the project. Obviously 4 > and 6 can be argued as project specific as well, but much less often > do I see these fluctuate. 7 is good because you mentioned that if > further permissions are needed, an entirely different system should be > used. ;) > > There is no single "right" or "wrong" approach. If it works, it > should help *at least* one other person! :) > > Good job on your first plugin attempt, Azril Nazli! > > On Jan 13, 8:05 am, robustsolution wrote: > > > thanks for sharing us your work. > > It was a very good start. > > some quick notes: > > 1)after signup user should receive an activation link to activate his > > account not to activate the account by default. in this case use > > should autologin > > 2)user should be able to login using the password with (either his > > username or his email) > > 3)user should not be able to change his username in edit mode, but he > > could change always his email address in edit mode, in this case his > > account will be deactivated(banned) until he verifies that he is the > > owner of the new email address > > 4)the resetpassword link should be used only for one reset password > > operation, for security reason. same for activation link > > 5)after successfully resetting the password, or activating the account > > user should autologin to the system > > 6) user life cycle: created,activated,banned then ,activated,banned, > > activated,banned, activated,banned,activated,banned, etc... so just > > three status is enough. > > 7)in case you have either user or admin account for the user record, > > is_admin is enough, otherwise a light or heavy weight permission > > system should be required > > 8)cookies should always be a user choice that developer could not > > ignore it 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: A simple User Management Plugin
thanks for sharing us your work. It was a very good start. some quick notes: 1)after signup user should receive an activation link to activate his account not to activate the account by default. in this case use should autologin 2)user should be able to login using the password with (either his username or his email) 3)user should not be able to change his username in edit mode, but he could change always his email address in edit mode, in this case his account will be deactivated(banned) until he verifies that he is the owner of the new email address 4)the resetpassword link should be used only for one reset password operation, for security reason. same for activation link 5)after successfully resetting the password, or activating the account user should autologin to the system 6) user life cycle: created,activated,banned then ,activated,banned, activated,banned, activated,banned,activated,banned, etc... so just three status is enough. 7)in case you have either user or admin account for the user record, is_admin is enough, otherwise a light or heavy weight permission system should be required 8)cookies should always be a user choice that developer could not ignore it 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: highest traffic cakePHP 1.2 sites?
1)I always encourage developers to code globally the assets in cakePHP, so instead of loading 6-non gzipped javascript files, you load one gzipped javascript file (dont bother yourself with minification). 2)If you are using the Auth components, be aware to not load the User model when the user is still a guest (not logged in), your application will feel shame if the load of the User Model will load most of the models in the app!!!, one of the weak point of the Auth component is that it loads obligatory the User model even if you do not use it for the current page!!! 3)Use a custom file engine to cache your heavy-weight queries as an array in a .php file 4)Use plugins as semi-app not as requestAction call, otherwise use elements 5)build your own tracking system, that logs guests requests, the logged-in users, and also after they logout, to make a real/exact estimation of the traffic on your web server/application 6)if you have a permission system in your application (ACL or any equivalent), try to make a caching of the permissions once the user is logs in, with an admin push from the admin, to refresh/recalculate/ reload the caching of these permissions. 7)do not overestimate the persistModel, it is a joke 8) try to avoid ACL (not a cake fault) if its not for record level permissions, use any equivalent permission system. anything is better than ACL for non-record-level permissions system. 9) if you want to use captcha, use it smartly without loosing the form data when user put a wrong code 10) caching is amazing just when you update the web site on a regular basis, otherwise it will be a nightmare. 11) and many more On Jan 8, 12:33 pm, keymaster wrote: > This is not meant to be a post on "evaluating cake's performance" or > anything like that. I use cake alot and have no issues. > > I also know that for those who utilize cake 1.2's various features for > performance optimization to the fullest, there are very few issues of > performance remaining even for the busiest apps. > > So, this is really just a curiosity question. The kind of thing one > thinks about when one doesn't feel like working :-) > > By chance, does anyone have a feel for which sites (other than > addons.mozilla.org which is cakePHP1.1 anyways) might be among the > highest traffic'ed cakePHP 1.2 sites ? 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: coding practices with models
in your previous code, you are not instantiating the banana, you are only looking for the banana record with the specific id. As for the Banana Model Class, you can define custom methods. You can do hat ever you want but, If you want to know how do I think? I do not put a method in the model unless I know It is going to be called from more than one controller, otherwise I put it as private method in the controller On Dec 28, 2:14 am, Christian wrote: > When i come across situations that I feel needs to be coded inside the > model I'm not sure whether (form the perspective of the controller or > a different model) to treat a model as an object, or just as a > collection of class methods. > > For example: > > If I want to peel a banana.. > > Is it correct to instantiate the Banana > $this->Banana->read(null,$id); > > and then call the method > $this->Banana->peel(); > > and in banana.php: > function peel() { > //since this method was called on a specific instance > //it should have access to it's private variables (tuple from the > database) > > } > > OR do i just call the method on the id and sort that out in the model > > $this->Banana->peel($id); > > then... > function peel($id) { > //need to instantiate the banana first before we can operate on it > $this->Banana->read(null,$id); > > } > > I'm curious about the practices of some of you regular cakers. > 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: How to setup relationships in model User has a Status
AFAIK, In general we have three statuses for every account created but not active (0) activated (1) banned (-1) It is better to stick to one table (users), so this table have an indexed integer field called status. As for "Active", ''Banned", etc... It is just a convention and 9X% of the queries around the users table do not need those strings. just because I don't want to say 100% (because I hate the number 100) On Dec 28, 1:24 am, Brettski wrote: > Hi, > > Just learning CakePHP now. > > I have a simple question, hopefully its a simple answer :) > > I'm trying to get my models setup right, so I have a user model, and a > status model, for example.. > > Status = "Active" or "Cancelled" etc. > > I can't seem to get the associations right. > > How do you set each of these up so that I return an array of status's > to the user model. > > I thought it would be User hasOne Status, Status hasMany Users but > that doesn't work, it looks for a Status.user_id which isn't a field > (as it doesn't make sense). > > 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: Problem Prototype / jQuery
the order I use is 1)prototype 2)scriptaculous 3)jquery then in the first line of the body section I use $j = jQuery.noConflict(); and It works... so for non jQuery plugins I use either the $j keyword or the jQuery keyword for jQuery plugins you may use the the $ keyword as it is encasulated inside a function happy new year On Dec 27, 3:34 pm, "Dr. Loboto" wrote: > Ask on JavaScript forums. It is not Cake-related problem. > > On Dec 26, 12:58 pm, thomaus wrote: > > > Hi, > > > I tried it this way: > > > > echo $javascript->link('/js/scriptaculous-js-1.8.3/lib/prototype'); > > echo $javascript->link('/js/scriptaculous-js-1.8.3/src/ > > scriptaculous'); > > > // jQuery > > echo $javascript->link('/js/jquery-1.3.2.min.js'); > > ?> > > > > > jQuery.noConflict(); > > > // Put all your code in your document ready area > > jQuery(document).ready(function($){ > > // Do jQuery stuff using $ > > $("div").hide(); > > }); > > > // Use Prototype with $(...), etc. > > $('someid').hide(); > > > > > > // jQuery configuration > > echo $javascript->link('/js/simpla.jquery.configuration.js'); > > // Facebox jQuery Plugin > > echo $javascript->link('/js/facebox.js'); > > // jQuery WYSIWYG Plugin > > echo $javascript->link('/js/jquery.wysiwyg.js'); > > ?> > > > > > > > > I also tried to put it just after the simpla.jquery.configuration and > > still, it doesn't work. > > > Thanks, > > > On Dec 25, 12:58 pm, "Dr. Loboto" wrote: > > > > jQuery.noConflict() must be called immediately after initial jQuery > > > include. > > > > On Dec 24, 11:08 pm,thomaus wrote: > > > > > Hi there, > > > > > I have an issue using both Prototype and jQuery in my app. > > > > > Here is my JS includes in my head folder: > > > > > > > > echo > > > > $javascript->link('/js/scriptaculous-js-1.8.3/lib/prototype'); > > > > echo $javascript->link('/js/scriptaculous-js-1.8.3/src/ > > > > scriptaculous'); > > > > > // jQuery > > > > echo $javascript->link('/js/jquery-1.3.2.min.js'); > > > > > // jQuery configuration > > > > echo $javascript->link('/js/simpla.jquery.configuration.js'); > > > > // Facebox jQuery Plugin > > > > echo $javascript->link('/js/facebox.js'); > > > > // jQuery WYSIWYG Plugin > > > > echo $javascript->link('/js/jquery.wysiwyg.js'); > > > > ?> > > > > > > > > > > > > > > > > > > jQuery.noConflict(); > > > > > // Put all your code in your document ready area > > > > jQuery(document).ready(function($){ > > > > // Do jQuery stuff using $ > > > > $("div").hide(); > > > > alert('jquery'); > > > > }); > > > > > // Use Prototype with $(...), etc. > > > > $('someid').hide(); > > > > > > > > > and no luck : when I comment jQuery, my Prototype paginator works, and > > > > when I comment Prototype, my jQuery tabs don't work. Can someone help > > > > me > > > > > I also tried the other solution commented here > > > > :http://docs.jquery.com/Using_jQuery_with_Other_Librariesbyputting > > > > jQuery include before the Prototype include and... no luck. > > > > > Just a thought : why on Earth Cake Ajax helper is based on the old > > > > fashioned Prototype and not on the great jQuery??? > > > > > 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: Multilanguage routes
I think the smart guy teknoid has a full article on this 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: Merry Christmas
it will be only in your and my dream happy new year 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: using the session object
you ask a great question I forget about putting in database because it should be treated as permanent storage not temporary/volatile storage now about file caching. either you use session or you create your own cache engine. if the arrays are large I prefer create my own cache engine but instead of "file_get_contents" the cahced version I "include" it. so this is the defference between session (serialized data), and cutom cache engine (that creates a normal PHP script file to be included later) and the happy new year On Dec 23, 10:24 pm, Josh wrote: > I have a fairly large array that I would like to access across http > requests in a given session. > > Is there a performance disadvantage to putting this in the session > object? > > The other option it seems is to put the data in the db, but I have no > need for this data to persist across sessions, so it seems > unnecessary. > > 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: Logout link in layout
in you app_controller.php, put this public function beforeRender() { if (!array_key_exists('requested', $this->params)) { $user = $this->Session->read($this->Auth->sessionKey); $this->set(compact('user')); } } and in the layout put this if (!empty($user)) echo $html->link('Logout', array('controller' => 'Users', 'action'=>'logout')); and the happy new year On Dec 24, 4:46 am, emmexx wrote: > I'd like to put a logout link in my default layout. The link should be > there only when a user has already logged in. > I put the following code in my app/views/layouts/default.ctp: > > if ($this->Auth->user()) > echo $html->link('Logout', array('controller' => 'Users', > 'action'=>'logout')); > > but, of course, cake didn't like and screamed in horror: > > Notice (8): Undefined property: View::$Auth [APP/views/elements/ > logout.ctp, line 3] > > Fatal error: Call to a member function user() on a non-object in /app/ > views/elements/logout.ctp on line 3 > > Is there a way to accomplish that? > > Thank you and Merry Christmas! > > maxx 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: Plugin callbacks and controller hooks
m sorry, captcha plugin is also considered as a very small separate application plugin, I gave a wrong example. but you still have the option number 2 but you need to specify the plugin key/prefix in the url array/string On Dec 18, 1:54 pm, robustsolution wrote: > AFAIK, > > plugin could be used > > -1-to be a ~~~separate application : example the blog plugin, the auth > plugin, the forum plugin, etc... > -2-to be called from anywhere by using a requestAction: example > captcha plugin is used to be called via requestAction to import the > "prove that you are human" image > > choose the option you need (you may use number 2) > > and have a nice baking day > > On Dec 18, 12:53 pm, Aargh wrote: > > > I would like to know if there is any official (or at least supported / > > under development) mechanism that would allow me to create hooks so > > that i can hook certain plugin functions into a controller. > > > What would be sweet : > > > Controller hooks > > > For example let-s say we have a two statistics plugins. One checks the > > ip, one checks the searchphrase. They both basically work with the > > same data, and could be hooked into the afterFilter or smth. > > > So the idea would be to be able to register a hook, and then (using > > naming conventions ??), certain (plugin) functions to be called. > > > View hooks > > > Would be great such thing to also exist for the views, let-s say we > > register a viewHook called "product_addons", so if we develop a "rate > > the product" plugin, the view would take a ctp from the plugin and > > render the stars and the rating form in that hook. And of course when > > disabling the plugin, searching for the things to be rendered there > > will return empty. Whatever. > > > I've seen something like (controllerHooks) this at Tarique Sani's > > Cheesecake, in his hitStats plugin. It has some AppInit component that > > will do the hooks. I'm not sure how it works, I've not investgated > > further as the software seems to be quite old (1.1 framework version I > > think). There was another implementation like this called SpliceIt, > > but is not mantained, and seems quite old also. > > > Is there any reccomended way of actually plugging/unplugging custom > > logic ? Because the plugins seem more like separate apps (that can use > > the main's app logic, and not the other way arround, which is ok after > > all) to me. Maybe I missed something, but I can't find a way to > > elegantly plug in/out custom logic into the controllers. > > > For plugging in/out custom elements/views i didn't find anything :(. > > > Probably doing this in models is wrong by design. > > > Maybe I have some brain damage from other apps I modified. But there > > are plenty of components and helpers that make development a breeze, > > until you need to actually do a plugin that can also easly plug out. > > This is one of the reasons I think apps like wordpress, prestashop and > > similar have a bigger community than any cakephp based app outhere > > (for example CheeseCake is a good photoblog, but without other (spam > > filtering for example) plugins is not to be considered by most > > photographers out there, and noone is willing to create one if there > > is no standard way to develop plugins in cakphp, and everytime you > > have to rediscover how the developer implemented the hooks). I think > > this would make easier for us to port plugins from one app to another, > > thus making creation of feature rich software easier. > > > Is very hard to do anything but custom software on cakephp, as for > > example creating a good shopping cart will essentially rule out 3'rd > > parties from developing payment or shipping plugins. Most of those > > payment plugins for example do the same thing, but using different > > apis. From the cart's point of view they all act the same, send a > > form, receive an answer, update the cart's status. But there is no > > elegant way to plug in/out these modules. And the funny thing is most > > of them do not even need a table, just a form and a way to validate > > the answer and change cart's status. > > > Some time ago I developed some publishing software with cake (1.1). It > > was great, until it came to statistics. I had to add lots of > > requestActions in the before and afterFilters. Right now is some kind > > of mess (as removong a "plugin" would also mean to remove the added > > logic into the main apps controllers and views). The next thing I >
Re: Database encryption & security
of course you are talking about two-way encryption not hashing (one way). by the way what do you mean by the database owner? either the guy have a full access to the database or a custom access. if you are the one who has full access, give him a mysql account with custom access to all tables except the tables that have sensitive info. otherwise an alternative solution should be required here. 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: Plugin callbacks and controller hooks
AFAIK, plugin could be used -1-to be a ~~~separate application : example the blog plugin, the auth plugin, the forum plugin, etc... -2-to be called from anywhere by using a requestAction: example captcha plugin is used to be called via requestAction to import the "prove that you are human" image choose the option you need (you may use number 2) and have a nice baking day On Dec 18, 12:53 pm, Aargh wrote: > I would like to know if there is any official (or at least supported / > under development) mechanism that would allow me to create hooks so > that i can hook certain plugin functions into a controller. > > What would be sweet : > > Controller hooks > > For example let-s say we have a two statistics plugins. One checks the > ip, one checks the searchphrase. They both basically work with the > same data, and could be hooked into the afterFilter or smth. > > So the idea would be to be able to register a hook, and then (using > naming conventions ??), certain (plugin) functions to be called. > > View hooks > > Would be great such thing to also exist for the views, let-s say we > register a viewHook called "product_addons", so if we develop a "rate > the product" plugin, the view would take a ctp from the plugin and > render the stars and the rating form in that hook. And of course when > disabling the plugin, searching for the things to be rendered there > will return empty. Whatever. > > I've seen something like (controllerHooks) this at Tarique Sani's > Cheesecake, in his hitStats plugin. It has some AppInit component that > will do the hooks. I'm not sure how it works, I've not investgated > further as the software seems to be quite old (1.1 framework version I > think). There was another implementation like this called SpliceIt, > but is not mantained, and seems quite old also. > > Is there any reccomended way of actually plugging/unplugging custom > logic ? Because the plugins seem more like separate apps (that can use > the main's app logic, and not the other way arround, which is ok after > all) to me. Maybe I missed something, but I can't find a way to > elegantly plug in/out custom logic into the controllers. > > For plugging in/out custom elements/views i didn't find anything :(. > > Probably doing this in models is wrong by design. > > Maybe I have some brain damage from other apps I modified. But there > are plenty of components and helpers that make development a breeze, > until you need to actually do a plugin that can also easly plug out. > This is one of the reasons I think apps like wordpress, prestashop and > similar have a bigger community than any cakephp based app outhere > (for example CheeseCake is a good photoblog, but without other (spam > filtering for example) plugins is not to be considered by most > photographers out there, and noone is willing to create one if there > is no standard way to develop plugins in cakphp, and everytime you > have to rediscover how the developer implemented the hooks). I think > this would make easier for us to port plugins from one app to another, > thus making creation of feature rich software easier. > > Is very hard to do anything but custom software on cakephp, as for > example creating a good shopping cart will essentially rule out 3'rd > parties from developing payment or shipping plugins. Most of those > payment plugins for example do the same thing, but using different > apis. From the cart's point of view they all act the same, send a > form, receive an answer, update the cart's status. But there is no > elegant way to plug in/out these modules. And the funny thing is most > of them do not even need a table, just a form and a way to validate > the answer and change cart's status. > > Some time ago I developed some publishing software with cake (1.1). It > was great, until it came to statistics. I had to add lots of > requestActions in the before and afterFilters. Right now is some kind > of mess (as removong a "plugin" would also mean to remove the added > logic into the main apps controllers and views). The next thing I > develop I would like to not become so messy. > > (Btw, sluggable behaviour, bindable behaviour, meio upload and magick > resize helper spared me a lot of work, 10x god the community is > strugling to add cool functionality to the framework). > > I searched about this topics, but I didn't find much. I checked > various apps for ideas, but most of them are outdated. > > Is there anything like this in plan ? Is there any component that > already do that ? 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: Caching a pagination data
I meant why arent you using the cache helper...etc On Dec 18, 8:58 am, robustsolution wrote: > hi HK, > Aren't you the cache helper in the controller? because AFAIK it should > be used also. > > caching view is something server-side (done on the server), it caches > the whole (browser request)'s page answer (the html source code) > > caching images is another thing, it is something done on the client > side (in the browser cache), you may treat the image as an asset file > (like css files or js files) to force caching it in the client side. > > as for caching just the returned value of the $this->paginate, you may > use this amazing linkhttp://book.cakephp.org/complete/764/Cache > > have a nice baking day > > On Dec 18, 7:56 am, HK wrote: > > > Hello all, > > > I have a function in my controller which reads about 4000-8000 images > > (depending on the event viewed) and then return a pagination. Since > > those images don't change per event I would like to cache them. > > > First of all can I use view cache? I enabled cache in core.php, and > > use $this->cacheAction=true in my action. > > app/tmp is writable (chmod -R 777) but no page appears on tmp/cache/ > > view only the empty file. Is it because I use $this->paginate()? > > > Can pagination work with cache? > > > Another solution would be to cache $this->paginate() so not to fetch > > data on every request. Can this be done, and how? > > > thanks a lot 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: Caching a pagination data
hi HK, Aren't you the cache helper in the controller? because AFAIK it should be used also. caching view is something server-side (done on the server), it caches the whole (browser request)'s page answer (the html source code) caching images is another thing, it is something done on the client side (in the browser cache), you may treat the image as an asset file (like css files or js files) to force caching it in the client side. as for caching just the returned value of the $this->paginate, you may use this amazing link http://book.cakephp.org/complete/764/Cache have a nice baking day On Dec 18, 7:56 am, HK wrote: > Hello all, > > I have a function in my controller which reads about 4000-8000 images > (depending on the event viewed) and then return a pagination. Since > those images don't change per event I would like to cache them. > > First of all can I use view cache? I enabled cache in core.php, and > use $this->cacheAction=true in my action. > app/tmp is writable (chmod -R 777) but no page appears on tmp/cache/ > view only the empty file. Is it because I use $this->paginate()? > > Can pagination work with cache? > > Another solution would be to cache $this->paginate() so not to fetch > data on every request. Can this be done, and how? > > thanks a lot 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: autocomplete with id and value
the idea about autocomplete is for listing values with or without relevance not with or without ids. otherwise a hack should be done. 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: the essential mix of cakephp tips (community edition)
Hi teknoid, "DO NOT HACK THE CORE AT ANY RATE, AND THIS IS FOR FORWARD COMPATIBILITY / MIGRATION PURPOSES, FOR EXAMPLE : AVOID ADDING AN ADDITIONAL CALLBACK BECAUSE YOU ALMOST ALWAYS DO NOT NEED TO CREATE IT" 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: To Sanitize or not? :: Public Opinion
you may sanitize somtimes, but you should always validate inputs (forms... urls http requests) -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: Using multiple criteria to login a user. Email or Username.
Dear Ahmed, how are you? It is very very simple, you dont need to change anything in the Auth component, anything in the login form you just need to put this in the beforeFilter() callback of the users controller if ($this->params['action']=='login' && !array_key_exists ('requested',$this->params) && !empty($this->data[$this->Auth- >userModel])) { $this->data[$this->Auth->userModel]=array_map('trim',$this->data [$this->Auth->userModel]); if(!empty($this->data[$this->Auth->userModel][$this->Auth->fields ['username']]) && !empty($this->data[$this->Auth->userModel][$this- >Auth->fields['password']])) { if (Validation::email($this->data[$this->Auth->userModel][$this- >Auth->fields['username']])) { $this->data[$this->Auth->userModel]['email']=mb_strtolower($this- >data[$this->Auth->userModel][$this->Auth->fields['username']]); unset($this->data[$this->Auth->userModel][$this->Auth->fields ['username']]); $this->Auth->fields['username']='email'; } } } please, have a nice baking day -- You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-...@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=.
Re: javascript alert after auth login
javascript? alert? after Auth m sorry m not a fan of this kind of debugging issues m not a fan of classic javascript validation... alert...etc On Nov 8, 8:47 pm, Marcelo Andrade wrote: > Hi there, > > Maybe it's a newbie question, but what's the proper way to > show a javascript alert after a successfull auth login? > > Best regards. > > -- > MARCELO DE F. ANDRADE > Belem, PA, Amazonia, Brazil > Linux User #221105 --~--~-~--~~~---~--~~ 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: Help Getting Model name
u may use the PHP function key() that returns the index element of the current array position. On Nov 8, 5:26 pm, "Dave" wrote: > Is there a simple way to get the model name from something like this? > > This is the data that's sent to cake. > > data[Contact][email] t...@something.com > data[Account][email] te...@fake.com > > Debug will get me > Array( > [Contact] => array( > [Email] => t...@something.com > ) > ) > > Where I simply need 'Contact' or 'Account' > > Thanks > > Dave --~--~-~--~~~---~--~~ 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: javascript files loading order
you can work on the layout variable $scripts_for_layout it contains the css files and the js files On Nov 8, 5:40 pm, emmexx wrote: > I use many javascript files in one application. > Some file is "linked" in the layout view, other are linked in a model > view. > Some of those files depend on the other (e.g.: file foo.js depends on > prototype). > > The html file created by cake contains the script tags ordered in the > wrong way (1st foo.js, 2nd prototype) so I get some javascript errors. > > Is there a way to force the loading order of javascript files? > > thank you > maxx --~--~-~--~~~---~--~~ 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: question about Request Handler
request handler deals with reading request header and setting response header as for manipulation of the data as I know the cake 'Xml' library can do it for xml data... example for parsing xml data as array App::import('Xml'); $xml_instance =& new Xml(); if ($xml_instance->load($xml_data)) { $xml_parsed_as_array = Set::reverse($xml_instance); debug($xml_parsed_as_array); } as for json manipulation through at server side u can use the basic json_encode/json_decode famous functions to convert PHP to json and vice versa, and you can use the js helper or the javascript helper as an alternative On Nov 5, 10:44 pm, Paulos23 wrote: > Hi people, > I am bulding an app which supports web services,where the returned > data may be XML or JSON.My idea is to create a component to handle > both types of data.In particular i use HttpSocket to hit the specific > url,then i take the data and finally i pass them to view.Now the > question i have is if i can use RequestHandler Component for this > approach,coz i don't want to generate XML, JSON but manipulate it and > set it to view. > > Any help would ne nice! --~--~-~--~~~---~--~~ 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: Auth Component does not logout via URL
m really sorry for the delay but I really misunderstood the question I don't know if you mean this http://book.cakephp.org/view/431/disableCache On Nov 4, 3:40 pm, "Prof. No Time" wrote: > Thanks very very much RobustSolution, I have applied your logic. Its > ok though I didn't use the "famous" remember me here checkbox. I have > studied the issue and finally discovered that it is a fault of the > BUGGY INTERNET EXPLORER that keeps CACHING the page instead of > visiting the SERVER for proper details (Stupid Explorer!!!). Please > can you help me out on how to prevent caching of the LOGOUT page by > such browsers? > > Cheers in ADV. > > On Nov 2, 3:29 pm, robustsolution wrote: > > > Prof.NoTime > > > try to take a coffee cup and get relaxed, this is my current solution/ > > tips/tricks for the moment > > > 1)put this in your AppController class > > final protected function _logout() { > > if (!empty($this->Cookie)) { > > //this ensures if you were using the Cookie component along > > with the > > Auth component (the famous remember me checkbox) > > //and you have saved the credentials inside cookie > > //you should delete the credentials from the cookie when > > you log out > > //noneed to verify if you have already saved the > > credentials inside > > cookie,noerror is thrown > > $this->Cookie->del($this->Auth->sessionKey); > > } > > return $this->Auth->logout(); > > > } > > > 2)your UsersController class logout() method should be now like this > > public function logout() { > > $this->redirect($this->_logout()); > > > } > > > 3)your UsersController class beforeFilter() method/callback should be > > now like this > > public function beforeFilter() { > > ... > > parent::beforeFilter(); > > //please specify the always allowed actions... logout should be the > > first one of course > > $this->Auth->allow > > ('logout','forgotpassword','resetpassword','activate','register'/* put > > here any other always-allowed action*/); > > if ($this->Auth->user()) { > > if (in_array($this->params['action'],array > > ('forgotpassword','resetpassword','register','activate'))) { > > //if you are forgetting your password, > > //if you resetting your password, > > //if you are registering as a new user, > > //or if you are activating you new accout via url > > //you should not be logged in ... yea this is logic > > $this->_logout(); > > } elseif($this->params['action']=='login') { > > //you are already logged in,noneed to login again > > $this->redirect($this->Auth->redirect()); > > } > > } elseif ($this->params['action']=='logout') { > > //you are already logged out,noneed to log out again > > $this->redirect($this->Auth->redirect()); > > } > > ... > > > } > > > now have a nice baking day --~--~-~--~~~---~--~~ 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: Hot out of the oven CakePHP 1.3 alpha
I started (today) exploring this 1.3 piece. for the first while I like it but I think I will ...fall in love with this new sweet cake thanks mark for your support/work and for these great newss --~--~-~--~~~---~--~~ 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: CakePHP Application Design Help
you dont need to create a controller class for the settings table just create a model for the settings table In case user is not created with its settings (in the same add form), do the following in the User model put this function afterSave($created) { if($created) { $this->Setting->create(); $data['Setting']['user_id']=$this->id; $this->Setting->save($data); } } have a nice baking day --~--~-~--~~~---~--~~ 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: Sanitize:: clean help
nice approach... euromark. On Nov 1, 9:23 am, "euromark (munich)" wrote: > way to complicated > > dont sanitize it > and use h() for output (text, varchar) > > that is way more handy than any other approach > > On 1 Nov., 06:44, Kyle Decot wrote: > > > Try echo $form->input("description",array("value"=>html_entity_decode(@ > > $this->data["Model"]["description"]))); > > > On Oct 31, 5:29 pm, "Dave" wrote: > > > > Can someone help me out with this fairly simple question. > > > > I am doing: > > > > $clean = new Sanitize(); > > > $this->data = $clean->clean($this->data); > > > > Now if a user enters quotes brackets or what not it gets converted to > > >