예제 #1
0
| session does not match the one given in this request, we'll bail.
|
*/
Route::filter('csrf', function () {
    if (Session::token() != Input::get('_token')) {
        throw new Illuminate\Session\TokenMismatchException();
    }
});
Route::filter('verifylogin', function () {
    if (!CommonUtilities::verify_login()) {
        return Redirect::to("home")->with("login-alert", true);
    }
});
Route::filter('verifyadmin', function () {
    if (CommonUtilities::verify_login()) {
        if (!(Session::has("admin") || Session::has("admin-read-only"))) {
            return Redirect::to("home")->with("admin-alert", true);
        }
    } else {
        return Redirect::to("home")->with("login-alert", true);
    }
});
Route::filter('verifyeditadmin', function () {
    if (CommonUtilities::verify_login()) {
        if (!Session::has("admin")) {
            return Redirect::to("home")->with("admin-alert", true);
        }
    } else {
        return Redirect::to("home")->with("login-alert", true);
    }
});