Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 37b4db8

Browse files
committed
Enable proxy configuration to use when contacting update server, as well as enable disabling calls to update server. Implements the requirement of #375
1 parent 286ecf1 commit 37b4db8

File tree

3 files changed

+27
-6
lines changed

3 files changed

+27
-6
lines changed

‎app/Http/Middleware/CheckUpdate.php‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,24 @@ public function handle(Request $request, Closure $next): mixed
3636
public function terminate(): void
3737
{
3838
Cache::remember('upstream_version',self::UPDATE_TIME,function() {
39+
if (! config('pla.update.enabled',TRUE)) {
40+
$return = new \stdClass;
41+
$return->action = 'disabled';
42+
43+
return $return;
44+
}
45+
3946
// CURL call to URL to see if there is a new version
4047
Log::debug(sprintf('CU_:Checking for updates for [%s]',config('app.version')));
4148

4249
$client = new Client;
4350

4451
try {
45-
$response = $client->request('POST',sprintf('%s/%s',self::UPDATE_SERVER,strtolower(config('app.version'))));
52+
$response = $client->request(
53+
method: 'POST',
54+
uri: sprintf('%s/%s',self::UPDATE_SERVER,strtolower(config('app.version'))),
55+
options: config('pla.update.proxy',[]),
56+
);
4657

4758
if ($response->getStatusCode() === 200) {
4859
$result = json_decode($response->getBody());

‎config/pla.php‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,4 +100,9 @@
100100
'uidnumber' => env('LDAP_TEMPLATE_UIDNUMBER_START', 1000),
101101
],
102102
],
103+
104+
'update' => [
105+
'enabled' => env('LDAP_UPDATE_ENABLED',FALSE),
106+
'proxy' => explode(',',env('LDAP_UPDATE_PROXY')),
107+
]
103108
];

‎resources/themes/architect/views/layouts/partials/topmenu.blade.php‎

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,24 +79,29 @@
7979

8080
@if(($x=Config::get('update_available')) && $x->action !== 'current')
8181
<li>
82-
@switch($x->action)
82+
@switch($x->action ?? NULL)
8383
@case('unable')
8484
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Upstream Version Unavailable">
8585
<i class="fas fa-fw fa-bolt fs-5"></i>
8686
</button>
8787
@break
8888
@case('upgrade')
89-
<button class="btn btn-warning p-1 m-1" data-bs-custom-class="custom-tooltip-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="Update Available:<br>{{ $x->version }}">
89+
<button class="btn btn-warning p-1 m-1" data-bs-custom-class="custom-tooltip-warning" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="@lang('Update Available'):<br>{{ $x->version }}">
9090
<i class="fas fa-fw fa-wrench fs-5"></i>
9191
</button>
9292
@break
9393
@case('mismatch')
94-
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="Version Issue - Upstream<br>{{ $x->version }}">
94+
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="@lang('Version Issue') - @lang('Upstream')<br>{{ $x->version }}">
9595
<i class="fas fa-fw fa-exclamation fs-5"></i>
9696
</button>
9797
@break
98-
@case('unknown')
99-
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="Version Issue - Unknown<br>{{ $x->version }}">
98+
@case('disabled')
99+
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="@lang('Version update check disabled by config')">
100+
<i class="fas fa-fw fa-ban fs-5"></i>
101+
</button>
102+
@break
103+
@default()
104+
<button class="btn btn-light opacity-2 p-1 m-1" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-html="true" title="@lang('Version Issue') - @lang('Unknown')<br>{{ $x->version }}">
100105
<i class="fas fa-fw fa-question fs-5"></i>
101106
</button>
102107
@break

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /