0

i am using asynchttp for do_login. but am using syncengine in all other session.. i have to change everything to asynchttp... how to do it.?? if i do like this my rhodes models are working and i can able to enter to the models after authenticating username and password. my codings...

def do_login

if @params['login']=="dummy" and @params['password']=="dummy"
begin
   result=Rho::AsyncHttp.get(
   :url => "http://localhost/juby/new.php",
    )
   @msg=result["body"]
   render :action => :index

  rescue Rho::RhoError => e
  @msg = e.message
end

else

@msg = Rho::RhoError.err_message(Rho::RhoError::ERR_UNATHORIZED) unless @msg && @msg.length > 4
render :action => :login
end

end

def logout

  SyncEngine.logout
  @msg = "You have been logged out."
  render :action => :login
end

def reset

  render :action => :reset
end

def do_reset
  Rhom::Rhom.database_full_reset
  SyncEngine.dosync
  @msg = "Database has been reset."
  redirect :action => :index, :query => {:msg => @msg}
end

def do_sync
  SyncEngine.dosync
  @msg =  "Sync has been triggered."
  redirect :action => :index, :query => {:msg => @msg}
end
end

After login i direct to index page. there the codings used are

<%if SyncEngine::logged_in > 0 %>

<a href="<%= url_for :controller => :index, :action => :do_sync %>" class="ui-btn-left" data-icon="refresh">
  Sync
</a>
<a href="<%= url_for :controller => :index, :action => :logout %>" class="ui-btn-right" data-icon="star">
    Logout
  </a>
<% else %>
    <a href="<%= url_for :controller => :Settings, :action => :login %>" class="ui-btn-right" data-icon="star">Login</a>
<% end %>

Since "if SyncEngine::logged_in > 0".... the statement is not working...

Friends please help me to make this statement working...how to change everything in asynchttp????? and in my project since link to the rhodes model is in first page we can able to enter in to models without using login page. please tell me how to block this section if try to enter without login....

LU RD
  • 34,438
  • 5
  • 88
  • 296
juby
  • 1
  • 2

1 Answers1

0

you can remove it if you don't want to use login, which will not affect to your other controller. You can comment the login section.

Let me know if you need any help.

Rameshwar Vyevhare
  • 2,699
  • 2
  • 28
  • 34