app/controllers/clientsportal_controller.rb
#
# Updates client password if everything is OK and redirects to show_profile.    
#
Updates client password if everything is OK and redirects to show_profile.
Updates client password if everything is OK and redirects to show_profile .
def update_client_password
        @client_login = @current_client.clients_logins.find_by_login( session[:client_login] )
        if @client_login.nil?
          flash[:error] = "We are sorry, but your login was removed by administrator"
          redirect_to :action => 'logout' and return            
        end
        @client_login.force_checking_password = true
        if @client_login.update_attributes(params[:client_login])
          flash[:notice] = 'Individual password has been successfully updated'
          redirect_to :action => 'show_profile'
        else
          render :action => :edit_client_password
        end
      end
def update_client_password @client_login = @current_client . clients_logins . find_by_login ( session [ :client_login ] ) if @client_login . nil? flash [ :error ] = "We are sorry, but your login was removed by administrator" redirect_to :action => 'logout' and return end @client_login . force_checking_password = true if @client_login . update_attributes ( params [ :client_login ] ) flash [ :notice ] = 'Individual password has been successfully updated' redirect_to :action => 'show_profile' else render :action => :edit_client_password end end
Updates client password if everything is OK and redirects to show_profile.
Updates client password if everything is OK and redirects to show_profile .
# Check if client login has been found #        unless @client_login.password_equals? params[:old_password] #          flash[:error] = "Current password is typed incorrectly" #          redirect_to :action => 'edit_client_password' and return   #        end