Skip to content

Commit

Permalink
Merge pull request #175 from opennetadmin/develop
Browse files Browse the repository at this point in the history
Found an issue with check version logic as well as sys_config editing…
  • Loading branch information
mattpascoe authored May 30, 2023
2 parents 5270ea3 + 1c748eb commit 44c67c1
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v19.0.0
v19.0.1
2 changes: 2 additions & 0 deletions www/winc/app_sysconf_edit.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ function ws_save($window_name, $form='') {
array('name' => $form['name'],
'value' => $form['value'],
'description' => $form['description'],
'field_validation_rule' => '',
'failed_rule_text' => '',
'editable' => 1,
'deleteable' => 1)
);
Expand Down
20 changes: 12 additions & 8 deletions www/workspace_plugins/builtin/desktop_versioncheck/main.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
Since fopen is required, I had been getting 'unable to determine' messages.
I was able to fix it by adding the following to my apache config for the ona site
php_admin_flag allow_url_fopen on
php_admin_flag allow_url_fopen on # not sure this is required anymore?
*/

$title_right_html = '';
Expand All @@ -17,11 +17,13 @@
// Display only on the desktop
if ($extravars['window_name'] == 'html_desktop') {
// Dont perform a version check if the user has requested not to
if (!array_key_exists('skip_version_check', $conf)) {
if (!$conf['skip_version_check']) {
//@ini_set('user_agent',$_SERVER['HTTP_USER_AGENT']."-----".$conf['version']);

// Define the URL we use to check what version is the latest release
$ona_check_version_url = 'http://checkversion.opennetadmin.com';
$onaver = 'Unable to determine';
$buffer = '';

if ($ona_check_version_url) {
$stream_opts = array(
Expand Down Expand Up @@ -49,15 +51,17 @@
$timeout = 2;
$old = @ini_set('default_socket_timeout', $timeout);
$file = @fopen($ona_check_version_url, 'r', false, $context);
@ini_set('default_socket_timeout', $old);
stream_set_timeout($file, $timeout);
#stream_set_blocking($file, 0);
if (!$file) {
$onaver="Unable to reach check version server";
} else {
@ini_set('default_socket_timeout', $old);
stream_set_timeout($file, $timeout);
#stream_set_blocking($file, 0);
}
//}
}

$onaver = 'Unable to determine';
$buffer = '';
if (isset($file)) {
if (isset($file) && $file != false) {
while (!feof ($file)) {
$buffer .= trim(fread ($file, 1024));
}
Expand Down

0 comments on commit 44c67c1

Please sign in to comment.