Hello,
I saw my alerts aren't working anymore and I started to study the code.
In cron.php i found
osc_do_auto_upgrade();
Is this autoupdating some scripts or db in osclass?
function osc_do_auto_upgrade() {
$data = osc_file_get_contents('http://osclass.org/latest_version_v1.php?callback=?');
$data = preg_replace('|^\?\((.*?)\);$|', '$01', $data);
$json = json_decode($data);
$result['error'] = 0;
if(isset($json->version)) {
if ($json->version > osc_version()) {
osc_set_preference('update_core_json', $data);
if (osc_check_dir_writable()) {
if (substr($json->version, 0, 1) != substr(osc_version(), 0, 1)) {
// NEW BRANCH
if (strpos(osc_auto_update(), 'branch') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
} else if (substr($json->version, 1, 1) != substr(osc_version(), 1, 1)) {
// MAJOR RELEASE
if (strpos(osc_auto_update(), 'branch') !== false || strpos(osc_auto_update(), 'major') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
} else if (substr($json->version, 2, 1) != substr(osc_version(), 2, 1)) {
// MINOR RELEASE
if (strpos(osc_auto_update(), 'branch') !== false || strpos(osc_auto_update(), 'major') !== false || strpos(osc_auto_update(), 'minor') !== false) {
osc_run_hook('before_auto_upgrade');
$result = osc_do_upgrade();
osc_run_hook('after_auto_upgrade', $result);
}
}
}
} else {
osc_set_preference('update_core_json', '');
}
osc_set_preference('last_version_check', time());
} else {
osc_set_preference('update_core_json', '');
osc_set_preference('last_version_check', time() - 23*3600);
}
if($result['error']==0 || $result['error']==6) {
if(strpos(osc_auto_update(), 'plugins')!==false) {
$total = osc_check_plugins_update(true);
if($total>0) {
$elements = osc_get_preference('plugins_to_update');
foreach($elements as $element) {
if(osc_is_update_compatible('plugins', $element, $json->s_name)) {
osc_market('plugins', $element);
}
}
}
}
if(strpos(osc_auto_update(), 'themes')!==false) {
$total = osc_check_themes_update(true);
if($total>0) {
$elements = osc_get_preference('themes_to_update');
foreach($elements as $element) {
if(osc_is_update_compatible('themes', $element, $json->s_name)) {
osc_market('themes', $element);
}
}
}
}
if(strpos(osc_auto_update(), 'languages')!==false) {
$total = osc_check_languages_update(true);
if($total>0) {
$elements = osc_get_preference('languages_to_update');
foreach($elements as $element) {
if(osc_is_update_compatible('languages', $element, $json->s_name)) {
osc_market('languages', $element);
}
}
}
}
}
}
EDIT.
In oc-admin all of my auto update preferences are off.
EDIT AGAIN.
I think this is doing nothing if in oc-admin all autoupgrade options are off.