Fix login and label. Check sync jobs and update info function.

This commit is contained in:
Matthew K. Fu JuYuan committed 2012-05-24 17:01:00 +08:00
1 parent c062b43069
commit 3480fa2545
8 files changed
+61 -38

No files matched your search

+2 -2
View File
@@ -15,10 +15,10 @@ class SessionsController < Devise::SessionsController
if $nccu_ldap_connection.bind
logger.info "=LDAP Binded password ok..."
result =check_auth_with_ldap(login_uid,login_password)
if result && login_password!=''
if result #&& login_password!=''
logger.info "==LDAP password passed..."
nccu_id = get_nccu_id_from_mid_site(login_uid)
resource = nccu_id.nil? ? nil : (User.first(conditions:{ nccu_id: nccu_id }))
resource = nccu_id.nil? ? nil : (User.first(conditions:{ nccu_ldap_uid: nccu_id }))
# resource = env['warden'].authenticate!(:check_nccu_ldap)
# resource = warden.authenticate!(:scope => resource_name, :recall => "#{controller_path}#new")
set_flash_message(:notice, :signed_in) if is_navigational_format?
+8
View File
@@ -0,0 +1,8 @@
class BackupServer
@queue = :high
def self.perform()
CronMail.time_check("Going to backup Orbit").deliver
# %x[touch #{Rails.root}/tmp/restart]
end
end
-8
View File
@@ -1,8 +0,0 @@
class RestartServer
@queue = :high
def self.perform()
CronMail.time_check("Going to restarting Orbit").deliver
%x[touch #{Rails.root}/tmp/restart]
end
end
+8
View File
@@ -4,6 +4,7 @@ class SyncDb
def self.perform()
self.start_sync
self.set_admin
end
def self.start_sync
@@ -12,4 +13,11 @@ class SyncDb
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
puts "SyncDb Synced"
end
def self.set_admin
task = 'mid_site:install_admin'
args = []
%x[rake #{task} --trace >> #{Rails.root}/log/rake.log]
puts "Admin done"
end
end
+3 -3
View File
@@ -11,12 +11,12 @@
<p class="alert hide">You need to sign in or sign up before continuing.</p>
<div class="main">
<div class="control-group clear">
<%= f.label :nccu_ldap_uid %>
<%= f.text_field :nccu_ldap_uid, :placeholder => t("nccu"), :style => "width: 330px;" %>
<%= f.label :nccu_ldap_uid ,t("nccu_c.nccu_ldap_uid")%>
<%= f.text_field :nccu_ldap_uid, :placeholder => t("nccu_c.nccu_ldap_uid"), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
</div>
<div class="control-group clear">
<%= f.label :password %>
<%= f.label :password,t("password") %>
<%= f.password_field :password, :placeholder => t(:dots), :style => "width: 330px;" %>
<span class="help-inline">Please correct the error</span>
<%= link_to t(:forgot_password), new_user_password_path, :class => 'pull-right forgot hide' %>