Subversion Repositories oidplus

Compare Revisions

Regard whitespace Rev 653 → Rev 654

/trunk/plugins/viathinksoft/adminPages/900_software_update/OIDplusPageAdminSoftwareUpdate.class.php
41,11 → 41,11
// Download and unzip
 
if (function_exists('gzdecode')) {
$url = "https://www.oidplus.com/updates/update_".($rev-1)."_to_".($rev).".txt.gz"; // TODO: in consts.ini
$url = sprintf(parse_ini_file(__DIR__.'/consts.ini')['update_package_gz'], $rev-1, $rev);
$cont = url_get_contents($url);
if ($cont !== false) $cont = @gzdecode($cont);
} else {
$url = "https://www.oidplus.com/updates/update_".($rev-1)."_to_".($rev).".txt"; // TODO: in consts.ini
$url = sprintf(parse_ini_file(__DIR__.'/consts.ini')['update_package'], $rev-1, $rev);
$cont = url_get_contents($url);
}
 
145,10 → 145,9
 
if (!$newest_version) {
$out['text'] .= '<p><font color="red">'._L('OIDplus could not determine the latest version. Probably the ViaThinkSoft server could not be reached.').'</font></p>';
}
else if (!$local_installation) {
} else if (!$local_installation) {
$out['text'] .= '<p><font color="red">'._L('OIDplus could not determine its version. (Required: %1). Please update your system manually via the "%2" command regularly.',$requireInfo,$updateCommand).'</font></p>';
} else if ($local_installation == $newest_version) {
} else if (substr($local_installation,4) >= substr($newest_version,4)) {
$out['text'] .= '<p><font color="green">'._L('You are already using the latest version of OIDplus.').'</font></p>';
} else {
$out['text'] .= '<p><font color="blue">'._L('Please enter %1 into the SSH shell to update OIDplus to the latest version.','<code>'.$updateCommand.'</code>').'</font></p>';
181,8 → 180,7
if (!$newest_version) {
$out['text'] .= '<p><font color="red">'._L('OIDplus could not determine the latest version. Probably the ViaThinkSoft server could not be reached.').'</font></p>';
$out['text'] .= '</div>';
}
else if ($local_installation == $newest_version) {
} else if (substr($local_installation,4) >= substr($newest_version,4)) {
$out['text'] .= '<p><font color="green">'._L('You are already using the latest version of OIDplus.').'</font></p>';
$out['text'] .= '</div>';
} else {
241,7 → 239,7
 
try {
if (is_null($this->releases_ser)) {
$url = "https://www.oidplus.com/updates/releases.ser"; // TODO: in consts.ini
$url = parse_ini_file(__DIR__.'/consts.ini')['revisionlog'];
$cont = url_get_contents($url);
if ($cont === false) return false;
$this->releases_ser = $cont;
269,7 → 267,7
private function getLatestRevision() {
try {
if (is_null($this->releases_ser)) {
$url = "https://www.oidplus.com/updates/releases.ser"; // TODO: in consts.ini
$url = parse_ini_file(__DIR__.'/consts.ini')['revisionlog'];
$cont = url_get_contents($url);
if ($cont === false) return false;
$this->releases_ser = $cont;
/trunk/plugins/viathinksoft/adminPages/900_software_update/consts.ini
1,3 → 1,6
[SoftwareUpdate]
svn = https://svn.viathinksoft.com/svn/oidplus
github = https://github.com/danielmarschall/oidplus
revisionlog = https://www.oidplus.com/updates/releases.ser
update_package = https://www.oidplus.com/updates/update_%s_to_%s.txt
update_package_gz = https://www.oidplus.com/updates/update_%s_to_%s.txt.gz
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/OIDplusPageAdminSystemFileCheck.class.php
62,7 → 62,10
 
try {
$mine = self::getDirContents(OIDplus::localpath());
$theirs = self::checksumFileToArray('https://www.oidplus.com/checksums/svn-rev'.$ver.'.txt'); // TODO: in consts.ini
$theirs = self::checksumFileToArray(sprintf(parse_ini_file(__DIR__.'/consts.ini')['checksum_file'],$ver));
if ($theirs === false) {
throw new OIDplusException(_L("Cannot download checksum file. Please try again later."));
}
 
$num = 0;
 
171,10 → 174,11
 
private static function checksumFileToArray($checksumfile) {
$out = array();
$lines = @file($checksumfile);
if (!$lines) {
throw new OIDplusException(_L("Cannot download checksum file. Please try again later."));
}
 
$cont = url_get_contents($checksumfile);
if ($cont === false) return false;
$lines = explode("\n", $cont);
 
foreach ($lines as $line) {
$line = trim($line);
if ($line == '') continue;
/trunk/plugins/viathinksoft/adminPages/902_systemfile_check/consts.ini
0,0 → 1,2
[SoftwareUpdate]
checksum_file = https://www.oidplus.com/checksums/svn-rev%s.txt