Permalink
Browse files

[xupdate] correction 'trust_dirname' storing process

  • Loading branch information...
nao-pon committed Apr 15, 2015
1 parent c88ef01 commit 833a778271ee07bda718c9d4b17772789dffe350
Showing with 24 additions and 9 deletions.
  1. +24 −9 xoops_trust_path/modules/xupdate/class/handler/ModuleStore.class.php
@@ -130,21 +130,36 @@ public function setmModule($readini = true)
}
}
if ( empty($trust_dirname) ){
if ( isset($this->modinfo['trust_dirname']) || !empty($this->modinfo['trust_dirname']) ){
$this->mModule->setVar('trust_dirname',$this->modinfo['trust_dirname']);
}elseif ( !isset($this->modinfo['trust_dirname']) || empty($this->modinfo['trust_dirname']) ){
if (!isset($this->modinfo['trust_dirname'])) {
$this->modinfo['trust_dirname'] = '';
}
if (empty($trust_dirname) && $this->getVar('target_type') === 'TrustModule'){
if ($this->modinfo['trust_dirname']){
$trust_dirname = $this->modinfo['trust_dirname'];
} else {
//for d3modules
if ( file_exists(XOOPS_MODULE_PATH.'/'.$this->getVar('dirname').'/mytrustdirname.php') ) {
$mytrustdirname='';
$mytrustdirname = '';
include XOOPS_MODULE_PATH.'/'.$this->getVar('dirname').'/mytrustdirname.php';
$trust_dirname = $mytrustdirname;
$this->modinfo['trust_dirname'] = $mytrustdirname;
$this->mModule->setVar('trust_dirname',$mytrustdirname);
}
}
$hModule->insert($this->mModule);
}else{
if ( !isset($this->modinfo['trust_dirname']) || empty($this->modinfo['trust_dirname']) ){
if ($trust_dirname) {
// update XCL core module info
$this->mModule->setVar('trust_dirname', $trust_dirname);
$hModule->insert($this->mModule);
}
} else {
if ($trust_dirname && $this->getVar('target_type') !== 'TrustModule') {
// 以前の X-update では。TrustMode ではないモジュールなのに
// なぜか mytrustdirname.php が存在するモジュールに対し、
// 誤って XCL Core の modules テーブルの trust_name を登録してしまっていたので、その対応。
$this->modinfo['trust_dirname'] = $trust_dirname = '';
$this->mModule->setVar('trust_dirname', $trust_dirname);
$hModule->insert($this->mModule);
}
if ($trust_dirname && !$this->modinfo['trust_dirname']){
$this->modinfo['trust_dirname'] = $trust_dirname;
}
}

0 comments on commit 833a778

Please sign in to comment.