admin) { access::forbidden(); } $view = new View("upgrader.html"); $view->available = module::available(); $view->done = Input::instance()->get("done"); print $view; } public function upgrade() { // Todo: give the admin a chance to log in here if (!user::active()->admin) { access::forbidden(); } // Upgrade gallery and user first module::install("gallery"); module::install("user"); // Then upgrade the rest foreach (module::available() as $id => $module) { if ($id == "gallery") { continue; } if ($module->active && $module->code_version != $module->version) { module::install($id); } } url::redirect("upgrader?done=1"); } }