|
Lines 192-217
sub store {
Link Here
|
| 192 |
|
192 |
|
| 193 |
$self->trim_whitespaces; |
193 |
$self->trim_whitespaces; |
| 194 |
|
194 |
|
| 195 |
# We don't want invalid dates in the db (mysql has a bad habit of inserting 0000-00-00) |
|
|
| 196 |
$self->dateofbirth(undef) unless $self->dateofbirth; |
| 197 |
$self->debarred(undef) unless $self->debarred; |
| 198 |
$self->date_renewed(undef) unless $self->date_renewed; |
| 199 |
$self->lastseen(undef) unless $self->lastseen; |
| 200 |
$self->updated_on(undef) unless $self->updated_on; |
| 201 |
|
| 202 |
# Set default values if not set |
| 203 |
$self->sms_provider_id(undef) unless $self->sms_provider_id; |
| 204 |
$self->guarantorid(undef) unless $self->guarantorid; |
| 205 |
|
| 206 |
# If flags == 0 or flags == '' => no permission |
| 207 |
$self->flags(undef) unless $self->flags; |
| 208 |
|
| 209 |
# tinyint or int |
| 210 |
$self->gonenoaddress(0) unless $self->gonenoaddress; |
| 211 |
$self->login_attempts(0) unless $self->login_attempts; |
| 212 |
$self->privacy_guarantor_checkouts(0) unless $self->privacy_guarantor_checkouts; |
| 213 |
$self->lost(0) unless $self->lost; |
| 214 |
|
| 215 |
unless ( $self->in_storage ) { #AddMember |
195 |
unless ( $self->in_storage ) { #AddMember |
| 216 |
|
196 |
|
| 217 |
# Generate a valid userid/login if needed |
197 |
# Generate a valid userid/login if needed |
|
Lines 237-245
sub store {
Link Here
|
| 237 |
: undef; |
217 |
: undef; |
| 238 |
$self->privacy($default_privacy); |
218 |
$self->privacy($default_privacy); |
| 239 |
|
219 |
|
| 240 |
unless ( defined $self->privacy_guarantor_checkouts ) { |
|
|
| 241 |
$self->privacy_guarantor_checkouts(0); |
| 242 |
} |
| 243 |
|
220 |
|
| 244 |
# Make a copy of the plain text password for later use |
221 |
# Make a copy of the plain text password for later use |
| 245 |
$self->plain_text_password( $self->password ); |
222 |
$self->plain_text_password( $self->password ); |
|
Lines 260-270
sub store {
Link Here
|
| 260 |
} |
237 |
} |
| 261 |
else { #ModMember |
238 |
else { #ModMember |
| 262 |
|
239 |
|
| 263 |
# Come from ModMember, but should not be possible (?) |
|
|
| 264 |
$self->dateenrolled(undef) unless $self->dateenrolled; |
| 265 |
$self->dateexpiry(undef) unless $self->dateexpiry; |
| 266 |
|
| 267 |
|
| 268 |
my $self_from_storage = $self->get_from_storage; |
240 |
my $self_from_storage = $self->get_from_storage; |
| 269 |
# FIXME We should not deal with that here, callers have to do this job |
241 |
# FIXME We should not deal with that here, callers have to do this job |
| 270 |
# Moved from ModMember to prevent regressions |
242 |
# Moved from ModMember to prevent regressions |
| 271 |
- |
|
|