* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-129.sme
- Useraccounts: Clean up forward email sub and make sure blank is errored [SME: 13056]
This commit is contained in:
@@ -179,7 +179,7 @@ sub do_update {
|
|||||||
$res = $c->pseudonym_clash($first);
|
$res = $c->pseudonym_clash($first);
|
||||||
$result .= $res unless $res eq 'OK';
|
$result .= $res unless $res eq 'OK';
|
||||||
|
|
||||||
if ($mail) {
|
if (defined $mail) {
|
||||||
$res = $c->emailforward($mail);
|
$res = $c->emailforward($mail);
|
||||||
$result .= $res unless $res eq 'OK';
|
$result .= $res unless $res eq 'OK';
|
||||||
}
|
}
|
||||||
@@ -217,7 +217,7 @@ sub do_update {
|
|||||||
$res = $c->pseudonym_clash($first);
|
$res = $c->pseudonym_clash($first);
|
||||||
$result .= $res unless $res eq 'OK';
|
$result .= $res unless $res eq 'OK';
|
||||||
|
|
||||||
if ($mail) {
|
if (defined $mail) {
|
||||||
$res = $c->emailforward($mail);
|
$res = $c->emailforward($mail);
|
||||||
$result .= $res unless $res eq 'OK';
|
$result .= $res unless $res eq 'OK';
|
||||||
}
|
}
|
||||||
@@ -554,27 +554,31 @@ sub pseudonym_clash {
|
|||||||
|
|
||||||
sub emailforward {
|
sub emailforward {
|
||||||
my ($c, $data) = @_;
|
my ($c, $data) = @_;
|
||||||
my $response = $c->email_simple($data);
|
#$c->app->log->info("emailformward called with $data!");
|
||||||
|
|
||||||
if ($response eq "OK") {
|
# Trim whitespace from $data
|
||||||
return "OK";
|
$data =~ s/^\s+|\s+$//g if defined $data;
|
||||||
} elsif ($data eq "") {
|
|
||||||
|
|
||||||
# Blank is ok, only if we're not forwarding, which means that the
|
# Check simple email validation first
|
||||||
# EmailForward param must be set to 'local'.
|
return "OK" if $c->email_simple($data) eq "OK";
|
||||||
|
|
||||||
|
# If trimmed data is empty
|
||||||
|
if ($data eq "") {
|
||||||
my $email_forward = $c->param('EmailForward') || '';
|
my $email_forward = $c->param('EmailForward') || '';
|
||||||
$email_forward =~ s/^\s+|\s+$//g;
|
$email_forward =~ s/^\s+|\s+$//g;
|
||||||
return 'OK' if $email_forward eq 'local';
|
return 'OK' if $email_forward eq 'local';
|
||||||
return $c->l('usr_CANNOT_CONTAIN_WHITESPACE');
|
return $c->l('usr_CANNOT_CONTAIN_WHITESPACE');
|
||||||
} else {
|
}
|
||||||
return $c->l('usr_CANNOT_CONTAIN_WHITESPACE')
|
|
||||||
if ($data =~ /\s+/);
|
|
||||||
|
|
||||||
# Permit a local address.
|
# Reject if $data contains any whitespace inside
|
||||||
return "OK" if $data =~ /^[a-zA-Z][a-zA-Z0-9\._\-]*$/;
|
return $c->l('usr_CANNOT_CONTAIN_WHITESPACE') if $data =~ /\s/;
|
||||||
return $c->l('usr_UNACCEPTABLE_CHARS');
|
|
||||||
} ## end else [ if ($response eq "OK")]
|
# Allow local address pattern
|
||||||
} ## end sub emailforward
|
return "OK" if $data =~ /^[a-zA-Z][a-zA-Z0-9._-]*$/;
|
||||||
|
|
||||||
|
# Otherwise reject for unacceptable chars
|
||||||
|
return $c->l('usr_UNACCEPTABLE_CHARS');
|
||||||
|
}
|
||||||
|
|
||||||
sub get_groups {
|
sub get_groups {
|
||||||
my ($c) = shift;
|
my ($c) = shift;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Summary: Sme Server Configuration : Manager 2
|
|||||||
%define name smeserver-manager
|
%define name smeserver-manager
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 128
|
%define release 129
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@@ -147,11 +147,14 @@ true
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-129.sme
|
||||||
|
- Useraccounts: Clean up forward email sub and make sure blank is errored [SME: 13056]
|
||||||
|
|
||||||
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-128.sme
|
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-128.sme
|
||||||
- Move group table to under others in User accounts setup panel [SME: 13068]
|
- Move group table to under others in User accounts setup panel [SME: 13068]
|
||||||
|
|
||||||
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-127.sme
|
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-127.sme
|
||||||
- Move same var declations to outside innner scope [SME: 13073]
|
- Group panel: Move same var declations to outside innner scope [SME: 13073]
|
||||||
|
|
||||||
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-126.sme
|
* Tue Nov 04 2025 Brian Read <brianr@koozali.org> 11.0.0-126.sme
|
||||||
- Remove debugging dump in portforwarding which crashes if no data [SME: 13243]
|
- Remove debugging dump in portforwarding which crashes if no data [SME: 13243]
|
||||||
|
|||||||
Reference in New Issue
Block a user