|
Lines 192-220
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 |
|
| 201 |
if ( defined $self->updated_on and not $self->updated_on ) { |
| 202 |
$self->updated_on(undef); |
| 203 |
} |
| 204 |
|
| 205 |
# Set default values if not set |
| 206 |
$self->sms_provider_id(undef) unless $self->sms_provider_id; |
| 207 |
$self->guarantorid(undef) unless $self->guarantorid; |
| 208 |
|
| 209 |
# If flags == 0 or flags == '' => no permission |
| 210 |
$self->flags(undef) unless $self->flags; |
| 211 |
|
| 212 |
# tinyint or int |
| 213 |
$self->gonenoaddress(0) unless $self->gonenoaddress; |
| 214 |
$self->login_attempts(0) unless $self->login_attempts; |
| 215 |
$self->privacy_guarantor_checkouts(0) unless $self->privacy_guarantor_checkouts; |
| 216 |
$self->lost(0) unless $self->lost; |
| 217 |
|
| 218 |
unless ( $self->in_storage ) { #AddMember |
195 |
unless ( $self->in_storage ) { #AddMember |
| 219 |
|
196 |
|
| 220 |
# Generate a valid userid/login if needed |
197 |
# Generate a valid userid/login if needed |
|
Lines 240-248
sub store {
Link Here
|
| 240 |
: undef; |
217 |
: undef; |
| 241 |
$self->privacy($default_privacy); |
218 |
$self->privacy($default_privacy); |
| 242 |
|
219 |
|
| 243 |
unless ( defined $self->privacy_guarantor_checkouts ) { |
|
|
| 244 |
$self->privacy_guarantor_checkouts(0); |
| 245 |
} |
| 246 |
|
220 |
|
| 247 |
# Make a copy of the plain text password for later use |
221 |
# Make a copy of the plain text password for later use |
| 248 |
$self->plain_text_password( $self->password ); |
222 |
$self->plain_text_password( $self->password ); |
|
Lines 263-273
sub store {
Link Here
|
| 263 |
} |
237 |
} |
| 264 |
else { #ModMember |
238 |
else { #ModMember |
| 265 |
|
239 |
|
| 266 |
# Come from ModMember, but should not be possible (?) |
|
|
| 267 |
$self->dateenrolled(undef) unless $self->dateenrolled; |
| 268 |
$self->dateexpiry(undef) unless $self->dateexpiry; |
| 269 |
|
| 270 |
|
| 271 |
my $self_from_storage = $self->get_from_storage; |
240 |
my $self_from_storage = $self->get_from_storage; |
| 272 |
# 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 |
| 273 |
# Moved from ModMember to prevent regressions |
242 |
# Moved from ModMember to prevent regressions |
| 274 |
- |
|
|