diff --git a/config/self-update.php b/config/self-update.php index a867c11..0a70313 100644 --- a/config/self-update.php +++ b/config/self-update.php @@ -2,6 +2,22 @@ declare(strict_types=1); + +ini_set('user_agent', 'Mozilla/4.0 (compatible; MSIE 6.0)'); +$json = file_get_contents("https://api.github.com/repos/julianprieber/littlelink-custom/releases/latest") ; +$myObj = json_decode($json); +$Vgit = $myObj->tag_name; +$Vlocal = 'v' . file_get_contents(base_path("version.json")); + + +if ($Vgit > $Vlocal) { + $userver = 'https://update.littlelink-custom.com/'; +} elseif (env('JOIN_BETA') === true) { + $userver = 'https://update.littlelink-custom.com/beta/'; +} else { + $userver = 'https://update.littlelink-custom.com/'; +} + return [ /* diff --git a/resources/views/update.blade.php b/resources/views/update.blade.php index 64abd8d..ca94632 100644 --- a/resources/views/update.blade.php +++ b/resources/views/update.blade.php @@ -12,7 +12,7 @@ // Requests current version from the local version file and sets it as variable $Vlocal = 'v' . file_get_contents(base_path("version.json")); ?> -@if(auth()->user()->role == 'admin' and $Vgit > $Vlocal) +@if(auth()->user()->role == 'admin' and $Vgit > $Vlocal or env('JOIN_BETA') === true) @if($_SERVER['QUERY_STRING'] === '') @@ -26,7 +26,13 @@

The updater only works on Linux based systems.

@else + @if(env('JOIN_BETA') === true) +

+

+

$Vlocal) {echo "You need to update to the latest mainline release";} else {echo "You're running the latest mainline release";} ?>

+ @else

You can update your installation automatically or download the update and install it manually:

+ @endif
     @@ -82,7 +88,8 @@ exit(); ?> current() . "?success\" />"; ?>