Model->users->Service->array); $user = $auth->getUser(); if ( array_key_exists('logout', $_GET) ) { $auth->logout(); header(sprintf('Location: %1$s', '/')); die($next); } elseif ( $user ) { return function ( $func ) { try { return $func(); } catch ( Exception $e ) { $exceptions = array(); do { $exceptions[] = array( 'type' => get_class($e), 'message' => $e->getMessage(), //'stack' => $e->getTrace(), 'file' => $e->getFile(), 'line' => $e->getLine(), ); } while ( $e = $e->getPrevious() ); die(EngineSystem::get('back') ->load('pages/error.html') ->run(array('exceptions' => $exceptions)) ->getData('')); } }; } elseif ( $data ) { try { //~ print_r($auth); $auth->login($data); header(sprintf('Location: %1$s', $next)); die($next); } catch ( Exception $e ) { $data['message'] = $e->getMessage(); $a = EngineSystem::get('back')->load('pages/login.html')->run($data)->getData(''); } } else $a = EngineSystem::get('back')->load('pages/login.html')->run()->getData(''); die($a); ?>