Пример #1
0
 public static void sendModeration(String name, float point) {
   Task t = new Task(name, point);
   t.status = TaskStatus.PENDING;
   t.suggestedBy = SUser.findByEmail(Auth.connected());
   t.save();
   thanks();
 }
Пример #2
0
 public static void fbLogin() {
   String token = params.get("token");
   if (null != token && !token.isEmpty()) {
     FacebookClient fb = new DefaultFacebookClient(token);
     User fbUser = fb.fetchObject("me", User.class);
     Logger.info("Facebook User:"******"Such a user does not exists. Create/Register one...");
       // Register a new...
       // Email uniqueness is controlled by Facebook I suppose, so no need to check on our side...
       sesUser = new SUser(fbUser.getName(), fbUser.getEmail());
       sesUser.fbId = fbUser.getId();
       sesUser.save();
     }
     Auth.fbLogin(token, sesUser);
   } else {
     redirect("/");
   }
 }