Using Zend_Auth to secure all controllers

后端 未结 4 398
醉梦人生
醉梦人生 2021-01-02 23:15

How would i globally secure all my controllers (except for my Login controller) to ensure my application is secure at all points (no hidden backdoor to ajax calls, etc). I t

4条回答
  •  执念已碎
    2021-01-02 23:37

    Well, you need to have an entry point to your system :)

    This can be achieved by extending Zend_Controller_Action, let's say:

    abstract class MyController extends Zend_Controller_Action {
      public function preDispatch(){
        // do the logic
      }
    } 
    

    And now each of your controllers only needs to extend MyController and you're secure.

提交回复
热议问题