Ejemplo n.º 1
0
 public function finishSignup($req, $res)
 {
     $params = ['title' => 'Finish Signup', 'userEmail' => $req->request('user_email'), 'username_post' => $req->request('username')];
     if ($fbid = $req->session('fbid')) {
         $profile = new FacebookProfile($fbid);
         $profile->load();
         $params['profileUrl'] = $profile->url();
         $params['profilePic'] = $profile->profilePicture();
         $params['username'] = $profile->username;
     } elseif ($tid = $req->session('tid')) {
         $profile = new TwitterProfile($tid);
         $profile->load();
         $params['profileUrl'] = $profile->url();
         $params['profilePic'] = $profile->profilePicture();
         $params['username'] = $profile->username;
     } elseif ($iid = $req->session('iid')) {
         $profile = new InstagramProfile($iid);
         $profile->load();
         $params['profileUrl'] = $profile->url();
         $params['profilePic'] = $profile->profilePicture();
         $params['username'] = $profile->username;
     } else {
         return $res->setCode(404);
     }
     $params['username'] = preg_replace('/[^a-z0-9]+/i', '', $params['username']);
     return new View('finishSignup', $params);
 }