mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
check for new versions
This commit is contained in:
parent
55a8d7275f
commit
100909a910
|
@ -30,9 +30,16 @@ if (!$user->isAdmin()) {
|
|||
}
|
||||
|
||||
$v = new SeedDMS_Version;
|
||||
if(@ini_get('allow_url_fopen') == '1') {
|
||||
$lines = file('http://www.seeddms.org/latest', FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES);
|
||||
$versions = array();
|
||||
foreach($lines as $line) {
|
||||
$versions[] = explode(':', $line);
|
||||
}
|
||||
}
|
||||
|
||||
$tmp = explode('.', basename($_SERVER['SCRIPT_FILENAME']));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'version'=>$v));
|
||||
$view = UI::factory($theme, $tmp[1], array('dms'=>$dms, 'user'=>$user, 'version'=>$v, 'availversions'=>$versions));
|
||||
if($view) {
|
||||
$view->show();
|
||||
exit;
|
||||
|
|
|
@ -35,11 +35,24 @@ class SeedDMS_View_Info extends SeedDMS_Bootstrap_Style {
|
|||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
$version = $this->params['version'];
|
||||
$availversions = $this->params['availversions'];
|
||||
|
||||
$this->htmlStartPage(getMLText("admin_tools"));
|
||||
$this->globalNavigation();
|
||||
$this->contentStart();
|
||||
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
if($availversions) {
|
||||
$newversion = '';
|
||||
foreach($availversions as $availversion) {
|
||||
if($availversion[0] == 'stable')
|
||||
$newversion = $availversion[1];
|
||||
}
|
||||
if($newversion > $version->_number) {
|
||||
$this->warningMsg(getMLText('no_current_version', array('latestversion'=>$newversion)));
|
||||
}
|
||||
} else {
|
||||
$this->warningMsg(getMLText('no_version_check'));
|
||||
}
|
||||
$this->contentContainerStart();
|
||||
echo $version->banner();
|
||||
$this->contentContainerEnd();
|
||||
|
|
Loading…
Reference in New Issue
Block a user