* ------------- */ Route::accept(array($config->manager->slug . '/shield/kill/id:(:any)', $config->manager->slug . '/shield/(:any)/kill/file:(:all)'), function ($folder = "", $path = false) use($config, $speak) { if (Guardian::get('status') !== 'pilot' || $folder === "") { Shield::abort(); } $info = Shield::info($folder, true); if ($path) { $path = File::path($path); if (!($file = File::exist(SHIELD . DS . $folder . DS . $path))) { Shield::abort(); // File not found! } } else { if (!($file = File::exist(SHIELD . DS . $folder))) { Shield::abort(); // Folder not found! } } Config::set(array('page_title' => $speak->deleting . ': ' . ($path ? File::B($file) : $info['title']) . $config->title_separator . $config->manager->title, 'files' => Get::files(SHIELD . DS . $folder, '*'), 'cargo' => DECK . DS . 'workers' . DS . 'kill.shield.php')); if ($request = Request::post()) { Guardian::checkToken($request['token']); $P = array('data' => array('path' => $file)); File::open($file)->delete(); if ($path) { Notify::success(Config::speak('notify_file_deleted', '<code>' . File::B($path) . '</code>')); } else { Notify::success(Config::speak('notify_success_deleted', $speak->shield)); } Weapon::fire('on_shield_update', array($P, $P)); Weapon::fire('on_shield_destruct', array($P, $P));
<?php /** * Login Page * ---------- * * [1]. manager/login * */ Route::accept($config->manager->slug . '/login', function () use($config, $speak) { if (!File::exist(File::D(__DIR__) . DS . 'launch.php')) { Shield::abort('404-manager'); } if (Guardian::happy()) { Guardian::kick($config->manager->slug . '/article'); } Config::set(array('page_title' => $speak->log_in . $config->title_separator . $config->title, 'cargo' => 'cargo.login.php')); include __DIR__ . DS . 'cargo.php'; if ($request = Request::post()) { Guardian::authorize()->kick(isset($request['kick']) ? $request['kick'] : $config->manager->slug . '/article'); } Shield::attach('manager-login'); }, 20); /** * Logout Page * ----------- * * [1]. manager/logout * */ Route::accept($config->manager->slug . '/logout', function () use($config, $speak) {