/** * Add a password - this is used when users are invited into the platform. * **/ public function addPasswordForm() { $lrs_list = Lrs::all(); return View::make('partials.users.addPassword', array('user' => Auth::user(), 'lrs_list' => $lrs_list)); }
| and give it the Closure to execute when that URI is requested. | */ App::singleton('oauth2', function () { $storage = new OAuth2\Storage\Mongo(App::make('db')->getMongoDB()); $server = new OAuth2\Server($storage); $server->addGrantType(new OAuth2\GrantType\ClientCredentials($storage)); return $server; }); Route::get('/', function () { if (Auth::check()) { $site = \Site::first(); $admin_dashboard = new \app\locker\data\dashboards\AdminDashboard(); //if super admin, show site dashboard, otherwise show list of LRSs can access if (Auth::user()->role == 'super') { $list = Lrs::all(); return View::make('partials.site.dashboard', array('site' => $site, 'list' => $list, 'stats' => $admin_dashboard->getFullStats(), 'graph_data' => $admin_dashboard->getGraphData(), 'dash_nav' => true)); } else { $lrs = Lrs::where('users._id', \Auth::user()->_id)->get(); return View::make('partials.lrs.list', array('lrs' => $lrs, 'list' => $lrs, 'site' => $site)); } } else { $site = \Site::first(); if (isset($site)) { return View::make('system.forms.login', array('site' => $site)); } else { return View::make('system.forms.register'); } } }); /*
public function __construct() { $this->lrs = Lrs::all(); }