Package com.ikanow.infinit.e.data_model.store.social.authentication

Examples of com.ikanow.infinit.e.data_model.store.social.authentication.AuthenticationPojo.toDb()


              }
              else if (authuser.getAccountType().equalsIgnoreCase("admin-enabled")) {
                isLogin = true;
                if (!multi) {
                  authuser.setLastSudo(new Date());
                  MongoDbManager.getSocial().getAuthentication().save(authuser.toDb());
                  bAdmin = true;
                }
              }
            }//TESTED
View Full Code Here


            // (ie admin rights last 10 minutes)
            bUpdateCookie = true;
          }
          if (bUpdateCookie && override) {
            authUser.setLastSudo(new Date());
            MongoDbManager.getSocial().getAuthentication().save(authUser.toDb());
          }
          rp = new LoginHandler().keepAlive(cookieLookup, override || !bUpdateCookie);
          // (ie if we're overriding we must be ... also if we're not override but are within the last sudo range then we are)
        }
        else {         
View Full Code Here

        AuthenticationPojo query = new AuthenticationPojo();
        query.setProfileId(new ObjectId(cookieLookup));
        AuthenticationPojo authUser = AuthenticationPojo.fromDb(DbManager.getSocial().getAuthentication().findOne(query.toDb()), AuthenticationPojo.class);     
        if ((null != authUser) && (null != authUser.getLastSudo())) {
          authUser.setLastSudo(null);
          MongoDbManager.getSocial().getAuthentication().save(authUser.toDb());
        }
      }
      rp.setResponse(new ResponseObject("Logout", true, "No longer admin."));
    }
    else if ( action.equals("logout"))
View Full Code Here

        //change pword
        String newpassword = createNewRandomPassword();
        //Take new password and encrypt it
        ap.setPassword(PasswordEncryption.encrypt(newpassword));
        ap.setModified(now);
        DbManager.getSocial().getAuthentication().save(ap.toDb());
       
        //email new password
        // Subject Line
        String subject = "Request to reset password";
 
View Full Code Here

          return rp;
        }//TESTED
       
        // Update auth to ensure this isn't abused
        ap.setModified(now);
        DbManager.getSocial().getAuthentication().save(ap.toDb());
       
        //email new password
        // Subject Line
        String subject = "Request to reset password";
 
View Full Code Here

      //Get user
      DBObject dbo = DbManager.getSocial().getAuthentication().findOne(new BasicDBObject("username",username));
      AuthenticationPojo ap = AuthenticationPojo.fromDb(dbo,AuthenticationPojo.class);     
      //change status to deactivate
      ap.setAccountStatus(InfiniteEnums.AccountStatus.DISABLED);
      DbManager.getSocial().getAuthentication().update(dbo, ap.toDb());
      //remove any cookie this user has
      removeCookies(ap.getProfileId().toString());     
      rp.setResponse(new ResponseObject("Deactivate Account",true,"Account deactivated successfully"));
    }
    catch (Exception e)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.