/**
  * Generate a new API key and add it to the database. 
  */
 static function doGenerate()
 {
     $new_random_key = sha1(rand() . ctrl_options::GetOption('server_ip'));
     ctrl_options::SetSystemOption('apikey', $new_random_key);
     self::$updated = true;
     return true;
 }