diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-03-21 08:52:25 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-03-21 08:52:25 +0000 |
commit | 013774ba79c5589f0a1abf653518f5b3aeffa081 (patch) | |
tree | a7ded9b853f2aec2d31b48191c2fcdb24ec554b3 | |
parent | b8957cad97f01c177d8b3524915a4188c3d42d86 (diff) | |
download | brdo-013774ba79c5589f0a1abf653518f5b3aeffa081.tar.gz brdo-013774ba79c5589f0a1abf653518f5b3aeffa081.tar.bz2 |
- Patch #235821 by kbahey and pwolanin: include upgrade path for cron changes, improved security of key.
-rw-r--r-- | modules/system/system.install | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/modules/system/system.install b/modules/system/system.install index c1854b20f..fc78a4db2 100644 --- a/modules/system/system.install +++ b/modules/system/system.install @@ -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); } /** @@ -2659,6 +2659,17 @@ function system_update_7000() { } /** + * 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. */ |