def identify_user():
 g.remote_addr = request.environ.get(u'HTTP_X_FORWARDED_FOR', u'')
 if (not g.remote_addr):
  g.remote_addr = request.environ.get(u'REMOTE_ADDR', u'Unknown IP Address')
 authenticators = p.PluginImplementations(p.IAuthenticator)
 if authenticators:
  for item in authenticators:
   item.identify()
   if g.user:
    break
 if (not getattr(g, u'user', None)):
  _identify_user_default()
 if (g.user and (not getattr(g, u'userobj', None))):
  g.userobj = model.User.by_name(g.user)
 if g.user:
  g.author = g.user
 else:
  g.author = g.remote_addr
 g.author = unicode(g.author)

def identify_user ( ) : g . remote_addr = request . environ . get ( u'HTTP_X_FORWARDED_FOR' , u'' ) if ( not g . remote_addr ) : g . remote_addr = request . environ . get ( u'REMOTE_ADDR' , u'Unknown IP Address' ) authenticators = p . PluginImplementations ( p . IAuthenticator ) if authenticators : for item in authenticators : item . identify ( ) if g . user : break if ( not getattr ( g , u'user' , None ) ) : _identify_user_default ( ) if ( g . user and ( not getattr ( g , u'userobj' , None ) ) ) : g . userobj = model . User . by_name ( g . user ) if g . user : g . author = g . user else : g . author = g . remote_addr g . author = unicode ( g . author )
try to identify the user if the user is identified then: g .