示例#1
0
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
示例#2
0
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
示例#3
0
def google_user(google_user_id, email):
    google_user_id = uid.google_user_id(
            users.User(_user_id=google_user_id, email=email))
    return user(google_user_id,
                db_key_email=email,
                user_email=email)
示例#4
0
 def make_google_user(self, google_user_id, email):
     google_user_id = uid.google_user_id(
             users.User(_user_id=google_user_id, email=email))
     return self.make_user(google_user_id,
                           db_key_email=email,
                           user_email=email)
示例#5
0
 def make_google_user(self, google_user_id, email):
     google_user_id = uid.google_user_id(
         users.User(_user_id=google_user_id, email=email))
     return self.make_user(google_user_id,
                           db_key_email=email,
                           user_email=email)