1515use OCA \Libresign \Handler \SignEngine \JSignPdfHandler ;
1616use OCA \Libresign \Helper \ConfigureCheckHelper ;
1717use OCA \Libresign \Helper \JavaHelper ;
18+ use OCP \App \IAppManager ;
1819use OCP \IAppConfig ;
20+ use OCP \IURLGenerator ;
1921use Psr \Log \LoggerInterface ;
2022
2123class ConfigureCheckService {
@@ -26,6 +28,8 @@ public function __construct(
2628 private IAppConfig $ appConfig ,
2729 private SystemConfig $ systemConfig ,
2830 private AppConfig $ ocAppConfig ,
31+ protected IAppManager $ appManager ,
32+ protected IURLGenerator $ urlGenerator ,
2933 private JSignPdfHandler $ jSignPdfHandler ,
3034 private CertificateEngineFactory $ certificateEngineFactory ,
3135 private SignSetupService $ signSetupService ,
@@ -351,9 +355,17 @@ private function getErrorAndTipToResultOfVerify(array $result, string $resource)
351355 }
352356 }
353357 $ this ->logger ->error ('Invalid hash of binaries files ' , ['result ' => $ result ]);
358+ if ($ this ->appManager ->isEnabledForUser ('logreader ' )) {
359+ return [
360+ 'Invalid hash of binaries files. ' ,
361+ 'Check your nextcloud.log file on '
362+ . $ this ->urlGenerator ->linkToRouteAbsolute ('settings.adminsettings.form ' , ['section ' => 'logging ' ])
363+ . ' and run occ libresign:install --all ' ,
364+ ];
365+ }
354366 return [
355367 'Invalid hash of binaries files. ' ,
356- 'Check your nextcloud.log file an run occ libresign:install --all ' ,
368+ 'Check your nextcloud.log file and run occ libresign:install --all ' ,
357369 ];
358370 }
359371
0 commit comments