Re: Plugin appController beforeFilter() action doesn't work anymore

2015-11-28 Thread Sam Clauw
I didn't find out which release changes caused the problem. But yesterday, I finally got the answar. When I changed the "beforeFilter" tot "beforeRender", it worked again! Thanks anyway for the help! Op donderdag 22 oktober 2015 12:13:17 UTC+2 schreef Rob Maurer: > &

Re: Plugin appController beforeFilter() action doesn't work anymore

2015-10-22 Thread Rob Maurer
There are changes made with each minor release that can affect your app; start here (http://book.cakephp.org/2.0/en/appendices.html) to see them listed all in one place. - Rob Maurer -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You

Plugin appController beforeFilter() action doesn't work anymore

2015-10-21 Thread Sam Clauw
Since my update from CakePhp 2.3. to CakePhp 2.7., my beforeFilter() action in pluginAppController doesn't work anymore: array( 'loginAction' => array( 'plugin' => 'coaster_cms', 'controller' => 'users', 'action'

Call of beforeFilter

2014-10-25 Thread Gaetan SNL
Hi, I don't understand why my AppController beforefilter is called after the beforeFilter of the controller. I have 3 Controllers : AppControllerProjectAppControllerProjectStpController. Each with beforeFilter function. *\app\Controller\Project\ProjectAppController.php* (line *6

Re: Stopping a REST request in the beforeFilter() of the AppController.php

2014-09-16 Thread José Lorenzo
to add some code to the beforeFilter() of the AppController which, under certain conditions, should stop the current REST request and print a different response. Say I do a GET request to the customers controller... http://localhost/cakephp/customers.json This returns what I would expect, my

Re: Stopping a REST request in the beforeFilter() of the AppController.php

2014-09-16 Thread Geoffrey Toogood
ahh! perfect :) thanks I will use this instead :) Much nicer to have it in the AppController cause I can use models :D Thanks!! On Tuesday, September 16, 2014 8:03:50 PM UTC+10, José Lorenzo wrote: Exceptions are rendered as json or xml automatically, if you have the RequestHandler

Stopping a REST request in the beforeFilter() of the AppController.php

2014-09-15 Thread Geoffrey Toogood
customers controller / model.. Router::mapResources('customers'); I want to add some code to the beforeFilter() of the AppController which, under certain conditions, should stop the current REST request and print a different response. Say I do a GET request to the customers controller

Re: Stopping a REST request in the beforeFilter() of the AppController.php

2014-09-15 Thread José Lorenzo
to halt a REST request after it has already been primed by the default mapResources route feature? In the app/Config/routes.php I have the following route for my customers controller / model.. Router::mapResources('customers'); I want to add some code to the beforeFilter

Re: Stopping a REST request in the beforeFilter() of the AppController.php

2014-09-15 Thread Geoffrey Toogood
have the following route for my customers controller / model.. Router::mapResources('customers'); I want to add some code to the beforeFilter() of the AppController which, under certain conditions, should stop the current REST request and print a different response. Say I do a GET request

Cakephp 2 - dynamic meta tags from beforeFilter

2014-07-01 Thread vbpupil
in the beforeFilter of my controller. ie controller: public function beforeFilter(){ $desc = 'test description text'; $this-set('meta_desc', $desc ); } and then calling it in my layout file. !DOCTYPE html ?php if(!isset($meta_desc)) { $meta_desc = 'House For Sale

Re: Cakephp 2 - dynamic meta tags from beforeFilter

2014-07-01 Thread Andras Kende
/img/icon.png/ im guessing that the best way to do this is by setting the values in the beforeFilter of my controller. ie controller: public function beforeFilter(){ $desc = 'test description text'; $this-set('meta_desc', $desc ); } and then calling it in my

Re: Cakephp 2 - dynamic meta tags from beforeFilter

2014-07-01 Thread vbpupil
for a share button eg: meta property=og:description content=description text/meta property=og:image content=http://www.myurl.co.uk/img/icon.png/ im guessing that the best way to do this is by setting the values in the beforeFilter of my controller. ie controller: public

PluginAppController beforeFilter() not working

2014-06-23 Thread Prashant
{ function beforeFilter() { parent::beforeFilter(); throw new ForbiddenException(); } } But the beforeFilter() hook is not getting called. Regards. -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com/CakePHP --- You received this message

Re: problem with redirect page in AppController beforefilter.

2014-05-04 Thread Stephen S
Hey Could you show a snippet of your code so we can see how you're doing it? On 2 May 2014 08:02, Vann Mardy vannmard...@gmail.com wrote: Dear All, i want to check user login beforeFilter , but i have one problem with redirect page (adminstrators/login) in AppController beforeFilter

problem with redirect page in AppController beforefilter.

2014-05-03 Thread Vann Mardy
Dear All, i want to check user login beforeFilter , but i have one problem with redirect page (adminstrators/login) in AppController beforeFilter. it show this message The page isn't redirecting properly. please help me. thanks you! -- Like Us on FaceBook https://www.facebook.com/CakePHP

Odd issue with beforeFilter()

2013-07-31 Thread April DeRossett
Greetings! I am using the Alaxos ACL plugin - which, is pretty awesome. The only issue I am having, and I haven't had on any of my other applications is with beforeFilter(). *In my AppController I have the following:* function beforeFilter() { parent::beforeFilter(); $this-Auth-allow

Re: Odd issue with beforeFilter()

2013-07-31 Thread April DeRossett
); Since this action uses a view of keyhole my before filter was not allowing the page. Simply adding keyhole to me beforefilter did the trick: function beforeFilter() { parent::beforeFilter(); $this-Auth-allow('view', *'keyhole'*); } Hope this helps others. -- Like Us on FaceBook https

Re: CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-14 Thread Dr. Fox
Please correct me if I'm not. I noticed the call happens twice when I include a call to parent::beforeFilter() in my controller's beforeFilter method which puts an overhead on the app. On Wednesday, 13 March 2013 20:27:36 UTC+1, AD7six wrote: CakePHP calls your controller beforeFilter

Re: CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-14 Thread Dr. Fox
I just figured this out. I had an element in the layout which has a line with a requestAction() call. This was responsible for the second call to beforeFilter(); Also, the cake book for 2.3 is a little misguiding in the way it defines the new parameters for cached elements. On page 50

CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-13 Thread Dr. Fox
This happens in CakePHP 2.3. If you define a beforeFilter() method in any of your controllers and call public function beforeFilter(){ parent::beforeFilter(); //Other controller code here } CakePHP calls your controller beforeFilter() which already contains a call to parent

Re: CakePHP 2.3 parent::beforeFilter Gets called twice

2013-03-13 Thread AD7six
CakePHP calls your controller beforeFilter() which already contains a call to parent::beforeFilter() and then calls the AppController's beforeFilter() again. That's not how CakePHP works. AD -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us on Twitter http://twitter.com

Re: loading models in beforeFilter

2013-01-13 Thread AD7six
executes and checks permissions. Your're spreading your auth logic around =) And anyway putting the class in the uses array doesn't work because controller classes are loaded after the beforeFilter() from what I read in the dispatcher code. That's logically impossible since the beforeFilter

Re: loading models in beforeFilter

2013-01-13 Thread Leonardo
-libraries/components/authentication.html#authorization Yes I know...actually what really happens is that inside beforeFilter() $this-Auth-isAuthorized() is called, since cake doesn't have any support for using authorization for anonymous users I call it explicitly. So no spreading of authorization

Re: loading models in beforeFilter

2013-01-13 Thread Stefano Campanella
beforeFilter() $this-Auth-isAuthorized() is called, since cake doesn't have any support for using authorization for anonymous users I call it explicitly. So no spreading of authorization code, it's still inside the authorize component. yes, I know it's a strange usage of cakephp

Re: loading models in beforeFilter

2013-01-13 Thread lowpass
On Sun, Jan 13, 2013 at 3:05 PM, Stefano Campanella leona...@guildofmessengers.com wrote: Nevermind, there was a mistake in a part of the Group class I'd have never thought of XD I'm having some trouble trying to follow what it is you're trying to do, but it appears that the crux of it is that

loading models in beforeFilter

2013-01-12 Thread Stefano Campanella
Hi all, I am trying to find a way to successfully load a model in before Filter without causing the explosion of my controller :D I am working on CakePHP 2.3.0 RC2 Basically, I am calling ClassRegistry::init() to load a model in AppController's beforeFilter() and it works perfectly. The only

Re: loading models in beforeFilter

2013-01-12 Thread AD7six
a model in AppController's beforeFilter() and it works perfectly. The only problem is that after this my controller fails to load its own model, it loads a generic AppModel instead. In particular, I have my UsersController which executes the beforeFilter() of AppController, in which

Re: loading models in beforeFilter

2013-01-12 Thread Stefano Campanella
the beforeFilter() from what I read in the dispatcher code. It seems so strange that models are not loaded in a callback that is used so often. One thing I noticed is that if I rename the model filename from User.php to user.php them the model is loaded correctly...but this goes against

Re: Is overriding AppController's beforeFilter() always recommended ?

2012-12-12 Thread alaxos
Thanks for your answers. That's also how I understand this remark in the cookbook. But it could probably be clarified, because apparently the given sample code may be a bit confusing for people not very confident with oop. It seems that it leads some people to include a beforeFilter() method

Is overriding AppController's beforeFilter() always recommended ?

2012-12-11 Thread alaxos
While answering a recent question on stackoverflow (http:// stackoverflow.com/questions/13825073/always-call-a-function-in- cakephp), I discovered that it seems to be recommended in the cookbook to always override the AppController beforeFilter() in child controllers (http://book.cakephp.org/2.0

Re: Is overriding AppController's beforeFilter() always recommended ?

2012-12-11 Thread euromark
a recent question on stackoverflow (http:// stackoverflow.com/questions/13825073/always-call-a-function-in- cakephp), I discovered that it seems to be recommended in the cookbook to always override the AppController beforeFilter() in child controllers (http://book.cakephp.org/2.0/en

Re: Is overriding AppController's beforeFilter() always recommended ?

2012-12-11 Thread lowpass
: While answering a recent question on stackoverflow (http:// stackoverflow.com/questions/13825073/always-call-a-function-in- cakephp), I discovered that it seems to be recommended in the cookbook to always override the AppController beforeFilter() in child controllers (http://book.cakephp.org

redirect in beforeFilter

2012-11-07 Thread sbang4
I have an issue with using redirect in beforeFilter. First, it seems that I can't use redirect in appcontroller(beforeFilter). Is there a way around? I've tried with Auth component allowing all actions and it worked. But I don't think this is a proper way to do it. Second, I can't redirect user

Re: redirect in beforeFilter

2012-11-07 Thread lowpass
It's difficult to say without seeing your code. Define can't use. On Tue, Nov 6, 2012 at 5:57 PM, sbang4 sba...@gmail.com wrote: I have an issue with using redirect in beforeFilter. First, it seems that I can't use redirect in appcontroller(beforeFilter). Is there a way around? I've tried

Passing arguments from element to beforeFilter in AppController

2012-10-08 Thread Lucky1968
Hi, In my AppControllers beforeFilter I use a TreeHelper to generate the main menu. Now I need to pass a/some arguments to this TreeHelper from within a Views element. Does anyone know if it can be done and how to do this? Or do I need to put this TreeHelper somewhere else instead

Re: function beforeFilter

2012-09-27 Thread euromark
,... can't read user,... and function beforeFilter() is in a app-controller.php with settings var $helpers = array('Html', 'Form', 'Time', 'Text', 'Javascript', 'Ajax', 'Session', 'Application', 'User', 'PhotoShow'); var $components = array('Cookie', 'RequestHandler', 'Session

Re: function beforeFilter

2012-09-27 Thread Jeremy Burns | Class Outfit
() function? Am Mittwoch, 26. September 2012 14:26:23 UTC+2 schrieb Chris: hi Jeremy,... can't access the site (secure area) with username and password,... loosing session I think,... can't read user,... and function beforeFilter() is in a app-controller.php with settings var $helpers

function beforeFilter

2012-09-26 Thread Chris
function beforeFilter working on a 1.2,... trying to migrate whole script to 1.3,... having problem,... what can be wrong,... ??? please help,... thanks function beforeFilter() { if($this-Session-check('user')) $this-user = $this-Session-read('user

Re: function beforeFilter

2012-09-26 Thread Jeremy Burns | Class Outfit
Why not describe your problem? Jeremy Burns Class Outfit http://www.classoutfit.com On 26 Sep 2012, at 13:10:17, Chris chris...@yahoo.com wrote: function beforeFilter working on a 1.2,... trying to migrate whole script to 1.3,... having problem,... what can be wrong,... ??? please help

Re: function beforeFilter

2012-09-26 Thread Tilen Majerle
not describe your problem? Jeremy Burns Class Outfit http://www.classoutfit.com On 26 Sep 2012, at 13:10:17, Chris chris...@yahoo.com wrote: function beforeFilter working on a 1.2,... trying to migrate whole script to 1.3,... having problem,... what can be wrong,... ??? please help,... thanks

Re: function beforeFilter

2012-09-26 Thread Chris
hi Jeremy,... can't access the site (secure area) with username and password,... loosing session I think,... can't read user,... and function beforeFilter() is in a app-controller.php with settings var $helpers = array('Html', 'Form', 'Time', 'Text', 'Javascript', 'Ajax', 'Session

Re: function beforeFilter

2012-09-26 Thread euromark
maybe its the ancient loadModel() function? Am Mittwoch, 26. September 2012 14:26:23 UTC+2 schrieb Chris: hi Jeremy,... can't access the site (secure area) with username and password,... loosing session I think,... can't read user,... and function beforeFilter() is in a app

Re: function beforeFilter

2012-09-26 Thread Chris
://www.classoutfit.com On 26 Sep 2012, at 13:10:17, Chris chri...@yahoo.com javascript: wrote: function beforeFilter working on a 1.2,... trying to migrate whole script to 1.3,... having problem,... what can be wrong,... ??? please help,... thanks function beforeFilter

Re: function beforeFilter

2012-09-26 Thread Chris
Chris: hi Jeremy,... can't access the site (secure area) with username and password,... loosing session I think,... can't read user,... and function beforeFilter() is in a app-controller.php with settings var $helpers = array('Html', 'Form', 'Time', 'Text', 'Javascript', 'Ajax

Re: function beforeFilter

2012-09-26 Thread Jeremy Burns | Class Outfit
,... can't read user,... and function beforeFilter() is in a app-controller.php with settings var $helpers = array('Html', 'Form', 'Time', 'Text', 'Javascript', 'Ajax', 'Session', 'Application', 'User', 'PhotoShow'); var $components = array('Cookie', 'RequestHandler', 'Session

Re: Unknown time before app_controller beforeFilter

2012-04-23 Thread stork
http:/google.com/search?q=cakephp+flow+chart Some of diagrams are bit outdated (for 1.x) but basics are still the same. Configure cache + sessions to not use filesystem storage and disable debug. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the

Re: Unknown time before app_controller beforeFilter

2012-04-23 Thread AD7six
On Monday, 23 April 2012 03:24:27 UTC+2, Dan Moseley wrote: Hi All, Could anyone help me to understand exactly what occurs prior to the first line of the app_controller's beforeFilter? I'm using the following line on the first line of my app_controller: round(microtime(true) - $_SERVER

Re: Unknown time before app_controller beforeFilter

2012-04-23 Thread Dan Moseley
wrote: Hi All, Could anyone help me to understand exactly what occurs prior to the first line of the app_controller's beforeFilter? I'm using the following line on the first line of my app_controller: round(microtime(true) - $_SERVER['REQUEST_TIME'], 2); This timer averages between 0.2

Unknown time before app_controller beforeFilter

2012-04-22 Thread Dan Moseley
Hi All, Could anyone help me to understand exactly what occurs prior to the first line of the app_controller's beforeFilter? I'm using the following line on the first line of my app_controller: round(microtime(true) - $_SERVER['REQUEST_TIME'], 2); This timer averages between 0.2 and 1.2

Re: Loading of plugins in AppController::beforeFilter

2012-01-08 Thread VuuRWerK
Argh, damn xD The good old ClassRegistry, totally forgotten, thanks for the hint! -- Christian On Jan 5, 11:16 pm, majna majna...@gmail.com wrote: You can load plugins form db in bootstrap.php too: $pluginHooks  = ClasRegistry::init('PluginHook')-find('all'); foreach ( $pluginHooks as

Loading of plugins in AppController::beforeFilter

2012-01-05 Thread VuuRWerK
::beforeFilter: = 8 = public function beforeFilter() { parent::beforeFilter(); $this-loadModel( 'PluginHook' ); $pluginHooks = $this-PluginHook-find( 'all' ); $plugins = array( ); foreach ( $pluginHooks as $pluginHook ) { $plugins[ $pluginHook[ 'PluginHook' ][ 'hook_id

Re: Loading of plugins in AppController::beforeFilter

2012-01-05 Thread majna
You can load plugins form db in bootstrap.php too: $pluginHooks = ClasRegistry::init('PluginHook')-find('all'); foreach ( $pluginHooks as $pluginHook ) ... and then Configure::write('plugins', $plugins) for your hooks to be available in views as Configure::read('plugins'); -- Our newest site

1.3.11 Auth ACL beforeFilter

2011-08-12 Thread SibLiant
but with no permissions in the aro_aco table no one should have access to any of the users controller actions. When I completely remove the beforeFilter function, this holds true. I can not access the users controllers index function - as expected. However when I simply put the function back in, I can access index, edit

Re: 1.3.11 Auth ACL beforeFilter

2011-08-12 Thread Ceeram
call parent::beforeFilter() also bindNode should be in your model -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from

Re: advice on refactoring beforeFilter in app_controller

2011-07-12 Thread gremlin
Start with breaking the chunks out into smaller private functions. See if that helps. On Jul 5, 1:59 pm, Zeu5 kimc...@gmail.com wrote: Hi there, the beforeFilter function in my app_controller over time has grown into a monstrous 300 line code. in that beforeFilter, i do things like

advice on refactoring beforeFilter in app_controller

2011-07-05 Thread Zeu5
Hi there, the beforeFilter function in my app_controller over time has grown into a monstrous 300 line code. in that beforeFilter, i do things like $this-set for non admin pages $this-Cookie-write $this-Auth-fields = array('username' = 'email', 'password' = 'password'); $this-Auth-authorize

User data invalid as I enter UsersController::beforeFilter()

2011-05-07 Thread Rob Wilkerson
. What's confusing me is that several fields are already marked invalid as soon as the page is loaded. No data was submitted, no data validated, no save action has taken place. Moreover, dumping $this- User-invalidFields() at the moment the request enters UsersController::beforeFilter() shows

Re: can't get past beforeFilter()

2011-03-27 Thread cricket
is being passed to the server ok but something's keeping the action from running. I've got log statements in both beforeFilter and the action itself, but the latter never show up in the log. Can anyone see anything I've missed? function beforeFilter() {        parent::beforeFilter

can't get past beforeFilter()

2011-03-26 Thread cricket
I've written a controller to handle a few XML-RPC requests, as well a a basic PHP client to test with. The data is being passed to the server ok but something's keeping the action from running. I've got log statements in both beforeFilter and the action itself, but the latter never show up

do I need $this-Auth-userModel = 'User'; in every controller beforefilter or not?

2011-02-09 Thread barricades
to be allowing me. I just kept getting 'you are not authorized...' messages. In another tutorial I then read through it said that I should have $this-Auth-userModel = 'User'; in the beforefilter of my users controller and posts controller. When I put that line in things started to work. So I'm

Re: do I need $this-Auth-userModel = 'User'; in every controller beforefilter or not?

2011-02-09 Thread Miles J
Most of those settings are default, so now you do not have to add them as long as you follow conventions. For easier convenience, place in your AppController. However, you do need to allow() in every controllers beforeFilter(). On Feb 9, 12:03 pm, barricades davow...@googlemail.com wrote: I'm

Controller-flash in beforeFilter...help!

2010-12-06 Thread creationsings
I have a mystery on my hands and I'm completely stumped. I'm really hoping someone can point me in the right direction. In my AppController class, I have a check in beforeFilter that if fails calls flash() to display a message for 3 seconds and return the user to another page. It works well

Re: Controller-flash in beforeFilter...help!

2010-12-06 Thread cricket
On Mon, Dec 6, 2010 at 1:23 PM, creationsings elfind...@gmail.com wrote: I have a mystery on my hands and I'm completely stumped.  I'm really hoping someone can point me in the right direction. In my AppController class, I have a check in beforeFilter that if fails calls flash() to display

Re: Controller-flash in beforeFilter...help!

2010-12-06 Thread creationsings
Hi cricket...thanks for replying. I actually checked that first and I am indeed calling the parent method in all my overrides. I did actually find a solution, though not the ideal one. So, the action method that was giving me problems is called submenu ...but I was actually trying to reuse an

Re: CakePHP 1.3 - RequestHandler-respondAs(js) not working in beforeFilter

2010-12-05 Thread Dr. Loboto
AJAX processing is very strange and called at very strange times. Try to move your logic from beforeFilter() to beforeRender(). If nothing helps you can hack RequestHandler to not re-set Content- Type... On Dec 3, 11:25 am, starchild.no1 starchild@gmail.com wrote: Hi all, I'm doing an ajax

CakePHP 1.3 - RequestHandler-respondAs(js) not working in beforeFilter

2010-12-03 Thread starchild.no1
Hi all, I'm doing an ajax update to see if username exsist.. However when I use the standard RequestHandler markup in my AppController or Users Controller beforeFilter function beforeFilter

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
$this-user['User']['id'] == $this-guestId; } } To automatically have this $user object available in my views, I want to set it in a beforeFilter(). function _prepareUser() { $this-user = new UserProxy($this-SimpleAuth, $this-SimpleAcl); $this-set('user', $this-user); } This requires

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
Oh, and by the way: why is the filter in beforeFilter resp. afterFilter? beforeRender makes sense to me, but beforeFilter seems a strange name to me... On Fri, Nov 12, 2010 at 10:30 AM, Joshua Muheim psybea...@gmail.com wrote: I'm using a component called SimpleAuth and SimpleAcl (instead

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-12 Thread Joshua Muheim
logic. * * So the new sequence is: * - beforeFilter() * - initialization of components * - _afterComponentsInitialization() * - action logic * - beforeRender() * - rendering logic * - afterFilter() * * To work properly, AfterComponentsInitializationFilter needs to be the last * Item

beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread psybear83
Hi all Is there a filter that runs after the initialization of components but before beforeRender? Thanks for help 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

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Bogdan Bursuc
Why do you need one ? On Thu, Nov 11, 2010 at 7:18 PM, psybear83 psybea...@gmail.com wrote: Hi all Is there a filter that runs after the initialization of components but before beforeRender? Thanks for help Josh Check out the new CakePHP Questions site http://cakeqs.org and help others

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Components are initialized before they get to beforeFilter(), so beforeFilter() should work fine. https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/controller.php#L525 On Nov 11, 9:24 am, Bogdan Bursuc bogdanbursu...@gmail.com wrote: Why do you need one ? On Thu, Nov 11

Re: beforeFilter() after initialization of components but before beforeRender? --psybear

2010-11-11 Thread Miles J
Also forgot to mention that there is an afterFilter() as well. On Nov 11, 10:30 am, Miles J mileswjohn...@gmail.com wrote: Components are initialized before they get to beforeFilter(), so beforeFilter() should work fine. https://github.com/cakephp/cakephp/blob/master/cake/libs/controller/c

Is there beforeFilter for admin_actions?

2010-06-11 Thread saidbakr
is administrator or not to proceed further to see the admin area. (I already know how, but I don't want to repeat this code for every admin_action. I prefer to place this code in the beforeFilter of the app_controller)// Check out the new CakePHP Questions site http://cakeqs.org and help others

Re: Broken URLs prevent app_controllers beforeFilter from executing

2010-03-16 Thread euromark
matthew, you dont use beforeFilter() to pass variables to the view especially due to the problem that it is not invoked on errors use beforeRender() for it! this will always be called - not matter what On 16 Mrz., 06:44, Dr. Loboto drlob...@gmail.com wrote: I know the only way - create

Re: Broken URLs prevent app_controllers beforeFilter from executing

2010-03-16 Thread Matthew Dunham
use beforeFilter() to pass variables to the view especially due to the problem that it is not invoked on errors use beforeRender() for it! this will always be called - not matter what On 16 Mrz., 06:44, Dr. Loboto drlob...@gmail.com wrote: I know the only way - create AppError, define

Broken URLs prevent app_controllers beforeFilter from executing

2010-03-15 Thread Matthew Dunham
I'm passing variables into my main layout in the beforeFilter() method using $this-set in my main app_controller, However, if someone visits a broken URL (where you would get a missing controller|action|view message, the beforeFilter doesn't run so bits of the layout are functioning correctly

Re: Broken URLs prevent app_controllers beforeFilter from executing

2010-03-15 Thread Dr. Loboto
Dunham m...@umpcmedia.com wrote: I'm passing variables into my main layout in the beforeFilter() method using $this-set in my main app_controller, However, if someone visits a broken URL (where you would get a missing controller|action|view message, the beforeFilter doesn't run so bits

BeforeFilter Redirect Loop

2010-01-16 Thread Uresh
hi, I am beginner in cakephp. I made controller and i want to apply Beforefilter() , which checks every time when controller/action calls. i write beforefilter() in my controller and checking if session is exist and username is set or not. function beforefilter() { $username

Re: BeforeFilter Redirect Loop

2010-01-16 Thread John Andersen
You have to make sure that the beforeFilter method allows the user to access /admin/index! So add a check that if it is admin/index, then do not redirect :) Enjoy, John On Jan 16, 2:45 pm, Uresh uresh.pa...@ifuturz.com wrote: hi, I am beginner in cakephp. I made controller and i want

Re: AppController : beforeFilter call - when action not defined

2009-12-22 Thread NeoWebTech
I found an alternative solution by using beforeRender instead of beforeFilter And assigning `logged_in` in 'ObAuth' Comp. On Dec 20, 11:45 am, NeoWebTech deva.in...@gmail.com wrote: Hello! I am PHP Developer for some time and developing my second CakePHP App now :) I am getting

Re: AppController : beforeFilter call - when action not defined

2009-12-22 Thread euromark
he is right at the beginning the had the same problems the reason: if an error is triggered, beforeFilter() and afterFilter() are not invoked! so everything you need in the layout should be in beforeRender() this should be the case anyway imagine you process some post data and redirect

AppController : beforeFilter call - when action not defined

2009-12-19 Thread NeoWebTech
action defined in controller which actually is 404 in production but I still want to access the variable. How can I do this? This the code in default.cpt ?php e($logged_in); ? I set $logged_in AppController's beforeFilter function. Following the whole code: class AppController extends Controller

app_controller beforeFilter does not working !

2009-07-30 Thread DatacenterHellas
'); function beforeFilter() { pr($this); } } ? but I have not response from it Why that ? ? ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send email

Re: app_controller beforeFilter does not working !

2009-07-30 Thread DatacenterHellas
Ok ! ! ! What I do is to call from the controller beforeFilter action the AppController::beforeFilter(); But I don't know if that is ok or If I have to do something else ! ! ! ? ? ? Thanks a lot :) On 30 Ιούλ, 11:05, DatacenterHellas merianosni...@gmail.com wrote: Hello all :) I'm creating

Re: app_controller beforeFilter does not working !

2009-07-30 Thread Andreas Derksen
hi, have you declared an beforeFilter() function in your active controller? try to call parent::beforeFilter(); in that function. i hope the pr($this); call is for test purposes only ;) because you dont print anything in your controllers/models greets Andreas DatacenterHellas schrieb: Ok

Re: app_controller beforeFilter does not working !

2009-07-30 Thread DatacenterHellas
What I done is AppController::beforeFilter(); Is that incorect ? ? ? What is the deference of the parent::beforeFilter(); The pr($this) is only for test :) Kind regards Merianos Nikos --~--~-~--~~~---~--~~ You received this message because you are subscribed

Re: app_controller beforeFilter does not working !

2009-07-30 Thread brian
You call it as parent::beforeFilter(), not AppController::beforeFilter(). parent is a keyword that refers to the class that some other class extends. And use parent::beforeFilter() only if the your controller also has a beforeFilter() method. If it does not, AppController's beforeFilter

Re: Auth-authenticate in beforeFilter causes Auth issues

2009-06-28 Thread Justin Poliey
I figured Cake would give me errors if I did that, so I never tried it :( It works fine now though, thanks a lot! Justin On Jun 27, 5:15 pm, Jorge Horacio Cué Cantú jorge@gmail.com wrote: You can set the salt to an empty strung, too. Regards 2009/6/27 Justin Poliey jd...@njit.edu

Auth-authenticate in beforeFilter causes Auth issues

2009-06-27 Thread Justin Poliey
Right now I'm using Cake's Auth component to build a simple user system. Pastes of the files in their entirety are available http://gist.github.com/136935 for reference. The problem is that when I call: $this-Auth-authenticate = ClassRegistry::init('User'), login.ctp always shows Login failed.

Auth-authenticate in beforeFilter causes Auth issues

2009-06-27 Thread Justin Poliey
Right now I'm using Cake's Auth component to build a simple user system. Pastes of the files in their entirety are available http://gist.github.com/136935 for reference. The problem is that when I call: $this-Auth-authenticate = ClassRegistry::init('User'), login.ctp always shows Login failed.

Re: Auth-authenticate in beforeFilter causes Auth issues

2009-06-27 Thread John Andersen
I understand that you are using MD5 instead of SHA1 in your user model! If that is the final decision, then why don't you just tell CakePHP to use MD5 as default and as shown in the example at: http://book.cakephp.org/view/566/Change-Hash-Function Maybe that would help you! Enjoy, John On

Re: Auth-authenticate in beforeFilter causes Auth issues

2009-06-27 Thread Justin Poliey
That's where I got the information I'm using now. The problem is if I just change the hash function with Security::setHash, Cake will still apply the salt before it hashes the passwords, so the hashes will still be incompatible. Thanks Justin On Jun 27, 7:06 am, John Andersen

Re: Auth-authenticate in beforeFilter causes Auth issues

2009-06-27 Thread Jorge Horacio Cué Cantú
You can set the salt to an empty strung, too. Regards 2009/6/27 Justin Poliey jd...@njit.edu That's where I got the information I'm using now. The problem is if I just change the hash function with Security::setHash, Cake will still apply the salt before it hashes the passwords, so the

pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread qwanta
I am setting a variable value that in app_controller beforeFilter, and I would like to access it in all child controllers beforeFilter function. class AppController extends Controller { var $components = array('Auth'); var $uses = array('User'); $auth_id = $this-Auth-user('id

Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread qwanta
setting a variable value that in app_controller beforeFilter, and I would like to access it in all child controllers beforeFilter function. class AppController extends Controller {   var $components = array('Auth');   var $uses = array('User');   $auth_id =  $this-Auth-user('id

Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread sbeam
On Apr 10, 11:16 am, qwanta rgmic...@gmail.com wrote: I am setting a variable value that in app_controller beforeFilter, and I would like to access it in all child controllers beforeFilter function. class AppController extends Controller {   var $components = array('Auth');   var $uses

Re: pass variable from beforeFilter in app_controller to child controller

2009-04-10 Thread Miles J
As a personal preference, I would store it in the session. This way it can be accessed outside of the controller as well. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups CakePHP group. To post to this group, send

Re: Stop code execution in beforeFilter() and render a view

2009-02-11 Thread guigouz
beforeFilter() method and if the check fails I want to stop execution of the action and render a view. I have something like this function beforeFilter() { . if (!$check) {   $data = array('msg'='my message');    $this-set('data', $data);    $this-layout = 'json

Re: Stop code execution in beforeFilter() and render a view

2009-02-11 Thread guigouz
you need to return false. On Tue, Jan 20, 2009 at 11:53 AM, Ron ron8...@gmail.com wrote: I am creating a check in my app_controller beforeFilter() method and if the check fails I want to stop execution of the action and render a view. I have something like this function

  1   2   3   >