fixes #2134 make sure database is writeable before new version notification

This commit is contained in:
plegall
2024-03-13 11:11:48 +01:00
parent 4d26c62470
commit d69bc8b884
2 changed files with 31 additions and 0 deletions
+23
View File
@@ -1421,6 +1421,29 @@ SELECT param, value
trigger_notify('load_conf', $condition);
}
/**
* Is the config table currentable writeable?
*
* @since 14
*
* @return boolean
*/
function pwg_is_dbconf_writeable()
{
list($param, $value) = array('pwg_is_dbconf_writeable_'.generate_key(12), date('c').' '.generate_key(20));
conf_update_param($param, $value);
list($dbvalue) = pwg_db_fetch_row(pwg_query('SELECT value FROM '.CONFIG_TABLE.' WHERE param = \''.$param.'\''));
if ($dbvalue != $value)
{
return false;
}
conf_delete_param($param);
return true;
}
/**
* Add or update a config parameter
*