Sindbad~EG File Manager

Current Path : /home/numerotech/www/livemt2023.aios-scientificcommittee.org/app/
Upload File :
Current File : //home/numerotech/www/livemt2023.aios-scientificcommittee.org/app/filters.php

<?php

/*
|--------------------------------------------------------------------------
| Application & Route Filters
|--------------------------------------------------------------------------
|
| Below you will find the "before" and "after" events for the application
| which may be used to do any work before or after a request into your
| application. Here you may also register your custom route filters.
|
*/

App::before(function($request)
{
	//
});


App::after(function($request, $response)
{
	//
});

/*
|--------------------------------------------------------------------------
| Authentication Filters
|--------------------------------------------------------------------------
|
| The following filters are used to verify that the user of the current
| session is logged into this application. The "basic" filter easily
| integrates HTTP Basic authentication for quick, simple checking.
|
*/

Route::filter('auth', function()
{
	//if (Auth::guest()) return Redirect::guest('login');
     if(!Auth::check())
     {
        
        if(Request::ajax())
        {
            $msg = "Your session has expired. Please log-in again . <a href=". url('/login') ." >Click here to go to Login</a>";
                $arr = ['data' => [], 'code' => 0, 'msg' => $msg];
                return Response::json($arr); 
        }

        return Redirect::to('/login');
     }

});

Route::filter('forumChangeDB', function($route) {
    
    $isBeta = $route->getParameter('isBeta'); // use the key you defined
    	
    //return $isLive;

    if($isBeta == 1)
    {
    	Cache::flush();
    	DB::setDefaultConnection('aiosBeta');
    }
    else if($isBeta == 0)
    {
    	Cache::flush();
    	DB::setDefaultConnection('aiosLive');
    }
    $route->forgetParameter('isBeta');

});

Route::filter('auth.basic', function()
{
	return Auth::basic();
});

/*
|--------------------------------------------------------------------------
| Guest Filter
|--------------------------------------------------------------------------
|
| The "guest" filter is the counterpart of the authentication filters as
| it simply checks that the current user is not logged in. A redirect
| response will be issued if they are, which you may freely change.
|
*/

Route::filter('guest', function()
{
	if (Auth::check()) return Redirect::to('/');
});

/*
|--------------------------------------------------------------------------
| CSRF Protection Filter
|--------------------------------------------------------------------------
|
| The CSRF filter is responsible for protecting your application against
| cross-site request forgery attacks. If this special token in a user
| 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('Profile', function()
{
    if (!User::IsProfileUpdated())
    {   
        return Redirect::to("profile")->with('msgError',"Please update your profile and click on SAVE to continue to Dashboard");
    }
    
});


Route::filter('IC', function()
{
    if (!App::make('UserController')->isUserType(CustomClass::getUserId(),CustomClass::$UserType_IC_CI))
    {
        return Redirect::to("abstracts");
    }

	if (!DateConfig::IsDateOpen('IC'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
		//App::abort(500, 'Something bad happened');             
			$msg = "IC Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard') ." >Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 
    		//throw new FideloperException("IC Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"IC Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard') .">Click here to go to Dashboard</a>");
    	}
	    
	}
	
});

Route::filter('FP', function()
{

    if (!App::make('UserController')->isUserType(CustomClass::getUserId(),CustomClass::$UserType_FP_CA))
    {
        return Redirect::to("abstracts");
    }


	if (!DateConfig::IsDateOpen('FP'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
			//App::abort(500, 'Something bad happened');
    		$msg = "FP Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard').">Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 
    		//throw new FideloperException("FP Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"FP Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    	}
	    
	}
	
});



Route::filter('PP', function()
{

    if (!App::make('UserController')->isUserType(CustomClass::getUserId(),CustomClass::$UserType_PP_CA))
    {
        return Redirect::to("abstracts");
    }

    if (!DateConfig::IsDateOpen('PP'))
    {   
        if(Request::ajax())
        {
            //App::abort(100);
            //App::abort(500, 'Something bad happened');
            $msg = "PP Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard').">Click here to go to Dashboard</a>";
            $arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 
            //throw new FideloperException("FP Date Time Closed You can not Submit abstract.");
        }
        else
        {
            return View::make('msg')->with('msg',"PP Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
        }
        
    }
    
});

Route::filter('VT', function()
{

    if (!App::make('UserController')->isUserType(CustomClass::getUserId(),CustomClass::$UserType_VT_CA))
    {
        return Redirect::to("abstracts");
    }

	if (!DateConfig::IsDateOpen('VT'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
		//App::abort(500, 'Something bad happened');
    		$msg = "VT Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard') ." >Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 
    		//throw new FideloperException("VT Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"VT Abstract Submission Closed. You can not Submit abstract. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    	}
	}
	
});


Route::filter('ARC', function()
{

     if (empty(CustomClass::GetMembership()->membership_no))
    {
        return Redirect::to("abstracts");
    }   
	if (!DateConfig::IsDateOpen('ARC'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
		//App::abort(500, 'Something bad happened');
    		$msg = "ARC Date Time Closed You can not Submit or Edit abstract. <a href=". url('/dashboard'). " >Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 

    		//throw new FideloperException("ARC Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"ARC Date Time Closed You can not Submit or Edit abstract. <a href=". url('/dashboard') ." >Click here to go to Dashboard</a>");
    	}
	    
	}

});



Route::filter('ARCInn', function()
{

     if (empty(CustomClass::GetMembership()->membership_no))
    {
        return Redirect::to("abstracts");
    }   
	if (!DateConfig::IsDateOpen('ARCInn'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
		//App::abort(500, 'Something bad happened');
    		$msg = "ARC - Innovator's corner Date Time Closed You can not Submit or Edit abstract. <a href=". url('/dashboard'). " >Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 

    		//throw new FideloperException("ARC Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"ARC - Innovator's corner Date Time Closed You can not Submit or Edit abstract. <a href=". url('/dashboard') ." >Click here to go to Dashboard</a>");
    	}
	    
	}

});




Route::filter('ARCLDP', function()
{

     if (empty(CustomClass::GetMembership()->membership_no))
    {
        return Redirect::to("abstracts");
    }   
	if (!DateConfig::IsDateOpen('ARCLDP'))
	{	
		if(Request::ajax())
    	{
    		//App::abort(100);
		//App::abort(500, 'Something bad happened');
    		$msg = "ARC LDP Date Time Closed You can not apply form. <a href=". url('/dashboard'). " >Click here to go to Dashboard</a>";
    		$arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 

    		//throw new FideloperException("ARC Date Time Closed You can not Submit abstract.");
    	}
    	else
    	{
    		return View::make('msg')->with('msg',"ARC LDP Date Time Closed You can not apply form. <a href=". url('/dashboard') ." >Click here to go to Dashboard</a>");
    	}
	    
	}

});


Route::filter('ICVAL', function()
{     
    if (!DateConfig::IsDateOpen('ICVAL'))
    {   
        return Redirect::to("abstracts");
    }

});



Route::filter('FPVAL', function()
{     
    if (!DateConfig::IsDateOpen('FPVAL'))
    {   
        return Redirect::to("abstracts");
    }

});

Route::filter('VTVAL', function()
{     
    if (!DateConfig::IsDateOpen('VTVAL'))
    {   
        return Redirect::to("abstracts");
    }

});
Route::filter('PPVAL', function()
{     
    if (!DateConfig::IsDateOpen('PPVAL'))
    {   
        return Redirect::to("abstracts");
    }

});


Route::filter('ARCVAL', function()
{     
    if (!DateConfig::IsDateOpen('ARCVAL'))
    {   
        return Redirect::to("abstracts");
    }

});



Route::filter('JUDGEVAL', function()
{     
    if (!DateConfig::IsDateOpen('JUDGEVAL'))
    {   
        return Redirect::to("abstracts");
    }

});


Route::filter('NOMIN', function()
{

    if (empty(CustomClass::GetMembership()->membership_no))
    {
        return Redirect::to("abstracts");
    }
    
    if (!DateConfig::IsDateOpen('NOMIN'))
    {   
        if(Request::ajax())
        {
            //App::abort(100);
        //App::abort(500, 'Something bad happened');
            $msg = "Nomination Date Time Closed You can not Submit. <a href=". url('/nominations'). " >Click here to go to Dashboard</a>";
            $arr = ['data' => [], 'code' => 0, 'msg' => $msg];
            return Response::json($arr); 
        }
        else
        {
            return View::make('msg')->with('msg',"Nomination Date Time Closed You can not Submit. <a href=". url('/nominations') ." >Click here to go to Dashboard</a>");
        }
        
    }
	
});

Route::filter('bo', function()
{
    if (CustomClass::GetMembership()->is_special_user != 1)
    {   
       return Redirect::to("/");
    }
});

Route::filter('forum', function()
{
    if (Auth::user()->forum_access != 1)
    {   
       return Redirect::to("/");
    }
});

Route::filter('FPUPLOAD', function()
{     
    if (!DateConfig::IsDateOpen('FPUPLOAD'))
    {         
        return View::make('msg')->with('msg',"Full Text upload is Closed. You can not upload Full Text and E-poster. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    }
});


Route::filter('EPUPLOAD', function()
{     
    if (!DateConfig::IsDateOpen('EPUPLOAD'))
    {         
        return View::make('msg')->with('msg',"E-Poster PPT upload is Closed. You can not upload Full Text and E-poster. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    }
});


Route::filter('PPUPLOAD', function()
{     
    if (!DateConfig::IsDateOpen('PPUPLOAD'))
    {         
        return View::make('msg')->with('msg',"Phsyical Poster PPT upload is Closed. You can not upload Phsyical Poster. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    }
});

Route::filter('PPPUPLOAD', function()
{     
    if (!DateConfig::IsDateOpen('PPPUPLOAD'))
    {         
        return View::make('msg')->with('msg',"Poster Podium Presentation upload is Closed. You can not upload Poster Podium Presentation. <a href=". url('/dashboard')." >Click here to go to Dashboard</a>");
    }
});



Route::filter('HYDEPARK', function()
{     
    if (!DateConfig::IsDateOpen('HYDEPARK'))
    {    
	return View::make('msg')->with('msg',"Hyde Park acceptance have been closed.");     
        //return View::make('msg')->with('msg',"Hyde Park acceptance opens at 2PM IST.");
    }
});


Route::filter('CALLEPOSTER', function()
{     
    if (!DateConfig::IsDateOpen('CALLEPOSTER'))
    {    
	return View::make('msg')->with('msg',"E-Poster acceptance have been closed.");     
        //return View::make('msg')->with('msg',"Hyde Park acceptance opens at 2PM IST.");
    }
});


Route::filter('CONSENTJUDGE', function()
{     
    if (!DateConfig::IsDateOpen('CONSENTJUDGE'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Route::filter('CONSENTPRESAUTHOR', function()
{     
    if (!DateConfig::IsDateOpen('CONSENTPRESAUTHOR'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});


Route::filter('CERTIFICATE2018', function()
{     
    if (!DateConfig::IsDateOpen('CERTIFICATE2018'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});


Route::filter('CERTIFICATE2019', function()
{     
    if (!DateConfig::IsDateOpen('CERTIFICATE2019'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});



Route::filter('CERTIFICATE2020', function()
{     
    if (!DateConfig::IsDateOpen('CERTIFICATE2020'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});


Route::filter('CERTIFICATE2021', function()
{     
    if (!DateConfig::IsDateOpen('CERTIFICATE2021'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Route::filter('CONSENTJUDGEPP', function()
{     
    if (!DateConfig::IsDateOpen('CONSENTJUDGEPP'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Route::filter('CONSENTEVALUATOR', function()
{     
    if (!DateConfig::IsDateOpen('CONSENTEVALUATOR'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});


Route::filter('bopoll', function()
{
   if (CustomClass::GetMembership()->is_poll_admin != 1)
   {   
      return Redirect::to("/");
   }
});

Route::filter('PRESENTATIONDEVICE', function()
{     
    if (!DateConfig::IsDateOpen('PRESENTATIONDEVICE'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Route::filter('FPROLECHANGE', function()
{     
    if (!DateConfig::IsDateOpen('FPROLECHANGE'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Route::filter('COMMITMENT', function()
{     
    if (!DateConfig::IsDateOpen('COMMITMENT'))
    {   
        return Redirect::to("abstracts");
    }

});

Route::filter('OPTINIJO', function()
{     
    if (!DateConfig::IsDateOpen('OPTINIJO'))
    {         
        return View::make('ijo_msg')->with('msg',"Opt-in for the October 2020 print issue of IJO is now closed. However, you can continue to opt-in for the November 2020 and subsequent issues. Cut-off dates will be the 20th of every month for to begin print copies from the next month.");
    }
});

Route::filter('CONSENTCONFERENCE', function()
{     
    if (!DateConfig::IsDateOpen('CONSENTCONFERENCE'))
    {         
        return View::make('msg')->with('msg',"Sorry! The date for providing your response has passed.");
    }
});

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists