public function doLogout()
 {
     //  Update Log
     LoginLogItem::updateLog(Auth::user(), null, true);
     //  Logout URL
     $logout_url = URL::route(UserItem::loginRoute(), UserItem::logoutRouteParams());
     //  Do Logout
     Auth::logout();
     //  Redirect
     return Redirect::to($logout_url)->with(FLASH_MSG_INFO, trans("auth-module::message.success_logout"));
 }
Ejemplo n.º 2
0
    $pathInfo = currentPathInfo();
    //  Get Admin Alias Path
    $adminAliasPath = adminAliasPath();
    //  Match
    if (substr($pathInfo, 0, strlen($adminAliasPath)) == $adminAliasPath) {
        //  Return Response
        return Response::view('laravel-admin::errors.missing', array("errorTitle" => "404 Page not Found", "exception" => $exception), 404);
    }
});
App::down(function () {
    //  Get Path Info
    $pathInfo = trim(currentPathInfo(), "/");
    //  Allowed
    $allowed = false;
    //  Check for Login Page
    if (currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::loginRoute(), \Developeryamhi\AuthModule\UserItem::loginRouteParams()) || currentPathUrl() == urlRoute(\Developeryamhi\AuthModule\UserItem::logoutRoute(), \Developeryamhi\AuthModule\UserItem::logoutRouteParams())) {
        $allowed = true;
    }
    //  Check for User
    if (!$allowed && Auth::check() && Auth::user()->canAccess("maintainance_mode")) {
        $allowed = true;
    }
    //  Get IPs if Setting Created
    $maintainance_ip_use_as = getSetting("maintainance_ip_use_as");
    $maintainance_ips = getSetting("maintainance_ips");
    //  Check if Setting is Valid
    if ($maintainance_ip_use_as && $maintainance_ips && !empty($maintainance_ips)) {
        //  IP List
        $ip_list = explode("\r\n", $maintainance_ips);
        //  Current Visitor IP
        $currentIP = Request::getClientIp();