* Sat Sep 13 2025 Brian Read <brianr@koozali.org> 11.0.0-115.sme
- Fix login and logout and user table buttons so that they are valid html and work for elinks [SME: 13113]
This commit is contained in:
		@@ -2,11 +2,12 @@
 | 
			
		||||
<div id="header2" class="hd2 module gradient-panel">
 | 
			
		||||
  <img src="images/KoozaliServerManager.png" alt="Koozali Logo" class="logo" >
 | 
			
		||||
  % if ( not defined $c->session->{username} ) {
 | 
			
		||||
    <button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="login">Login</a></button>
 | 
			
		||||
		<a class="login-button no-visited-state" target="_parent" href="/smanager/login">Login</a>
 | 
			
		||||
  % } else {
 | 
			
		||||
  <button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="logout">Logout <%= $c->session->{username} %></a></button>
 | 
			
		||||
  <!--><button type='button' class="login-button"><a class = "no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a></button>-->
 | 
			
		||||
		<a class="login-button no-visited-state" target="_parent" href="/smanager/logout">Logout <%= $c->session->{username} %></a>
 | 
			
		||||
  % }
 | 
			
		||||
  <div id="flag-container" class = "flag-style">
 | 
			
		||||
    <!--			 The flag icon will be inserted here -->
 | 
			
		||||
  </div>
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
@@ -65,80 +65,89 @@
 | 
			
		||||
          % 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">
 | 
			
		||||
                % <button type='button' class='sme-modify-button' title='$modify_text'>
 | 
			
		||||
                  % $modify_text
 | 
			
		||||
                  % </button>
 | 
			
		||||
                % </a>
 | 
			
		||||
            % };
 | 
			
		||||
          % $actionResetPw = qq{
 | 
			
		||||
            % <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWS&user=$useraccounts_user_name">
 | 
			
		||||
              % <button type='button' class='sme-password-button' title='$password_text' >
 | 
			
		||||
                % $password_text
 | 
			
		||||
                % </button>
 | 
			
		||||
              % </a>
 | 
			
		||||
          % };
 | 
			
		||||
% $actionModify = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=UPS&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-modify-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$modify_text" aria-label="$modify_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-pencil"></span>
 | 
			
		||||
%     <span class="ui-button-text">$modify_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
% $actionResetPw = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWS&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-password-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$password_text" aria-label="$password_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-refresh"></span>
 | 
			
		||||
%     <span class="ui-button-text">$password_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        % } else {
 | 
			
		||||
        % $actionModify = qq{
 | 
			
		||||
          % <a href="useraccountsd?CsrfDef=$csrf_token&trt=UPD&user=$useraccounts_user_name">
 | 
			
		||||
            % <button type='button' class='sme-modify-button' title='$modify_text' >
 | 
			
		||||
              % $modify_text
 | 
			
		||||
              % </button>
 | 
			
		||||
            % </a>
 | 
			
		||||
        % };
 | 
			
		||||
% $actionModify = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=UPD&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-modify-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$modify_text" aria-label="$modify_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-pencil"></span>
 | 
			
		||||
%     <span class="ui-button-text">$modify_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        % }
 | 
			
		||||
        % if ($password_set ne 'yes') {
 | 
			
		||||
          % $actionLock = l('ACCOUNT_LOCKED');
 | 
			
		||||
          % $actionResetPw = qq{
 | 
			
		||||
            % <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
 | 
			
		||||
              % <button type='button' class='sme-password-button unset' title="$password_text - currently unset" style = background:pink; >
 | 
			
		||||
                % $password_text
 | 
			
		||||
                % </button>
 | 
			
		||||
              % </a>
 | 
			
		||||
          % };
 | 
			
		||||
% $actionResetPw = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-password-button unset ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$password_text - currently unset" aria-label="$password_text - currently unset"
 | 
			
		||||
%      style="background:pink;">
 | 
			
		||||
%     <span class="ui-icon ui-icon-refresh"></span>
 | 
			
		||||
%     <span class="ui-button-text">$password_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        % } elsif ($useraccounts_user_name ne 'admin') {
 | 
			
		||||
        % my $lock_text = l('ACCOUNT LOCKED'); # Localized text
 | 
			
		||||
        % my $lock_text = l('LOCK_ACCOUNT'); # 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' >
 | 
			
		||||
              % $lock_text
 | 
			
		||||
              % </button>
 | 
			
		||||
            % </a>
 | 
			
		||||
        % };
 | 
			
		||||
        % $actionResetPw = qq{
 | 
			
		||||
          % <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name">
 | 
			
		||||
            % <button type='button' class='sme-password-button' title='$password_text' >
 | 
			
		||||
              % $password_text
 | 
			
		||||
              % </button>
 | 
			
		||||
            % </a>
 | 
			
		||||
        % };
 | 
			
		||||
% $actionLock = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=LCK&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-lock-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$lock_text" aria-label="$lock_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-locked"></span>
 | 
			
		||||
%     <span class="ui-button-text">$lock_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
% $actionResetPw = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=PWD&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-password-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$password_text" aria-label="$password_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-refresh"></span>
 | 
			
		||||
%     <span class="ui-button-text">$password_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        % }
 | 
			
		||||
        % if ( $removable eq 'yes' ) {
 | 
			
		||||
          % 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' >
 | 
			
		||||
                % $remove_text
 | 
			
		||||
                % </button>
 | 
			
		||||
              % </a>
 | 
			
		||||
          % };
 | 
			
		||||
% $actionRemove = qq{
 | 
			
		||||
%   <a href="useraccountsd?CsrfDef=$csrf_token&trt=DEL&user=$useraccounts_user_name"
 | 
			
		||||
%      class="sme-remove-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$remove_text" aria-label="$remove_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-trash"></span>
 | 
			
		||||
%     <span class="ui-button-text">$remove_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        % }
 | 
			
		||||
 | 
			
		||||
        % 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>
 | 
			
		||||
            % </a>
 | 
			
		||||
        % };
 | 
			
		||||
% $actionroundcube = qq{
 | 
			
		||||
%   <a href="roundcubepanel?CsrfDef=$csrf_token&url=https://$thisdomain/roundcube?_user=$useraccounts_user_name&height=600px"
 | 
			
		||||
%      class="sme-email-button ui-button ui-corner-all ui-widget ui-button-icon-only"
 | 
			
		||||
%      title="$roundcube_text" aria-label="$roundcube_text">
 | 
			
		||||
%     <span class="ui-icon ui-icon-mail-closed"></span>
 | 
			
		||||
%     <span class="ui-button-text">$roundcube_text</span>
 | 
			
		||||
%   </a>
 | 
			
		||||
% };
 | 
			
		||||
        <td class='sme-border' style="min-width:35em">
 | 
			
		||||
          <%= $c->render_to_string( inline => $actionModify ) %>
 | 
			
		||||
          <%= $c->render_to_string( inline => $actionResetPw ) %>
 | 
			
		||||
@@ -155,4 +164,4 @@
 | 
			
		||||
 | 
			
		||||
  %= hidden_field 'trt' => $usr_datas->{trt}
 | 
			
		||||
 | 
			
		||||
</div>
 | 
			
		||||
</div>
 | 
			
		||||
		Reference in New Issue
	
	Block a user