Skip to content

Commit 85f6d3a

Browse files
author
Serghey Rodin
committed
Imrovements for Softaculous App Installer
1 parent 7d956ab commit 85f6d3a

File tree

4 files changed

+47
-5
lines changed

4 files changed

+47
-5
lines changed

bin/v-add-vesta-softaculous

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ source $VESTA/conf/vesta.conf
2222
#----------------------------------------------------------#
2323

2424
if [ "$TYPE" = 'WEB' ]; then
25-
$BIN/v-schedule-vesta-softaculous
26-
exit
25+
if [ ! -e "$VESTA/softaculous" ] && [ ! -e "$VESTA/ioncube" ]; then
26+
$BIN/v-schedule-vesta-softaculous
27+
exit
28+
fi
2729
else
2830
cmd="v-add-vesta-softaculous"
2931
check_cron=$(grep "$cmd" $VESTA/data/users/admin/cron.conf 2> /dev/null)

bin/v-list-sys-vesta-updates

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ format=${1-shell}
1414

1515
# Includes
1616
source $VESTA/func/main.sh
17+
source $VESTA/conf/vesta.conf
1718
fields="\$NAME \$VERSION \$RELEASE \$ARCH \$UPDATED \$DESCR \$TIME \$DATE"
1819

1920
# JSON list function
@@ -123,6 +124,46 @@ data="$data\nNAME='vesta-nginx' VERSION='$VERSION' RELEASE='$RELEASE'"
123124
data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='internal web server'"
124125
data="$data TIME='$TIME' DATE='$DATE'"
125126

127+
# Checking installed vesta-ioncube version
128+
if [ "$SOFTACULOUS" = 'yes' ]; then
129+
if [ -e "/etc/redhat-release" ]; then
130+
eval $(rpm --queryformat="$rpm_format" -q vesta-ioncube)
131+
DATE=$(date -d @$UTIME +%F)
132+
TIME=$(date -d @$UTIME +%T)
133+
else
134+
dpkg_data=$(dpkg-query -s vesta-ioncube)
135+
pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-php.list)
136+
ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
137+
VERSION=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f1 -d \-)
138+
RELEASE=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f2 -d \-)
139+
DATE=$(date -d @$pkg_date +"%F")
140+
TIME=$(date -d @$pkg_date +"%T")
141+
fi
142+
data="$data\nNAME='vesta-ioncube' VERSION='$VERSION' RELEASE='$RELEASE'"
143+
data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='php encoder'"
144+
data="$data TIME='$TIME' DATE='$DATE'"
145+
fi
146+
147+
# Checking installed vesta-softaculous version
148+
if [ "$SOFTACULOUS" = 'yes' ]; then
149+
if [ -e "/etc/redhat-release" ]; then
150+
eval $(rpm --queryformat="$rpm_format" -q vesta-softaculous)
151+
DATE=$(date -d @$UTIME +%F)
152+
TIME=$(date -d @$UTIME +%T)
153+
else
154+
dpkg_data=$(dpkg-query -s vesta-softaculous)
155+
pkg_date=$(stat -c "%Y" /var/lib/dpkg/info/vesta-php.list)
156+
ARCH=$(echo "$dpkg_data"|grep Architecture | cut -f 2 -d ' ')
157+
VERSION=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f1 -d \-)
158+
RELEASE=$(echo "$dpkg_data"|grep ^Vers |cut -f2 -d ' '|cut -f2 -d \-)
159+
DATE=$(date -d @$pkg_date +"%F")
160+
TIME=$(date -d @$pkg_date +"%T")
161+
fi
162+
data="$data\nNAME='vesta-softaculous' VERSION='$VERSION' RELEASE='$RELEASE'"
163+
data="$data ARCH='$ARCH' UPDATED='$UPDATED' DESCR='app installer'"
164+
data="$data TIME='$TIME' DATE='$DATE'"
165+
fi
166+
126167

127168
# Listing data
128169
case $format in

bin/v-update-sys-vesta-all

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ source $VESTA/conf/vesta.conf
2222
#----------------------------------------------------------#
2323

2424
# Starting update loop
25-
for package in vesta vesta-nginx vesta-php; do
25+
for package in vesta vesta-nginx vesta-php vesta-ioncube vesta-softaculous; do
2626
$BIN/v-update-sys-vesta "$package"
2727
done
2828

web/inc/main.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@
2929
$user_combined_ip .= '|'. $_SERVER['HTTP_FORWARDED'];
3030
}
3131

32-
3332
if(!isset($_SESSION['user_combined_ip'])){
3433
$_SESSION['user_combined_ip'] = $user_combined_ip;
3534
}
3635

3736
// Checking user to use session from the same IP he has been logged in
38-
if($_SESSION['user_combined_ip'] != $user_combined_ip){
37+
if($_SESSION['user_combined_ip'] != $user_combined_ip && $_SERVER['REMOTE_ADDR'] != '127.0.0.1'){
3938
session_destroy();
4039
session_start();
4140
$_SESSION['request_uri'] = $_SERVER['REQUEST_URI'];

0 commit comments

Comments
 (0)