* Mon Feb 10 2025 Brian Read <brianr@koozali.org> 11.0.0-51.sme
- Replace url in call to webmail by browser url rather than system host and domain [SME: 12910] - Fix up CSS so not inline - Sort out reveiw panel missing routines from FormMagic [SME: 12907].
This commit is contained in:
		@@ -275,6 +275,18 @@ a.menu-title {
 | 
			
		||||
    left: 2px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.roundcube div {
 | 
			
		||||
	height:462px;
 | 
			
		||||
	width:85%;
 | 
			
		||||
	margin-bottom:1%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.roundcube object {
 | 
			
		||||
	margin-top:1%;
 | 
			
		||||
	height:95%;
 | 
			
		||||
	width:100%;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*end*/
 | 
			
		||||
EOF
 | 
			
		||||
 
 | 
			
		||||
@@ -31,7 +31,7 @@ use SrvMngr::Plugin::WithoutCache;
 | 
			
		||||
use esmith::I18N;
 | 
			
		||||
 | 
			
		||||
#this is overwrittrn with the "release" by the spec file - release can be "99.el8.sme"
 | 
			
		||||
our $VERSION = '50.el8.sme'; 
 | 
			
		||||
our $VERSION = '51.el8.sme'; 
 | 
			
		||||
#Extract the release value
 | 
			
		||||
if ($VERSION =~ /^(\d+)/) {
 | 
			
		||||
    $VERSION = $1;  # $1 contains the matched numeric digits
 | 
			
		||||
@@ -812,7 +812,6 @@ sub get_public_ip_address
 | 
			
		||||
    return undef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
sub email_simple {
 | 
			
		||||
    my ($c, $data) = @_;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -152,6 +152,55 @@ sub get2_local_networks {
 | 
			
		||||
    } ## end else [ if ($numNetworks == 0)]
 | 
			
		||||
} ## end sub get2_local_networks
 | 
			
		||||
 | 
			
		||||
sub get_net_prop {
 | 
			
		||||
  my $fm = shift;
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  my $prop = shift;
 | 
			
		||||
 | 
			
		||||
  my $record = $networks->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->prop($prop);
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    return '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
sub get_local_networks {
 | 
			
		||||
    my $fm = shift;
 | 
			
		||||
 | 
			
		||||
    my @nets = $networks->get_all_by_prop('type' => 'network');
 | 
			
		||||
 | 
			
		||||
    my $numNetworks = @nets;
 | 
			
		||||
    if ($numNetworks == 0) {
 | 
			
		||||
        return  $fm->localise('NO_NETWORKS');
 | 
			
		||||
    }
 | 
			
		||||
    else {
 | 
			
		||||
        my $out = "";
 | 
			
		||||
        foreach my $network (sort @nets) {
 | 
			
		||||
            if ($out ne "") {
 | 
			
		||||
                $out .= "<BR>";
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            $out .= $network->key."/" . get_net_prop($fm, $network->key, 'Mask');
 | 
			
		||||
 | 
			
		||||
            if ( defined get_net_prop($fm, $network->key, 'Router') ) {
 | 
			
		||||
                $out .= " via " . get_net_prop ($fm, $network->key, 'Router'); 
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return $out;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub get_local_domain
 | 
			
		||||
{
 | 
			
		||||
    return (get_value('','DomainName'));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
=head2 print2_gateway_stanza
 | 
			
		||||
 | 
			
		||||
If this system is a server gateway, show the external ip and gateway ip (mojo ver)
 | 
			
		||||
@@ -217,4 +266,51 @@ sub print2_dhcp_stanza {
 | 
			
		||||
    } ## end if (get_prop($c, 'dhcpd'...))
 | 
			
		||||
    return $out;
 | 
			
		||||
} ## end sub print2_dhcp_stanza
 | 
			
		||||
 | 
			
		||||
sub get_value {
 | 
			
		||||
  my $fm = shift;
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  my $record = $db->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->value();
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    return '';
 | 
			
		||||
  }
 | 
			
		||||
  
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub get_prop {
 | 
			
		||||
  my $fm = shift if (ref($_[0]) ); # If we're being called in a formmagick context
 | 
			
		||||
				 # The first argument will always be a fm.
 | 
			
		||||
				 #otherwise, we don't want to grab it
 | 
			
		||||
  my $item = shift;
 | 
			
		||||
  my $prop = shift;
 | 
			
		||||
 | 
			
		||||
  my $record = $db->get($item);
 | 
			
		||||
  if ($record) {
 | 
			
		||||
    return $record->prop($prop);
 | 
			
		||||
  }
 | 
			
		||||
  else {
 | 
			
		||||
    return '';
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
sub get_public_ip_address
 | 
			
		||||
{
 | 
			
		||||
    my $self = shift;
 | 
			
		||||
    my $sysconfig = $db->get('sysconfig');
 | 
			
		||||
    if ($sysconfig)
 | 
			
		||||
    {
 | 
			
		||||
        my $publicIP = $sysconfig->prop('PublicIP');
 | 
			
		||||
        if ($publicIP)
 | 
			
		||||
        {
 | 
			
		||||
            return $publicIP;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    return undef;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
1;
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ package SrvMngr::Controller::Roundcubepanel;
 | 
			
		||||
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
# heading     : System
 | 
			
		||||
# description : Roundcube webmail
 | 
			
		||||
# description : Webmail
 | 
			
		||||
# navigation  : 99999 9999
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
#----------------------------------------------------------------------
 | 
			
		||||
@@ -21,10 +21,9 @@ use SrvMngr qw(theme_list init_session);
 | 
			
		||||
sub main {
 | 
			
		||||
    my $c = shift;
 | 
			
		||||
    $c->app->log->info($c->log_req);
 | 
			
		||||
    my $title            = $c->l('Roundcube Webmail');
 | 
			
		||||
    my $title            = $c->l('Webmail');
 | 
			
		||||
    my $roundcube_url    = $c->param('url');
 | 
			
		||||
    my $roundcube_height = $c->param('height') | 600;
 | 
			
		||||
    $c->stash(title => $title, modul => $roundcube_url, height => $roundcube_height);
 | 
			
		||||
    $c->stash(title => $title, modul => $roundcube_url);
 | 
			
		||||
    $c->render(template => 'roundcube');
 | 
			
		||||
} ## end sub main
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -128,13 +128,12 @@
 | 
			
		||||
				%};
 | 
			
		||||
			%}
 | 
			
		||||
			
 | 
			
		||||
			%my $thisdomain = session 'SystemName';
 | 
			
		||||
			%$thisdomain .= ".".session 'DomainName';
 | 
			
		||||
		    % my $thisdomain = $c->req->url->to_abs->host;
 | 
			
		||||
			% my $roundcube_text = l('Webmail');  # Localized text
 | 
			
		||||
			%my $csrf_token = "TOKEN";  # CSRF token for security
 | 
			
		||||
			%my $useraccounts_user_name = $user->key;  # useraccountss_entry name extracted from the data structure
 | 
			
		||||
			% $csrf_token = "TOKEN";  # CSRF token for security
 | 
			
		||||
			% $useraccounts_user_name = $user->key;  # useraccountss_entry name extracted from the data structure
 | 
			
		||||
			% $actionroundcube = qq{
 | 
			
		||||
				%<a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name">
 | 
			
		||||
				%<a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name&height=600px">
 | 
			
		||||
				%	<button type='button' class='sme-email-button' title='$roundcube_text' >
 | 
			
		||||
				%		$roundcube_text
 | 
			
		||||
				%	</button>
 | 
			
		||||
 
 | 
			
		||||
@@ -14,25 +14,26 @@
 | 
			
		||||
			%= $c->render_to_string(inline => stash 'error') 
 | 
			
		||||
		</div>
 | 
			
		||||
    %}
 | 
			
		||||
    <h1> roundcube - <%=$title %></h1><br>
 | 
			
		||||
    <p>If the roundcube panel does not appear after logging in, then please check your password.</p><br />
 | 
			
		||||
    <h1><%=$title %></h1><br>
 | 
			
		||||
    <p>If the Webmail panel does not appear after logging in, then please check your password.</p><br />
 | 
			
		||||
 | 
			
		||||
    % my $thisdomain = session 'SystemName';
 | 
			
		||||
    % $thisdomain .= ".".session 'DomainName';
 | 
			
		||||
    % my $thisdomain = $c->req->url->to_abs->host;
 | 
			
		||||
    % my $url = $c->stash('modul');
 | 
			
		||||
    % if (!$url) {
 | 
			
		||||
	%	$url = $thisdomain."/roundcube";
 | 
			
		||||
	%}
 | 
			
		||||
    % my $username = 'admin';
 | 
			
		||||
    % if ($url =~ /[?&]_user=([^&]+)/) {
 | 
			
		||||
	%	$username = $1;
 | 
			
		||||
	%}
 | 
			
		||||
	
 | 
			
		||||
	<a href="<%= "https://".$thisdomain."/" %>roundcube?_user=<%= $username %>"><button class="sme-fullwindow1-button" width=20em title="<%= l('Full Window') %>"><%= l('Full Window') %></button></a>
 | 
			
		||||
 | 
			
		||||
    % my $height = $c->stash('height') | '600px';
 | 
			
		||||
    % if ($height !~ /px$/) { $height = $height.'px';}
 | 
			
		||||
    % if ($url eq "") {
 | 
			
		||||
	%	$url = "https://".$thisdomain."/roundcube";
 | 
			
		||||
	% if (!($url =~ /https:/)) {
 | 
			
		||||
    % $url = 'https://' . $url;
 | 
			
		||||
	%}
 | 
			
		||||
	<object id="roundcube" class="roundcube" data="<%=$url %>" style="width:99%;height:<%= $height %>;" title="<%= $c->stash('title') %>"  type="text/html" ><%= $c->stash('title') %> not found</object>
 | 
			
		||||
 | 
			
		||||
    <div class='roundcube'>
 | 
			
		||||
		<a href="<%= "https://".$thisdomain."/" %>roundcube?_user=<%= $username %>"><button class="sme-fullwindow1-button" width=20em title="<%= l('Full Window') %>"><%= l('Full Window') %></button></a>
 | 
			
		||||
		<object id="roundcube" data="<%=$url %>" title="<%= $c->stash('title') %>"  type="text/html" ><%= $c->stash('title') %> not found</object>
 | 
			
		||||
	</div>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -2,7 +2,7 @@ Summary: Sme server  navigation module : manager 2
 | 
			
		||||
%define name smeserver-manager
 | 
			
		||||
Name: %{name}
 | 
			
		||||
%define version 11.0.0
 | 
			
		||||
%define release 50
 | 
			
		||||
%define release 51
 | 
			
		||||
Version: %{version}
 | 
			
		||||
Release: %{release}%{?dist}
 | 
			
		||||
License: GPL
 | 
			
		||||
@@ -143,6 +143,11 @@ true
 | 
			
		||||
%defattr(-,root,root)
 | 
			
		||||
 | 
			
		||||
%changelog
 | 
			
		||||
* Mon Feb 10 2025 Brian Read <brianr@koozali.org> 11.0.0-51.sme
 | 
			
		||||
- Replace url in call to webmail by browser url rather than system host and domain [SME: 12910]
 | 
			
		||||
- Fix up CSS so not inline
 | 
			
		||||
- Sort out reveiw panel missing routines from FormMagic [SME: 12907].
 | 
			
		||||
 | 
			
		||||
* Sun Feb 09 2025 Brian Read <brianr@koozali.org> 11.0.0-50.sme
 | 
			
		||||
- Move all routines from FormMagic still called by SM2 panels to SM2 [SME: 12906]
 | 
			
		||||
- delete all references to FormMagic 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user