DG MS; added route for exported xml

This commit is contained in:
danielvincent 2010-10-07 14:21:53 -07:00
parent 7a3d168123
commit 8f1973815e
2 changed files with 8 additions and 1 deletions

View file

@ -4,6 +4,7 @@
class UsersController < ApplicationController class UsersController < ApplicationController
require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__) require File.expand_path('../../../lib/diaspora/ostatus_builder', __FILE__)
require File.expand_path('../../../lib/diaspora/exporter', __FILE__)
before_filter :authenticate_user!, :except => [:new, :create, :public] before_filter :authenticate_user!, :except => [:new, :create, :public]
@ -56,6 +57,11 @@ class UsersController < ApplicationController
end end
end end
def export
exporter = Diaspora::Exporter.new(Diaspora::Exporters::XML)
render :xml => exporter.execute(current_user)
end
private private
def prep_image_url(params) def prep_image_url(params)
url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/' url = APP_CONFIG[:pod_url].chop if APP_CONFIG[:pod_url][-1,1] == '/'

View file

@ -14,6 +14,7 @@ Diaspora::Application.routes.draw do
:password => "devise/passwords"} :password => "devise/passwords"}
# added public route to user # added public route to user
match 'public/:username', :to => 'users#public' match 'public/:username', :to => 'users#public'
match 'users/export', :to => 'users#export'
resources :users, :except => [:create, :new, :show] resources :users, :except => [:create, :new, :show]
match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends' match 'aspects/move_friends', :to => 'aspects#move_friends', :as => 'move_friends'