Commit 013774ba authored by Dries's avatar Dries

- Patch #235821 by kbahey and pwolanin: include upgrade path for cron changes,...

- Patch #235821 by kbahey and pwolanin: include upgrade path for cron changes, improved security of key.
parent b8957cad
......@@ -408,9 +408,9 @@ function system_install() {
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'node_options_forum', 'a:1:{i:0;s:6:"status";}');
$cron_key = md5(time());
$cron_key = serialize(md5(mt_rand()));
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'cron_key', serialize($cron_key));
db_query("INSERT INTO {variable} (name, value) VALUES ('%s', '%s')", 'cron_key', $cron_key);
}
/**
......@@ -2658,6 +2658,17 @@ function system_update_7000() {
return $ret;
}
/**
* Generate a cron key and save it in the variables table
*/
function system_update_7001() {
$ret = array();
variable_set('cron_key', md5(mt_rand()));
$ret[] = array('success' => TRUE, 'query' => "variable_set('cron_key')");
return $ret;
}
/**
* @} End of "defgroup updates-6.x-to-7.x"
* The next series of updates should start at 8000.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment