Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: imcsk8/diaspora-filemanager
...
head fork: imcsk8/diaspora-filemanager
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
View
3  .gitignore
@@ -19,7 +19,7 @@ vendor/bundle/*
vendor/cache/*
config/database.yml
config/ldap.yml
-config/locales/diaspora/es_UACH.yml
+config/locales/diaspora/es-UACH.yml
.rvmrc_custom
#Mailing list stuff
@@ -46,6 +46,7 @@ public/source.tar*
tmp/**/*
tmp/*
*.sqlite3
+public_html/*
# Temporary files of every sort
.sass-cache/*
View
12 app/controllers/user_files_controller.rb
@@ -56,13 +56,11 @@ def create
end
if create_object
respond_to do |format|
- Rails.logger.debug "DEBUG FILE SALVADA #{params[:text]} ";
format.json{ render(:layout => false , :json => {"success" => true, "data" => @file}.to_json )}
format.html{ redirect_to person_user_files_path + "/showdir/#{@currdir}"}
- Rails.logger.debug "DEBUG DESPUES de JSON";
end
else
- Rails.logger.debug "DEBUG FILE NO SALVADA #{message}";
+ Rails.logger.debug "DEBUG::problem saving file #{message}";
respond_with @file, :location => person_user_files_path, :error => message
end
@@ -109,13 +107,14 @@ def create_object
params[:filename] = params[:user_file].original_filename
params[:unixperms] = "-r-wr--r--"
else
- Rails.logger.debug "DEBUG ES DIRECTORIO #{params[:unixperms]}"
+ Rails.logger.debug "DEBUG it's a directory #{params[:unixperms]}"
params[:filename] = params[:user_file]
end
- Rails.logger.debug "CREATE FILE CON USERNAME #{params[:user_path]}/#{params[:filename]}"
+ Rails.logger.debug "DEBUG::Creating file #{params[:user_path]}/#{params[:filename]}"
begin
@file = current_user.build_post(:user_file, params)
rescue Exception => e
+ Rails.logger.debug "DEBUG::Error creating file #{e.message}"
raise e
end
@@ -252,6 +251,9 @@ def get_user_info
@currdir = "/"
@user_path = "#{UserFilesController.hashdir(current_user.username)}/#{current_user.username}"
aspects = current_user.aspects_from_ids(params[:aspect_ids])
+ aspect_ids = (session[:a_ids] ? session[:a_ids] : [])
+ @stream = Stream::Aspect.new(current_user, aspect_ids, :order => sort_order,
+ :max_time => params[:max_time].to_i)
if @person
@profile = @person.profile
@contact = current_user.contact_for(@person)
View
6 app/models/user.rb
@@ -186,7 +186,7 @@ def add_contact_to_aspect(contact, aspect)
def build_post(class_name, opts = {})
opts[:author] = self.person
opts[:diaspora_handle] = opts[:author].diaspora_handle
-
+
model_class = class_name.to_s.camelize.constantize
model_class.diaspora_initialize(opts)
end
@@ -523,15 +523,19 @@ def create_person
params[:filename] = "public"
begin
@file = self.build_post(:user_file, params)
+ Rails.logger.debug("DEBUG:: FILE: #{@file}")
rescue Exception => e
+ Rails.logger.debug("Cant' create post for public folder!! #{e.message}")
raise e
end
+ Rails.logger.debug("DEBUG:: FILE: #{@file}")
if @file.save
aspects = self.aspects_from_ids(params[:aspect_ids])
unless @file.pending
self.add_to_streams(@file, aspects)
self.dispatch_post(@file, :to => params[:aspect_ids])
end
+ File.symlink("#{Rails.root}/public/uploads/files/#{params[:path]}/public", "#{Rails.root}/public_html/#{self.username}")
else
return false
end
View
2  app/models/user_file.rb
@@ -70,7 +70,7 @@ def self.diaspora_initialize(params = {})
rescue Exception => e
if e.message =~ /No such file/
FileUtils.mkdir_p(newdir)
- return
+ return file
end
Rails.logger.debug "DEBUG ERROR CREANDO DIR: #{e.message}"
raise e
View
2  db/schema.rb
@@ -303,10 +303,10 @@
t.string "status_message_guid"
t.integer "likes_count", :default => 0
t.integer "comments_count", :default => 0
- t.integer "o_embed_cache_id"
t.string "filename"
t.string "path"
t.string "unixperms"
+ t.integer "o_embed_cache_id"
end
add_index "posts", ["author_id", "root_guid"], :name => "index_posts_on_author_id_and_root_guid", :unique => true

No commit comments for this range

Something went wrong with that request. Please try again.