public static function read() { $types = Session::get('messages'); // no messages no problem if (is_null($types)) { return ''; } $html = ''; foreach ($types as $type => $messages) { foreach ($messages as $message) { $html .= sprintf(static::$mwrap, $type, implode('<br>', (array) $message)); } } Session::erase('messages'); return sprintf(static::$wrap, $html); }
} catch (Exception $e) { Input::flash(); Notify::error($e->getMessage()); return Response::redirect('account'); } return Response::redirect('complete'); })); /* Complete */ Route::get('complete', function () { // check we have a database if (!Session::get('install')) { Notify::error('Please select your language'); return Response::redirect('start'); } $settings = Session::get('install'); $vars['site_uri'] = $settings['metadata']['site_path']; $vars['admin_uri'] = rtrim($settings['metadata']['site_path'], '/') . '/index.php/admin/login'; $vars['htaccess'] = Session::get('htaccess'); // scrub session now we are done Session::erase('install'); file_put_contents(APP . 'install.lock', time()); return Layout::create('complete', $vars); }); /* 404 catch all */ Route::any(':all', function () { return Response::error(404); });
private static function logout() { $session = new Session(); $session->erase('_user'); $session->destroy(); return self::loginview(); }
public static function logout() { Session::erase(static::$session); }
$token = Session::get('token'); $user = Session::get('user'); if ($token != $key) { Notify::error(__('users.recovery_expired')); return Response::redirect('admin/login'); } $validator = new Validator(array('password' => $password)); $validator->check('password')->is_max(6, __('users.password_too_short', 6)); if ($errors = $validator->errors()) { Input::flash(); Notify::error($errors); return Response::redirect('admin/reset/' . $key); } User::update($user, array('password' => Hash::make($password))); Session::erase('user'); Session::erase('token'); Notify::success(__('users.password_reset')); return Response::redirect('admin/login'); })); /* Upgrade */ Route::get('admin/upgrade', function () { $vars['messages'] = Notify::read(); $vars['token'] = Csrf::token(); $version = Config::meta('update_version'); $url = 'https://github.com/anchorcms/anchor-cms/archive/%s.zip'; $vars['version'] = $version; $vars['url'] = sprintf($url, $version); return View::create('upgrade', $vars)->partial('header', 'partials/header')->partial('footer', 'partials/footer'); });
public static function logout() { Session::erase('user'); }