redirection to login page after creating new user, account validation done, fill in all languages for names also done plus the name error in the backend for noname or half filled profile is also fixed

This commit is contained in:
Harry Bomrah 2013-11-27 19:29:23 +08:00 committed by saurabhbhatia
parent f32692c20a
commit 0338557a33
8 changed files with 21 additions and 11 deletions

View File

@ -29,7 +29,6 @@ class ApplicationController < ActionController::Base
end end
end end
def site_restart def site_restart
Resque.enqueue(RestartServer) Resque.enqueue(RestartServer)
end end

View File

@ -28,7 +28,7 @@ class BasicInfosController < ApplicationController
def role_update def role_update
user = User.find(params[:id]) user = User.find(params[:id])
if user.update_attributes(params[:user]) if user.update_attributes(params[:user])
redirect_to root_path redirect_to "/users/sign_in"
else else
@roles = Role.where(:disabled => false) @roles = Role.where(:disabled => false)
render :action => "role_page" render :action => "role_page"

View File

@ -60,14 +60,25 @@ class FacebookController< ApplicationController
if data["success"] if data["success"]
user = JSON.parse(data["user"]) user = JSON.parse(data["user"])
u = User.find(current_user.id) u = User.find(current_user.id)
u.first_name = user["first_name"] firstname = {}
u.last_name = user["last_name"] lastname = {}
@site_valid_locales.each do |locale|
firstname[locale] = user["first_name"]
lastname[locale] = user["last_name"]
end
u.first_name_translations = firstname
u.last_name_translations = lastname
u.office_tel = user["phone"] u.office_tel = user["phone"]
u.email = user["email"] u.email = user["email"]
# u.email = "xyz@zyx.com"
u.sex = user["gender"] || "unknown" u.sex = user["gender"] || "unknown"
u.remote_avatar_url = user["picture"] if user["picture"] u.remote_avatar_url = user["picture"] if user["picture"]
u.save! if u.save
render :json=>{"success"=>true,"user"=>user}.to_json render :json=>{"success"=>true,"user"=>user}.to_json
else
render :json=>{"success"=>false,"message"=>"Email already occupied."}.to_json
end
else else
render :json=>{"success"=>false,"message"=>data["message"]}.to_json render :json=>{"success"=>false,"message"=>data["message"]}.to_json
end end

View File

@ -16,7 +16,7 @@
<% end %> <% end %>
</td> </td>
<td> <td>
<%= link_to user_for_listing.name,admin_users_new_interface_path(user_for_listing) %> <%= link_to (user_for_listing.name ? user_for_listing.name : user_for_listing.user_id),admin_users_new_interface_path(user_for_listing) %>
<div class="quick-edit"> <div class="quick-edit">
<ul class="nav nav-pills"> <ul class="nav nav-pills">
<%= content_tag(:li, link_to(t(:edit),edit_admin_users_new_interface_path(user_for_listing))) if is_admin? %> <%= content_tag(:li, link_to(t(:edit),edit_admin_users_new_interface_path(user_for_listing))) if is_admin? %>

View File

@ -18,7 +18,7 @@
<%= image_tag(user_for_summary.avatar) %> <%= image_tag(user_for_summary.avatar) %>
</div> </div>
<div class="member-info"> <div class="member-info">
<h4 class="member-name"><%= link_to user_for_summary.name,admin_users_new_interface_path(user_for_summary)%></h4> <h4 class="member-name"><%= link_to (user_for_summary.name ? user_for_summary.name : user_for_summary.user_id),admin_users_new_interface_path(user_for_summary)%></h4>
<div class="member-mail muted"><%= user_for_summary.email%></div> <div class="member-mail muted"><%= user_for_summary.email%></div>
<hr> <hr>
<ul class="member-roles"> <ul class="member-roles">

View File

@ -18,5 +18,5 @@
</div> </div>
<%= image_tag(user_for_thumbnail.avatar) %> <%= image_tag(user_for_thumbnail.avatar) %>
</div> </div>
<h4 class="member-name text-center"><%= link_to user_for_thumbnail.name,admin_users_new_interface_path(user_for_thumbnail)%></h4> <h4 class="member-name text-center"><%= link_to (user_for_thumbnail.name ? user_for_thumbnail.name : user_for_thumbnail.user_id),admin_users_new_interface_path(user_for_thumbnail)%></h4>
</li> </li>

View File

@ -28,7 +28,7 @@
timeInterval = setInterval(function(){ timeInterval = setInterval(function(){
if( facebookWindow.closed ){ if( facebookWindow.closed ){
clearInterval(timeInterval); clearInterval(timeInterval);
$(".msg").removeClass('hide').find("h4").text("Importing,please wait..."); $(".msg").removeClass('hide alert-danger').find("h4").text("Importing,please wait...");
$.ajax({ $.ajax({
url : "/facebook/profile_import", url : "/facebook/profile_import",
data : {"user_id":"<%= @user.id.to_s %>"}, data : {"user_id":"<%= @user.id.to_s %>"},

View File

@ -6,7 +6,7 @@
"type": "sftp", "type": "sftp",
"save_before_upload": true, "save_before_upload": true,
"upload_on_save": false, "upload_on_save": true,
"sync_down_on_open": false, "sync_down_on_open": false,
"sync_skip_deletes": false, "sync_skip_deletes": false,
"confirm_downloads": false, "confirm_downloads": false,