-
Notifications
You must be signed in to change notification settings - Fork 57
/
Copy pathmain.php
53 lines (39 loc) · 1.29 KB
/
main.php
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
//@error_reporting($_SERVER ['SERVER_NAME'] == "localhost" ? E_ALL : 0);
// Changing file/directory permissions recursively
$start_dir = BASE_DIR; // Starting directory
$perms ['file'] = FILE_PERMISSIONS; // chmod value for files
$perms ['folder'] = DIR_PERMISSIONS; // chmod value for folders
function chmod_r($dir) {
global $perms;
$dp = @opendir($dir);
while($file = readdir($dp)) {
if (($file == ".") || ($file == ".."))
continue;
$fullPath = $dir . '/' . $file;
if(is_dir($fullPath)) {
// echo('DIR:' . $fullPath . "\n");
@chmod($fullPath, $perms ['folder']);
chmod_r($fullPath, $perms ['folder'], $perms ['file']);
} else {
// echo('FILE:' . $fullPath . "\n");
@chmod($fullPath, $perms ['file']);
}
}
closedir($dp);
}
chmod_r($start_dir, $perms ['folder'], $perms ['file']);
// Sets the local language based on the browser
$language = @$_POST ['language'] ? $_POST ['language'] : $browserLang;
$lf = "lang.$language.php";
if (!preg_match('|^lang\.[a-z]{2}-[a-z]{2}\.php$|', $lf))
die('Error with lang file');
include('./setup/lang/' . $lf);
include('./setup/lib/main.lib.php');
$step = null;
$id = getstep($step);
$l =& $lang [$step];
include("./setup/tpls/header.tpl.php");
include("./setup/tpls/{$step}.tpl.php");
include("./setup/tpls/footer.tpl.php");
?>