예제 #1
0
 public function postAuth()
 {
     $data = Input::all();
     $remember = isset($data['remember']) ? true : false;
     $validator = Validator::make($data, WorkWithInput::rulesForInputAuth(), WorkWithInput::messagesForErrors());
     $userMessages = $validator->messages();
     $emailError = $userMessages->first('email');
     $passwordError = $userMessages->first('password');
     $result['errors'] = array($emailError, $passwordError);
     if ($userMessages->has('email') || $userMessages->has('password')) {
         return $result;
     }
     if (Auth::attempt(array('email' => $data['email'], 'password' => $data['password']), $remember)) {
         $result['authOk'] = LinksInMenu::echoAuthMode();
         $result['backUrl'] = $this->getBackUrl();
         return $result;
     }
     $result['errors']['1'] = "Нет такого пользователя";
     return $result;
 }
예제 #2
0
				<!-- Collect the nav links, forms, and other content for toggling -->
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li <?php 
echo LinksInMenu::isActive(URL::route('vanguard'));
?>
>
							<a href="<?php 
echo URL::route('vanguard');
?>
">Стажировка</a>
						</li>
						<?php 
echo LinksInMenu::linkForMainMenu();
?>
					</ul>
					<ul class="nav navbar-nav navbar-right">
						<?php 
echo LinksInMenu::echoAuthMode();
?>
					</ul>
					<?php 
echo View::make('vanguard.loginModal');
?>
				</div>
				<!-- /.navbar-collapse -->
			</div>
			<!-- /.container-fluid -->
		</nav>
	</header>
</div>