diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/lib/SrvMngr/Controller/Shared_folders.pm smeserver-shared-folders-0.3/root/usr/share/smanager/lib/SrvMngr/Controller/Shared_folders.pm --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/lib/SrvMngr/Controller/Shared_folders.pm 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/lib/SrvMngr/Controller/Shared_folders.pm 2020-07-31 17:14:00.000000000 +0100 @@ -0,0 +1,337 @@ +package SrvMngr::Controller::Shared_folders; + +#---------------------------------------------------------------------- +# heading : Collaboration +# description : Shared Folders +# navigation : 2000 2600 +# +# name : shared_foldersget, method : get, url : /shared_folders, ctlact : Shared_folders#main +# name : shared_folderss, method : post, url : /shared_folders, ctlact : Shared_folders#do_save +# name : shared_foldersc, method : get, url : /shared_foldersc, ctlact : Shared_folders#do_create_modify +# name : shared_foldersc, method : post, url : /shared_foldersc, ctlact : Shared_folders#do_create_modify +# name : shared_foldersd, method : get, url : /shared_foldersd, ctlact : Shared_folders#do_delete +# name : shared_foldersp, method : get, url : /shared_foldersp, ctlact : Shared_folders#do_permissions +# name : shared_folderse, method : get, url : /shared_folderse, ctlact : Shared_folders#do_encrypt +# routes : end +# +# Documentation : https://wiki.contribs.org/SharedFolders +#---------------------------------------------------------------------- + +use strict; +use warnings; +use Mojo::Base 'Mojolicious::Controller'; + +use Locale::gettext; +use SrvMngr::I18N; +use SrvMngr qw(theme_list init_session); + +use Data::Dumper; +use esmith::util; +use esmith::HostsDB; +use esmith::AccountsDB; + +our $db = esmith::ConfigDB->open(); +our $adb = esmith::AccountsDB->open(); + +our $user = 'admin'; +#$ENV{'REMOTE_USER'}; +$user = $1 if ( $user =~ /^([a-z][\-a-z0-9]*)$/ ); +our @usergroups = $adb->user_group_list($user); + +use constant FALSE => 0; +use constant TRUE => 1; + +my %shf_datas = (); + +sub main { + # + # Main Panel + # + my $c = shift; + $c->app->log->info( $c->log_req ); + $shf_datas{first} = 'shf_FIRSTPAGE_DESC'; + do_display($c); +} + +sub do_display { + my $c = shift; + my $title = $c->l('shf_FORM_TITLE'); + my $modul = ''; + my @shares = get_all_shares($c); + my @encryptedfolders = get_all_encrypted_shares($c); + $shf_datas{trt} = 'LIST'; + + $c->stash( + title => $title, + modul => $modul, + shf_datas => \%shf_datas, + sharedfolders => \@shares, + encryptedfolders => \@encryptedfolders, + empty => ( scalar @shares == 0 ), + emptye => ( scalar @encryptedfolders == 0 ) + ); + + $c->render( template => 'shared_folders' ); +} + +sub get_all_shares { + my $c = shift; + my @sharesdb = $adb->get_all_by_prop( type => 'share' ); + my @shares = (); + foreach my $sharerec (@sharesdb) { + next if ( ( $sharerec->prop('Hide') || 'no' ) eq 'yes' ); + my $removable = $sharerec->prop('Removable') || 'yes'; + my %row = ( + "Name" => $sharerec->key, + "Description" => $sharerec->prop("Name"), + "Removeable" => $removable + ); + push( @shares, \%row ); + } + return @shares; +} + +sub get_all_encrypted_shares { + + my $c = shift; + my @shares = $adb->get_all_by_prop( type => 'share' ); + my @encfs = (); + foreach (@shares) { + my @sharegroups = split( /[,;]/, + ( $_->prop('WriteGroups') || '' ) . ',' + . ( $_->prop('ReadGroups') || '' ) ); + my @shareusers = split( /[,;]/, + ( $_->prop('WriteUsers') || '' ) . ',' + . ( $_->prop('ReadUsers') || '' ) ); + @sharegroups = keys %{ { map { $_ => 1 } @sharegroups } }; + + my %count = (); + my @intersection = (); + foreach my $element ( @sharegroups, @usergroups ) { $count{$element}++ } + foreach my $element ( keys %count ) { + push @intersection, $element if ( $count{$element} > 1 ); + } + + # Only display the share in the list if encryption is enabled + # and the user has at least read access + if ( + ( ( $_->prop('Encryption') || 'disabled' ) eq 'enabled' ) + && ( ( scalar @intersection > 0 ) + || ( grep { $_ eq $user } @shareusers ) + || ( $user eq 'admin' ) ) + ) + { + push @encfs, $_; + } + } + unless ( scalar @encfs > 0 ) { + return (); + } + + my @encrypted_shares = (); + foreach my $i (@encfs) { + my $sharename = $i->key(); + my $sharedesc = $i->prop('Name'); + + my $mountstatus = +`/bin/mount | /bin/grep /home/e-smith/files/shares/$sharename/ | grep -c fuse`; + chomp($mountstatus); + my $sharestatus = + ( $mountstatus eq '1' ) + ? $c->l('shf_ENCRYPT_MOUNTED') + : $c->l('shf_ENCRYPT_NOT_MOUNTED'); + + my $actionMount = "shf_ENCRYPT_MOUNT" + ; #$q->a({href => "${href}Mount&name=$sharename"},$self->localise('MOUNT')). ' '; + + my $actionUmount = 'shf_ENCRYPT_UNMOUNT' + ; #$q->a({href => "${href}Umount&name=$sharename"}, $self->localise('UMOUNT')). ' '; + + my $action = ( $mountstatus eq '1' ) ? $actionUmount : $actionMount; + + my %row = ( + "Name" => $sharename, + "Description" => $sharedesc, + "Status" => $sharestatus, + "Action" => $action + ); + push( @encrypted_shares, \%row ); + } + return @encrypted_shares; +} + +sub do_encrypt { + # + # Enable/disable encrypt share clicked + # + my $c = shift; + $c->app->log->info( $c->log_req ); + my $title = $c->l('shf_main_title'); + my $modul = ''; + my $mode = $c->param("mode"); + + #etc.... + + do_display($c); #If no errors +} + +sub do_save { + # + # Save pressed + # + my $c = shift; + $c->app->log->info( $c->log_req ); + + my $title = $c->l('shf_main_title'); + my $modul = ''; + my $mode = $c->param("mode"); + + #etc.... + if ( $mode = "DEL" ) { + my $name = $c->param("name"); + my $msg = remove_share( $c, $name ); + if ( $msg eq "ok" ) { + $shf_datas{success} = "shf_SUCCESSFULLY_DELETED_SHARE"; + } + else { + $shf_datas{error} = $msg; + } + } + do_display($c); + +} + +sub do_delete { + # + # Delete/Remove clicked + # + my $c = shift; + $c->app->log->info( $c->log_req ); + + my $title = $c->l('shf_REMOVE_TITLE'); + my $modul = ''; + + #etc..... + $shf_datas{trt} = 'DEL'; + $c->stash( + title => $title, + modul => $modul, + shf_datas => \%shf_datas, + ); + $c->render( template => 'shared_folders' ); +} + +sub do_create_modify { + # + # Delete/Remove clicked + # + my $c = shift; + $c->app->log->info( $c->log_req ); + + my $title = $c->l('shf_create_modify_title'); + my $modul = ''; + my $empty; + + #Selection options + $shf_datas{disable_enable} = + [ [ $c->l(''), 'disabled' ], [ $c->l(''), 'enabled' ] ]; + $shf_datas{recyclebin} = [ + [ $c->l('shf_DISABLED'), 'disabled' ], + [ $c->l('shf_DONT_KEEP_VERSIONS'), 'enabled' ], + [ $c->l('shf_KEEP_VERSIONS'), 'keep-versions' ] + ]; + $shf_datas{SMBaccess} = [ + [ $c->l('shf_ENABLED_BROWSEABLE'), 'browseable' ], + [ $c->l('shf_ENABLED_NON_BROWSEABLE'), 'non-browseable' ], + [ 'No access', 'none' ] + ]; + $shf_datas{webaccess} = [ + [ $c->l('shf_ENTIRE_INTERNET_NO_PASSWORD'), 'global' ], + [ $c->l('shf_ENTIRE_INTERNET_PASSWORD'), 'global-pw' ], + [ $c->l('shf_ENTIRE_INTERNET_PASSWORD_REMOTE'), 'global-pw-remote' ], + [ $c->l('shf_LOCAL_NETWORK_NO_PASSWORD'), 'local' ], + [ $c->l('shf_LOCAL_NETWORK_PASSWORD'), 'local-pw' ], + [ $c->l('shf_NO_ACCESS'), 'None' ] + ]; + $shf_datas{retention} = [ + [ $c->l('shf_UNLIMITED'), 'unlimited' ], + [ $c->l('shf_ONE_WEEK'), 7 ], + [ $c->l('shf_ONE_MONTH'), 30 ], + [ $c->l('shf_SIX_MONTHS'), 180 ], + [ $c->l('shf_ONE_YEAR'), 365 ] + ]; + my $name = $c->param("name") || ''; + my @params = (); + if ($name ne ''){ + my $namedb = $adb->get($name); + my @params = ('SMBaccess' => $namedb->get_value("SMBaccess") || '', + ); + } + + $shf_datas{param_details} = \@params; + + #etc..... + + $shf_datas{trt} = 'CR_MOD'; + $c->stash( + title => $title, + modul => $modul, + shf_datas => \%shf_datas, + empty => $empty + ); + $c->render( template => 'shared_folders' ); +} + +sub do_permisssions { + # + # Delete/Remove clicked + # + my $c = shift; + $c->app->log->info( $c->log_req ); + + my $title = $c->l('shf_permissions_title'); + my $modul = ''; + + #etc..... + + $shf_datas{trt} = 'PERM'; + $c->stash( + title => $title, + modul => $modul, + shf_datas => \%shf_datas, + ); + $c->render( template => 'shared_folders' ); +} + +# Remove a share +sub remove_share { + my $c = shift; + my $name = shift; + my $acct = $adb->get($name); + + #return $self->error('CANCELED','First') if ($c->param('cancel')); + return 'shf_CANT_FIND_SHARE' + unless ( $acct && $acct->prop('type') eq 'share' ); + + # Untaint $name before use in system() + $name =~ /(.+)/; + $name = $1; + my $encryption = $acct->prop('Encryption') || 'disabled'; + my $mountstatus = + `/bin/mount | grep /home/e-smith/files/shares/$name/ | grep -c fuse`; + chomp($mountstatus); + + if ( ( $encryption eq 'enabled' ) && ( $mountstatus eq '1' ) ) { + return "shf_ERROR_ENCRYPTED_ENABLED"; + } + $acct->set_prop( 'type', 'share-deleted' ); + if ( system( "/sbin/e-smith/signal-event", "share-delete", $name ) == 0 ) { + $acct->delete(); + } + else { + return "shf_ERROR_WHILE_DELETING_SHARE"; + } + return "ok"; +} + +1; diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Shared_folders/en.pm smeserver-shared-folders-0.3/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Shared_folders/en.pm --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Shared_folders/en.pm 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/lib/SrvMngr/I18N/Modules/Shared_folders/en.pm 2020-07-31 08:47:00.000000000 +0100 @@ -0,0 +1,125 @@ +package SrvMngr::I18N::Modules::Shared_folders::en; +use strict; +use warnings; +use utf8; +use Mojo::Base 'SrvMngr::I18N'; + +use SrvMngr::I18N::Modules::General::en; + +my %lexicon = ( + +'shf_title' => 'Shared Folders', +'shf_FORM_TITLE' => ' Create, modify, or remove shared folders', +'shf_FIRSTPAGE_DESC' => ' You can remove any shared folder by clicking on the corresponding command next to the shared folder.', +'shf_ADD_TITLE' => ' Create or modify a shared folder', +'shf_NAME_FIELD_DESC' => ' The share name should contain only lower-case letters, numbers, periods, hyphens and underscores, and should start with a lower-case letter. For example "johnson", "intra", and "cust3.prj12" are all valid names, but "3associates", "John Smith" and "Bus!Partner" are not. The name is limited to [_1] characters.', +'shf_NAME_LABEL' => ' Shared folder name', +'shf_REMOVE_TITLE' => ' Remove shared folder', +'shf_REMOVE_DESC' => ' + You are about to remove the following shared folder
+ All files belonging to this shared folder will be deleted.
+ Are you sure you wish to remove it ?
+ ', +'shf_ERROR_WHILE_CREATING_SHARE' => ' An error occurred while creating the shared folder.', +'shf_SUCCESSFULLY_CREATED_SHARE' => ' Successfully created shared folder.', +'shf_NO_SHARES' => ' There are no shared folders currently configured.', +'shf_CANT_FIND_SHARE' => ' Can\'t find account for [_1] (does it exist?)', +'shf_CANT_CREATE_SHARE' => ' Can\'t create new account for [_1] (does it already exist?)', +'shf_ERROR_WHILE_MODIFYING_SHARE' => ' An error occurred while modifying the shared folder.', +'shf_SUCCESSFULLY_MODIFIED_SHARE' => ' Successfully modified shared folder.', +'shf_SUCCESSFULLY_DELETED_SHARE' => ' Successfully deleted shared folder.', +'shf_ERROR_WHILE_DELETING_SHARE' => ' An error occurred while deleting the share.', +'shf_Shares' => +'Shares', +'shf_INVALID_SHARE_DESCRIPTION' => +'Error: unexpected or missing characters in share description', +'shf_ACCT_NAME_HAS_INVALID_CHARS' => +'The shared folder name "[_1]" contains invalid characters. Shared folder names must start with a lower case letter and contain only lower case letters, numbers, and hyphens.', +'shf_MAX_SHARE_NAME_LENGTH_ERROR' => ' The shared folder name "[_1]" is too long. The maximum is [_1] characters.', +'shf_ACCT_CLASHES_WITH_PSEUDONYM' => ' + The account "[_1]" clashes with pseudonym details for [_2] account "[_3]".

[_2] is a pseudonym for [_1].

+ ', +'shf_ACCOUNT_EXISTS' => ' The account "[_1]" is an existing [_2] account.', +'shf_LABEL_ADD_SHARE_BUTTON' => ' Create a new shared folder', +'shf_DESC_PERMISSIONS' => ' You can use this matrix to define groups and users access permissions.', +'shf_DESC_SMB_SETTINGS' => ' The following settings control the access of this shared folder from the local network, using the SMB/CIFS protocol. ', +'shf_LABEL_SMB_ACCESS' => ' SMB Access', +'shf_LABEL_RECYCLEBIN' => ' Recycle bin', +'shf_LABEL_RETENTION' => ' Retention time', +'shf_UNLIMITED' => ' unlimited', +'shf_ONE_WEEK' => ' one week', +'shf_ONE_MONTH' => ' one month', +'shf_SIX_MONTHS' => ' six months', +'shf_ONE_YEAR' => ' one year', +'shf_DESC_HTTP_SETTINGS' => ' The following settings control the access of this shared folder using the HTTP/HTTPS protocol.', +'shf_LABEL_HTTP_ACCESS' => ' Web Access', +'shf_LABEL_WEBDAV' => ' WebDav support', +'shf_LABEL_REQUIRE_SSL' => ' Force secure connections', +'shf_LABEL_INDEXES' => ' Indexes', +'shf_LABEL_DYNAMIC_CONTENT' => ' Dynamic content execution (PHP, CGI, SSI)', +'shf_LOCAL_NETWORK_NO_PASSWORD' => 'Local network (no password required)', +'shf_LOCAL_NETWORK_PASSWORD' => 'Local network (password required)', +'shf_ENTIRE_INTERNET_NO_PASSWORD' => 'Entire Internet (no password required)', +'shf_ENTIRE_INTERNET_PASSWORD' => 'Entire Internet (password required)', +'shf_ENTIRE_INTERNET_PASSWORD_REMOTE' => 'Entire Internet (password required outside local network)', +'shf_NONE' => 'No access', +'shf_ENABLED_BROWSEABLE' => 'Enabled, browseable', +'shf_ENABLED_NON_BROWSEABLE' => 'Enabled, hidden', +'shf_DONT_KEEP_VERSIONS' => 'Enabled, keep only the latest version', +'shf_KEEP_VERSIONS' => 'Enabled, keep a copy of all versions', +'shf_PERMISSIONS' => ' Permissions', +'shf_WRITE_PERM' => ' Read / Write', +'shf_READ_PERM' => ' Read Only', +'shf_ENABLED' => ' enabled', +'shf_DISABLED' => ' disabled', +'shf_YES' => ' yes', +'shf_NO' => ' no', +'shf_NAME' => 'Name', +'shf_DESCRIPTION' => 'Description', +'shf_ACTION' => ' Action', +'shf_MODIFY' => ' Modify', +'shf_REMOVE' => ' Remove', +'shf_CANCELED' => ' Cancelled', +'shf_MANUAL_PERMS' => ' Permissions on this shared folder are managed manually, modifications will only affect web access if a password is required.

', +'shf_DESC_ENCRYPTION' => ' The followings options let you protect your data. If encryption is enabled, the data will never be stored in clear text on the server. Your share will either be "available" (data will appear as clear text, encryption/decryption is done on the fly), or protected (only the ciphered data is available on the server). Encryption can only be set at shared folder creation time. Also, read only groups are not supported with encrypted shared folders. If you enable encryption, only members of groups with read/write privileges will be able to access this share.', +'shf_LABEL_ENCRYPTION' => ' Encryption', +'shf_DESC_PASSWORD' => ' You need to choose a password to protect your data. This password must be at least 8 characters long. Do not loose this password. If you forget it, your data will be lost because there\'s no way to recover it.', +'shf_LABEL_PASSWORD' => ' Password', +'shf_LABEL_PASSWORD2' => ' Password (confirmation)', +'shf_DESC_INACTIVITY' => ' To provide additional security, you can set an inactivity time out (in minutes). When the data is available, if nobody access it for this period of time, the data will go back to protected mode automatically.', +'shf_INACTIVITY' => ' Inactivity timeout', +'shf_ERROR_WITH_ENCRYPTION' => ' An error occured while performing initial folder encryption', +'shf_ERROR_ENCRYPTED_ENABLED' => ' This shared folder is encrypted and access is enabled. You have to put it in protected mode before removing it', +'shf_INVALID_INACTIVITY' => ' Inactivity value must be numbers only', +'shf_PASSWORD_MISMATCH' => ' Passwords don\'t match', +'shf_PASSWORD_TOO_SHORT' => ' Password is too short, please use at least 8 characters', +'shf_DESC_PYDIO' => ' The following settings control the access of this shared folder with the web based file manager Pydio (formerly AjaXplorer)', +'shf_LABEL_PYDIO' => ' Pydio Access', +'shf_TITLE_PERMISSIONS' => ' Access right management', +'shf_USERS' => 'Users', + +'shf_ENCRYPT_FORM_TITLE' => 'Shared Folders Encryption', +'shf_ENCRYPT_Shared Folders Encryption' => 'Shared Folders Encryption', +'shf_ENCRYPT_FIRSTPAGE_DESC' =>'This panel lets you enable encrypted shared folder access.', +'shf_ENCRYPT_STATUS' => 'Status', +'shf_ENCRYPT_MOUNTED' => 'Enabled', +'shf_ENCRYPT_NOT_MOUNTED' => 'Protected', +'shf_ENCRYPT_MOUNT' =>'Enable', +'shf_ENCRYPT_UMOUNT' => 'Protect', +'shf_ENCRYPT_ERROR_MOUNTING' => 'An error occured. Check that you have the correct password.', +'shf_ENCRYPT_UMOUNT_DESC' => 'Are you sure you want to protect this shared folder ? Once protected, the content won\'t be accessible until re-enabled with the associated password.', +'shf_ENCRYPT_MOUNT_DESC' => 'You have to enter the password to make this folder\'s content available.', +'shf_ENCRYPT_LABEL_MOUNT_PASSWORD' => 'Password', +'shf_ENCRYPT_VALIDATE' => 'Validate', +'shf_ENCRYPT_NO_ENCRYPTED_SHARE' => 'No encrypted share configured', + +); + +our %Lexicon = ( + %{ SrvMngr::I18N::Modules::General::en::Lexicon }, + %lexicon +); + + +1; + diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_create_modify.html.ep smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_create_modify.html.ep --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_create_modify.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_create_modify.html.ep 2020-07-31 17:15:00.000000000 +0100 @@ -0,0 +1,54 @@ +%# +%# Create or Modify shared folder +%# +
+

+ %= l('shf_ADD_TITLE') +

+ %= $c->render_to_string(inline =>l('shf_NAME_FIELD_DESC')) +
+ % my $btn = $c->l('shf_ADD'); + %= form_for '/shared_folders' => (method => 'POST') => begin + %my $name = $c->param("name") || ''; + %my $desc = $c->param("desc") || ''; + + %=l "shf_NAME_LABEL" + + + %= text_field name =>$name +
+ + %=l "shf_DESCRIPTION" + + + %= text_field description=>$desc +
+ %= l('shf_DESC_SMB_SETTINGS') + + %=l "shf_LABEL_SMB_ACCESS" + + + % param SMBaccess => $shf_datas->{param_details}->{SMBaccess}; + %= select_field SMBaccess =>$shf_datas->{SMBaccess} +
+ + %=l "shf_LABEL_RECYCLEBIN" + + + $ param recyclebin => $shf_datas->{param_details}->{recyclebin}; + %= select_field recyclebin=>$shf_datas->{recyclebin} +
+ + %=l "shf_LABEL_RETENTION" + + + $ param retention => $shf_datas->{param_details}->{retention}; + %= select_field retention=>$shf_datas->{retention} +
+ %= l('shf_DESC_HTTP_SETTINGS') + + %= submit_button "$btn", class => 'action' + % end +
+ + diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_delete.html.ep smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_delete.html.ep --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_delete.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_delete.html.ep 2020-07-30 06:26:00.000000000 +0100 @@ -0,0 +1,33 @@ +%# +%# Delete shared folder +%# +
+

+ %= l('shf_REMOVE_TITLE') +

+ %= $c->render_to_string(inline =>l('shf_REMOVE_DESC')) +
+ % my $btn = $c->l('shf_REMOVE'); + %= form_for '/shared_folders' => (method => 'POST') => begin + %my $name = $c->param("name"); + %my $desc = $c->param("desc") || ''; + + %=l "shf_NAME" + + + %= $name +
+ + %=l "shf_DESCRIPTION" + + + %= $desc +
+ %= hidden_field mode=>"DEL" + %= hidden_field name=>$name + %= hidden_field desc=>$desc + %= submit_button "$btn", class => 'action' + % end +
+ + diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_list.html.ep smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_list.html.ep --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_list.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_list.html.ep 2020-07-31 08:49:00.000000000 +0100 @@ -0,0 +1,94 @@ +
+ + % my $btn = l('shf_LABEL_ADD_SHARE_BUTTON'); + + %= form_for '/shared_foldersc' => (method => 'POST') => begin +
+ %= submit_button "$btn", class => 'action' +
+ + %# Table of shares + + % if ($empty){ +
+ %=l 'shf_NO_SHARES' +
+ % } else { + + + + + + + + % foreach my $sharedfolder (@$sharedfolders) { + + %= t td => (class => 'sme-border') => $sharedfolder->{"Name"} + %= t td => (class => 'sme-border') => $sharedfolder->{"Description"} + + + % + + + %} + +
+ %=l 'NAME' + + %=l 'DESCRIPTION' + + %=l 'shf_ACTION' +
+ "><%=l 'shf_PERMISSIONS'%> + + "><%=l 'MODIFY'%> + + &desc=<%= $sharedfolder->{"Description"}%>"><%=l 'REMOVE'%> +
+ %} + + %#Table of encrypted shares +

+ %=l 'shf_ENCRYPT_FORM_TITLE' +

+ %=l 'shf_ENCRYPT_FIRSTPAGE_DESC' +
+ % if ($emptye){ +
+ %=l 'shf_ENCRYPT_NO_ENCRYPTED_SHARE' +
+ % } else { + + + + + + + + + + % foreach my $encryptedfolder (@$encryptedfolders) { + + %= t td => (class => 'sme-border') => $encryptedfolder->{"Name"} + %= t td => (class => 'sme-border') => $encryptedfolder->{"Description"} + %= t td => (class => 'sme-border') => $c->l($encryptedfolder->{"Status"}) + % my $action = $encryptedfolder->{"Action"}; + % my $actiondesc = $c->l("$action"); + + + %} + +
+ %=l 'NAME' + + %=l 'DESCRIPTION' + + %=l 'shf_ENCRYPT_STATUS' + + %=l 'shf_ACTION' +
<%=$actiondesc%>
+ + % } + + % end +
diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_permisssions.html.ep smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_permisssions.html.ep --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/partials/_shf_permisssions.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/partials/_shf_permisssions.html.ep 2020-07-24 12:31:00.000000000 +0100 @@ -0,0 +1,59 @@ +%# +%# Delete shared folder +%# +
+ % my $btn = $c->l('SAVE'); + % my $MailServer = $shf_datas->{mailserver}; + + %= form_for '/shared_folders_save' => (method => 'POST') => begin +
+ % my $domain = $c->param('domain'); + %=$c->render_to_string(inline =>l('shf_Delegate_Domain',$domain)) +
+ + %=l "shf_Server_or_IP" + + + %=text_field 'MailServer' =>$MailServer + +

+ %if ($empty) { + %=$c->l('shf_No_pseudonyms_for',$domain); +
+ + %=$c->render_to_string(inline=>l('shf_Click_Here_first')) +
+ + %} else { + %=$c->l('shf_Current_list_for',$domain); +
+ + %=$c->render_to_string(inline=>l('shf_Click_Here_add')) +

+ + %#Table of pseudonyms: + + + + + + + + +
+ %=l 'shf_Pseudonyms' + + %=l 'shf_Local_User' + + +
+ %} + +
+ %=$c->render_to_string(inline =>l('shf_Need_Save')); +
+ %= submit_button "$btn", class => 'action' + % end +
+ + diff -urN smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/shared_folders.html.ep smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/shared_folders.html.ep --- smeserver-shared-folders-0.3.old/root/usr/share/smanager/themes/default/templates/shared_folders.html.ep 1970-01-01 01:00:00.000000000 +0100 +++ smeserver-shared-folders-0.3/root/usr/share/smanager/themes/default/templates/shared_folders.html.ep 2020-07-24 12:13:00.000000000 +0100 @@ -0,0 +1,43 @@ +% layout 'default', title => "Sme server 2 - Shared Folders", share_dir => './'; + +% content_for 'module' => begin +
+ + % if ($config->{debug} == 1) { +

+ %= dumper $c->current_route +

+ % } + +

<%=$title%>

+ %= $modul + + %if ($shf_datas->{first}) { + %=$c->render_to_string(inline =>$c->l($shf_datas->{first})) + + %} elsif ($shf_datas->{success}) { +
+

Operation Status Report

+ %= $c->l($shf_datas->{success}); +
+ + %} elsif ($shf_datas->{error}) { +
+

Operation Status Report - error

+ %= $c->l($shf_datas->{error}); +
+ %} + + + % if ($shf_datas->{trt} eq 'CR_MOD') { + %= include 'partials/_shf_create_modify' + %} elsif ($shf_datas->{trt} eq 'DEL') { + %= include 'partials/_shf_delete' + %} elsif ($shf_datas->{trt} eq 'PERM') { + %= include 'partials/_shf_permissions' + %} else { + %= include 'partials/_shf_list' + %} + +
+%end