Added changeEmailAndInvalidate as well as flag manipulation methods.
This commit is contained in:
@@ -606,6 +606,15 @@ public class DepotUserRepository extends DepotRepository
|
|||||||
updatePartial(OOOUserRecord.getKey(userId), OOOUserRecord.EMAIL, email);
|
updatePartial(OOOUserRecord.getKey(userId), OOOUserRecord.EMAIL, email);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the specified user's email address and marks their account as unvalidated.
|
||||||
|
*/
|
||||||
|
public void changeEmailAndInvalidate (int userId, String email)
|
||||||
|
{
|
||||||
|
updatePartial(OOOUserRecord.getKey(userId), OOOUserRecord.EMAIL, email,
|
||||||
|
OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitAnd(~OOOUser.VALIDATED_FLAG));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the specified user's password (should already be encrypted).
|
* Updates the specified user's password (should already be encrypted).
|
||||||
*/
|
*/
|
||||||
@@ -633,6 +642,24 @@ public class DepotUserRepository extends DepotRepository
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the supplied flags to the specified user's flags.
|
||||||
|
*/
|
||||||
|
public void addFlags (int userId, int addMask)
|
||||||
|
{
|
||||||
|
updatePartial(OOOUserRecord.getKey(userId),
|
||||||
|
OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitOr(addMask));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clears the supplied flags from the specified user's flags.
|
||||||
|
*/
|
||||||
|
public void clearFlags (int userId, int clearMask)
|
||||||
|
{
|
||||||
|
updatePartial(OOOUserRecord.getKey(userId),
|
||||||
|
OOOUserRecord.FLAGS, OOOUserRecord.FLAGS.bitAnd(~clearMask));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 'Delete' the users account such that they can no longer access it, however we do not delete
|
* 'Delete' the users account such that they can no longer access it, however we do not delete
|
||||||
* the record from the db. The name is changed such that the original name has XX=FOO if the
|
* the record from the db. The name is changed such that the original name has XX=FOO if the
|
||||||
|
|||||||
Reference in New Issue
Block a user