I am unsure how to restore a user with the user.settings.USER_DELETED or restore a USER_INACTIVE any help would be appreciated
I am unsure how to restore a user with the user.settings.USER_DELETED or restore a USER_INACTIVE any help would be appreciated
Re: User Object USER_DELETED
By: Mortifis to All on Tue Jul 23 2019 12:52:15
I am unsure how to restore a user with the user.settings.USER_DELETED or restore a USER_INACTIVE any help would be appreciated
user.settings &=~ USER_DELETED;
Re: User Object USER_DELETED
By: Mortifis to All on Tue Jul 23 2019 12:52:15
I am unsure how to restore a user with the user.settings.USER_DELETED or restore a USER_INACTIVE any help would be appreciated
user.settings &=~ USER_DELETED;
interesting ... that &=~ ... undeletes?
no wonder USER_DELETED = 0 didn't
work ... thought it was a BOOLEAN o.o
Re: User Object USER_DELETED
By: Mortifis to All on Tue Jul 23 2019 12:52:15
I am unsure how to restore a user with the user.settings.USER_DELETED or restore a USER_INACTIVE any help would be appreciated
user.settings &=~ USER_DELETED;
as learning any language ( obviously I am not C adept) what does ~& or even just ~ mean negate a bitwise?
Re: Re: User Object USER_DELETED
By: Mortifis to echicken on Tue Jul 23 2019 22:40:15
as learning any language ( obviously I am not C adept) what does ~& or even just ~ mean negate a bitwise?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/ Bitwise_Operators
'~a' inverts the bits of 'a'
'a & b' returns ones in positions where both 'a' and 'b' have ones
'a & ~b' returns ones in positions where both 'a' and the inverse of 'b' have ones
'a &= b' assigns the result of 'a & b' to 'a'
'a &= ~b' assigns the result of 'a & ~b' to 'a'
'a | b' returns ones where either 'a' or 'b' have ones
'a |= b' assigns the result of 'a | b' to 'a'
So:
var a = 1; // 00000001
var b = 2; // 00000010
a |= b; // a = 00000001 | 00000010
a &= ~b; // a = 00000011 & 11111101
if that makes sense.
Sysop: | Ruben Figueroa |
---|---|
Location: | Mesquite, Tx |
Users: | 3 |
Nodes: | 4 (0 / 4) |
Uptime: | 97:18:10 |
Calls: | 77 |
Files: | 53 |
Messages: | 71,115 |