* 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:
2025-02-12 16:31:17 +00:00
parent a4668da720
commit d776f20736
7 changed files with 150 additions and 39 deletions

View File

@@ -59,11 +59,11 @@
%= t td => (class => 'sme-border') => "$first $last"
%= t td => (class => 'sme-border') => $vpnaccess
%= t td => (class => 'sme-border') => $fwd
%my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = '&nbsp;';
%my $modify_text = l('MODIFY'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
%my $password_text = l("PASSWORD_RESET");
% my ($actionModify, $actionLock, $actionResetPw, $actionRemove,$actionroundcube) = '&nbsp;';
% my $modify_text = l('MODIFY'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security
% my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
% my $password_text = l("PASSWORD_RESET");
%if ($useraccounts_user_name eq 'admin') {
%$actionModify = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=UPS&user=$useraccounts_user_name">
@@ -98,9 +98,9 @@
%</a>
%};
%} elsif ($useraccounts_user_name ne 'admin') {
%my $lock_text = l('ACCOUNT LOCKED'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
%my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
% my $lock_text = l('ACCOUNT LOCKED'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security
% my $useraccounts_user_name = $user->key; # useraccountss_entry name extracted from the data structure
%$actionLock = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=LCK&user=$useraccounts_user_name">
% <button type='button' class='sme-lock-button' title='$lock_text' >
@@ -117,8 +117,8 @@
%};
%}
%if ( $removable eq 'yes' ) {
%my $remove_text = l('REMOVE'); # Localized text
%my $csrf_token = "TOKEN"; # CSRF token for security
% my $remove_text = l('REMOVE'); # Localized text
% my $csrf_token = "TOKEN"; # CSRF token for security
%$actionRemove = qq{
%<a href="useraccountsd?CsrfDef=$csrf_token&trt=DEL&user=$useraccounts_user_name">
% <button type='button' class='sme-remove-button' title='$remove_text' >
@@ -128,13 +128,12 @@
%};
%}
%my $thisdomain = session 'SystemName';
%$thisdomain .= ".".session 'DomainName';
%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
%$actionroundcube = qq{
%<a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name">
% my $thisdomain = $c->req->url->to_abs->host;
% my $roundcube_text = l('Webmail'); # Localized text
% $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&height=600px">
% <button type='button' class='sme-email-button' title='$roundcube_text' >
% $roundcube_text
% </button>
@@ -156,4 +155,4 @@
%= hidden_field 'trt' => $usr_datas->{trt}
</div>
</div>

View File

@@ -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>