Server does not support .htaccess files
Good day, I need to install cakePHP on a server that does not support .htaccess files: (http://cp.micronet-ohio.com/psoft/servlet/psoft.hsphere.CP/oandoplc/ 223909_0/psoft.hsphere.CP?template_name=quick/quick_view.html) 1. How do I go about this? 2. What are the implications? Thank you. 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 Auth Component cannot remember url before authentication
I got it dear. Thanks very much. I opened up the Auth component and digested it myself (Afterall, its just another component written by a brother of mine, lol). I then discovered that the session variable for storing the intended url is 'Auth.redirect', so I leveraged on it by checking it and redirecting there if it exists, otherwise, I redirect to my own default user role page. Its working like breeze! THANK YOU. On Apr 19, 12:01 pm, cricket wrote: > On Apr 19, 6:19 am, "Prof. No Time" > wrote: > > > Thanks for the response Cricket, I have dumped my codes below. Please > > assist me. Regards. > > > My AppController::beforeFilter() > > > function beforeFilter(){ > > $this->Auth->fields = array('username' => 'username', 'password' => > > 'passkey'); > > $this->Auth->allow($this->allowedActions); > > The above line is unnecessary. > > > $this->Auth->authorize = 'controller'; > > $this->Auth->loginAction = array('controller' => 'users', 'action' > > => 'login'); > > $this->Auth->loginRedirect = array('controller' => 'pages', 'action' > > => 'display', 'home'); > > $this->Auth->logoutRedirect = '/'; > > $this->Auth->autoRedirect = false; > > The above line tellsAuthnot to call its own redirect() method, even > though the redirect var is set. > > > > > } > > > My UsersController::login() > > > if ($this->Auth->user()) { > > if (!empty($this->data)) { > > $this->Session->setFlash('You have been logged in > > successfully'); > > $this->_postLoginOperations(); //This method redirects the user > > based on role > > $this->data = array(); > > } > > $this->redirect($this->Auth->redirect()); > > This is maybe a problem. You're instructingAuthto redirect if > there's no submitted data. IOW, the first time the login view is > displayed. That's what it looks like, anyway. > > But I can't say more without knowing what _postLoginOperations() does. > > When you say it doesn't work, do you mean thatAuthis sending you > somewhere other than pages->display->home? Or that you're seeing an > endless loop? Something else? > > Believe me--I know thatAuthcan be pretty darned confusing. > > Check out the newCakePHPQuestions sitehttp://cakeqs.organd help others with > theirCakePHPrelated 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: CakePHP Auth Component cannot remember url before authentication
Thanks for the response Cricket, I have dumped my codes below. Please assist me. Regards. My AppController::beforeFilter() function beforeFilter(){ $this->Auth->fields = array('username' => 'username', 'password' => 'passkey'); $this->Auth->allow($this->allowedActions); $this->Auth->authorize = 'controller'; $this->Auth->loginAction = array('controller' => 'users', 'action' => 'login'); $this->Auth->loginRedirect = array('controller' => 'pages', 'action' => 'display', 'home'); $this->Auth->logoutRedirect = '/'; $this->Auth->autoRedirect = false; } My UsersController::login() if ($this->Auth->user()) { if (!empty($this->data)) { $this->Session->setFlash('You have been logged in successfully'); $this->_postLoginOperations(); //This method redirects the user based on role $this->data = array(); } $this->redirect($this->Auth->redirect()); } On Apr 16, 11:55 am, cricket wrote: > On Apr 16, 1:40 am, "Prof. No Time" > wrote: > > > In the cook book, we are told that theauthcomponentuses the session > >componenttoremembertheurlthe user intended to visit and hence > > when authenticated, automatically takes the user there. However, this > > DOES NOT WORK for me (cake 1.2.5). What could be the problem? > > What does your AppController::beforeFilter() look like? Specifically, > do you have $this->Auth->autoRedirect = false? Do you have any code in > UsersController::login() or is it empty? > > Check out the newCakePHPQuestions sitehttp://cakeqs.organd help others with > theirCakePHPrelated 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
Auth Component: Allow action in a controller but disallow it in another
Hello, Please I have an action named "referrals", I wish to allow this action in the guestscontroller without authentication but I have a similar action in the userscontroller and the staffscontroller. I DO NOT wish to change the action (vis-a-vis url format) name for LEGACY reasons. The Auth component keeps allowing my users and staffs referral pages access without authentication. This is understandable though. The question now is how do I achieve this feat? Thank You. 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
Email Component: I see html email as source code in Squirrel mail web client
When I send Email via the Email Component as "Both" i.e. html and text. It appears fine in my outlook and also yahoo and I think Gmail too but when I check it in Squirrel Mail webmail interface, it shows the text portion first, then the html source code underneath. This is pretty embarrassing as most of my clients will be checking via webmail. What can I do to prevent this, please. Thank You. 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
CakePHP Auth Component cannot remember url before authentication
In the cook book, we are told that the auth component uses the session component to remember the url the user intended to visit and hence when authenticated, automatically takes the user there. However, this DOES NOT WORK for me (cake 1.2.5). What could be the problem? Thank you. 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 Component does not logout via URL
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: Cake and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR
Thanks so so much AD7six, Your suggestion of Router::url() worked like magic but for the second suggestion on the query, I tried it and the debug dump gave me this: SELECT `AppSetting`.`id`, `AppSetting`.`name`, `AppSetting`.`value`, `AppSetting`.`created`, `AppSetting`.`modified` FROM `app_settings` AS `AppSetting` WHERE `AppSetting`.`name` IN ('EMAIL_HEADER_HTML', 'EMAIL_FOOTER_HTML', 'EMAIL_HEADER_TEXT', 'EMAIL_FOOTER_TEXT') As you can see from above, it generates to an IN SQL query, I do not want an IN SQL query what I want is this: SELECT `AppSetting`.`id`, `AppSetting`.`name`, `AppSetting`.`value`, `AppSetting`.`created`, `AppSetting`.`modified` FROM `app_settings` AS `AppSetting` (WHERE `AppSetting`.`name` = 'EMAIL_HEADER_HTML' OR `AppSetting`.`name` = 'EMAIL_FOOTER_HTML' OR `AppSetting`.`name` = 'EMAIL_HEADER_TEXT' OR `AppSetting`.`name` = 'EMAIL_FOOTER_TEXT') Please how do I write the "find()" syntax to achieve this? Or am I missing a point here? Is the 'IN' syntax equivalent (100%) to the 'OR' syntax I desire? Cheers. --~--~-~--~~~---~--~~ 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 and PHP5/PHP6, Base URL in Controllers and FIND QUERY with OR
Please people, I seriously need answers to the following questions. I need them treated as numbered please. Regards, Questions: 1. When shall cake PHP be fully PHP 5 compatible and all the PHP 4 OOP be gone since PHP 5.3 is already throwing strict faces against some PHP 4 constructs and I really wonder if PHP6 will smile at cake PHP at all (I'm just scared). 2. How can I get the base URL inside a controller and inside a component. By base URL I mean something like this: if my application runs at http://localhost/salesmaster/products/admin then base URL is http://localhost/salesmaster. I know I can use the HTML->link('/') in views but how do I get them in the controller and in the component please. 3. How do I write the find query to process this kind of SQL? SELECT `AppSetting`.`id`, `AppSetting`.`name`, `AppSetting`.`value`, `AppSetting`.`created`, `AppSetting`.`modified` FROM `app_settings` AS `AppSetting` WHERE `AppSetting`.`id` < 5 AND ((`AppSetting`.`name` = 'SITE_MAINTENANCE') OR (`AppSetting`.`name` = 'EMAIL_HEADER_HTML')) Emphasis on the OR part of the query with the same field name: AppSetting.name --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Auth Component does not logout via URL
Good day all, Please, I have a little problem with my AUTH component. I am using the default AUTH component in 1.2.5. I discovered that when I login to my app and then try to log out by typing the logout url: http://localhost/myapp/logout (which is routed to myapp/users/logout), the auth component simply refuses to logout (instead it gives me the deny message: You are not authorized to bla bla bla...). It also presents me with the login form to authorize me. The funniest part is that if I then enter my credentials, I am then logged out. (Imagine entering username and password to log out of an application, isn't that sickening?) However, when I click on logout link from within a page, it logs out correctly. What could be the cause of this? --~--~-~--~~~---~--~~ 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: Controller and Session in View
Thanks Brian, I am using the AUTH component. I want to access Auth.user() in the view and I think the only way I can do that is if I can get the controller in the view so I can say this->controller->Auth->user(). I guess this is the wrongest way to go right? But I am new and just floating around trying to find my feet. Please don't be irritated with my blunders, help me. Also, when I use the auth component, I'd like to know the following: 1. How and When do I know that the Auth component has successfully (or otherwise) authenticated the user? Is there something like if ($this- >Auth->authSuccess){}? 2. How can I perform further actions after a successful auth like, save the login time, check for file permissions and load them, notify other people that someone just logged in? I'm grateful for your help. God bless you! On Oct 13, 6:11 pm, brian wrote: > On Tue, Oct 13, 2009 at 12:37 PM, Prof. No Time > > wrote: > > > Hello People, thanks so much for your attempts at my bake problem. > > Obviously no one was close at all to the answer but I figured out > > myself how to bake and I have baked successfully quite a number of > > times now. I am new to this cake thing and I hope you guys can help me > > sail through. I love Qcubed because they always answer when I cry, I > > hope cake won't be any different. > > > Now to my Question, please, how do I access the CONTROLLER and SESSION > > in a VIEW? Is it possible? If yes HOW, if no ALTERNATIVE. > > In the view, use $session['whatever']. Add debug($session) to see what > it looks like. > > As for accessing the controller, it's not really set up for that and > you probably don't need to. What are you trying to do? --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---
Controller and Session in View
Hello People, thanks so much for your attempts at my bake problem. Obviously no one was close at all to the answer but I figured out myself how to bake and I have baked successfully quite a number of times now. I am new to this cake thing and I hope you guys can help me sail through. I love Qcubed because they always answer when I cry, I hope cake won't be any different. Now to my Question, please, how do I access the CONTROLLER and SESSION in a VIEW? Is it possible? If yes HOW, if no ALTERNATIVE. Regards brethren in the bakery! --~--~-~--~~~---~--~~ 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 Bake Error: I just cant BAKE, please help
Good day all, Each time I try baking in cake, I just end up hating cakePHP! Please someone help me out. I downloaded the latest edition 1.2.5 and I tried to study the chapter on ACL. While running the cake bake command (On WindowsXP Professional, Apache 2.2.8, PHP 5.2.5, what else?), I got the following error: Fatal error: Class 'DATABASE_CONFIG' not found in X:\wamp\www\aclstudy \cake\console\libs\tasks\db_config.php on line 265 This error popped up right after it had finished copying the skel files and then told me that no db config is found and as such I should create one. I entered all the demanded parameters correctly then it crashed with the error stated above. Please kindly put me through on how to tackle this because I'm STUCK! Regards, Prof. No Time --~--~-~--~~~---~--~~ 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 -~--~~~~--~~--~--~---