OneBot: Leantime 改造版源码(BOM/Univer 表格/AI 接管/品牌替换等)

This commit is contained in:
wangruiguo
2026-09-03 18:49:20 +08:00
commit d647428529
3501 changed files with 1988906 additions and 0 deletions

View File

@@ -0,0 +1,66 @@
<?php
namespace Leantime\Domain\Install\Controllers;
use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Controller\Controller;
use Leantime\Core\Controller\Frontcontroller as FrontcontrollerCore;
use Leantime\Domain\Install\Services\Install as InstallService;
use Symfony\Component\HttpFoundation\Response;
class Update extends Controller
{
private InstallService $installService;
/**
* init - initialize private variables
*/
public function init(InstallService $installService)
{
$this->installService = $installService;
}
/**
* get - handle get requests
*
* @params parameters or body of the request
*/
public function get($params)
{
if (! $this->installService->needsUpdate()) {
return FrontcontrollerCore::redirect(BASE_URL.'/auth/login');
}
$updatePage = self::dispatch_filter('customUpdatePage', 'install.update');
return $this->tpl->display($updatePage, 'entry');
}
/**
* @throws BindingResolutionException
*/
public function post($params): Response
{
if (isset($_POST['updateDB'])) {
$success = $this->installService->runUpdate();
if (is_array($success) === true) {
foreach ($success as $errorMessage) {
$this->tpl->setNotification('There was a problem. Please reach out to support@leantime.io for assistance.', 'error');
// report($errorMessage);
}
$this->tpl->setNotification('There was a problem updating your database. Please check your error logs to verify your database is up to date.', 'error');
return FrontcontrollerCore::redirect(BASE_URL.'/install/update');
}
if ($success === true) {
return FrontcontrollerCore::redirect(BASE_URL);
}
}
$this->tpl->setNotification('There was a problem. Please reach out to support@leantime.io for assistance.', 'error');
return FrontcontrollerCore::redirect(BASE_URL.'/install/update');
}
}