Confirm the admin route usage https

By Kyle Kai (darkhero)
While entering the admin route, needing to be confirmed must use https to carry on an on-line, in order not to the user neglect, and use the http on-line, so we have to make the check conversion automatically in the cakephp.
In app_controller.php

Download code
function beforeFilter() {
    if(!isset($this->params[CAKE_ADMIN]) && empty(env('HTTPS'))){
        $this->redirect('/'.CAKE_ADMIN);
        exit();
    }
}