Skip to content

Commit 1e196a3

Browse files
committed
Web App installer: started implementation
1 parent 3dcb6f6 commit 1e196a3

File tree

12 files changed

+175
-0
lines changed

12 files changed

+175
-0
lines changed

web/add/webapp/index.php

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
error_reporting(NULL);
3+
ob_start();
4+
$TAB = 'WEB';
5+
6+
// Main include
7+
include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
8+
9+
// Check domain argument
10+
if (empty($_GET['domain'])) {
11+
header("Location: /list/web/");
12+
exit;
13+
}
14+
15+
// Edit as someone else?
16+
if (($_SESSION['user'] == 'admin') && (!empty($_GET['user']))) {
17+
$user=escapeshellarg($_GET['user']);
18+
}
19+
20+
// Get all user domains
21+
exec (HESTIA_CMD."v-list-web-domains ".escapeshellarg($user)." json", $output, $return_var);
22+
$user_domains = json_decode(implode('', $output), true);
23+
$user_domains = array_keys($user_domains);
24+
unset($output);
25+
26+
// List domain
27+
$v_domain = $_GET['domain'];
28+
if(!in_array($v_domain, $user_domains)) {
29+
header("Location: /list/web/");
30+
exit;
31+
}
32+
33+
$v_web_apps = [
34+
[ 'name'=>'Wordpress', 'group'=>'cms','version'=>'1.2.3', 'thumbnail'=>'/images/webapps/wp-thumb.png' ],
35+
[ 'name'=>'Drupal', 'group'=>'cms', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/drupal-thumb.png' ],
36+
[ 'name'=>'Joomla', 'group'=>'cms', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/joomla-thumb.png' ],
37+
38+
[ 'name'=>'Opencart', 'group'=>'ecommerce', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/opencart-thumb.png' ],
39+
[ 'name'=>'Prestashop', 'group'=>'ecommerce', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/prestashop-thumb.png' ],
40+
[ 'name'=>'Magento', 'group'=>'ecommerce', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/magento-thumb.png' ],
41+
42+
[ 'name'=>'Laravel', 'group'=>'starter', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/laravel-thumb.png' ],
43+
[ 'name'=>'Symfony', 'group'=>'starter', 'version'=>'1.2.3', 'thumbnail'=>'/images/webapps/symfony-thumb.png' ],
44+
45+
];
46+
47+
// Check POST request
48+
if (!empty($_POST['ok'])) {
49+
50+
// Check token
51+
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
52+
header('location: /login/');
53+
exit();
54+
}
55+
}
56+
57+
// Render page
58+
render_page($user, $TAB, 'add_webapp');
59+
60+
// Flush session messages
61+
unset($_SESSION['error_msg']);
62+
unset($_SESSION['ok_msg']);

web/css/styles.min.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,74 @@ form#vstobjects .alert {
11141114
width: 380px;
11151115
}
11161116

1117+
.app-list.cards {
1118+
xdisplay: flex;
1119+
xflex-wrap: wrap;
1120+
align-content: center;
1121+
margin-bottom: 10rem;
1122+
1123+
}
1124+
1125+
1126+
.card {
1127+
float:left;
1128+
overflow: hidden;
1129+
border:1px solid #e6e6e6;
1130+
box-sizing: border-box;
1131+
width:200px;
1132+
min-height:260px;
1133+
margin-top:3em;
1134+
margin-right:3em;
1135+
box-shadow: 0px 0px 3px rgba(0,0,0,0.1);
1136+
color: #353535;
1137+
1138+
}
1139+
1140+
.card:nth-child(4n+1) {
1141+
clear:left;
1142+
}
1143+
.card:nth-child(4n) {
1144+
margin-right:0;
1145+
}
1146+
1147+
.card .card-details {
1148+
font-size: 0.8rem;
1149+
background-color: #f5f5f5;
1150+
padding: 0.5em 0.8em;
1151+
border-top: 1px solid #e6e6e6;
1152+
text-align: center;
1153+
1154+
}
1155+
.card .card-details p {
1156+
margin: 0 0 0.3em 0;
1157+
font-size: 1em;
1158+
text-align: left;
1159+
}
1160+
1161+
.card p.card-title {
1162+
font-size: 1.2em;
1163+
font-weight: 500;
1164+
}
1165+
1166+
.card .card-thumb {
1167+
background-color: #fff;
1168+
display: block;
1169+
height: 180px;
1170+
width: 200px;
1171+
text-align: center;
1172+
}
1173+
.card .card-thumb img {
1174+
max-height: 180px;
1175+
max-width: 200px;
1176+
height: auto;
1177+
width: auto;
1178+
1179+
}
1180+
1181+
.card button {
1182+
margin:0.3em;
1183+
}
1184+
11171185
.l-stat {
11181186
margin: 34px auto;
11191187
position: fixed;
19.5 KB
Loading
61.9 KB
Loading
5.33 KB
Loading
46.6 KB
Loading
32.6 KB
Loading
40.6 KB
Loading
17.9 KB
Loading
7.39 KB
Loading

0 commit comments

Comments
 (0)