diff --git a/bin/v-activate-vesta-license b/bin/v-activate-vesta-license new file mode 100755 index 00000000..d3796a98 --- /dev/null +++ b/bin/v-activate-vesta-license @@ -0,0 +1,62 @@ +#!/bin/bash +# info: activate vesta license +# options: MODULE LICENSE +# +# The function activates and register vesta license + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +module=$(echo $1 | tr '[:lower:]' '[:upper:]') +license=$2 + +# Importing system enviroment +source /etc/profile + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +# Checking arg number +check_args '2' "$#" 'MODULE LICENSE' + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Activating license +v_host='https://vestacp.com/checkout' +answer=$(curl -s $v_host/activate.php?licence_key=$license&module=$module) +check_result $? "cant' connect to vestacp.com " $E_CONNECT + +# Checking server answer +if [[ "$answer" != '0' ]]; then + echo "Error: $module license $license is invalid" + exit $E_INVALID +fi + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Updating vesta.conf +if [ -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then + echo "${module}_KEY='$license'" >> $VESTA/conf/vesta.conf +else + sed -i "s/${module}_KEY=.*/${module}_KEY='$license'/g" $VESTA/conf/vesta.conf +fi + +# Logging +log_event "$OK" "$EVENT" + +exit diff --git a/bin/v-check-vesta-license b/bin/v-check-vesta-license new file mode 100755 index 00000000..46aa40a7 --- /dev/null +++ b/bin/v-check-vesta-license @@ -0,0 +1,59 @@ +#!/bin/bash +# info: check vesta license +# options: [MODULE] +# +# The function activates and register vesta license + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +module=$(echo $1 | tr '[:lower:]' '[:upper:]') + +# Importing system enviroment +source /etc/profile + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Checking module +if [ -z "$module" ]; then + modules=$(grep _KEY= $VESTA/conf/vesta.conf) +else + modules=$(grep "${module}_KEY" $VESTA/conf/vesta.conf) +fi + +IFS=$'\n' +for str in $modules; do + module=$(echo "$str" |cut -f 1 -d _) + license=$(echo "$str" |cut -f 2 -d \') + if [ ! -z "$license" ]; then + v_host='https://vestacp.com/checkout' + answer=$(curl -s $v_host/check.php?licence_key=$license) + check_result $? "cant' connect to vestacp.com " 0 + if [[ "$answer" != '0' ]]; then + sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf + echo "deactivating $module" + fi + fi +done + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +exit diff --git a/bin/v-deactivate-vesta-license b/bin/v-deactivate-vesta-license new file mode 100755 index 00000000..c460cda6 --- /dev/null +++ b/bin/v-deactivate-vesta-license @@ -0,0 +1,61 @@ +#!/bin/bash +# info: deactivate vesta license +# options: MODULE LICENSE +# +# The function activates and register vesta license + + +#----------------------------------------------------------# +# Variable&Function # +#----------------------------------------------------------# + +# Argument defenition +module=$(echo $1 | tr '[:lower:]' '[:upper:]') +license=$2 + +# Importing system enviroment +source /etc/profile + +# Includes +source $VESTA/func/main.sh +source $VESTA/conf/vesta.conf + + +#----------------------------------------------------------# +# Verifications # +#----------------------------------------------------------# + +# Checking arg number +check_args '2' "$#" 'MODULE LICENSE' + + +#----------------------------------------------------------# +# Action # +#----------------------------------------------------------# + +# Activating license +v_host='https://vestacp.com/checkout' +answer=$(curl -s $v_host/cancel.php?licence_key=$license) +check_result $? "cant' connect to vestacp.com " $E_CONNECT +echo $answer + +# Checking server answer +if [[ "$answer" != '0' ]]; then + echo "Error: $module license $license is invalid" + exit $E_INVALID +fi + + +#----------------------------------------------------------# +# Vesta # +#----------------------------------------------------------# + +# Updating vesta.conf +if [ ! -z "$(grep "${module}_KEY" $VESTA/conf/vesta.conf)" ]; then + sed -i "s/${module}_KEY=.*/${module}_KEY=''/g" $VESTA/conf/vesta.conf +fi + +# Logging +log_event "$OK" "$EVENT" + +exit diff --git a/web/css/styles.min.css b/web/css/styles.min.css index bb5c3b3e..2b126f6d 100644 --- a/web/css/styles.min.css +++ b/web/css/styles.min.css @@ -799,11 +799,6 @@ input[type="checkbox"] { background-color: #c4da5e; } .l-profile__notifications.updates { - background-position: -165px -135px; -} - -.l-profile__notifications.updates2 { -/* background-position: -202px -135px; */ background-position: -202px -157px; } @@ -820,32 +815,40 @@ input[type="checkbox"] { z-index: 21; font-size: 12px; padding: 0; - color: #9E9E9E; + color: #7f7f7f; } +.notification-container .unseen { + color: #ABABAB; +} + + .notification-container li { border-bottom: 1px solid #555; padding: 10px 15px 24px; } .notification-container .mark-seen { - background: rgba(0, 0, 0, 0) url("/images/sprite.png") repeat scroll -427px -486px; - border: 5px solid #454545; - border-radius: 12px; + background-color: #abc04b; + border: 2px solid #454545; + border-radius: 10px; cursor: pointer; - display: inline-block; + display: none; float: right; - height: 9px; - margin-right: -8px; - margin-top: -3px; - width: 9px; + height: 7px; + margin-right: -5px; + margin-top: 0; + width: 7px; } .notification-container .mark-seen:hover { background-color: #333; - border-color: #333; + border-color: #abc04b; } .notification-container .mark-seen:active { background-color: #777; border-color: #777; } +.notification-container .unseen .mark-seen{ + display: inline-block; +} .notification-container .title { color: #9e9e9e; font-weight: bold; @@ -870,7 +873,6 @@ input[type="checkbox"] { color: #dacf2e; } - .notification-container a { color: #5ABDB5;/* #eee;*/ } @@ -881,6 +883,21 @@ input[type="checkbox"] { color: #00C0C0; } +.notification-container .icon { + display: inline-block; + width: 0; +} +.notification-container .icon.filemanager { + display: inline-block; + width: 22px; + background: url("/images/flat_icons.png") repeat scroll -31px -100px; +} +.notification-container .icon.starred { + display: inline-block; + width: 21px; + background: url("/images/sprite.png") repeat scroll -184px 556px; +} + .l-stat { @@ -3001,6 +3018,10 @@ form#vstobjects.suspended { background-color: #5f9491; } +.description.cancel-success { + color: #8fac0a; + font-weight: bold; +} .description .licence { padding: 20px 0; diff --git a/web/delete/notification/index.php b/web/delete/notification/index.php new file mode 100644 index 00000000..fa3a14f1 --- /dev/null +++ b/web/delete/notification/index.php @@ -0,0 +1,30 @@ + \ + ~!:TOPIC~!\ + ~!:NOTICE~!\ + ' + ] + }, // file manager // diff --git a/web/list/notifications/index.php b/web/list/notifications/index.php new file mode 100644 index 00000000..0130bb2b --- /dev/null +++ b/web/list/notifications/index.php @@ -0,0 +1,45 @@ + $note){ + $note['ID'] = $key; + $data[$key] = $note; + } + echo json_encode($data); + exit(); +} + + + +$TAB = 'NOTIFICATIONS'; +// Header +include($_SERVER['DOCUMENT_ROOT'].'/templates/header.html'); + +// Panel +top_panel($user,$TAB); + +// Data +exec (VESTA_CMD."v-list-user-notifications $user json", $output, $return_var); +$data = json_decode(implode('', $output), true); +$data = array_reverse($data,true); +if ($_SESSION['user'] == 'admin') { + include($_SERVER['DOCUMENT_ROOT'].'/templates/admin/list_notifications.html'); +} else { + include($_SERVER['DOCUMENT_ROOT'].'/templates/user/list_notifications.html'); +} + +// Back uri +$_SESSION['back'] = $_SERVER['REQUEST_URI']; + +// Footer +include($_SERVER['DOCUMENT_ROOT'].'/templates/footer.html'); diff --git a/web/list/user/index.php b/web/list/user/index.php index 4e7e3e09..129a78c4 100644 --- a/web/list/user/index.php +++ b/web/list/user/index.php @@ -1,4 +1,5 @@
@@ -630,7 +630,7 @@ | |
- | |
- @@ -656,7 +656,7 @@ | |
- @@ -669,35 +669,111 @@ | |
- |
|
- + | + + | +
+ + >
+
+
+ if($_GET['sftp_licence_key'] != '' || $_SESSION['SFTP_KEY']){
+ $licence_key = $_GET['sftp_licence_key'] != '' ? $_GET['sftp_licence_key'] : $_SESSION['SFTP_KEY'];
+ echo 'Restrict users so that they cannot use SSH and access only their home directory.
+
+
+ Licence Key: ';
+ } else {
+ echo '
+ Restrict users so that they cannot use SSH and access only their home directory.
+ This is a commercial module, you would need to purchace license key to enable it.
+
+ +
+ Enter License Key:
+ +
|
+ |
+ | |
- |