def get_current_user_id_from_cookies_unsafe(): user = users.get_current_user() if user: #if we have a google account user_id = "http://googleid.khanacademy.org/" + user.user_id() else: #if not a google account, try facebook user_id = facebook_util.get_current_facebook_user_id_from_cookies() if not user_id: #if we don't have a user_id, then it's not facebook or google user_id = get_phantom_user_id_from_cookies() return user_id
def get_current_user_id_from_cookies_unsafe(): user = users.get_current_user() if user: #if we have a google account user_id = "http://googleid.khanacademy.org/" + user.user_id() else: #if not a google account, try facebook user_id = facebook_util.get_current_facebook_user_id_from_cookies() if not user_id: #if we don't have a user_id, then it's not facebook or google user_id = get_phantom_user_id_from_cookies() return user_id
def _get_current_user_id_from_cookies_unsafe(): user = users.get_current_user() user_id = None if user: # if we have a google account user_id = uid.google_user_id(user) if not user_id: user_id = auth.cookies.get_user_from_khan_cookies() if not user_id: user_id = facebook_util.get_current_facebook_user_id_from_cookies() # if we don't have a user_id, then it's not facebook or google if not user_id: user_id = get_phantom_user_id_from_cookies() return user_id
def _get_current_user_id_from_cookies_unsafe(): user = users.get_current_user() user_id = None if user: # if we have a google account user_id = uid.google_user_id(user) if not user_id: user_id = auth.cookies.get_user_from_khan_cookies() if not user_id: user_id = facebook_util.get_current_facebook_user_id_from_cookies() # if we don't have a user_id, then it's not facebook or google if not user_id: user_id = get_phantom_user_id_from_cookies() return user_id