src/snac/client/webui/WebUIExecutor.php
/**
     * Create User
     *
     * Takes the Google OAuth2 user information and token and loads it into a SNAC User object.
     *
     * @param \League\OAuth2\Client\Provider\GoogleUser $googleUser User from Google OAuth Connection
     * @param \League\OAuth2\Client\Token\AccessToken $googleToken The access token
     * @return \snac\data\User SNAC User object
     */
Create User
Takes the Google OAuth2 user information and token and loads it into a SNAC User object.


Create User Takes the Google OAuth2 user information and token and loads it into a SNAC User object .
public function createUser($googleUser, $googleToken) {
        $user = new \snac\data\User();
        $avatar = $googleUser->getAvatar();
        $avatarSmall = null;
        $avatarLarge = null;
        if ($avatar != null) {
            $avatar = str_replace("?sz=50", "", $avatar);
            $avatarSmall = $avatar . "?sz=20";
            $avatarLarge = $avatar . "?sz=250";
        }
        $user->setAvatar($avatar);
        $user->setAvatarSmall($avatarSmall);
        $user->setAvatarLarge($avatarLarge);
        $user->setUserName($googleUser->getEmail());
        $user->setEmail($googleUser->getEmail());
        $user->setFirstName($googleUser->getFirstName());
        $user->setFullName($googleUser->getName());
        $user->setLastName($googleUser->getLastName());
        $token = array (
                "access_token" => $googleToken->getToken(),
                "expires" => $googleToken->getExpires()
        );
        $user->setToken($token);
        return $user;
    }
public function createUser ( $ googleUser , $ googleToken ) { $ user = new \ snac \ data \ User ( ) ; $ avatar = $ googleUser -> getAvatar ( ) ; $ avatarSmall = null ; $ avatarLarge = null ; if ( $ avatar != null ) { $ avatar = str_replace ( " ?sz=50 " , " " , $ avatar ) ; $ avatarSmall = $ avatar . " ?sz=20 " ; $ avatarLarge = $ avatar . " ?sz=250 " ; } $ user -> setAvatar ( $ avatar ) ; $ user -> setAvatarSmall ( $ avatarSmall ) ; $ user -> setAvatarLarge ( $ avatarLarge ) ; $ user -> setUserName ( $ googleUser -> getEmail ( ) ) ; $ user -> setEmail ( $ googleUser -> getEmail ( ) ) ; $ user -> setFirstName ( $ googleUser -> getFirstName ( ) ) ; $ user -> setFullName ( $ googleUser -> getName ( ) ) ; $ user -> setLastName ( $ googleUser -> getLastName ( ) ) ; $ token = array ( " access_token " => $ googleToken -> getToken ( ) , " expires " => $ googleToken -> getExpires ( ) ) ; $ user -> setToken ( $ token ) ; return $ user ; }
Create User
 Takes the Google OAuth2 user information and token and loads it into a SNAC User object.
Create User Takes the Google OAuth2 user information and token and loads it into a SNAC User object .