Package nz.org.winters.appspot.acrareporter.store

Examples of nz.org.winters.appspot.acrareporter.store.AppUser


  }

  @Override
  public List<AppPackage> getPackageGraphDataTotals(LoginInfo loginInfo) throws IllegalArgumentException
  {
    AppUser appUser = getAppUser(loginInfo);
    long ownerId = getOwnerId(appUser);

    List<AppPackage> list = ObjectifyService.ofy().load().type(AppPackage.class).filter("Owner", ownerId).order("PACKAGE_NAME").list();
    // AppPackage[] result = new AppPackage[list.size()];
View Full Code Here


  }

  @Override
  public List<DailyCounts> getLastMonthDailyCounts(LoginInfo loginInfo) throws IllegalArgumentException
  {
    AppUser user = getAppUser(loginInfo);
    Calendar monthback = GregorianCalendar.getInstance();
    monthback.set(Calendar.HOUR, 0);
    monthback.set(Calendar.MINUTE, 0);
    monthback.set(Calendar.SECOND, 0);
    monthback.set(Calendar.MILLISECOND, 0);
View Full Code Here

    ObjectifyService.ofy().delete().type(ACRALog.class).ids(idsACRA);

    if (owner != 0L)
    {
      AppPackage appPackage = getAppPackage(PACKAGE_NAME);
      AppUser appUser = getAppUser(owner);

      appPackage.Totals.Deleted = appPackage.Totals.Deleted + beoList.size();
      appPackage.Totals.LookedAt = appPackage.Totals.LookedAt - lookedAt;
      ObjectifyService.ofy().save().entity(appPackage);
View Full Code Here

      loginInfo.setNickname(user.getNickname());

      if (userService.isUserLoggedIn())
      { // && userService.isUserAdmin()
        loginInfo.setUserAdmin(userService.isUserAdmin());
        AppUser appUser = ObjectifyService.ofy().load().type(AppUser.class).filter("EMailAddress", user.getEmail()).first().now();
        loginInfo.setAppUserShared(appUser == null ? null : appUser);
        decodeAuthString(appUser);

        if (Configuration.appUserMode == Configuration.UserMode.umSingle)
        {
          if (userService.isUserAdmin())
          {
            if (appUser == null)
            {
              appUser = ObjectifyService.ofy().load().type(AppUser.class).first().now();
              if (appUser != null)
              {
                decodeAuthString(appUser);
                if (!appUser.EMailAddress.equals(user.getEmail()))
                {
                  // not the administator.
                  loginInfo.setLoggedIn(false);
                  return loginInfo;
                }
              }

              appUser = new AppUser();
              appUser.EMailAddress = user.getEmail();
              appUser.FirstName = user.getNickname();
              appUser.LastName = "UNKNOWN";
              appUser.City = "";
              appUser.Country = "";
              appUser.isSubscriptionPaid = true;
              appUser.isSuperDude = true;
              appUser.isUser = true;
              ObjectifyService.ofy().save().entity(appUser);
              loginInfo.setLoggedIn(true);
            } else
            {
              loginInfo.setLoggedIn(true);
            }

          } else
          {
            loginInfo.setLoggedIn(false);
            return loginInfo;
          }
        } else if (Configuration.appUserMode == Configuration.UserMode.umMultipleSameApps)
        {
          if (userService.isUserAdmin())
          {
            if (appUser == null)
            {
              appUser = new AppUser();
              appUser.EMailAddress = user.getEmail();
              appUser.FirstName = user.getNickname();
              appUser.LastName = "UNKNOWN";
              appUser.City = "";
              appUser.Country = "";
View Full Code Here

        log.severe("package unknown " + apppackage);
        return;
      }

      // get user for package.
      AppUser appUser = ObjectifyService.ofy().load().type(AppUser.class).id(appPackage.Owner).now();

      if (appUser == null)
      {
        response.getWriter().println("FAIL USER UNKNOWN");
        log.severe("User not found " + apppackage);
View Full Code Here

    List<DailyCounts> counts = DailyCountsGetters.getAllUsersDaysBack(daysBack);

    for (DailyCounts count : counts)
    {
      // resp.getWriter().println("COUNT: " + count.toString());
      AppUser user = remote.getAppUser(count.Owner);
      // resp.getWriter().println("USER: " + user.toString());

      if (user.isSubscriptionPaid)
      {
        try
View Full Code Here

        log.severe("package unknown " + apppackage);
        return;
      }

      // get user for package.
      AppUser appUser = ObjectifyService.ofy().load().type(AppUser.class).id(Long.parseLong(idStr)).now();

      if (appUser == null)
      {
        response.getWriter().println("FAIL USER UNKNOWN");
        log.severe("User not found " + apppackage);
View Full Code Here

          log.severe("Authentication Failed " + acraLog.PACKAGE_NAME);
          return;
        }

        // get user for package.
        AppUser appUser = ofy.load().type(AppUser.class).id(appPackage.Owner).now();

        if (appUser == null)
        {
          response.getWriter().println("FAIL USER UNKNOWN");
          log.severe("User not found " + acraLog.PACKAGE_NAME);
View Full Code Here

        response.getWriter().println("FAIL NO FUNCTION");
        log.severe("no function");
        return;
      }

      AppUser appUser = ObjectifyService.ofy().load().type(AppUser.class).filter("AndroidKey", apiKey).first().now();
      if (appUser == null)
      {
        response.getWriter().println("FAIL UNKNOWN API KEY: " + apiKey);
        log.severe("unknown apikey: " + apiKey);
        return;
View Full Code Here

      {
        resp.getWriter().println("ERROR: no user");
        return;
      }

      AppUser user = ObjectifyService.ofy().load().type(AppUser.class).filter("EMailAddress", useremail).first().now();
      if (user == null)
      {
        resp.getWriter().println("ERROR: User invalid");
        return;
      }
View Full Code Here

TOP

Related Classes of nz.org.winters.appspot.acrareporter.store.AppUser

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.