Skip to content
Extraits de code Groupes Projets
Valider 8f197381 rédigé par danielvincent's avatar danielvincent
Parcourir les fichiers

DG MS; added route for exported xml

parent 7a3d1681
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -4,6 +4,7 @@ ...@@ -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 ...@@ -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] == '/'
......
...@@ -14,7 +14,8 @@ Diaspora::Application.routes.draw do ...@@ -14,7 +14,8 @@ 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'
resources :users, :except => [:create, :new, :show] match 'users/export', :to => 'users#export'
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'
match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend' match 'aspects/move_friend', :to => 'aspects#move_friend', :as => 'move_friend'
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter