-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathadd_files.php
More file actions
31 lines (26 loc) · 971 Bytes
/
add_files.php
File metadata and controls
31 lines (26 loc) · 971 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<?php
require_once 'includes/config.php';
$loggedinuser = $session['user']['username'];
$dbuser = $session['db_user'];
if (!empty($_POST['fileset']) && $_POST['fileset'] == 'index') {
try {
$project->generateIndexFile($session['user']['projectfolder']);
} catch (Exception $e) {
die('Unable to create files. Perhaps you did not create the project directory with write permission');
}
}
if (!empty($_POST['fileset']) && $_POST['fileset'] != 'index') {
try {
$project->generateFiles($session['user']['projectfolder'], $_POST['fileset']);
} catch (Exception $e) {
die('Unable to create files. Perhaps you did not create the project directory with write permission');
}
}
if (!empty($_POST['filename'])) {
try {
$project->generateFile($session['user']['projectfolder'], $_POST['filename']);
} catch (Exception $e) {
die('Unable to create files. Perhaps you did not create the project directory with write permission');
}
}
header('Location: .');