Initial SM2 panels - WIP

This commit is contained in:
Brian Read 2025-05-19 12:51:54 +01:00
parent 12a24b7973
commit 76a4ff6b43
8 changed files with 709 additions and 2 deletions

View File

@ -0,0 +1,401 @@
#
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
#
#
# Routines to be edited by the developer to provide content and validation for parameters
# and provison of the control data for table(s)
#
use esmith::util;
use esmith::util::network;
use esmith::ConfigDB;
use esmith::HostsDB;
use esmith::AccountsDB;
use esmith::NetworksDB;
use esmith::DomainsDB;
use constant FALSE => 0;
use constant TRUE => 1;
#The most common ones
my $cdb;
my $adb;
#my $ndb
#my $hdb
#my $ddb
# Validation routines - parameters for each panel
sub validate_USERTABLE {
my $c = shift;
my $rua_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub validate_PARAMS {
my $c = shift;
my $rua_data = shift; #Data hash as parameter
# Validation for each field
my $ret = "";
if (! TRUE) #validate $c->param('Account')
{$ret .= 'Validation for Account failed';}
if (! TRUE) #validate $c->param('User_Name')
{$ret .= 'Validation for User_Name failed';}
if (! TRUE) #validate $c->param('Shell')
{$ret .= 'Validation for Shell failed';}
if (! TRUE) #validate $c->param('Sudoer')
{$ret .= 'Validation for Sudoer failed';}
if (! TRUE) #validate $c->param('VPNClientAccess')
{$ret .= 'Validation for VPNClientAccess failed';}
if (! TRUE) #validate $c->param('ChrootDir2')
{$ret .= 'Validation for ChrootDir2 failed';}
if (! TRUE) #validate $c->param('ChrootDir')
{$ret .= 'Validation for ChrootDir failed';}
if (! TRUE) #validate $c->param('sshKeys')
{$ret .= 'Validation for sshKeys failed';}
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
# Get singleton data for each panel
sub get_data_for_panel_USERTABLE {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my %ret = (
'Data1'=>'Data for USERTABLE', #Example
# fields from Inputs in USERTABLE $fields['USERTABLE']
);
return %ret;
}
sub get_data_for_panel_PARAMS {
# Return a hash with the fields required which will be loaded into the shared data
my $c = shift;
my $user = $c->param('Selected');
$adb = esmith::AccountsDB->open();
$userrec = $adb->get_record($user) || return {};
my %ret = (
# fields from Inputs in PARAMS $fields['PARAMS']
'Account'=>$user,
'User_Name'=>$c->get_full_name($user),
'Shell'=>$userrec->prop('Shell') || 'no',
'Sudoer'=>$userrec->prop('Sudoer') || 'no',
'VPNClientAccess'=>$userrec->prop('VPNClientAccess') || 'no',
'ChrootDir2'=>$userrec->prop('ChrootDir') || '',
'ChrootDir'=>$userrec->prop('ChrootDir') || '',
'sshKeys'=>$c->get_ssh_keys($user),
);
return %ret;
}
# Get control data for table(s)
# Define a constant hash for field name mapping
use constant getAllUsers_FIELD_MAPPING => (
'Account' => 'User',
'User_Name' => 'Full_Name',
'Shell_Access' => 'Shell',
'Sudo' => 'Sudoer',
'SSH_Keys' => 'Keys',
'Chroot_Path' => 'Chroot',
'RSSH_+_VPN_Access' => 'VPNClientAccess',
'Modify' => 'Modify'
#'target_field2' => 'source_field2',
# Add more mappings as needed
);
sub actual_getAllUsers {
my $c = shift;
# Actual code for extracting getAllUsers
$cdb = esmith::ConfigDB->open();
$adb = esmith::AccountsDB->open();
my @data = ();
my @users = $adb->users;
return $c->l("ACCOUNT_USER_NONE") if (@users == 0);
for my $user (@users)
{
my $username = $user->key;
# make clearer by only showing yes and localise
my $vpn = $user->prop('VPNClientAccess') || '';
if ($vpn eq 'yes') { $vpn = 'YES'; } else { $vpn = ''; }
my $sudo = $user->prop('Sudoer') || '';
if ($sudo eq 'yes') { $sudo = 'YES'; } else { $sudo = ''; }
my $keys = '';
my $file = "/home/e-smith/files/users/$username/.ssh/authorized_keys2";
if (( -e $file ) && (! -z $file ))
{ $keys = 'YES'; }
my $shell = $user->prop('Shell') || '';
if ($shell eq '/usr/bin/rssh') { $shell = ''; }
my $ChrootDir = $user->prop('ChrootDir') || "";
$ChrootDir =~ s:/home/e-smith/files/ibays/::;
$ChrootDir =~ s:/home/e-smith/files/users/$username/home:home:;
$acc = $user->key;
push @data,
{ User => $user->key,
FullName => $user->prop('FirstName') . " " .
$user->prop('LastName'),
Sudoer => $user->prop('Sudoer') || 'no',
VPNClientAccess => $user->prop('VPNClientAccess') || 'no',
shell => $shell,
chroot => $ChrootDir,
ChrootDir => $user->prop('ChrootDir') || "/home/e-smith/files/users/$username/home",
sudo => $c->l($sudo),
keys => $c->l($keys),
vpn => $c->l($vpn),
Modify => "<a href='remoteuseraccessd?trt=PARAMS&Selected=$acc'>".$c->l('MODIFY')."</a>",
}
}
return @data;
}
sub get_getAllUsers {
# Return an array of hashes of the contents for each row and column for getAllUsers
my $c = shift;
my @source_records = $c->actual_getAllUsers();
my @transformed_records;
my %Field_Mapping = getAllUsers_FIELD_MAPPING();
# Iterate over each record in the source array
for my $source_record (@source_records) {
my %transformed_record;
# Iterate over each key-value pair in the $Field_Mapping constant
while (my ($target, $source) = each %Field_Mapping) {
# Check if the source field exists in the source record
if (exists $source_record->{$source}) {
# Assign the source field value to the target field in the transformed record
$transformed_record{$target} = $source_record->{$source};
}
}
# Add transformed record to the array if it's not empty
push @transformed_records, \%transformed_record if %transformed_record;
}
return \@transformed_records;
}
# Return hash with values from row in which link clicked on table
sub get_selected_USERTABLE {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
sub get_selected_PARAMS {
my $c = shift;
my $selected = shift; #Parameter is name of selected row.
my $is_new_record = shift; #Indicates new record required (defaults)
my %ret = {};
return %ret;
}
#after sucessful modify or create or whatever and submit then perfom (if the params validate)
sub perform_USERTABLE {
my $c = shift;
my $rua_data = shift; #Data hash as parameter
my $ret = "";
my $db = $cdb; #maybe one of the others
my $dbkey = 'ChangeThis';
# To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub perform_PARAMS {
my $c = shift;
#my $rua_data = shift; #Data hash as parameter
#my $ret = "";
#my $db = $cdb; #maybe one of the others
#my $dbkey = 'ChangeThis';
## To make it write to DB as comment, delete this (regex) string in each if statement "TRUE\) \#copy or perform with value: .* e.g."
#if (! TRUE) #copy or perform with value: Account e.g. $db->set_prop($dbkey,'Account',$c->param('Account'),type=>'service'))
#{$ret .= 'Perform/save failed for Account';}
#if (! TRUE) #copy or perform with value: User_Name e.g. $db->set_prop($dbkey,'User_Name',$c->param('User_Name'),type=>'service'))
#{$ret .= 'Perform/save failed for User_Name';}
#if (! TRUE) #copy or perform with value: Shell e.g. $db->set_prop($dbkey,'Shell',$c->param('Shell'),type=>'service'))
#{$ret .= 'Perform/save failed for Shell';}
#if (! TRUE) #copy or perform with value: Sudoer e.g. $db->set_prop($dbkey,'Sudoer',$c->param('Sudoer'),type=>'service'))
#{$ret .= 'Perform/save failed for Sudoer';}
#if (! TRUE) #copy or perform with value: VPNClientAccess e.g. $db->set_prop($dbkey,'VPNClientAccess',$c->param('VPNClientAccess'),type=>'service'))
#{$ret .= 'Perform/save failed for VPNClientAccess';}
#if (! TRUE) #copy or perform with value: ChrootDir2 e.g. $db->set_prop($dbkey,'ChrootDir2',$c->param('ChrootDir2'),type=>'service'))
#{$ret .= 'Perform/save failed for ChrootDir2';}
#if (! TRUE) #copy or perform with value: ChrootDir e.g. $db->set_prop($dbkey,'ChrootDir',$c->param('ChrootDir'),type=>'service'))
#{$ret .= 'Perform/save failed for ChrootDir';}
#if (! TRUE) #copy or perform with value: sshKeys e.g. $db->set_prop($dbkey,'sshKeys',$c->param('sshKeys'),type=>'service'))
#{$ret .= 'Perform/save failed for sshKeys';}
$ret = $c->userpanel_change_settings();
if ($ret eq "") {$ret = 'ok';}
return $ret;
}
sub create_link{
# WIP
my ($c,$route, $panel, $index) = @_;
my $link = "$route?trt=$panel&Selected=$index";
return $link;
}
sub get_full_name {
my $c = shift;
my $user = shift;
return $adb->get_prop($user, "FirstName") . " " .
$adb->get_prop($user, "LastName");
}
sub get_chroot_options {
my $c = shift;
my $user = $c->params('Selected');
return [ [] ];
}
sub get_ssh_keys{
my $c = shift;
my $user = shift;
my $file = "/home/e-smith/files/users/$user/.ssh/authorized_keys2";
if ($user eq 'admin')
{ $file = "/root/.ssh/authorized_keys2"; }
my $sshKeys = '';
# if exists and is not empty
if (( -e $file ) && (! -z $file ))
{
open (SSHKEY, "<$file")
or die "Error: Could not open file: $file\n";
my @sshTemp = <SSHKEY>;
$sshKeys = join ("", @sshTemp);
close SSHKEY;
}
return $sshKeys;
}
sub get_chroot_dirs {
my $self = shift;
my @options = (
['', ''],
['home', '. ~/home'],
['/home/e-smith/files', '.. /home/e-smith/files']
);
foreach my $account ($adb->get_all) {
if ($account->prop('type') =~ /ibay/) {
my $key = $account->key;
push @options,
["/home/e-smith/files/ibays/$key", $key],
["/home/e-smith/files/ibays/$key/html", "$key/html"],
["/home/e-smith/files/ibays/$key/files", "$key/files"];
}
}
return \@options;
}
sub userpanel_change_settings
{
my $c = shift;
my $Shell = $c->param ('Shell');
my $Sudoer = $c->param ('Sudoer');
my $VPNClientAccess = $c->param ('VPNClientAccess');
my $ChrootDir = $c->param ('ChrootDir');
my $ChrootDir2 = $c->param ('ChrootDir2');
$adb = esmith::AccountsDB->open();
my $user = $c->param('Selected');
if ($user =~ /^([a-z][\-a-z0-9]*)$/)
{
$user = $1;
}
my $sshKeys = $c->param ('sshKeys');
if ($sshKeys ne '')
{
my $file = "/home/e-smith/files/users/$user/.ssh/authorized_keys2";
my $dir = "/home/e-smith/files/users/$user/.ssh";
if ($user eq 'admin')
{ $file = "/root/.ssh/authorized_keys2";
$dir = "/root/.ssh"; }
# delete .ssh/authorized_keys2
if ($sshKeys =~ /deletekeys/)
{
system ("/bin/rm -rf $file") == 0
or die ("Error deleting $file.\n");
}
else
{
# Strip out DOS Carriage Returns (CR)
$sshKeys =~ s/\r//g;
unless ( -e $file )
{ system ("/bin/mkdir -p $dir") == 0
or die ("Error creating ssh directory.\n"); }
unlink $file;
open (SSHKEY, ">$file")
or die ("Error saving SSH Keys.\n");
print SSHKEY "$sshKeys\n";
close SSHKEY;
system ("/bin/chown -R $user.$user $dir") == 0
or die ("Error chown .ssh directory.\n");
}
}
# if the drop down is blank and field is valid
# set the field to the drop down, save the drop down
if (($ChrootDir2 eq '' ) && ($ChrootDir ne ''))
{
$ChrootDir2 = $ChrootDir || '';
}
if (($Sudoer eq 'yes') or ($Shell eq '/bin/bash'))
{
$adb->set_prop($user, 'Shell', '/bin/bash');
} else {
$adb->set_prop($user, 'Shell', '/usr/bin/rssh');
}
$adb->set_prop($user, 'Sudoer', $Sudoer);
$adb->set_prop($user, 'ChrootDir', $ChrootDir2);
$adb->set_prop($user, 'VPNClientAccess', $VPNClientAccess);
system ("/sbin/e-smith/signal-event", "user-modify", $user) == 0
or die ("Error occurred updating user access\n");
return 'ok'; #$self->success("SUCCESS");
}
1;

View File

@ -0,0 +1,31 @@
#
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
#
'rua_Select_an_FTP_Chroot_path' => 'Select an FTP chroot path from the drop down box or enter it in the text field The selection will overwrite the text field',
'rua_Sudo_Access' => 'Sudo Access',
'rua_Edit_Remote_User_Access_settings:' => 'Edit Remote User Access settings',
'rua_SHELL,_VPN_&amp;_FTP_access' => 'SHELL, VPN camp FTP access for users depend on the settings in the Remote Access Panel being opened',
'rua_RSSH_+_VPN__ClientAccess' => 'RSSH + VPN ClientAccess',
'rua_Modify' => 'Modify',
'rua_Sudo_access_allows_users_to' => 'Sudo access allows users to execute commands with the permissions of the root account without knowing the root password This is more desirable than passing around the root password Setting Sudo to yes also sets the shell to bash',
'rua_Select_Chroot_path' => 'Select chroot path',
'rua_User_Remote_access' => 'User Remote access',
'rua_Enter_the_public_SSH_Keys' => 'Enter the public SSH Keys to allow ssh access without passwords Keys should be pasted as a single line But they will wrap onto three or more lines in the display To delete all keys type deletekeys.',
'rua_Account' => 'Account',
'rua_User_Name' => 'User Name',
'rua_USERTABLE_panel_action_was_successful' => 'USERTABLE panel action was successful',
'rua_Change_user_remote_access_settings' => 'Change user remote access settings',
'rua_RSSH_+_VPN_Access' => 'RSSH + VPN Access',
'rua_Shell_Access' => 'Shell Access',
'rua_APPLY' => 'Apply',
'rua_PARAMS_panel_action_was_successful' => 'PARAMS panel action was successful',
'rua_Save' => 'Save',
'rua_Sudo' => 'Sudo',
'rua_Chroot_Path' => 'chroot Path',
'rua_Current_list_of_users' => 'Current list of users',
'rua_ChrootDir' => 'Chrootdir',
'rua_Enabling_bash_shell_access_for' => 'Enabling bash shell access for a user account poses a security risk Only use this option if you know what you are doing A safer option is to allow rush access (sftp, Ssh camp rsync).',
'rua_SSH_Keys' => 'SSH Keys',
'rua_User_Name' => 'User Name',
'rua_Account' => 'Account',
'rua_Shell_Access' => 'Shell Access',

View File

@ -0,0 +1,29 @@
/*
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
*/
.Remoteuseraccess-panel {}
.name {}
.rout {}
.head {}
.subh {}
.tabl1 {}
thead .tabl1 {}
tbody .tabl1 {}
.name {}
.rout {}
.head {}
.subh {}
.para1 {}
.para2 {}
.para3 {}
.para4 {}
.para5 {}
.text10 {}
.text11 {}
.sele1 {}
.sele2 {}
.sele3 {}
.sele4 {}
.text5 {}
.text6 {}
.subm7 {}

View File

@ -0,0 +1,5 @@
//
//Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
//
$(document).ready(function() {
});

View File

@ -0,0 +1,117 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
%#
<div id="Remoteuseraccess-PARAMS" class="partial Remoteuseraccess-PARAMS">
<!--
<script>
window.onload = function() {
SelectInput();
};
</script>
-->
% if (config->{debug} == 1) {
<pre>
%= dumper $rua_data
</pre>
% }
% my $btn = l('rua_APPLY');
%= form_for "remoteuseraccessu" => (method => 'POST') => begin
% param 'trt' => $rua_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $rua_data->{trt}
%= hidden_field 'Selected' => $c->param('Selected')
%# Inputs etc in here.
<h1 class='head'><%=l('rua_Change_user_remote_access_settings')%></h1>
<h2 class='subh'><%=l('rua_Edit_Remote_User_Access_settings:')%></h2>
<p class='paragraph para1'>
%=l('rua_Enabling_bash_shell_access_for')
</p>
<p class='paragraph para2'>
%=l('rua_Sudo_access_allows_users_to')
</p>
<p class='paragraph para3'>
%=l('rua_SHELL,_VPN_&amp;_FTP_access')
</p>
<p class='paragraph para4'>
%=l('rua_Select_an_FTP_Chroot_path')
</p>
<p class='paragraph para5'>
%=l('rua_Enter_the_public_SSH_Keys')
</p>
<p><span class=label>
%=l('rua_Account')
</span><span class=data>
% param 'Account' => $rua_data->{Account} unless param 'Account';
%= text_field 'Account', size => '50', class => 'textinput Account' , pattern=>'.*' , placeholder=>'Account', title =>'Pattern regex mismatch', id => 'Account_text'
<br></span></p>
<p><span class=label>
%=l('rua_User_Name')
</span><span class=data>
% param 'User_Name' => $rua_data->{User_Name} unless param 'User_Name';
%= text_field 'User_Name', size => '50', class => 'textinput User_Name' , pattern=>'.*' , placeholder=>'User_Name', title =>'Pattern regex mismatch', id => 'User_Name_text'
<br></span></p>
<p><span class=label>
%=l('rua_Shell_Access')
</span><span class=data>
% my @Shell_options = [['' => ''], ['/bin/bash' => '/bin/bash']];
% param 'Shell' => $rua_data->{Shell} unless param 'Shell';
%= select_field 'Shell' => @Shell_options, class => 'input', id => 'Shell_select'
<br></span> </p>
<p><span class=label>
%=l('rua_Sudo_Access')
</span><span class=data>
% my @Sudoer_options = [['No' => 'no'], ['Yes' => 'yes']];
% param 'Sudoer' => $rua_data->{Sudoer} unless param 'Sudoer';
%= select_field 'Sudoer' => @Sudoer_options, class => 'input', id => 'Sudoer_select'
<br></span> </p>
<p><span class=label>
%=l('rua_RSSH_+_VPN__ClientAccess')
</span><span class=data>
% my @VPNClientAccess_options = [['No' => 'no'], ['Yes' => 'yes']];
% param 'VPNClientAccess' => $rua_data->{VPNClientAccess} unless param 'VPNClientAccess';
%= select_field 'VPNClientAccess' => @VPNClientAccess_options, class => 'input', id => 'VPNClientAccess_select'
<br></span> </p>
<p><span class=label>
%=l('rua_Select_Chroot_path')
</span><span class=data>
% my @ChrootDir2_options = $c->get_chroot_dirs();
% param 'ChrootDir2' => $rua_data->{ChrootDir2} unless param 'ChrootDir2';
%= select_field 'ChrootDir2' => @ChrootDir2_options, class => 'input', id => 'ChrootDir2_select'
<br></span> </p>
<p><span class=label>
%=l('rua_ChrootDir')
</span><span class=data>
% param 'ChrootDir' => $rua_data->{ChrootDir} unless param 'ChrootDir';
%= text_field 'ChrootDir', size => '50', class => 'textinput ChrootDir' , pattern=>'.*' , placeholder=>'ChrootDir', title =>'Pattern regex mismatch', id => 'ChrootDir_text'
<br></span></p>
<p><span class=label>
%=l('rua_SSH_Keys')
</span><span class=data>
% param 'ssh_keys' => $rua_data->{ssh_keys} unless param 'ssh_keys';
%= text_area 'ssh_keys', cols=>40, rows=>10
<br></span></p>
<span class='data'>
%= submit_button l('rua_Save'), class => 'action subm7'
</span>
%# Probably finally by a submit.
%end
</div>

View File

@ -0,0 +1,61 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
%#
<div id="Remoteuseraccess-USERTABLE" class="partial Remoteuseraccess-USERTABLE">
<script>
window.onload = function() {
SelectInput();
};
</script>
% if (config->{debug} == 1) {
<pre>
%= dumper $rua_data
</pre>
% }
% my $btn = l('rua_APPLY');
% $c->param(Selected => undef);
%= form_for "remoteuseraccessu" => (method => 'POST') => begin
% param 'trt' => $rua_data->{trt} unless param 'trt';
%= hidden_field 'trt' => $rua_data->{trt}
%# Inputs etc in here.
<h1 class='head'><%=l('rua_Change_user_remote_access_settings')%></h1>
<h2 class='subh'><%=l('rua_Current_list_of_users')%></h2>
<br /><table class="sme-border TableSort sme-table tabl1 ">
<thead class='tabl1'>
<tr table-head-row>
<th class='sme-border table-head-col table-head-col-Account '><%=l('rua_Account')%></th>
<th class='sme-border table-head-col table-head-col-User Name '><%=l('rua_User_Name')%></th>
<th class='sme-border table-head-col table-head-col-Shell Access '><%=l('rua_Shell_Access')%></th>
<th class='sme-border table-head-col table-head-col-Sudo '><%=l('rua_Sudo')%></th>
<th class='sme-border table-head-col table-head-col-SSH Keys '><%=l('rua_SSH_Keys')%></th>
<th class='sme-border table-head-col table-head-col-Chroot Path '><%=l('rua_Chroot_Path')%></th>
<th class='sme-border table-head-col table-head-col-RSSH + VPN Access '><%=l('rua_RSSH_+_VPN_Access')%></th>
<th class='sme-border table-head-col table-head-col-Modify '><%=l('rua_Modify')%></th>
</tr>
</thead>
<tbody class='tabl1'>
% my $control_data = $c->stash('getAllUsers');
% foreach my $row (@$control_data) {
<tr class='table-row'>
<td class='sme-border table-col table-col-Account'><%=$c->render_to_string(inline=>$row->{'Account'})%></td>
<td class='sme-border table-col table-col-User_Name'><%=$c->render_to_string(inline=>$row->{'User_Name'})%></td>
<td class='sme-border table-col table-col-Shell_Access'><%=$c->render_to_string(inline=>$row->{'Shell_Access'})%></td>
<td class='sme-border table-col table-col-Sudo'><%=$c->render_to_string(inline=>$row->{'Sudo'})%></td>
<td class='sme-border table-col table-col-SSH_Keys'><%=$c->render_to_string(inline=>$row->{'SSH_Keys'})%></td>
<td class='sme-border table-col table-col-Chroot_Path'><%=$c->render_to_string(inline=>$row->{'Chroot_Path'})%></td>
<td class='sme-border table-col table-col-RSSH_+_VPN_Access'><%=$c->render_to_string(inline=>$row->{'RSSH_+_VPN_Access'})%></td>
<td class='sme-border table-col table-col-Modify'><%=$c->render_to_string(inline=>$row->{'Modify'})%></td>
</tr>
%}
</tbody>
</table>
%# Probably finally by a submit.
%end
</div>

View File

@ -0,0 +1,60 @@
%#
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-15 12:40:04
%#
% layout 'default', title => "Sme server 2 - User Remote access", share_dir => './';
%# css specific to this panel:
% content_for 'module' => begin
%= stylesheet '/css/remoteuseraccess.css'
%= javascript '/js/remoteuseraccess.js'
<div id="module" class="module Remoteuseraccess-panel">
% if (config->{debug} == 1) {
<pre>
%= dumper $c->current_route
%= dumper $rua_data->{trt}
</pre>
% }
<h1><%=$title%></h1>
% if ( stash('modul')) {
%= $c->render_to_string(inline => stash('modul') );
% }
%if ($c->stash('first')) {
<br><p>
%=$c->render_to_string(inline =>$c->l($c->stash('first')))
</p>
%} elsif ($c->stash('success')) {
<div class='success '>
<p>
%= $c->l($c->stash('success'));
</p>
</div>
<br />
%} elsif ($c->stash('error')) {
<div class='sme-error'>
<p>
%= $c->l($c->stash('error'));
</p>
</div>
<br />
%}
%#Routing to partials according to trt parameter.
%#This ought to be cascading if/then/elsif, but is easier to just stack the if/then's rather like a case statement'
% if ($rua_data->{trt} eq "USERTABLE") {
%= include 'partials/_rua_USERTABLE'
%}
% if ($rua_data->{trt} eq "PARAMS") {
%= include 'partials/_rua_PARAMS'
%}
</div>
%end

View File

@ -5,8 +5,8 @@
Summary: Smeserver module to configure Shell and FTP access for individual users
%define name smeserver-remoteuseraccess
Name: %{name}
%define version 1.3
%define release 8
%define version 11.0.0
%define release 1
Version: %{version}
Release: %{release}%{?dist}
License: GNU GPL version 2
@ -38,6 +38,9 @@ Also sets Chroots FTP access, VPN Client Access,
and allows you to enter ssh keys
%changelog
* Mon May 19 2025 Brian Read <brianr@koozali.org> 11.0.0-1.sme
- Add in SM2 panels
* Sun Sep 08 2024 fix-e-smith-pkg.sh by Trevor Batley <trevor@batley.id.au> 1.3-8.sme
- Fix e-smith references in smeserver-remoteuseraccess [SME: 12732]