+ /*
+ Check and disable incompatible extensions.
+ */
+ function update_extensions()
+ {
+ global $version;
+
+ $mods = get_company_extensions();
+ $exts = get_company_extensions($this->cur_company);
+
+ $fixed = false;
+ foreach($mods as $key => $ins) {
+ foreach($exts as $ext)
+ if ($ext['name'] == $ins['name'] && (!check_src_ext_version($ins['version']))) {
+ $mods[$key]['active'] = false;
+ $this->log_error(sprintf(_("Uncompatible extension '%s' disabled for company %d."), $ins['name'], $this->cur_company), 'Notice');
+ $fixed = true;
+ continue 2;
+ }
+ }
+ if ($fixed)
+ write_extensions($mods, $this->cur_company);
+ }
+