<commit_before>class Admin::PublicUserController < ApplicationController

  private

  def login_public_user klass,login,password,options={}
    flash[:error]=nil
    if request.post? && params[:user]
      user = klass.authenticate(params[:user][login],params[:user][password])
      loged_in=yield user if user
      if user && loged_in
        register_user_in_session user
        redirect_to options[:login_url] || home_url
      else
        flash[:error]=flash[:error] || I18n.t(:"flash.login failed")
      end
    else
      redirect_to options[:login_url] || home_url if logged_in?
    end
  end
  
  def remember_me(user)
    cookies.delete :remember_me unless user.remember_token
    domain=request.domain()
    if params[:remember_me] && !user.remember_token
      user.update_attributes!(:remember_token=>Digest::SHA1.hexdigest("$$#{Time.now.to_s}$$#{params[:login]}$$"))<commit_msg>Flash ir public user changed<commit_after>class Admin::PublicUserController < ApplicationController

  private

  def login_public_user klass,login,password,options={}
    flash[:error]=nil
    if request.post? && params[:user]
      user = klass.authenticate(params[:user][login],params[:user][password])
      loged_in=yield user
      if user && loged_in
        register_user_in_session user
        redirect_to options[:login_url] || home_url
      else
        flash[:error]||=I18n.t(:"flash.login failed")
      end
    else
      redirect_to options[:login_url] || home_url if logged_in?
    end
  end
  
  def remember_me(user)
    cookies.delete :remember_me unless user.remember_token
    domain=request.domain()
    if params[:remember_me] && !user.remember_token
      user.update_attributes!(:remember_token=>Digest::SHA1.hexdigest("$$#{Time.now.to_s}$$#{params[:login]}$$"))
{'fraction_non_alphanumeric': 0.1270996640537514, 'fraction_numerical': 0.0033594624860022394, 'mean_word_length': 4.091168091168091, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '970374', 'n_tokens_mistral': 565, 'n_tokens_neox': 547, 'n_words': 98}