+ def check_database_writable(need_api = false)
+ if OSM_STATUS == :database_offline or OSM_STATUS == :database_readonly or
+ (need_api and (OSM_STATUS == :api_offline or OSM_STATUS == :api_readonly))
+ redirect_to :controller => 'site', :action => 'offline'
+ end
+ end
+
+ def check_api_readable