Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/maven/fixes/8.1' into maven/feat…
Browse files Browse the repository at this point in the history
…ure/ltiplatform-8.1
  • Loading branch information
thomschke committed Dec 10, 2022
2 parents 8222b94 + 961c020 commit bcec80e
Show file tree
Hide file tree
Showing 31 changed files with 526 additions and 179 deletions.
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
variables:
MAVEN_CLI: "-Ddocker.registry=$DOCKER_REGISTRY -Dhelm.deploy.url=$HELM_REGISTRY -Dhelm.deploy.type=$HELM_TYPE -Dmaven.deploy.releases=$MAVEN_DEPLOY_RELEASES -Dmaven.deploy.snapshots=$MAVEN_DEPLOY_SNAPSHOTS --batch-mode --errors --fail-fast --show-version -T 1C"
MAVEN_CLI: "-Ddocker.registry=$DOCKER_REGISTRY -Dhelm.deploy.url=$HELM_REGISTRY -Dhelm.deploy.type=$HELM_TYPE -Dmaven.deploy.releases=$MAVEN_DEPLOY_RELEASES -Dmaven.deploy.snapshots=$MAVEN_DEPLOY_SNAPSHOTS --batch-mode --errors --fail-fast --show-version"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"

default:
Expand Down
9 changes: 9 additions & 0 deletions src/main/php/admin/update/update.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,15 @@ function run($installedVersion) {
file_put_contents(MC_ROOT_PATH . 'conf/system.conf.php', 'DEFINE("ENABLE_VIEWER_JS", true); # toggle viewer.js for office documents', FILE_APPEND | LOCK_EX);
}

if(version_compare ( '6.0.102', $installedVersion ) > 0) {
$viewer_js_conf = "VIEWER_JS_CONFIG = [
'pdf',
//'office',
//'spreadsheet'
];";
file_put_contents(MC_ROOT_PATH . 'conf/system.conf.php', $viewer_js_conf, FILE_APPEND | LOCK_EX);
}


} catch ( Exception $e ) {
error_log ( print_r ( $e, true ) );
Expand Down
2 changes: 1 addition & 1 deletion src/main/php/admin/vendor/.htaccess
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Order Deny,Allow
Deny from all
Allow from localhost
Allow from 127.0.0.1
Allow from 127.0.0.0/8 ::1
12 changes: 10 additions & 2 deletions src/main/php/func/classes.new/ESModule.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ final public function setName($ESMODULE_NAME)
*/
final public function setModuleByMimetype($p_mimetype)
{
global $VIEWER_JS_CONFIG;

// use only MIME's "type/subtype" specification, skip optional parameters
$MimeTypeParts = explode(';', $p_mimetype);
$MimeType = $MimeTypeParts[0];
Expand All @@ -150,8 +152,14 @@ final public function setModuleByMimetype($p_mimetype)
}

$modName = $result -> ESMODULE_NAME;
if (!ENABLE_VIEWER_JS && $modName == 'office'){
$modName = 'doc';
$viewer_js_modules = [
'pdf',
'office',
'spreadsheet'
];
if (!ENABLE_VIEWER_JS && $modName == 'office' ||
ENABLE_VIEWER_JS && in_array($modName, $viewer_js_modules) && !in_array($modName, $VIEWER_JS_CONFIG) ){
$modName = 'doc';
}

Logger::getLogger('de.metaventis.esrender.index') -> info('Mimetype is "'.$MimeType.'", using module "'.$modName.'".');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public function process($p_kind, $objectLocked = false) {
else {
exec($cmd . ">> ". $logfile . " 2>&1 &");
}
//exec("php " . dirname(__FILE__) . "/Converter.php > /dev/null 2>/dev/null &");



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function getCacheFileName()
* @see ESRender_Module_Base::createInstance()
*/
public function createInstance() {
global $CC_RENDER_PATH;
global $CC_RENDER_PATH, $VIEWER_JS_CONFIG;;
ini_set('memory_limit', '4000M');
$Logger = $this->getLogger();

Expand All @@ -45,8 +45,14 @@ public function createInstance() {
$this->filename = $this-> esObject ->getObjectIdVersion();

$module = $this->esObject->module->getName();
if (!ENABLE_VIEWER_JS && strpos($module, 'office') !== false){
$module = 'doc';
$viewer_js_modules = [
'pdf',
'office',
'spreadsheet'
];
if (!ENABLE_VIEWER_JS && strpos($module, 'office') !== false ||
ENABLE_VIEWER_JS && in_array($module, $viewer_js_modules) && !in_array($module, $VIEWER_JS_CONFIG) ){
$module = 'doc';
}

// real path
Expand Down
Loading

0 comments on commit bcec80e

Please sign in to comment.