Skip to content

Commit 763b5d0

Browse files
Ilia RostovtsevIlia Rostovtsev
Ilia Rostovtsev
authored and
Ilia Rostovtsev
committed
18.40 [patch #707]
1 parent b81efe5 commit 763b5d0

36 files changed

+305
-82
lines changed

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
## Changelog
22

3+
#### Version 18.41-beta20 (02 April, 2017)
4+
* Added ability to install patched version of the theme directly from _GitHub_, to get early access on the new features [#707](https://github.com/qooob/authentic-theme/issues/707)
5+
* Added console script for updating the theme [#703](https://github.com/qooob/authentic-theme/issues/703)
6+
* Added error handler for saving files in background calls [#689](https://github.com/qooob/authentic-theme/issues/689)
7+
* Added controls for operations in icon mode [#684](https://github.com/qooob/authentic-theme/issues/684)
8+
* Added ability to display version patch number [#676](https://github.com/qooob/authentic-theme/issues/676)
9+
* Fixed bugs [#687](https://github.com/qooob/authentic-theme/issues/687) [#688](https://github.com/qooob/authentic-theme/issues/688) [#692](https://github.com/qooob/authentic-theme/issues/692) [#693](https://github.com/qooob/authentic-theme/issues/693) [#695](https://github.com/qooob/authentic-theme/issues/695) [#696](https://github.com/qooob/authentic-theme/issues/696) [#697](https://github.com/qooob/authentic-theme/issues/697) [#698](https://github.com/qooob/authentic-theme/issues/698) [#699](https://github.com/qooob/authentic-theme/issues/699) [#700](https://github.com/qooob/authentic-theme/issues/700) [#701](https://github.com/qooob/authentic-theme/issues/701) [#702](https://github.com/qooob/authentic-theme/issues/702) [#704](https://github.com/qooob/authentic-theme/issues/704)
10+
311
### Version 18.40 (21 March, 2017)
412
* Added ability to use theme configuration for all users [#640](https://github.com/qooob/authentic-theme/issues/640#issuecomment-287572703)
513
* Added complete support for dark palette in the content page (right frame) [#664](https://github.com/qooob/authentic-theme/issues/664)
614
* Added ability to toggle dark/light palette in a flash
715
* Added autocomplete feature (using _Tab_) for _Command Shell_ port [#641](https://github.com/qooob/authentic-theme/pull/641)
8-
* Added ability to enable _beta channel_ for the theme updates to get early access on the new features
916
* Added close button for popovers and improved its general appearance [#46862](https://www.virtualmin.com/node/46862)
1017
* Added support for included links in help popovers
1118
* Added _Swedish_ language, thanks to [Sopor Spr](https://github.com/Sopor-)

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
Theme can be easily updated manually. Please make sure that you have `git` command installed on your system. Using console, do the following:
5959
1. Go to _Webmin_ (`cd /usr/libexec/webmin`) or _Usermin_ (`cd /usr/libexec/usermin`) directory __*__
6060
2. Descend into theme's directory (`cd authentic-theme`)
61-
3. Run [`./theme-update.sh -r`](https://github.com/qooob/authentic-theme/issues/703) and hit _y_ to continue
61+
3. Run [`./theme-update.sh`](https://github.com/qooob/authentic-theme/issues/703) and hit _y_ to continue
6262
4. Restart _Webmin_/_Usermin_ after update
6363
<br>__*__ *Binary directory might be different from `libexec` depending on the system. Run `whereis webmin` to figure this out.*
6464

authentic-init.pm

+18-14
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ sub settings_filter
3232
my (%in_data) = @_;
3333

3434
delete @in_data{ grep( !/^config_portable_|^settings_/, keys %in_data ) };
35-
delete @in_data{ grep( !m/^\w*$/, keys %in_data ) };
35+
delete @in_data{ grep( !m/^\w*$/, keys %in_data ) };
3636
for ( values %in_data ) { s/(.*)/'$1';/ }
3737
for ( values %in_data ) { s/\$|`*//g }
3838
for ( values %in_data ) { s/<<//g }
@@ -1075,30 +1075,34 @@ sub theme_night_mode
10751075
}
10761076
}
10771077

1078+
sub theme_git_version
1079+
{
1080+
my $git_version = undef;
1081+
my $git_version_file = $root_directory . "/authentic-theme/version";
1082+
if ( -e $git_version_file && $__settings{'settings_sysinfo_theme_patched_updates'} eq 'true' ) {
1083+
$git_version = read_file_lines( $git_version_file, 1 );
1084+
$git_version = $git_version->[0];
1085+
}
1086+
return $git_version;
1087+
}
1088+
10781089
sub theme_version
10791090
{
10801091
my ($switch) = @_;
10811092
my $sh__ln__p___version = '18.32';
10821093
my $sh__ln__c___version = '18.40';
1094+
my $sh__ln__g___version = theme_git_version();
10831095
( ( !$switch ) && ( $sh__ln__c___version =~ s/\.//ig ) );
1084-
return $sh__ln__c___version;
1085-
}
1096+
( ( !$switch && $sh__ln__g___version )
1097+
&& ( $sh__ln__c___version = $sh__ln__g___version, ( $sh__ln__c___version =~ s/\.|-|git//ig ) ) );
10861098

1087-
sub theme_git_version
1088-
{
1089-
my $git_version = undef;
1090-
my $git_version_file = $root_directory . "/authentic-theme/version";
1091-
if (-e $git_version_file) {
1092-
$git_version = read_file_lines( $git_version_file, 1 );
1093-
$git_version = $git_version->[0];
1094-
}
1095-
return $git_version;
1099+
return $sh__ln__c___version;
10961100
}
10971101

10981102
sub get_version
10991103
{
1100-
my ($version) = @_;
1101-
return $version =~ /([0-9]+[.][0-9]+)/;
1104+
my ($version) = @_;
1105+
return $version =~ /([0-9]+[.][0-9]+)/;
11021106
}
11031107

11041108
sub get_env

authentic-lib.pm

+64-20
Original file line numberDiff line numberDiff line change
@@ -1117,22 +1117,35 @@ sub get_sysinfo_vars
11171117

11181118
# Build version response message
11191119
if ( &Version::Compare::version_compare( $remote_version, $installed_version ) == 1 ) {
1120+
my $git_version_remote = index( $remote_version, '-git-' ) != -1;
11201121
$authentic_theme_version =
11211122
'<a href="https://github.com/qooob/authentic-theme" target="_blank">'
11221123
. $Atext{'theme_name'} . '</a> '
1123-
. ($installed_git_version ? $installed_git_version : $installed_version) . '. '
1124-
. $Atext{'theme_update_available'} . ' '
1124+
. $installed_version . '. '
1125+
. (
1126+
$git_version_remote ? $Atext{'theme_git_patch_available'} : $Atext{'theme_update_available'} )
1127+
. ' '
11251128
. $remote_version
1126-
. '&nbsp;&nbsp;&nbsp;<div class="btn-group margined-left-4">'
1127-
. '<a class="btn btn-xxs btn-success authentic_update" href="'
1129+
. '&nbsp;&nbsp;&nbsp;<div class="btn-group">'
1130+
. '<a data-git="'
1131+
. ( $git_version_remote
1132+
? 1
1133+
: 0 )
1134+
. '" class="btn btn-xxs btn-'
1135+
. ( $git_version_remote ? 'warning' : 'success' )
1136+
. ' authentic_update" href="'
11281137
. $gconfig{'webprefix'}
1129-
. '/webmin/edit_themes.cgi"><i class="fa fa-fw fa-refresh">&nbsp;</i>'
1138+
. '/webmin/edit_themes.cgi"><i class="fa fa-fw '
1139+
. ( $git_version_remote ? 'fa-git-pull' : 'fa-refresh' )
1140+
. '">&nbsp;</i>'
11301141
. $Atext{'theme_update'} . '</a>'
11311142
. '<a class="btn btn-xxs btn-info" target="_blank" href="https://github.com/qooob/authentic-theme/blob/master/CHANGELOG.md"><i class="fa fa-fw fa-pencil-square-o">&nbsp;</i>'
11321143
. $Atext{'theme_changelog'} . '</a>'
11331144
. '<a data-remove-version="'
11341145
. $remote_version
1135-
. '" class="btn btn-xxs btn-warning" target="_blank" href="https://github.com/qooob/authentic-theme/releases/download/'
1146+
. '" class="btn btn-xxs btn-warning'
1147+
. ( $git_version_remote ? ' hidden' : '' )
1148+
. '" target="_blank" href="https://github.com/qooob/authentic-theme/releases/download/'
11361149
. $remote_version
11371150
. '/authentic-theme-'
11381151
. $remote_version
@@ -1151,7 +1164,7 @@ sub get_sysinfo_vars
11511164
$authentic_theme_version =
11521165
'<a href="https://github.com/qooob/authentic-theme" target="_blank">'
11531166
. $Atext{'theme_name'} . '</a> '
1154-
. ($installed_git_version ? $installed_git_version : $installed_version)
1167+
. $installed_version
11551168
. '<div class="btn-group margined-left-4"><a href="'
11561169
. $gconfig{'webprefix'}
11571170
. '/webmin/edit_themes.cgi" data-href="'
@@ -1849,29 +1862,36 @@ sub embed_login_head
18491862
sub get_authentic_version
18501863
{
18511864

1865+
our $remote_version;
1866+
18521867
# Get local version
18531868
our $installed_version = read_file_lines( $root_directory . "/authentic-theme/VERSION.txt", 1 );
18541869
$installed_version = $installed_version->[0];
18551870

1856-
our $installed_git_version = theme_git_version();
1857-
1858-
our $remote_version;
1871+
# Get local git version if available
1872+
if ( theme_git_version() ) {
1873+
$installed_version = theme_git_version();
1874+
}
18591875

18601876
$installed_version =~ s/^\s+|\s+$//g;
18611877

18621878
if ( $__settings{'settings_sysinfo_theme_updates'} eq 'true' && $get_user_level eq '0' ) {
18631879

18641880
# Get remote version if allowed
1865-
http_download( 'raw.githubusercontent.com', '443', '/qooob/authentic-theme/master/VERSION.txt',
1866-
\$remote_version, \$error, undef, 1, undef, undef, 5 );
1881+
http_download( 'raw.githubusercontent.com',
1882+
'443',
1883+
'/qooob/authentic-theme/master/'
1884+
. ( $__settings{'settings_sysinfo_theme_patched_updates'} ne 'true'
1885+
? 'VERSION.txt'
1886+
: 'version'
1887+
)
1888+
. '',
1889+
\$remote_version,
1890+
\$error,
1891+
undef, 1, undef, undef, 5 );
18671892

18681893
# Trim versions' number
18691894
$remote_version =~ s/^\s+|\s+$//g;
1870-
if ( $__settings{'settings_sysinfo_theme_beta_updates'} ne 'true'
1871-
&& index( $remote_version, 'beta' ) != -1 )
1872-
{
1873-
$remote_version = '0';
1874-
}
18751895
}
18761896
else {
18771897
$remote_version = '0';
@@ -2274,7 +2294,7 @@ sub _settings
22742294
'8',
22752295
'settings_sysinfo_theme_updates',
22762296
'false',
2277-
'settings_sysinfo_theme_beta_updates',
2297+
'settings_sysinfo_theme_patched_updates',
22782298
'false',
22792299
'settings_sysinfo_csf_updates',
22802300
'false',
@@ -2863,8 +2883,8 @@ sub get_xhr_request
28632883
my $path = $in{'xhr-get_list_path'};
28642884
my @dirs;
28652885

2866-
if ( $get_user_level eq '2' || $get_user_level eq '4') {
2867-
$path = get_user_home() . $path;
2886+
if ( $get_user_level eq '2' || $get_user_level eq '4' ) {
2887+
$path = get_user_home() . $path;
28682888
}
28692889

28702890
opendir( my $dirs, $path );
@@ -2893,6 +2913,30 @@ sub get_xhr_request
28932913
get_autocomplete_shell( $in{'xhr-get_autocomplete_type'}, $in{'xhr-get_autocomplete_string'} );
28942914
print get_json( \@data );
28952915
}
2916+
elsif ( $in{'xhr-update'} eq '1' && foreign_available('webmin') ) {
2917+
my @update_rs;
2918+
if ( !has_command('git') ) {
2919+
@update_rs = { "no_git" => $Atext{'theme_git_patch_no_git_message'}, };
2920+
print get_json( \@update_rs );
2921+
}
2922+
else {
2923+
my $usermin = usermin_available();
2924+
my $usermin_root;
2925+
backquote_logged("yes | $root_directory/authentic-theme/theme-update.sh -no-restart");
2926+
if ($usermin) {
2927+
$usermin_root = $root_directory;
2928+
$usermin_root =~ s/webmin/usermin/;
2929+
backquote_logged("yes | $usermin_root/authentic-theme/theme-update.sh -no-restart");
2930+
}
2931+
@update_rs = {
2932+
"success" => (
2933+
$usermin
2934+
? Atext( 'theme_git_patch_update_success_message2', theme_git_version() )
2935+
: Atext( 'theme_git_patch_update_success_message', theme_git_version() )
2936+
) };
2937+
print get_json( \@update_rs );
2938+
}
2939+
}
28962940
elsif ( $in{'xhr-info'} eq '1' ) {
28972941
our ( $cpu_percent, $mem_percent, $virt_percent,
28982942
$disk_percent, $host, $os,

authentic.pm

+1-3
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@ sub theme_header
2929
. '" data-default-theme="'
3030
. $__settings{'settings_navigation_color'}
3131
. '" data-theme-version="'
32-
. theme_version('version')
33-
. '" data-theme-git-version="'
34-
. theme_git_version()
32+
. (theme_git_version() ? theme_git_version() : theme_version('version'))
3533
. '" data-level="'
3634
. $get_user_level
3735
. '" data-user-home="'

lang/ca.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ theme_xhred_global_no_results_found=No s'ha trobat cap resultat
634634

635635
#18.40
636636
theme_new_password_header=Set new password for user
637-
settings_sysinfo_theme_beta_updates=Including beta versions
638637
login_reset=Password recovery
639638
theme_xhred_move_top=Move to top
640639
theme_xhred_move_bottom=Move to bottom
@@ -661,3 +660,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
661660
theme_xhred_global_choose=Choose
662661
theme_xhred_global_select=Select
663662
theme_xhred_global_ok=OK
663+
settings_sysinfo_theme_patched_updates=Including patched versions
664+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
665+
theme_git_patch_available=Latest available patch
666+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
667+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
668+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
669+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
670+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

lang/cz.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ theme_xhred_global_no_results_found=No results found
634634

635635
#18.40
636636
theme_new_password_header=Set new password for user
637-
settings_sysinfo_theme_beta_updates=Including beta versions
638637
login_reset=Password recovery
639638
theme_xhred_move_top=Move to top
640639
theme_xhred_move_bottom=Move to bottom
@@ -661,3 +660,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
661660
theme_xhred_global_choose=Choose
662661
theme_xhred_global_select=Select
663662
theme_xhred_global_ok=OK
663+
settings_sysinfo_theme_patched_updates=Including patched versions
664+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
665+
theme_git_patch_available=Latest available patch
666+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
667+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
668+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
669+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
670+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

lang/da.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ theme_xhred_global_no_results_found=No results found
634634

635635
#18.40
636636
theme_new_password_header=Set new password for user
637-
settings_sysinfo_theme_beta_updates=Including beta versions
638637
login_reset=Password recovery
639638
theme_xhred_move_top=Move to top
640639
theme_xhred_move_bottom=Move to bottom
@@ -661,3 +660,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
661660
theme_xhred_global_choose=Choose
662661
theme_xhred_global_select=Select
663662
theme_xhred_global_ok=OK
663+
settings_sysinfo_theme_patched_updates=Including patched versions
664+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
665+
theme_git_patch_available=Latest available patch
666+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
667+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
668+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
669+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
670+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

lang/de.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,6 @@ theme_xhred_global_no_results_found=No results found
633633

634634
#18.40
635635
theme_new_password_header=Set new password for user
636-
settings_sysinfo_theme_beta_updates=Including beta versions
637636
login_reset=Password recovery
638637
theme_xhred_move_top=Move to top
639638
theme_xhred_move_bottom=Move to bottom
@@ -660,3 +659,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
660659
theme_xhred_global_choose=Choose
661660
theme_xhred_global_select=Select
662661
theme_xhred_global_ok=OK
662+
settings_sysinfo_theme_patched_updates=Including patched versions
663+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
664+
theme_git_patch_available=Latest available patch
665+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
666+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
667+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
668+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
669+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

lang/en.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,6 @@ theme_xhred_global_no_results_found=No results found
632632

633633
#18.40
634634
theme_new_password_header=Set new password for user
635-
settings_sysinfo_theme_beta_updates=Including beta versions
636635
login_reset=Password recovery
637636
theme_xhred_move_top=Move to top
638637
theme_xhred_move_bottom=Move to bottom
@@ -659,3 +658,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
659658
theme_xhred_global_choose=Choose
660659
theme_xhred_global_select=Select
661660
theme_xhred_global_ok=OK
661+
settings_sysinfo_theme_patched_updates=Including patched versions
662+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
663+
theme_git_patch_available=Latest available patch
664+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
665+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
666+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
667+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
668+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

lang/es.UTF-8

+8-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,6 @@ theme_xhred_global_no_results_found=No results found
634634

635635
#18.40
636636
theme_new_password_header=Set new password for user
637-
settings_sysinfo_theme_beta_updates=Including beta versions
638637
login_reset=Password recovery
639638
theme_xhred_move_top=Move to top
640639
theme_xhred_move_bottom=Move to bottom
@@ -661,3 +660,11 @@ settings_sysinfo_easypie_charts_size=Diameter of charts
661660
theme_xhred_global_choose=Choose
662661
theme_xhred_global_select=Select
663662
theme_xhred_global_ok=OK
663+
settings_sysinfo_theme_patched_updates=Including patched versions
664+
settings_sysinfo_theme_patched_updates_description=In order to make this option work, <code>git</code> command has to be installed on your system
665+
theme_git_patch_available=Latest available patch
666+
theme_git_patch_no_git_message=In order to install latest patches directly from GitHub you must make sure that <code>git</code> command is installed.
667+
theme_git_patch_update_success_message=Theme upgrade for Webmin was successful. Currently installed version is <tt>$1</tt>. Reloading...
668+
theme_git_patch_update_success_message2=Theme upgrade for both Webmin and Usermin was successful. Currently installed version is <tt>$1</tt>. Reloading...
669+
theme_xhred_git_patch_update=Theme upgrade has failed. Try using console to do it manually.
670+
theme_xhred_git_patch_initiated=Theme upgrade has been initiated.

0 commit comments

Comments
 (0)