Ejemplo n.º 1
0
 public function postLogin()
 {
     $remember = Input::has('remember') ? true : false;
     $credentials = $this->getCerdentials();
     if (Auth::attempt($credentials, $remember)) {
         Session::flash('success', 'Welcome user!');
         /*
         |$id is used to store the the unique 'user_id'
         |of the logged in user in session varible so thar
         |latter this can be used.
         |
         */
         //$data=$this->users->get(Input::get('email'));
         $firstname = Users::getFirstName(Auth::id());
         Session::put('first_name', $firstname);
         $checkCollegeName = Users::getCollege(Auth::id());
         if ($checkCollegeName) {
             $data = "Welcome ";
             return Redirect::to('/dashboard')->with('message', $data . " " . $firstname);
         } else {
             return Redirect::to('/college');
         }
     } else {
         return Redirect::back()->with('message', 'Wrong email or password');
         //return Redirect::to('/login')->with('failed',Lang::get('login.invalid_login'));
     }
 }
Ejemplo n.º 2
0
$maxLevel = Users::getUserMaxLevel(Auth::id());
?>

<div class="navbar-fixed">
		    <nav>
		      	<div class="nav-wrapper">
		        	<a href="/" class="brand-logo"><img src="/images/logo.jpg" class="logo-image">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Obscura</a>
		        	<a href="#" data-activates="mobile-demo" class="button-collapse"><i class="material-icons">menu</i></a>
		        	<ul class="right hide-on-med-and-down">
		          		<li><a class="waves-effect waves-light" href="/dashboard">Home</a></li>
						<li><a class="waves-effect waves-light" href="https://www.facebook.com/obscuranitkkr" target="_blank">Forum</a></li>
						<li><a class="waves-effect waves-light" href="/leaderboard">Leaderboard</a></li>
						<li><a class="dropdown-button" href="#!" data-activates="levels">Levels<i class="material-icons right">arrow_drop_down</i></a></li>

						<li><a class="dropdown-button" href="#!" data-activates="logout"><?php 
echo Users::getFirstName(Auth::id());
?>
<i class="material-icons right">arrow_drop_down</i></a></li>




		        	</ul>

		        	 <ul id='logout' class='dropdown-content'>
					  	<li><a href="/logout">Logout</a></li>
					</ul>

					<ul id='levels' class='dropdown-content'>
					<?php 
$i = 0;