function getExample()
 {
     dump(\Auth::check());
     dump(auth()->check());
     dump(Auth::check());
     dump(\Session::all());
     dump(session()->all());
     dump(Session::all());
 }
 /**
  * Register bindings in the container.
  *
  * @return void
  */
 public function boot()
 {
     View::composer('*', function (\Illuminate\View\View $view) {
         $view->with('session', \Session::all());
         if (\Sentry::check()) {
             $view->with('user', \Sentry::getUser());
         }
     });
 }
Example #3
0
 public function __construct()
 {
     self::$items['GET'] = $_GET;
     self::$items['POST'] = $_POST;
     self::$items['REQUEST'] = $_REQUEST;
     self::$items['SERVER'] = $_SERVER;
     self::$items['GLOBALS'] = $GLOBALS;
     self::$items['SESSION'] = Session::all();
     self::$items['COOKIE'] = Cookie::all();
 }
Example #4
0
 public function __construct()
 {
     self::$items['GET'] = $_GET;
     self::$items['POST'] = $_POST;
     self::$items['REQUEST'] = $_REQUEST;
     self::$items['SERVER'] = $_SERVER;
     self::$items['GLOBALS'] = $GLOBALS;
     self::$items['SESSION'] = Session::all();
     self::$items['COOKIE'] = Cookie::all();
     define('IS_MOBILE', $this->isMobile());
 }
 public function show()
 {
     if (Session::has('user')) {
         $respuesta = json_encode(array("error" => false, 'message' => "Usuario autenticado", 'respuesta' => array(Session::all(), 200)));
     } else {
         $respuesta = json_encode(array("error" => true, 'message' => "Usuario no autenticado", 'respuesta' => array('', 404)));
     }
     $final_response = Response::make($respuesta, 200);
     $final_response->header('Content-Type', "application/json; charset=utf-8");
     return $final_response;
 }
Example #6
0
function session($get = false, $set = false)
{
    if ($get) {
        if ($set) {
            return Session::set($get, $set);
        } else {
            return Session::get($get);
        }
    } else {
        return Session::all();
    }
}
Example #7
0
 /**
  * Return specified session data.
  * Return all session if empty parameter.
  *
  * @param null $eleK
  *
  * @return mixed
  */
 function sess($eleK = null)
 {
     if (empty($eleK)) {
         return Session::all();
     } else {
         $ele = Session::get($eleK);
     }
     if (empty($ele)) {
         return false;
     } else {
         return $ele;
     }
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     echo '<pre>';
     print_r(Session::all());
     // $u = new User;
     $u = User::find(1);
     $u->first_name = 'Mohamed';
     $u->last_name = 'J';
     $u->email = '*****@*****.**';
     $u->password = Hash::make('123456');
     $u->level_access = 1;
     $u->status = 1;
     $u->user_key = str_random(32);
     $u->save();
     return 'Default Admin Controller.';
 }
Example #9
0
 public function ajaxChangeCity()
 {
     $city_id = Input::get('city_id');
     $response = ['status' => false, 'errorText' => ''];
     $user_city_cache_key = self::$user_city_cache_key;
     $user_city_cache_min = self::$user_city_cache_min;
     if (is_numeric($city_id)) {
         $city = Dic::valueBySlugAndId('city', $city_id, 'all');
         if (is_object($city) && $city->id) {
             Session::set($user_city_cache_key, $city->id);
             setcookie('change_city', true, time() + 60 * $user_city_cache_min, '/');
             $response['status'] = true;
             $response['session'] = Session::all();
         } else {
             $response['errorText'] = 'wrong city_id';
         }
     } else {
         $response['errorText'] = 'bad city_id';
     }
     return Response::json($response);
 }


<div class="container page-board page-auth-forms">
	<div class="row">
		<div class="col-md-4 col-md-offset-4">
				
				<div class="content-popup @if($errors->any()) animated shake @endif">
					<div class="popup-intro">
						<h3>Dokończ rejestrację</h3>
						<p>Potrzebujemy Twój E-mail</p>
					</div>
					
					{{ Form::open(array('url' => '/auth/login/complete', 'class' => 'form-auth')) }}
						<?php 
$session = Session::all();
?>
						<input type="email" id="email" name="email" class="input-default @if ($errors->has('email'))has-error @endif" placeholder="Twój E-mail">
						@if ($errors->has('email')) <p class="help-block">{{ $errors->first('email') }}</p> @endif	
						@if(strtolower($session['mmanos']['social']['pending']['provider']) == 'instagram')
						<input type="hidden" name="provider" value="{{ strtolower($session['mmanos']['social']['pending']['provider']) }}">
						<input type="hidden" name="provider_id" value="{{ $session['mmanos']['social']['pending']['provider_id'] }}">
						<input type="hidden" name="first_name" value="{{ $session['mmanos']['social']['pending']['user_info']['first_name'] }}">
						<input type="hidden" name="last_name" value="{{ $session['mmanos']['social']['pending']['user_info']['last_name'] }}">
						<input type="hidden" name="access_token" value="{{ $session['mmanos']['social']['pending']['access_token']['token'] }}">
						<input type="hidden" name="profile_picture" value="{{$session['mmanos']['social']['pending']['access_token']['extra_params']['user']['profile_picture']}}">
						@elseif(strtolower($session['mmanos']['social']['pending']['provider']) == 'twitter')
	
							<input type="hidden" name="provider" value="{{ strtolower($session['mmanos']['social']['pending']['provider']) }}">
							<input type="hidden" name="provider_id" value="{{ $session['mmanos']['social']['pending']['provider_id'] }}">
							<input type="hidden" name="first_name" value="{{ $session['mmanos']['social']['pending']['user_info']['first_name'] }}">
Example #11
0
 /**
  * For handle order step by step
  *
  * @return Redirect
  */
 public function progress()
 {
     $order_session = Session::all();
     $data_ret = [];
     switch (Input::get('step')) {
         case 'index':
             Session::put('order.index', Input::only(['type', 'quantity_box', 'quantity_custom', 'quantity_item', 'description']));
             break;
         case 'schedule':
             $delivery_date = Input::get('delivery_year') . '-' . Input::get('delivery_month') . '-' . Input::get('delivery_day');
             if (!$this->_validateDateShouldLater($delivery_date)) {
                 return Redirect::back()->withMessages(['Delivery date should greater than today'])->withInput();
             }
             // if pickup immediaetly we pass this validation
             if (Input::get('type') != 'immediately') {
                 $pickup_date = Input::get('pickup_year') . '-' . Input::get('pickup_month') . '-' . Input::get('pickup_day');
                 if (!$this->_validateDateShouldLater($pickup_date)) {
                     return Redirect::back()->withMessages(['Pickup date should greater than today'])->withInput();
                 }
             }
             Session::put('order.schedule', Input::only(['delivery_day', 'delivery_month', 'delivery_year', 'delivery_time', 'type', 'pickup_day', 'pickup_month', 'pickup_year', 'pickup_time']));
             break;
         case 'payment':
             if (!Auth::check()) {
                 $userRepo = app('UserRepo');
                 if (Input::get('user_action') == 'signin') {
                     // if fails login redirect back with errors and input
                     if (!$userRepo->login(Input::get('credentials'))) {
                         return Redirect::back()->withMessages($userRepo->getErrors())->withInput();
                     }
                 } elseif (Input::get('user_action') == 'signup') {
                     // if fails register redirect back with errors and input
                     if (!$userRepo->register(Input::only(['firstname', 'lastname', 'email', 'phone', 'address', 'password']))) {
                         return Redirect::back()->withMessages($userRepo->getErrors())->withInput();
                     }
                 }
             }
             Session::put('order.payment', Input::only(['method', 'message']));
             break;
         case 'review':
             # save space credit used
             $space_credit = app('UserRepo')->getCustomerSpaceCredit();
             $order_index = Session::get('order.index');
             $total = calcPrice('box', $order_index['quantity_box']) + calcPrice('item', $order_index['quantity_item']);
             if ($total > $space_credit) {
                 $data_ret['total'] = "Total : Rp. " . number_format($total - $space_credit, 0, ',', '.') . ',-';
                 $data_ret['space_credit_sisa'] = "Rp. " . number_format(0, 0, ',', '.') . ',-';
                 $data_ret['space_credit_used'] = "Rp. " . number_format($space_credit, 0, ',', '.') . ',-';
                 Session::put('order.space_credit_used', $space_credit);
             } else {
                 $data_ret['total'] = "Total : Rp. " . number_format(0, 0, ',', '.') . ',-';
                 $data_ret['space_credit_sisa'] = "Rp. " . number_format($space_credit - $total, 0, ',', '.') . ',-';
                 $data_ret['space_credit_used'] = "Rp. " . number_format($total, 0, ',', '.') . ',-';
                 Session::put('order.space_credit_used', $total);
             }
             break;
     }
     if (Request::ajax()) {
         return $data_ret;
     } else {
         $redirectTo = Input::get('redirect_to');
         return Redirect::to($redirectTo);
     }
 }
 public function deleteimages()
 {
     $removed_image = Input::get('removed_image');
     //former name
     $added_images = Session::all();
     $added_image = Session::get($removed_image);
     $new_file_name = $added_image['newfilename'];
     $destinationPath = 'public/pb-uploads/pet_images/';
     /*
     	TODO FOR THE IMAGE FILE
     	-----------------------
     	* Delete it from the /pet-image path
     	* Delete it from the session
     */
     // delete from the folder
     File::delete($destinationPath . $new_file_name);
     // Deleted the image from the session.
     Session::forget($removed_image);
 }
Example #13
0
<?php

if (Sentry::check()) {
    $user = Sentry::getUser();
} else {
    $user = null;
}
$guest = !Sentry::check();
View::composer('*', function ($view) use($user, $guest) {
    $view->with('session', Session::all());
    $view->with('guest', $guest);
    $view->with('user', $user);
});
Route::get('/imprint', array('as' => 'imprint', 'uses' => 'HomeController@imprint'));
Route::get('/privacy', array('as' => 'privacy', 'uses' => 'HomeController@privacy'));
/**
 * Account
 */
Route::get('/', array('as' => 'home', 'uses' => 'HomeController@index'));
Route::group(array(Config::get('app.forceSsl') ? 'https' : 'http'), function () {
    Route::get('/login', array('as' => 'user.login', 'uses' => 'UserController@login'));
    Route::post('/login', array('as' => 'user.do-login', 'uses' => 'UserController@doLogin', 'before' => 'csrf'));
    Route::get('/login/github', array('as' => 'user.login.github', 'uses' => 'UserController@loginGithub'));
    Route::post('/login/github', array('as' => 'user.login.github', 'uses' => 'UserController@loginGithub'));
    Route::get('/register', array('as' => 'user.register', 'uses' => 'UserController@register'));
    Route::post('/register', array('as' => 'user.do-register', 'uses' => 'UserController@doRegister', 'before' => 'csrf'));
    Route::get('/activate/{code}', array('as' => 'user.activate', 'uses' => 'UserController@activate'))->where('code', '\\w+');
});
Route::group(array('before' => 'auth', Config::get('app.forceSsl') ? 'https' : 'http'), function () {
    /**
     * Users
Example #14
0
 /**
  * Echo out the session.
  */
 static function print_session()
 {
     static::debug(Session::all());
 }
Example #15
0
Route::get('/', 'PostsController@index');
// Route::get('/resume', 'HomeController@showResume');
Route::get('/portfolio', 'HomeController@showPortfolio');
// Route::get('/sayhello/{name}', function($name)
// {
//     if ($name == "") {
//         return Redirect::to('/');
//     } else {
//         $data = array('name' => $name);
//         return View::make('my-first-view')->with($data);
//     }
// });
Route::get('/posts', 'PostsController@index');
Route::resource('/posts', 'PostsController');
Route::get('/create', 'PostsController@create');
Route::get('/session/{value}', function ($value) {
    Session::put('some-key', $value);
    if (Session::has('some-key')) {
        echo Session::get('some-key');
    }
});
Route::get('/session', function () {
    return Session::all();
});
Route::get('login', 'HomeController@getLogin');
Route::post('login', 'HomeController@postLogin');
Route::get('logout', 'HomeController@getLogout');
// Route::get('/orm-test', function(){
// 	$post = Post::find(2);
// 	dd($post);
// });
Example #16
0
        return View::make('user.user_login');
    }
});
Route::get('/user/login/', function () {
    return redirect('/');
});
Route::any('/user/', function () {
    return redirect('/');
});
Route::any('/user/request_amendment', 'User\\DashboardController@request_amendment');
Route::get('user/dashboard', 'User\\DashboardController@index');
Route::post('user/time_entry', 'User\\DashboardController@time_entry');
Route::post('/user/login', 'User\\LoginController@authenticate');
Route::get('/logout', function () {
    Auth::logout();
    Session::flush();
    return redirect('/');
});
Route::get('/user/logout/', function () {
    return redirect('/logout');
});
Route::get('/client/logout/', function () {
    return redirect('/logout');
});
Route::get('/testldap/', 'User\\DashboardController@testLdap');
Route::get('/client/', 'Client\\LoginController@index');
Route::post('/client/login', 'Client\\LoginController@authenticate');
Route::get('/client/dashboard', function () {
    print_r(Session::all());
});
Route::controllers(['auth' => 'Auth\\AuthController', 'password' => 'Auth\\PasswordController']);
 /**
  * Outputs Session and Cookie data in various forms.
  * Used to understand how Sessions and Cookies are working
  */
 public function getSessionsAndCookies()
 {
     # Log in check
     if (Auth::check()) {
         echo "You are logged in: " . Auth::user();
     } else {
         echo "You are not logged in.";
     }
     echo "<br><br>";
     # Cookies
     echo "<h1>Your Raw, encrypted Cookies</h1>";
     echo Paste\Pre::render($_COOKIE, '');
     # Decrypted cookies
     echo "<h1>Your Decrypted Cookies</h1>";
     echo Paste\Pre::render(Cookie::get(), '');
     echo "<br><br>";
     # All Session files
     echo "<h1>All Session Files</h1>";
     $files = File::files(app_path() . '/storage/sessions');
     foreach ($files as $file) {
         if (strstr($file, Cookie::get('laravel_session'))) {
             echo "<div style='background-color:yellow'><strong>YOUR SESSION FILE:</strong><br>";
         } else {
             echo "<div>";
         }
         echo "<strong>" . $file . "</strong>:<br>" . File::get($file) . "<br>";
         echo "</div><br>";
     }
     echo "<br><br>";
     # Your Session Data
     $data = Session::all();
     echo "<h1>Your Session Data</h1>";
     echo Paste\Pre::render($data, 'Session data');
     echo "<br><br>";
     # Token
     echo "<h1>Your CSRF Token</h1>";
     echo Form::token();
     echo "<script>document.querySelector('[name=_token]').type='text'</script>";
     echo "<br><br>";
 }
 /**
  * Dump current session and exit.
  */
 public function dumpSession()
 {
     dd(\Session::all());
 }
Example #19
0
<?php

$session = array_merge(Session::all(), array('cookie' => $_COOKIE));
?>

@if(!empty($session))
	<table>
		<tr>
			<th>Key</th>
			<th>Value</th>
		</tr>
		@foreach($session as $key => $value)
			<tr>
				<td>{{ $key }}</td>
				<td>
					@if (is_array($value) || is_object($value))
						<pre>{{ print_r($value, true) }}</pre>
					@else
						{{ $value }}
					@endif
				</td>
			</tr>
		@endforeach
	</table>
@else
	<span class="anbu-empty">There are no session entries.</span>
@endif
Example #20
0
 public function get()
 {
     return \Session::all();
 }
Example #21
0
 public function postLogout()
 {
     $input = Input::get('token');
     Auth::logout();
     Session::forget('user');
     return Session::all();
 }
Example #22
0
@extends('frontend.templates.register_pages')

@section('content')
<?php 
$user_array = Session::all();
if (!isset($_GET["utm_source"])) {
    $_GET["utm_source"] = "";
}
if (!isset($_GET["utm_medium"])) {
    $_GET["utm_medium"] = "";
}
if (!isset($_GET["utm_campaign"])) {
    $_GET["utm_campaign"] = "";
}
function RegPageURL()
{
    $pageURL = 'http';
    //if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
    $pageURL .= "://";
    if ($_SERVER["SERVER_PORT"] != "80") {
        $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
    } else {
        $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
    }
    return $pageURL;
}
$currentPageUrl = RegPageURL();
?>
<style>
.wowtables_small_div{
  background: #eabc3f;
Example #23
0
@extends('app')

@section('content')
<div class="container">
	<div class="row">
		<div class="col-md-10 col-md-offset-1">
			<div class="panel panel-default">
				<div class="panel-heading">{{trans('location.new_mutation')}}</div>
				<div class="panel-body">
					{!! Html::ul($errors->all()) !!}
					<?php 
$data = Session::all();
//print_r($data)
?>
					@if(!Session::has('master'))
					{!! Form::open(array('url' => 'warehouse_move_items/create')) !!}

					<div class="form-group col-md-6">
					{!! Form::label('no', trans('location.no') .' *') !!}
					<!-- {!! Form::text('no', Input::old('no'), array('class' => 'form-control', 'required', 'value' =>Common::no_auto('moving') )) !!} -->
					<input class="form-control" required="required" name="no" type="text" id="no" value="{!! Common::no_auto('moving') !!}">
					</div>

					<div class="form-group col-md-6">
					{!! Form::label('date', trans('location.date') .' *') !!}
					{!! Form::date('date', \Carbon\Carbon::now(), array('class' => 'form-control', 'required')) !!}
					</div>

					<div class="form-group col-md-6">
					{!! Form::label('loc_from', trans('location.from_location') .' *') !!}
					{!! Form::select('loc_from', $loc, 'null', array('class' => 'form-control', 'required', 'id'=>'loc_from')) !!}
Example #24
0
 /**
  * return all scripts for btn count
  *
  * @return Array
  */
 private function getCounts()
 {
     return array('environment' => function () {
         return \App::environment();
     }, 'memory' => function () {
         return Profiler::getMemoryUsage();
     }, 'controller' => function () {
         return 2;
         global $app;
         if (strpos($app::VERSION, '4.1') !== FALSE) {
             return $controller = \Route::current()->getActionName() != "" ? \Route::current()->getActionName() : "N/A";
         } elseif (strpos($app::VERSION, '4.0') !== FALSE) {
             return $controller = \Route::currentRouteAction() != "" ? \Route::currentRouteAction() : "N/A";
         }
     }, 'routes' => function () {
         return count(\Route::getRoutes());
     }, 'log' => function ($app_logs) {
         return count($app_logs);
     }, 'sql' => function ($sql_log) {
         return count($sql_log);
     }, 'checkpoints' => function ($times) {
         return round($times['total'], 3);
     }, 'file' => function ($includedFiles) {
         return count($includedFiles);
     }, 'view' => function ($view_data) {
         return count($view_data);
     }, 'session' => function () {
         return count(array_merge(\Session::all(), ['']));
     }, 'input' => function () {
         return count(array_merge($_POST, $_GET));
     }, 'server' => function () {
         return count($_SERVER);
     }, 'storage' => function ($storageLogs) {
         return count($storageLogs);
     }, 'config' => function ($config) {
         return count($config);
     }, 'auth' => function () {
         return \Auth::user()->email ? \Auth::user()->email : 'User';
     }, 'auth-sentry' => function () {
         return \Sentry::getUser()->email ? \Sentry::getUser()->email : 'User';
     });
 }
Example #25
0
 public static function session()
 {
     $message = 'состояние сессии';
     $session = \Session::all();
     $data = compact('message', 'session');
     self::report(self::SESSION, $data);
 }
Example #26
0
<?php

$vars = Session::all();
foreach ($vars as $key => $value) {
    switch ($key) {
        case 'success':
        case 'error':
        case 'warning':
        case 'info':
            ?>
                <div class="row">
                    <div class="alert alert-{{ ($key == 'error') ? 'danger' : $key }} alert-dismissable">
                        <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                        <strong>{{ ucfirst($key) }}:</strong> {!! $value !!}
                    </div>
                </div>
                <?php 
            Session::forget($key);
            break;
        default:
    }
}
Example #27
0
<?php

Route::get('t', function () {
    dd(Session::all());
});
Route::get('f', function () {
    Session::flush();
});
Route::get('/', ['uses' => 'catering\\ReservationsController@home', 'as' => 'home.index']);
Route::get('/home', 'catering\\ReservationsController@home');
Route::get('/equip', 'catering\\ReservationsController@equipments');
Route::get('/contact', ['uses' => 'catering\\ReservationsController@contact', 'as' => 'home.contact']);
Route::get('/thanks', 'catering\\ReservationsController@thanks');
Route::post('/contact', ['uses' => 'catering\\ReservationsController@contactStore', 'as' => 'home.contact.save']);
Route::get('/misc/list-information/', ['uses' => 'AdminController@information', 'as' => 'misc.list']);
Route::get('/misc/set-information/{id}/{value}', ['uses' => 'AdminController@editInformation', 'as' => 'misc.edit']);
Route::get('/misc/content/', ['uses' => 'AdminController@contents', 'as' => 'misc.content.list']);
Route::get('/misc/content/create/', ['uses' => 'AdminController@createContent', 'as' => 'misc.content.create']);
Route::get('/misc/content/edit/{id}', ['uses' => 'AdminController@editContent', 'as' => 'misc.content.edit']);
Route::post('/misc/content/save', ['uses' => 'AdminController@storeContent', 'as' => 'misc.content.save']);
Route::get('/login', ['uses' => 'AuthController@getLogin', 'as' => 'default.login']);
Route::get('/sign-in', 'AuthController@getSignIn');
Route::post('/sign-in', 'AuthController@postSignIn');
Route::get('/sign-out', 'AuthController@getSignOut');
Route::post('/signin', 'AuthController@signIn');
// USER CRUDS
Route::model('user', 'User');
Route::get('/settings/users', 'Settings\\UsersController@index');
Route::get('/settings/users/create', 'Settings\\UsersController@create');
Route::post('/settings/users', 'Settings\\UsersController@store');
Route::get('/settings/users/{user}', 'Settings\\UsersController@show');
Example #28
0
    // var_dump(Util::isEmail("*****@*****.**"));
    // echo number_format(1, 2);
    // $demo = [];
    if (true) {
        // $demo['test'] = 5;
        $demo = ['test' => 7];
    }
    echo $demo['test'];
});
Route::get('upload-demo', 'TaskController@uploadImage');
Route::get('/test', 'TestController@index');
Route::get('pay', function () {
    return View::make('pay.index');
});
Route::post('alipayapi', 'AlipayController@alipayapi');
Route::get('notify_url', 'AlipayController@notifyUrl');
Route::get('return_url', 'AlipayController@returnUrl');
Route::get('uuid', function () {
    // echo date('Ymdhis');
    echo date('y-m-d H:i:s ') . rand(1000, 9999);
});
Route::get('push', function () {
    $task = array('task_id' => 1, 'task_title' => 'hello', 'user_id' => 2);
    Session::set('task', $task);
});
Route::get('get', function () {
    echo '<pre>';
    // var_dump(Session::get('task'));
    var_dump(Session::all());
    echo '</pre>';
});
 public function test()
 {
     var_dump(Session::all());
     die;
     /*
             $xml = new simpleXMLElement( '<xml><return_code>return_code</return_code><return_msg><![CDATA[OK]]></return_msg></xml>' );
             var_dump( $xml );die();
     */
     //return View::make( 'user.test' );
 }
Example #30
0
/**
 * Return all Sessions contents
 *
 * @return array
 */
function zbase_sessions()
{
    return \Session::all();
}