Skip to content

Commit c4ed2e1

Browse files
committed
Check in 1.8.4
1 parent 5a3312b commit c4ed2e1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2933
-676
lines changed

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ add_definitions(-DUSE_UDNS)
197197

198198
add_subdirectory(src)
199199
add_subdirectory(support)
200+
add_subdirectory(lshostexec)
200201

201202
if (BUILD_TEST)
202203
add_subdirectory(test)

LSQUICCOMMIT

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
c201607dbced72a1f74a803ac0d49e8c0c8b6bba
1+
70486141724f85e97b08f510673e29f399bbae8f

build.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,10 @@ if [ -e build/support/cmd_ns/cmd_ns ] ; then
669669
cp build/support/cmd_ns/cmd_ns dist/lsns/bin/
670670
fi
671671

672+
if [ -e build/lshostexec/lshostexec ] ; then
673+
cp build/lshostexec/lshostexec dist/lsns/bin/
674+
fi
675+
672676

673677
cpModuleSoFiles
674678

dist/add-ons/webcachemgr/VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.17.4.1
1+
1.17.4.2

dist/add-ons/webcachemgr/src/Panel/ControlPanel.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class ControlPanel
3636
/**
3737
* @var string
3838
*/
39-
const PANEL_API_VERSION = '1.17.4.1';
39+
const PANEL_API_VERSION = '1.17.4.2';
4040

4141
/**
4242
* @since 1.9
@@ -1047,6 +1047,7 @@ public static function meetsMinAPIVerRequirement()
10471047
public static function checkPanelAPICompatibility( $panelAPIVer )
10481048
{
10491049
$supportedAPIVers = array(
1050+
'1.17.4.2',
10501051
'1.17.4.1',
10511052
'1.17.4',
10521053
'1.17.3',

dist/add-ons/webcachemgr/src/PanelController.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -765,6 +765,8 @@ protected function checkRefreshAction()
765765
}
766766

767767
/**
768+
*
769+
* @deprecated release_ver_placeholder
768770
*
769771
* @return bool|void Function outputs ajax and exits without returning a
770772
* value when $init is evaluated to be false.
@@ -897,8 +899,26 @@ protected function checkFlagActions()
897899

898900
$info = &$_SESSION["{$action}_info"];
899901

902+
$doOld = false;
903+
904+
if ( $action == WPInstallStorage::CMD_MASS_UNFLAG ) {
905+
/**
906+
* Set to maintain compatibility with old ViewModel + Tpl.
907+
*
908+
* @deprecated release_ver_placeholder
909+
*/
910+
$oldInfo = &$_SESSION['unflagInfo'];
911+
$doOld = true;
912+
}
913+
914+
900915
if ( $init ) {
901916
$info = [ 'installs' => $this->wpInstallStorage->getPaths() ];
917+
918+
if ( $doOld ) {
919+
$oldInfo = $info;
920+
}
921+
902922
return true;
903923
}
904924

@@ -927,6 +947,13 @@ protected function checkFlagActions()
927947

928948
if ( empty($info['installs']) ) {
929949
unset($_SESSION["{$action}_info"]);
950+
951+
if ( $doOld ) {
952+
unset($_SESSION['unflagInfo']);
953+
}
954+
}
955+
elseif ( $doOld ) {
956+
$oldInfo = $info;
930957
}
931958

932959
$msgs = $this->wpInstallStorage->getAllCmdMsgs();

dist/functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ installation()
10181018

10191019
util_ccpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/lsperld.fpl fcgi-bin/RackRunner.rb fcgi-bin/lsnode.js
10201020
util_cpfile "$SDIR_OWN" $EXEC_MOD fcgi-bin/RailsRunner.rb fcgi-bin/RailsRunner.rb.2.3
1021-
util_cpfile "$SDIR_OWN" $EXEC_MOD lsns/bin/common.py lsns/bin/lscgctl lsns/bin/lscgstats lsns/bin/lspkgctl lsns/bin/lsnsctl lsns/bin/unmount_ns lsns/bin/cmd_ns lsns/bin/lssetup
1021+
util_cpfile "$SDIR_OWN" $EXEC_MOD lsns/bin/common.py lsns/bin/lshostexec lsns/bin/lscgctl lsns/bin/lscgstats lsns/bin/lspkgctl lsns/bin/lsnsctl lsns/bin/unmount_ns lsns/bin/cmd_ns lsns/bin/lssetup
10221022

10231023
pkill _recaptcha
10241024
util_cpfile "$SDIR_OWN" $EXEC_MOD lsrecaptcha/_recaptcha lsrecaptcha/_recaptcha.shtml

dist/lsns/bin/lspkgctl

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,8 @@ def plesk_home_dict():
171171
home_dict[user.pw_dir] = user
172172
return home_dict
173173

174-
def read_pleskplans():
174+
def read_pleskplans(plans):
175175
home_dict = plesk_home_dict()
176-
plans = {}
177176
userplans = {}
178177
# Thanks to Stas Karpinsky of vangus.co.il for correcting the SQL!
179178
plan_lines = run_program(['plesk', 'db', \
@@ -214,10 +213,20 @@ def read_pleskplans():
214213
userplans[user.pw_name] = plan
215214
return plans, userplans
216215

216+
def read_diskplans():
217+
plans = {}
218+
logging.debug("read_diskplans")
219+
if (os.path.exists(common.get_pkg_dir())):
220+
for f in glob.glob(common.get_pkg_dir() + '/*.conf'):
221+
finalfile = f[len(common.get_pkg_dir()) + 1:][:-5]
222+
logging.debug("Found package file: %s, finalfile: %s" % (f, finalfile))
223+
plans[finalfile] = []
224+
return plans
225+
217226
def read_usersplans():
227+
plans = read_diskplans()
218228
if common.get_plesk():
219-
return read_pleskplans()
220-
plans = {}
229+
return read_pleskplans(plans)
221230
userplans = {}
222231
planfiles = glob.glob('/var/cpanel/packages/*')
223232
for planfile in planfiles:
@@ -288,6 +297,9 @@ def write_pkg(pkg, pkg_json):
288297
f = open(common.pkg_to_filename(pkg), 'w', encoding="utf-8")
289298
except Exception as err:
290299
common.fatal_error('Error opening %s for write: %s' % (common.pkg_to_filename(pkg), err))
300+
if 'size' in pkg_json:
301+
logging.debug("Remove size")
302+
del pkg_json['size']
291303
for opt in common.get_options():
292304
if opt in pkg_json and arrInfinite(opt, pkg_json):
293305
del pkg_json[opt]
@@ -297,8 +309,17 @@ def write_pkg(pkg, pkg_json):
297309
common.fatal_error('Error writing %s: %s' % (common.pkg_to_filename(pkg), err))
298310
f.close()
299311

300-
def revalidate_pkg(pkg, users, users_vals, org_pkg, pkg_json, force, args_dict):
301-
logging.debug("revalidate_pkg")
312+
def revalidate_pkg(pkg, pkg_sizes, users, users_vals, org_pkg, pkg_json, force, args_dict):
313+
logging.debug("revalidate_pkg %s %d users" % (pkg, len(users)))
314+
if len(users) == 0:
315+
logging.debug("Delete package entirely: %s" % pkg)
316+
filename = common.pkg_to_filename(pkg)
317+
if os.path.exists(filename):
318+
os.remove(filename)
319+
if pkg in pkg_sizes:
320+
del pkg_sizes[pkg]
321+
write_pkg_sizes(pkg_sizes)
322+
return
302323
test_users = []
303324
if force:
304325
test_users = users
@@ -324,7 +345,7 @@ def revalidate_pkg(pkg, users, users_vals, org_pkg, pkg_json, force, args_dict):
324345

325346
def validate_pkg(pkg, pkg_sizes, users_vals, users):
326347
pkg_json = read_pkg(pkg, pkg_sizes)
327-
revalidate_pkg(pkg, users, users_vals, pkg_json, pkg_json, False, None)
348+
revalidate_pkg(pkg, pkg_sizes, users, users_vals, pkg_json, pkg_json, False, None)
328349

329350
def command_validate(args, users_vals, usersplans, pkg_sizes):
330351
if args.command == 'validate-all' or args.command == 'list-all':
@@ -406,7 +427,7 @@ def command_set(args, users_vals, usersplans, pkg_sizes):
406427
pkg_sizes[pkg] = args.size
407428
if not set_json(args, pkg_json) and not all_users:
408429
continue
409-
revalidate_pkg(pkg, usersplans[pkg], users_vals, org_pkg, pkg_json, all_users, vars(args))
430+
revalidate_pkg(pkg, pkg_sizes, usersplans[pkg], users_vals, org_pkg, pkg_json, all_users, vars(args))
410431
if write_sizes:
411432
write_pkg_sizes(pkg_sizes)
412433
return 0

lshostexec/CMakeLists.txt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
cmake_minimum_required(VERSION 2.8)
2+
3+
SET(lshostexec_SRCS
4+
lshostexec.c
5+
)
6+
7+
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/extensions/cgi)
8+
#link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../thirdparty/lib/)
9+
10+
add_executable(lshostexec ${lshostexec_SRCS} )
11+
12+
target_link_libraries(lshostexec
13+
rt )
14+
15+

0 commit comments

Comments
 (0)