Add in shares contrib also fix comment out script in partial add fix json5 python
This commit is contained in:
546
Targets/Shares/Shares-Custom.pm
Normal file
546
Targets/Shares/Shares-Custom.pm
Normal file
@@ -0,0 +1,546 @@
|
||||
#
|
||||
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
#
|
||||
#
|
||||
# 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 - open DB when required.
|
||||
my $cdb;
|
||||
my $adb;
|
||||
my $ndb;
|
||||
my $hdb;
|
||||
my $ddb;
|
||||
|
||||
# Validation routines - parameters for each panel
|
||||
|
||||
sub validate_LIST {
|
||||
my $c = shift;
|
||||
my $sf_data = shift; #Data hash as parameter
|
||||
# Validation for each field
|
||||
my $ret = "";
|
||||
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub validate_MODIFY {
|
||||
my $c = shift;
|
||||
my $sf_data = shift; #Data hash as parameter
|
||||
# Validation for each field
|
||||
my $ret = "";
|
||||
|
||||
if (! TRUE) #validate $c->param('description')
|
||||
{$ret .= 'Validation for description failed';}
|
||||
if (! TRUE) #validate $c->param('smbaccess')
|
||||
{$ret .= 'Validation for smbaccess failed';}
|
||||
if (! TRUE) #validate $c->param('recyclebin')
|
||||
{$ret .= 'Validation for recyclebin failed';}
|
||||
if (! TRUE) #validate $c->param('retention')
|
||||
{$ret .= 'Validation for retention failed';}
|
||||
if (! TRUE) #validate $c->param('httpaccess')
|
||||
{$ret .= 'Validation for httpaccess failed';}
|
||||
if (! TRUE) #validate $c->param('webdav')
|
||||
{$ret .= 'Validation for webdav failed';}
|
||||
if (! TRUE) #validate $c->param('requireSSL')
|
||||
{$ret .= 'Validation for requireSSL failed';}
|
||||
if (! TRUE) #validate $c->param('indexes')
|
||||
{$ret .= 'Validation for indexes failed';}
|
||||
if (! TRUE) #validate $c->param('dynamic')
|
||||
{$ret .= 'Validation for dynamic failed';}
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub validate_PERMISSIONS {
|
||||
my $c = shift;
|
||||
my $sf_data = shift; #Data hash as parameter
|
||||
# Validation for each field
|
||||
my $ret = "";
|
||||
|
||||
if (! TRUE) #validate $c->param('writegroup')
|
||||
{$ret .= 'Validation for writegroup failed';}
|
||||
if (! TRUE) #validate $c->param('readgroup')
|
||||
{$ret .= 'Validation for readgroup failed';}
|
||||
if (! TRUE) #validate $c->param('writegroup')
|
||||
{$ret .= 'Validation for writegroup failed';}
|
||||
if (! TRUE) #validate $c->param('readgroup')
|
||||
{$ret .= 'Validation for readgroup failed';}
|
||||
if (! TRUE) #validate $c->param('writegroup')
|
||||
{$ret .= 'Validation for writegroup failed';}
|
||||
if (! TRUE) #validate $c->param('readgroup')
|
||||
{$ret .= 'Validation for readgroup failed';}
|
||||
if (! TRUE) #validate $c->param('writegroup')
|
||||
{$ret .= 'Validation for writegroup failed';}
|
||||
if (! TRUE) #validate $c->param('readgroup')
|
||||
{$ret .= 'Validation for readgroup failed';}
|
||||
if (! TRUE) #validate $c->param('writegroup')
|
||||
{$ret .= 'Validation for writegroup failed';}
|
||||
if (! TRUE) #validate $c->param('readgroup')
|
||||
{$ret .= 'Validation for readgroup failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if (! TRUE) #validate $c->param('writeuser')
|
||||
{$ret .= 'Validation for writeuser failed';}
|
||||
if (! TRUE) #validate $c->param('readuser')
|
||||
{$ret .= 'Validation for readuser failed';}
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub validate_REMOVE {
|
||||
my $c = shift;
|
||||
my $sf_data = shift; #Data hash as parameter
|
||||
# Validation for each field
|
||||
my $ret = "";
|
||||
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
# Get singleton data for each panel
|
||||
|
||||
sub get_data_for_panel_LIST {
|
||||
# Return a hash with the fields required which will be loaded into the shared data
|
||||
my $c = shift;
|
||||
my %ret = (
|
||||
'Data1'=>'Data for LIST', #Example
|
||||
# fields from Inputs in LIST $fields['LIST']
|
||||
|
||||
);
|
||||
return %ret;
|
||||
}
|
||||
|
||||
sub get_data_for_panel_MODIFY {
|
||||
# Return a hash with the fields required which will be loaded into the shared data
|
||||
my $c = shift;
|
||||
my %ret = (
|
||||
'Data1'=>'Data for MODIFY', #Example
|
||||
# fields from Inputs in MODIFY $fields['MODIFY']
|
||||
'description'=>'description contents',
|
||||
'smbaccess'=>'smbaccess contents',
|
||||
'recyclebin'=>'recyclebin contents',
|
||||
'retention'=>'retention contents',
|
||||
'httpaccess'=>'httpaccess contents',
|
||||
'webdav'=>'webdav contents',
|
||||
'requireSSL'=>'requireSSL contents',
|
||||
'indexes'=>'indexes contents',
|
||||
'dynamic'=>'dynamic contents',
|
||||
|
||||
);
|
||||
return %ret;
|
||||
}
|
||||
|
||||
sub get_data_for_panel_PERMISSIONS {
|
||||
# Return a hash with the fields required which will be loaded into the shared data
|
||||
my $c = shift;
|
||||
my %ret = (
|
||||
'Data1'=>'Data for PERMISSIONS', #Example
|
||||
# fields from Inputs in PERMISSIONS $fields['PERMISSIONS']
|
||||
'writegroup'=>'writegroup contents',
|
||||
'readgroup'=>'readgroup contents',
|
||||
'writegroup'=>'writegroup contents',
|
||||
'readgroup'=>'readgroup contents',
|
||||
'writegroup'=>'writegroup contents',
|
||||
'readgroup'=>'readgroup contents',
|
||||
'writegroup'=>'writegroup contents',
|
||||
'readgroup'=>'readgroup contents',
|
||||
'writegroup'=>'writegroup contents',
|
||||
'readgroup'=>'readgroup contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
'writeuser'=>'writeuser contents',
|
||||
'readuser'=>'readuser contents',
|
||||
|
||||
);
|
||||
return %ret;
|
||||
}
|
||||
|
||||
sub get_data_for_panel_REMOVE {
|
||||
# Return a hash with the fields required which will be loaded into the shared data
|
||||
my $c = shift;
|
||||
my %ret = (
|
||||
'Data1'=>'Data for REMOVE', #Example
|
||||
# fields from Inputs in REMOVE $fields['REMOVE']
|
||||
|
||||
);
|
||||
return %ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
# Get control data for table(s)
|
||||
|
||||
# Define a constant hash for field name mapping
|
||||
use constant Table1_FIELD_MAPPING => (
|
||||
'Table1-Name' => 'Table1-Name',
|
||||
'Table1-Description' => 'Table1-Description',
|
||||
'Table1-Actionp' => 'Table1-Actionp',
|
||||
'Table1-Actionm' => 'Table1-Actionm',
|
||||
'Table1-Actionr' => 'Table1-Actionr',
|
||||
);
|
||||
|
||||
sub actual_Table1 {
|
||||
my $c = shift;
|
||||
my @ret = ();
|
||||
# Actual code for extracting Table1
|
||||
$adb = esmith::AccountsDB::open() | die("Unable to open accounts DB");
|
||||
my @shares = $adb->get_all_by_prop(type => 'share');
|
||||
foreach my $share (@shares) {
|
||||
my $sharename = $share->key();
|
||||
my $sharedesc = $share->prop('Name');
|
||||
next if (($share->prop('Hide') || 'no') eq 'yes');
|
||||
my $removable = $share->prop('Removable') || 'yes';
|
||||
my $actionModify = '<a href="sharesd?trt=MODIFY&Selected='.$sharename.'>'.$c->l('sf_Modify').'>';
|
||||
my $actionPerm = '<a href="sharesd?trt=PERMISSIONS&Selected='.$sharename.'>'.$c->l('sf_Permisssions').'>';
|
||||
my $actionRemove = ($removable ne 'no') ?'<a href="sharesd?trt=REMOVE&Selected='.$sharename.'>'.$c->l('sf_Remove').'>' : '';
|
||||
push @ret,
|
||||
{ Table1-Name => $sharename,
|
||||
Table1-Description => $sharedesc,
|
||||
Table1-Actionp => $actionPerm,
|
||||
Table1-Actionm => $actionModify,
|
||||
Table1-Actionr => $actionRemove,
|
||||
}
|
||||
}
|
||||
return @ret;
|
||||
}
|
||||
|
||||
sub get_Table1 {
|
||||
# Return an array of hashes of the contents for each row and column for Table1
|
||||
my $c = shift;
|
||||
my @source_records = $c->actual_Table1();
|
||||
my @transformed_records;
|
||||
my %Field_Mapping = Table1_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;
|
||||
}
|
||||
|
||||
# Define a constant hash for field name mapping
|
||||
use constant Table2_FIELD_MAPPING => (
|
||||
'Table2-Groups' => 'Source-for-Table2-Groups',
|
||||
'Table2-Description' => 'Source-for-Table2-Description',
|
||||
'Table2-Read / Write' => 'Source-for-Table2-Read / Write',
|
||||
'Table2-Read Only' => 'Source-for-Table2-Read Only'
|
||||
#'target_field2' => 'source_field2',
|
||||
# Add more mappings as needed
|
||||
);
|
||||
|
||||
sub actual_Table2 {
|
||||
my $c = shift;
|
||||
my @ret = ();
|
||||
# Actual code for extracting Table2
|
||||
return @ret;
|
||||
}
|
||||
|
||||
sub get_Table2 {
|
||||
# Return an array of hashes of the contents for each row and column for Table2
|
||||
my $c = shift;
|
||||
my @source_records = $c->actual_Table2();
|
||||
my @transformed_records;
|
||||
my %Field_Mapping = Table2_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_LIST {
|
||||
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_MODIFY {
|
||||
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_PERMISSIONS {
|
||||
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_REMOVE {
|
||||
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_LIST {
|
||||
my $c = shift;
|
||||
my $sf_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_MODIFY {
|
||||
my $c = shift;
|
||||
my $sf_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: description e.g. $db->set_prop($dbkey,'description',$c->param('description'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for description';}
|
||||
if (! TRUE) #copy or perform with value: smbaccess e.g. $db->set_prop($dbkey,'smbaccess',$c->param('smbaccess'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for smbaccess';}
|
||||
if (! TRUE) #copy or perform with value: recyclebin e.g. $db->set_prop($dbkey,'recyclebin',$c->param('recyclebin'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for recyclebin';}
|
||||
if (! TRUE) #copy or perform with value: retention e.g. $db->set_prop($dbkey,'retention',$c->param('retention'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for retention';}
|
||||
if (! TRUE) #copy or perform with value: httpaccess e.g. $db->set_prop($dbkey,'httpaccess',$c->param('httpaccess'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for httpaccess';}
|
||||
if (! TRUE) #copy or perform with value: webdav e.g. $db->set_prop($dbkey,'webdav',$c->param('webdav'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for webdav';}
|
||||
if (! TRUE) #copy or perform with value: requireSSL e.g. $db->set_prop($dbkey,'requireSSL',$c->param('requireSSL'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for requireSSL';}
|
||||
if (! TRUE) #copy or perform with value: indexes e.g. $db->set_prop($dbkey,'indexes',$c->param('indexes'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for indexes';}
|
||||
if (! TRUE) #copy or perform with value: dynamic e.g. $db->set_prop($dbkey,'dynamic',$c->param('dynamic'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for dynamic';}
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub perform_PERMISSIONS {
|
||||
my $c = shift;
|
||||
my $sf_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: writegroup e.g. $db->set_prop($dbkey,'writegroup',$c->param('writegroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writegroup';}
|
||||
if (! TRUE) #copy or perform with value: readgroup e.g. $db->set_prop($dbkey,'readgroup',$c->param('readgroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readgroup';}
|
||||
if (! TRUE) #copy or perform with value: writegroup e.g. $db->set_prop($dbkey,'writegroup',$c->param('writegroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writegroup';}
|
||||
if (! TRUE) #copy or perform with value: readgroup e.g. $db->set_prop($dbkey,'readgroup',$c->param('readgroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readgroup';}
|
||||
if (! TRUE) #copy or perform with value: writegroup e.g. $db->set_prop($dbkey,'writegroup',$c->param('writegroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writegroup';}
|
||||
if (! TRUE) #copy or perform with value: readgroup e.g. $db->set_prop($dbkey,'readgroup',$c->param('readgroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readgroup';}
|
||||
if (! TRUE) #copy or perform with value: writegroup e.g. $db->set_prop($dbkey,'writegroup',$c->param('writegroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writegroup';}
|
||||
if (! TRUE) #copy or perform with value: readgroup e.g. $db->set_prop($dbkey,'readgroup',$c->param('readgroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readgroup';}
|
||||
if (! TRUE) #copy or perform with value: writegroup e.g. $db->set_prop($dbkey,'writegroup',$c->param('writegroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writegroup';}
|
||||
if (! TRUE) #copy or perform with value: readgroup e.g. $db->set_prop($dbkey,'readgroup',$c->param('readgroup'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readgroup';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if (! TRUE) #copy or perform with value: writeuser e.g. $db->set_prop($dbkey,'writeuser',$c->param('writeuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for writeuser';}
|
||||
if (! TRUE) #copy or perform with value: readuser e.g. $db->set_prop($dbkey,'readuser',$c->param('readuser'),type=>'service'))
|
||||
{$ret .= 'Perform/save failed for readuser';}
|
||||
if ($ret eq "") {$ret = 'ok';}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
sub perform_REMOVE {
|
||||
my $c = shift;
|
||||
my $sf_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 create_link{
|
||||
# WIP
|
||||
my ($c,$route, $panel, $index) = @_;
|
||||
my $link = "$route?trt=$panel&Selected=$index";
|
||||
return $link;
|
||||
}
|
||||
1;
|
398
Targets/Shares/Shares.pm
Normal file
398
Targets/Shares/Shares.pm
Normal file
@@ -0,0 +1,398 @@
|
||||
package SrvMngr::Controller::Shares;
|
||||
#
|
||||
# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
# Remember that each route must be unique (else they just overwrite each other).
|
||||
# you cannot have get and post on the same name and url.
|
||||
#
|
||||
#----------------------------------------------------------------------
|
||||
# heading : Network
|
||||
# description : Shared Folders
|
||||
# navigation : 7000 400
|
||||
#
|
||||
# name : shares, method : get, url : /shares, ctlact : Shares#main
|
||||
# name : sharesu, method : post, url : /sharesu, ctlact : Shares#do_update
|
||||
# name : sharesd, method : get, url : /sharesd, ctlact : Shares#do_display
|
||||
#
|
||||
# routes : end
|
||||
#
|
||||
# Documentation: https://wiki.contribs.org/Shares
|
||||
#----------------------------------------------------------------------
|
||||
|
||||
#
|
||||
# Scheme of things:
|
||||
#
|
||||
# TBA!!
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
use Mojo::Base 'Mojolicious::Controller';
|
||||
|
||||
use constant FALSE => 0;
|
||||
use constant TRUE => 1;
|
||||
|
||||
use Locale::gettext;
|
||||
use SrvMngr::I18N;
|
||||
use SrvMngr qw(theme_list init_session);
|
||||
|
||||
use Data::Dumper;
|
||||
|
||||
use esmith::util;
|
||||
use esmith::util::network;
|
||||
use esmith::ConfigDB;
|
||||
use esmith::AccountsDB;
|
||||
use esmith::NetworksDB;
|
||||
use esmith::HostsDB;
|
||||
use esmith::DomainsDB;
|
||||
|
||||
my $cdb;
|
||||
my $adb;
|
||||
my $ndb;
|
||||
my $hdb;
|
||||
my $ddb;
|
||||
|
||||
my %sf_data;
|
||||
|
||||
require '/usr/share/smanager/lib/SrvMngr/Controller/Shares-Custom.pm'; #The code that is to be added by the developer
|
||||
|
||||
sub main {
|
||||
#
|
||||
# Initial entry - route is "/<whatever>"
|
||||
#
|
||||
#set initial panel
|
||||
#for initial panel:
|
||||
#Specifiy panel to enter
|
||||
#load up _data hash with DB fields
|
||||
#load up stash with pointer(s) to control fields hash(= get-))
|
||||
#and a pointer to the prefix_data hash
|
||||
#render initial panel
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info( $c->log_req );
|
||||
|
||||
#The most common ones
|
||||
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
|
||||
|
||||
%sf_data = ();
|
||||
my $title = $c->l('sf_Shared_Folders');
|
||||
my $modul = '';
|
||||
|
||||
$sf_data{'trt'} = 'LIST';
|
||||
|
||||
#Load any DB entries into the <prefix>_data area so as they are preset in the form
|
||||
# which DB - this only really works if the initial panel is a PARAMS type panel and not a TABLE
|
||||
my $db = $cdb; #pickup local or global db or Default to config
|
||||
|
||||
|
||||
$c->do_display($sf_data{'trt'});
|
||||
|
||||
}
|
||||
|
||||
# Post request with params - submit from the form
|
||||
sub do_update {
|
||||
#
|
||||
# Return after submit pushed on panel (this is a post) - route is "/<whatever>u"
|
||||
# parameters in the params hash.
|
||||
#
|
||||
#load up all params into prefix_data hash:
|
||||
#By panel (series of if statements - only one executed):
|
||||
#call validate-PANEL() - return ret = ok or error message
|
||||
|
||||
#if validation not ok:
|
||||
#render back to current panel with error message in stash
|
||||
#otherwise:
|
||||
#By panel (series of if statements - only one executed):
|
||||
#do whatever is required: call perform-PANEL() - return "ok" or Error Message
|
||||
#call signal-event for any global actions specified (check it exists - error and continue?)
|
||||
#if action smeserver-<whatever>-update exists
|
||||
#signal_event smeserver-<whatever>-update
|
||||
#call signal-event for any specific actions for thids panel (check it exists first - error and continue)
|
||||
#set success in stash
|
||||
#if no "nextpanel" entry:
|
||||
#set firstpanel
|
||||
#else
|
||||
#set nextpanel
|
||||
#call render
|
||||
|
||||
my $c = shift;
|
||||
$c->app->log->info($c->log_req);
|
||||
my $modul = '';
|
||||
|
||||
#The most common ones - you might want to comment out any not used.
|
||||
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
|
||||
|
||||
my $title = $c->l('sf_Shared_Folders');
|
||||
|
||||
# Accessing all POST/GET parameters
|
||||
my $params = $c->req->params->to_hash;
|
||||
|
||||
# Get number of POST parameters
|
||||
#my $num_params = keys scaler %$params;
|
||||
|
||||
#Params are available in the hash "params" - copy to the prefix_data hash
|
||||
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
|
||||
# $sf_data{$key} = $value;
|
||||
#}
|
||||
|
||||
# the value of trt will tell you which panel has returned
|
||||
my $trt = $c->param('trt') || 'LIST'; #hidden control on every form.
|
||||
my $ret = 'ok';
|
||||
|
||||
#Validate the parameters in a custom sub one for each panel (although only one of these will be executed)
|
||||
my $thispanel;
|
||||
|
||||
if ($trt eq 'LIST'){
|
||||
#Validate form parameters for panel LIST
|
||||
$ret = $c->validate_LIST(\%sf_data);
|
||||
$thispanel = 'LIST';
|
||||
}
|
||||
|
||||
if ($trt eq 'MODIFY'){
|
||||
#Validate form parameters for panel MODIFY
|
||||
$ret = $c->validate_MODIFY(\%sf_data);
|
||||
$thispanel = 'MODIFY';
|
||||
}
|
||||
|
||||
if ($trt eq 'PERMISSIONS'){
|
||||
#Validate form parameters for panel PERMISSIONS
|
||||
$ret = $c->validate_PERMISSIONS(\%sf_data);
|
||||
$thispanel = 'PERMISSIONS';
|
||||
}
|
||||
|
||||
if ($trt eq 'REMOVE'){
|
||||
#Validate form parameters for panel REMOVE
|
||||
$ret = $c->validate_REMOVE(\%sf_data);
|
||||
$thispanel = 'REMOVE';
|
||||
}
|
||||
|
||||
if ($ret ne "ok"){
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->do_display($thispanel);
|
||||
} else {
|
||||
#Do whatever is needed, including writing values to the DB
|
||||
|
||||
|
||||
if ($trt eq 'LIST'){
|
||||
#do whatever is required ...
|
||||
$ret = $c->perform_LIST(\%sf_data);
|
||||
if ($ret ne "ok") {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
sf_data => \%sf_data
|
||||
);
|
||||
$c->render(template => "shares");
|
||||
} else {
|
||||
$c->stash( success => $c->l('sf_LIST_panel_action_was_successful')); #A bit bland - edit it in the lex file
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'MODIFY'){
|
||||
#do whatever is required ...
|
||||
$ret = $c->perform_MODIFY(\%sf_data);
|
||||
if ($ret ne "ok") {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
sf_data => \%sf_data
|
||||
);
|
||||
$c->render(template => "shares");
|
||||
} else {
|
||||
$c->stash( success => $c->l('sf_MODIFY_panel_action_was_successful')); #A bit bland - edit it in the lex file
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'PERMISSIONS'){
|
||||
#do whatever is required ...
|
||||
$ret = $c->perform_PERMISSIONS(\%sf_data);
|
||||
if ($ret ne "ok") {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
sf_data => \%sf_data
|
||||
);
|
||||
$c->render(template => "shares");
|
||||
} else {
|
||||
$c->stash( success => $c->l('sf_PERMISSIONS_panel_action_was_successful')); #A bit bland - edit it in the lex file
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'REMOVE'){
|
||||
#do whatever is required ...
|
||||
$ret = $c->perform_REMOVE(\%sf_data);
|
||||
if ($ret ne "ok") {
|
||||
# return to the panel with error message
|
||||
$c->stash(error => $c->l($ret));
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
sf_data => \%sf_data
|
||||
);
|
||||
$c->render(template => "shares");
|
||||
} else {
|
||||
$c->stash( success => $c->l('sf_REMOVE_panel_action_was_successful')); #A bit bland - edit it in the lex file
|
||||
}
|
||||
}
|
||||
|
||||
# and call any signal-events needed
|
||||
#TBD
|
||||
# Setup shared data and call panel
|
||||
if ('none' eq 'none') {
|
||||
$sf_data{'trt'} = 'LIST';
|
||||
} else {
|
||||
$sf_data{'trt'} = 'none';
|
||||
}
|
||||
$c->do_display($sf_data{'trt'});
|
||||
}
|
||||
}
|
||||
|
||||
sub do_display {
|
||||
#
|
||||
# Return after link clicked in table (this is a get) - route is "/<whatever>d"
|
||||
# Expects ?trt=PANEL&selected="TableRowName" plus any other required
|
||||
#
|
||||
# OR it maybe a post from the main panel to add a new record
|
||||
#
|
||||
#load up all supplied params into prefix_data hash
|
||||
#call get-selected-PANEL() - returns hash of all relevent parameters
|
||||
#load up returned hash into prefix_data
|
||||
#render - to called panel
|
||||
|
||||
my ($c,$trt) = @_;
|
||||
$c->app->log->info($c->log_req);
|
||||
|
||||
#The most common ones - you might want to comment out any not used.
|
||||
$cdb = esmith::ConfigDB->open() || die("Couldn't open config db");
|
||||
$adb = esmith::AccountsDB->open() || die("Couldn't open Accounts db");
|
||||
$ndb = esmith::NetworksDB->open() || die("Couldn't open Network db");
|
||||
$hdb = esmith::HostsDB->open() || die("Couldn't open Hosts db");
|
||||
$ddb = esmith::DomainsDB->open() || die("Couldn't open Domains db");
|
||||
|
||||
my $title = $c->l('sf_Shared_Folders');
|
||||
my $modul = "";
|
||||
|
||||
# Accessing all parameters
|
||||
my $params = $c->req->params->to_hash;
|
||||
|
||||
# Get number of parameters
|
||||
my $num_params = keys %$params;
|
||||
|
||||
#Tag as Post or Get (ie. create new entry or edit existing one
|
||||
my $is_new_record = ($c->req->method() eq 'POST');
|
||||
|
||||
#Params are available in the hash "params" - copy to the prefix_data hash
|
||||
#while (my ($key, $value) = each %{$c->req->params->to_hash}) {
|
||||
# $sf_data{$key} = $value;
|
||||
#}
|
||||
|
||||
# the value of trt will tell you which panel has returned
|
||||
if (! $trt){
|
||||
$trt = $c->param('trt') || 'LIST'; #Indicates where to go now
|
||||
}
|
||||
|
||||
# Now add in the params from the selected row from the table
|
||||
|
||||
my %selectedrow;
|
||||
|
||||
if ($trt eq 'LIST'){
|
||||
#Validate Get selected row (if applicable) LIST
|
||||
%selectedrow = $c->get_selected_LIST($sf_data{'Selected'},$is_new_record);
|
||||
}
|
||||
|
||||
if ($trt eq 'MODIFY'){
|
||||
#Validate Get selected row (if applicable) MODIFY
|
||||
%selectedrow = $c->get_selected_MODIFY($sf_data{'Selected'},$is_new_record);
|
||||
}
|
||||
|
||||
if ($trt eq 'PERMISSIONS'){
|
||||
#Validate Get selected row (if applicable) PERMISSIONS
|
||||
%selectedrow = $c->get_selected_PERMISSIONS($sf_data{'Selected'},$is_new_record);
|
||||
}
|
||||
|
||||
if ($trt eq 'REMOVE'){
|
||||
#Validate Get selected row (if applicable) REMOVE
|
||||
%selectedrow = $c->get_selected_REMOVE($sf_data{'Selected'},$is_new_record);
|
||||
}
|
||||
|
||||
|
||||
#Copy in the selected row params to the prefix_data hash to pass to the panel
|
||||
while (my ($key, $value) = each %selectedrow){
|
||||
$sf_data{$key} = $value;
|
||||
}
|
||||
# Where to go now
|
||||
$sf_data{'trt'} = $trt;
|
||||
|
||||
# Set up other shared data according to the panel to go to
|
||||
|
||||
if ($trt eq 'LIST'){
|
||||
# pickup any other contents needed and load them into hash shared with panel
|
||||
my %returned_hash;
|
||||
# subroutine returns a hash directly
|
||||
%returned_hash = $c->get_data_for_panel_LIST();
|
||||
# Copy each key-value pair from the returned hash to the prefix data hash
|
||||
while (my ($key, $value) = each %returned_hash) {
|
||||
$sf_data{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'MODIFY'){
|
||||
# pickup any other contents needed and load them into hash shared with panel
|
||||
my %returned_hash;
|
||||
# subroutine returns a hash directly
|
||||
%returned_hash = $c->get_data_for_panel_MODIFY();
|
||||
# Copy each key-value pair from the returned hash to the prefix data hash
|
||||
while (my ($key, $value) = each %returned_hash) {
|
||||
$sf_data{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'PERMISSIONS'){
|
||||
# pickup any other contents needed and load them into hash shared with panel
|
||||
my %returned_hash;
|
||||
# subroutine returns a hash directly
|
||||
%returned_hash = $c->get_data_for_panel_PERMISSIONS();
|
||||
# Copy each key-value pair from the returned hash to the prefix data hash
|
||||
while (my ($key, $value) = each %returned_hash) {
|
||||
$sf_data{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
if ($trt eq 'REMOVE'){
|
||||
# pickup any other contents needed and load them into hash shared with panel
|
||||
my %returned_hash;
|
||||
# subroutine returns a hash directly
|
||||
%returned_hash = $c->get_data_for_panel_REMOVE();
|
||||
# Copy each key-value pair from the returned hash to the prefix data hash
|
||||
while (my ($key, $value) = each %returned_hash) {
|
||||
$sf_data{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# and table control fields
|
||||
$c->stash(Table1=>$c->get_Table1());
|
||||
$c->stash(Table2=>$c->get_Table2());
|
||||
|
||||
|
||||
# Data for panel
|
||||
$c->stash(
|
||||
title => $title,
|
||||
modul => $modul,
|
||||
sf_data => \%sf_data
|
||||
);
|
||||
$c->render(template => "shares");
|
||||
}
|
||||
1;
|
69
Targets/Shares/_sf_LIST.html.ep
Normal file
69
Targets/Shares/_sf_LIST.html.ep
Normal file
@@ -0,0 +1,69 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
%#
|
||||
<div id="Shares-LIST" class="partial Shares-LIST">
|
||||
# <script>
|
||||
# window.onload = function() {
|
||||
# SelectInput();
|
||||
# };
|
||||
# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $sf_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('sf_APPLY');
|
||||
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
%= form_for "sharesu" => (method => 'POST') => begin
|
||||
% param 'trt' => $sf_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $sf_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
|
||||
<h1 class='head'><%=l('sf_Create,_modify,_or_remove_shared')%></h1>
|
||||
|
||||
<h2 class='subh'><%=l('sf_Manage_shared-folders_settings:')%></h2>
|
||||
|
||||
<p class='paragraph para1'>
|
||||
%=l('sf_You_can_remove_any_shared')
|
||||
</p>
|
||||
|
||||
<p class='paragraph para2'>
|
||||
%=l('sf_Create_a_new_shared_folder')
|
||||
</p>
|
||||
|
||||
<a href='shared-folderu?trt=MODIFY' class='link link1'>
|
||||
%= l('sf_Create_a_new_shared_folder')
|
||||
</a>
|
||||
%#= link_to l('sf_Create_a_new_shared_folder'), 'shared-folderu?trt=MODIFY' , class=>'link link1'
|
||||
|
||||
|
||||
<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-Name '><%=l('sf_Name')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Description '><%=l('sf_Description')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Actionp '><%=l('sf_Actionp')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Actionm '><%=l('sf_Actionm')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Actionr '><%=l('sf_Actionr')%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='tabl1'>
|
||||
% my $control_data = $c->stash('Table1');
|
||||
% foreach my $row (@$control_data) {
|
||||
<tr class='table-row'>
|
||||
<td class='sme-border table-col table-col-Table1-Name'><%=$c->render_to_string(inline=>$row->{'Table1-Name'})%></td>
|
||||
<td class='sme-border table-col table-col-Table1-Description'><%=$c->render_to_string(inline=>$row->{'Table1-Description'})%></td>
|
||||
<td class='sme-border table-col table-col-Table1-Actionp'><%=$c->render_to_string(inline=>$row->{'Table1-Actionp'})%></td>
|
||||
<td class='sme-border table-col table-col-Table1-Actionm'><%=$c->render_to_string(inline=>$row->{'Table1-Actionm'})%></td>
|
||||
<td class='sme-border table-col table-col-Table1-Actionr'><%=$c->render_to_string(inline=>$row->{'Table1-Actionr'})%></td>
|
||||
</tr>
|
||||
%}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
%# Probably finally by a submit.
|
||||
%end
|
||||
</div>
|
113
Targets/Shares/_sf_MODIFY.html.ep
Normal file
113
Targets/Shares/_sf_MODIFY.html.ep
Normal file
@@ -0,0 +1,113 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
%#
|
||||
<div id="Shares-MODIFY" class="partial Shares-MODIFY">
|
||||
# <script>
|
||||
# window.onload = function() {
|
||||
# SelectInput();
|
||||
# };
|
||||
# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $sf_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('sf_APPLY');
|
||||
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
%= form_for "sharesu" => (method => 'POST') => begin
|
||||
% param 'trt' => $sf_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $sf_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
|
||||
<h1 class='head'><%=l('sf_Create,_modify,_or_remove_shared')%></h1>
|
||||
|
||||
<h2 class='subh'><%=l('sf_Create_or_modify_a_shared')%></h2>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_description')
|
||||
</span><span class=data>
|
||||
% param 'description' => $sf_data->{description} unless param 'description';
|
||||
%= text_field 'description', size => '50', class => 'textinput description' , pattern=>'.*' , placeholder=>'description', title =>'Pattern regex mismatch', id => 'description_text'
|
||||
<br></span></p>
|
||||
|
||||
<p class='paragraph para14'>
|
||||
%=l('sf_The_following_settings_control_the')
|
||||
</p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_smbaccess')
|
||||
</span><span class=data>
|
||||
% my @smbaccess_options = [['Enabled, browseable' => 'browseable'], ['Enabled, hidden' => 'non-browseable'], ['No access' => 'none']];
|
||||
% param 'smbaccess' => $sf_data->{smbaccess} unless param 'smbaccess';
|
||||
%= select_field 'smbaccess' => @smbaccess_options, class => 'input', id => 'smbaccess_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_recyclebin')
|
||||
</span><span class=data>
|
||||
% my @recyclebin_options = [['disabled' => 'disabled'], ['Enabled, keep only the latest version' => 'enabled'], ['Enabled, keep a copy of all versions' => 'keep-versions']];
|
||||
% param 'recyclebin' => $sf_data->{recyclebin} unless param 'recyclebin';
|
||||
%= select_field 'recyclebin' => @recyclebin_options, class => 'input', id => 'recyclebin_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_retention')
|
||||
</span><span class=data>
|
||||
% my @retention_options = [['one month' => '30'], ['one week' => '7'], ['one year' => '365'], ['six months' => '180'], ['unlimited' => 'unlimited']];
|
||||
% param 'retention' => $sf_data->{retention} unless param 'retention';
|
||||
%= select_field 'retention' => @retention_options, class => 'input', id => 'retention_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p class='paragraph para2'>
|
||||
%=l('sf_The_following_settings_control_the')
|
||||
</p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_httpaccess')
|
||||
</span><span class=data>
|
||||
% my @httpaccess_options = [['Entire Internet (no password required)' => 'global'], ['Entire Internet (password required)' => 'global-pw'], ['Entire Internet (password required outside local network)' => 'global-pw-remote'], ['Local network (no password required)' => 'local'], ['Local network (password required)' => 'local-pw'], ['No access' => 'none']];
|
||||
% param 'httpaccess' => $sf_data->{httpaccess} unless param 'httpaccess';
|
||||
%= select_field 'httpaccess' => @httpaccess_options, class => 'input', id => 'httpaccess_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_webdav')
|
||||
</span><span class=data>
|
||||
% my @webdav_options = [['disabled' => 'disabled'], ['enabled' => 'enabled']];
|
||||
% param 'webdav' => $sf_data->{webdav} unless param 'webdav';
|
||||
%= select_field 'webdav' => @webdav_options, class => 'input', id => 'webdav_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_requireSSL')
|
||||
</span><span class=data>
|
||||
% my @requireSSL_options = [['disabled' => 'disabled'], ['enabled' => 'enabled']];
|
||||
% param 'requireSSL' => $sf_data->{requireSSL} unless param 'requireSSL';
|
||||
%= select_field 'requireSSL' => @requireSSL_options, class => 'input', id => 'requireSSL_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_indexes')
|
||||
</span><span class=data>
|
||||
% my @indexes_options = [['disabled' => 'disabled'], ['enabled' => 'enabled']];
|
||||
% param 'indexes' => $sf_data->{indexes} unless param 'indexes';
|
||||
%= select_field 'indexes' => @indexes_options, class => 'input', id => 'indexes_select'
|
||||
<br></span> </p>
|
||||
|
||||
<p><span class=label>
|
||||
%=l('sf_dynamic')
|
||||
</span><span class=data>
|
||||
% my @dynamic_options = [['disabled' => 'disabled'], ['enabled' => 'enabled']];
|
||||
% param 'dynamic' => $sf_data->{dynamic} unless param 'dynamic';
|
||||
%= select_field 'dynamic' => @dynamic_options, class => 'input', id => 'dynamic_select'
|
||||
<br></span> </p>
|
||||
|
||||
<span class='data'>
|
||||
%= submit_button l('sf_Save'), class => 'action subm109'
|
||||
</span>
|
||||
|
||||
%# Probably finally by a submit.
|
||||
%end
|
||||
</div>
|
365
Targets/Shares/_sf_PERMISSIONS.html.ep
Normal file
365
Targets/Shares/_sf_PERMISSIONS.html.ep
Normal file
@@ -0,0 +1,365 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
%#
|
||||
<div id="Shares-PERMISSIONS" class="partial Shares-PERMISSIONS">
|
||||
# <script>
|
||||
# window.onload = function() {
|
||||
# SelectInput();
|
||||
# };
|
||||
# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $sf_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('sf_APPLY');
|
||||
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
%= form_for "sharesu" => (method => 'POST') => begin
|
||||
% param 'trt' => $sf_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $sf_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
|
||||
<h1 class='head'><%=l('sf_Create,_modify,_or_remove_shared')%></h1>
|
||||
|
||||
<h2 class='subh'><%=l('sf_Access_right_management')%></h2>
|
||||
|
||||
<p class='paragraph para10'>
|
||||
%=l('sf_You_can_use_this_matrix')
|
||||
</p>
|
||||
|
||||
<br /><table class="sme-border TableSort sme-table tabl2 ">
|
||||
<thead class='tabl2'>
|
||||
<tr table-head-row>
|
||||
<th class='sme-border table-head-col table-head-col-Groups '><%=l('sf_Groups')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Description '><%=l('sf_Description')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Read / Write '><%=l('sf_Read_/_Write')%></th>
|
||||
<th class='sme-border table-head-col table-head-col-Read Only '><%=l('sf_Read_Only')%></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class='tabl2'>
|
||||
% my $control_data = $c->stash('Table2');
|
||||
% foreach my $row (@$control_data) {
|
||||
<tr class='table-row'>
|
||||
<td class='sme-border table-col table-col-Table2-Groups'><%=$c->render_to_string(inline=>$row->{'Table2-Groups'})%></td>
|
||||
<td class='sme-border table-col table-col-Table2-Description'><%=$c->render_to_string(inline=>$row->{'Table2-Description'})%></td>
|
||||
<td class='sme-border table-col table-col-Table2-Read / Write'><%=$c->render_to_string(inline=>$row->{'Table2-Read / Write'})%></td>
|
||||
<td class='sme-border table-col table-col-Table2-Read Only'><%=$c->render_to_string(inline=>$row->{'Table2-Read Only'})%></td>
|
||||
</tr>
|
||||
%}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writegroup')
|
||||
</span><span class=data>
|
||||
% param 'writegroup' => $sf_data->{writegroup} unless param 'writegroup';
|
||||
%=checkbox_field 'writegroup', class => 'chec110'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readgroup')
|
||||
</span><span class=data>
|
||||
% param 'readgroup' => $sf_data->{readgroup} unless param 'readgroup';
|
||||
%=checkbox_field 'readgroup', class => 'chec111'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writegroup')
|
||||
</span><span class=data>
|
||||
% param 'writegroup' => $sf_data->{writegroup} unless param 'writegroup';
|
||||
%=checkbox_field 'writegroup', class => 'chec112'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readgroup')
|
||||
</span><span class=data>
|
||||
% param 'readgroup' => $sf_data->{readgroup} unless param 'readgroup';
|
||||
%=checkbox_field 'readgroup', class => 'chec113'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writegroup')
|
||||
</span><span class=data>
|
||||
% param 'writegroup' => $sf_data->{writegroup} unless param 'writegroup';
|
||||
%=checkbox_field 'writegroup', class => 'chec114'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readgroup')
|
||||
</span><span class=data>
|
||||
% param 'readgroup' => $sf_data->{readgroup} unless param 'readgroup';
|
||||
%=checkbox_field 'readgroup', class => 'chec115'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writegroup')
|
||||
</span><span class=data>
|
||||
% param 'writegroup' => $sf_data->{writegroup} unless param 'writegroup';
|
||||
%=checkbox_field 'writegroup', class => 'chec116'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readgroup')
|
||||
</span><span class=data>
|
||||
% param 'readgroup' => $sf_data->{readgroup} unless param 'readgroup';
|
||||
%=checkbox_field 'readgroup', class => 'chec117'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writegroup')
|
||||
</span><span class=data>
|
||||
% param 'writegroup' => $sf_data->{writegroup} unless param 'writegroup';
|
||||
%=checkbox_field 'writegroup', class => 'chec118'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readgroup')
|
||||
</span><span class=data>
|
||||
% param 'readgroup' => $sf_data->{readgroup} unless param 'readgroup';
|
||||
%=checkbox_field 'readgroup', class => 'chec119'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec120'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec121'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec122'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec123'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec124'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec125'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec126'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec127'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec128'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec129'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec130'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec131'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec132'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec133'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec134'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec135'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec136'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec137'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec138'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec139'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec140'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec141'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec142'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec143'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec144'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec145'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_writeuser')
|
||||
</span><span class=data>
|
||||
% param 'writeuser' => $sf_data->{writeuser} unless param 'writeuser';
|
||||
%=checkbox_field 'writeuser', class => 'chec146'
|
||||
</span></p>
|
||||
|
||||
|
||||
<p><span class='label'>
|
||||
%=l('sf_readuser')
|
||||
</span><span class=data>
|
||||
% param 'readuser' => $sf_data->{readuser} unless param 'readuser';
|
||||
%=checkbox_field 'readuser', class => 'chec147'
|
||||
</span></p>
|
||||
|
||||
|
||||
<span class='data'>
|
||||
%= submit_button l('sf_Save'), class => 'action subm148'
|
||||
</span>
|
||||
|
||||
%# Probably finally by a submit.
|
||||
%end
|
||||
</div>
|
50
Targets/Shares/_sf_REMOVE.html.ep
Normal file
50
Targets/Shares/_sf_REMOVE.html.ep
Normal file
@@ -0,0 +1,50 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
%#
|
||||
<div id="Shares-REMOVE" class="partial Shares-REMOVE">
|
||||
# <script>
|
||||
# window.onload = function() {
|
||||
# SelectInput();
|
||||
# };
|
||||
# </script>
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $sf_data
|
||||
</pre>
|
||||
% }
|
||||
% my $btn = l('sf_APPLY');
|
||||
|
||||
% $c->param(Selected => undef); #This may need deleting for a params panel - only needed for a table
|
||||
|
||||
%= form_for "sharesu" => (method => 'POST') => begin
|
||||
% param 'trt' => $sf_data->{trt} unless param 'trt';
|
||||
%= hidden_field 'trt' => $sf_data->{trt}
|
||||
%# Inputs etc in here.
|
||||
|
||||
<h1 class='head'><%=l('sf_Create,_modify,_or_remove_shared')%></h1>
|
||||
|
||||
<h2 class='subh'><%=l('sf_Remove_shared_folder')%></h2>
|
||||
|
||||
<p class='paragraph para11'>
|
||||
%=l('sf_You_are_about_to_remove')
|
||||
</p>
|
||||
|
||||
<p class='paragraph para21'>
|
||||
%=l('sf_All_files_belonging_to_this')
|
||||
</p>
|
||||
|
||||
<p class='paragraph para31'>
|
||||
%=l('sf_Are_you_sure_you_wish')
|
||||
</p>
|
||||
|
||||
<span class='data'>
|
||||
%= submit_button l('sf_Cancel'), class => 'action subm149'
|
||||
</span>
|
||||
|
||||
<span class='data'>
|
||||
%= submit_button l('sf_Remove'), class => 'action subm150'
|
||||
</span>
|
||||
|
||||
%# Probably finally by a submit.
|
||||
%end
|
||||
</div>
|
86
Targets/Shares/shares.css
Normal file
86
Targets/Shares/shares.css
Normal file
@@ -0,0 +1,86 @@
|
||||
/*
|
||||
Generated by: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
*/
|
||||
.Shares-panel {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.head {}
|
||||
.subh {}
|
||||
.para1 {}
|
||||
.para2 {}
|
||||
.link1 {}
|
||||
.tabl1 {}
|
||||
thead .tabl1 {}
|
||||
tbody .tabl1 {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.head {}
|
||||
.subh {}
|
||||
.text100 {}
|
||||
.para14 {}
|
||||
.sele101 {}
|
||||
.sele102 {}
|
||||
.sele103 {}
|
||||
.para2 {}
|
||||
.sele104 {}
|
||||
.sele105 {}
|
||||
.sele106 {}
|
||||
.sele107 {}
|
||||
.sele108 {}
|
||||
.subm109 {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.head {}
|
||||
.subh {}
|
||||
.para10 {}
|
||||
.tabl2 {}
|
||||
thead .tabl2 {}
|
||||
tbody .tabl2 {}
|
||||
.chec110 {}
|
||||
.chec111 {}
|
||||
.chec112 {}
|
||||
.chec113 {}
|
||||
.chec114 {}
|
||||
.chec115 {}
|
||||
.chec116 {}
|
||||
.chec117 {}
|
||||
.chec118 {}
|
||||
.chec119 {}
|
||||
.chec120 {}
|
||||
.chec121 {}
|
||||
.chec122 {}
|
||||
.chec123 {}
|
||||
.chec124 {}
|
||||
.chec125 {}
|
||||
.chec126 {}
|
||||
.chec127 {}
|
||||
.chec128 {}
|
||||
.chec129 {}
|
||||
.chec130 {}
|
||||
.chec131 {}
|
||||
.chec132 {}
|
||||
.chec133 {}
|
||||
.chec134 {}
|
||||
.chec135 {}
|
||||
.chec136 {}
|
||||
.chec137 {}
|
||||
.chec138 {}
|
||||
.chec139 {}
|
||||
.chec140 {}
|
||||
.chec141 {}
|
||||
.chec142 {}
|
||||
.chec143 {}
|
||||
.chec144 {}
|
||||
.chec145 {}
|
||||
.chec146 {}
|
||||
.chec147 {}
|
||||
.subm148 {}
|
||||
.name {}
|
||||
.rout {}
|
||||
.head {}
|
||||
.subh {}
|
||||
.para11 {}
|
||||
.para21 {}
|
||||
.para31 {}
|
||||
.subm149 {}
|
||||
.subm150 {}
|
68
Targets/Shares/shares.html.ep
Normal file
68
Targets/Shares/shares.html.ep
Normal file
@@ -0,0 +1,68 @@
|
||||
%#
|
||||
%# Generated by SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
%#
|
||||
% layout 'default', title => "Sme server 2 - Shared Folders", share_dir => './';
|
||||
%# css specific to this panel:
|
||||
% content_for 'module' => begin
|
||||
%= stylesheet '/css/shares.css'
|
||||
%= javascript '/js/shares.js'
|
||||
<div id="module" class="module Shares-panel">
|
||||
|
||||
% if (config->{debug} == 1) {
|
||||
<pre>
|
||||
%= dumper $c->current_route
|
||||
%= dumper $sf_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 ($sf_data->{trt} eq "LIST") {
|
||||
%= include 'partials/_sf_LIST'
|
||||
%}
|
||||
|
||||
% if ($sf_data->{trt} eq "MODIFY") {
|
||||
%= include 'partials/_sf_MODIFY'
|
||||
%}
|
||||
|
||||
% if ($sf_data->{trt} eq "PERMISSIONS") {
|
||||
%= include 'partials/_sf_PERMISSIONS'
|
||||
%}
|
||||
|
||||
% if ($sf_data->{trt} eq "REMOVE") {
|
||||
%= include 'partials/_sf_REMOVE'
|
||||
%}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
%end
|
5
Targets/Shares/shares.js
Normal file
5
Targets/Shares/shares.js
Normal 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-21 08:46:42
|
||||
//
|
||||
$(document).ready(function() {
|
||||
});
|
46
Targets/Shares/shares_en.lex
Normal file
46
Targets/Shares/shares_en.lex
Normal file
@@ -0,0 +1,46 @@
|
||||
#
|
||||
# Generated by SM2Gen version: SM2Gen version:0.9(20Jan2025) Chameleon version:4.5.4 On Python:3.12.3 at 2025-05-21 08:46:42
|
||||
#
|
||||
'sf_readgroup' => 'regroup',
|
||||
'sf_Description' => 'Description',
|
||||
'sf_dynamic' => 'Dynamic',
|
||||
'sf_description' => 'Description',
|
||||
'sf_The_following_settings_control_the' => 'The following settings control the access of this shared folder using the HTTP/HTTPS protocol',
|
||||
'sf_Create,_modify,_or_remove_shared' => 'create modify Or remove shared folders',
|
||||
'sf_Remove' => 'Remove',
|
||||
'sf_httpaccess' => 'Httpaccess',
|
||||
'sf_readuser' => 'reader',
|
||||
'sf_Cancel' => 'Cancel',
|
||||
'sf_All_files_belonging_to_this' => 'All files belonging to this shared folder will be deleted',
|
||||
'sf_smbaccess' => 'Smbaccess',
|
||||
'sf_You_can_use_this_matrix' => 'You can use this matrix to define groups and users access permissions',
|
||||
'sf_webdav' => 'Webdav',
|
||||
'sf_Create_a_new_shared_folder' => 'Create a new shared folder',
|
||||
'sf_REMOVE_panel_action_was_successful' => 'REMOVE panel action was successful',
|
||||
'sf_Actionr' => 'action',
|
||||
'sf_You_are_about_to_remove' => 'You are about to remove the following shared folder',
|
||||
'sf_Shared_Folders' => 'Shared Folders',
|
||||
'sf_MODIFY_panel_action_was_successful' => 'MODIFY panel action was successful',
|
||||
'sf_indexes' => 'Indexes',
|
||||
'sf_Are_you_sure_you_wish' => 'Are you sure you wish to remove it ?',
|
||||
'sf_Actionm' => 'action',
|
||||
'sf_writeuser' => 'Writeuser',
|
||||
'sf_LIST_panel_action_was_successful' => 'LIST panel action was successful',
|
||||
'sf_Remove_shared_folder' => 'Remove shared folder',
|
||||
'sf_PERMISSIONS_panel_action_was_successful' => 'PERMISSIONS panel action was successful',
|
||||
'sf_Manage_shared-folders_settings:' => 'Manage shared-folders settings',
|
||||
'sf_You_can_remove_any_shared' => 'You can remove any shared folder by clicking on the corresponding command next to the shared folder',
|
||||
'sf_APPLY' => 'Apply',
|
||||
'sf_requireSSL' => 'requires',
|
||||
'sf_Groups' => 'Groups',
|
||||
'sf_Save' => 'Save',
|
||||
'sf_Actionp' => 'action',
|
||||
'sf_writegroup' => 'Writegroup',
|
||||
'sf_Name' => 'Name',
|
||||
'sf_Read_Only' => 'Read Only',
|
||||
'sf_retention' => 'Retention',
|
||||
'sf_Access_right_management' => 'Access right management',
|
||||
'sf_Read_/_Write' => 'Read / Write',
|
||||
'sf_Create_or_modify_a_shared' => 'Create or modify a shared folder',
|
||||
'sf_The_following_settings_control_the' => 'The following settings control the access of this shared folder from the local network Using the SMB/CIFS protocol',
|
||||
'sf_recyclebin' => 'Recyclebin',
|
Reference in New Issue
Block a user