clockwerk-www – Diff between revs 50 and 53
?pathlinks?
Rev 50 | Rev 53 | |||
---|---|---|---|---|
Line 2... | Line 2... | |||
2 | |
2 | |
|
3 | /////////////////////////////////////////////////////////////////////////// |
3 | /////////////////////////////////////////////////////////////////////////// |
|
4 | // Copyright (C) Wizardry and Steamworks 2014 - License: MIT // |
4 | // Copyright (C) Wizardry and Steamworks 2014 - License: MIT // |
|
Line 5... | Line -... | |||
5 | /////////////////////////////////////////////////////////////////////////// |
- | ||
6 | |
- | ||
7 | /////////////////////////////////////////////////////////////////////////// |
- | ||
8 | // Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // |
- | ||
9 | /////////////////////////////////////////////////////////////////////////// |
- | ||
10 | function wasChown($path, $uid, $gid) { |
- | ||
11 | switch(filetype($path)) { |
- | ||
12 | case 'dir': |
- | ||
13 | if(($dir = opendir($path)) === false) break; |
- | ||
14 | while(false !== ($file = readdir($dir))) { |
- | ||
15 | if($file == '.' || $file == '..') continue; |
- | ||
16 | wasChown($path.'/'.$file, $uid, $gid); |
- | ||
17 | } |
- | ||
18 | case 'file': |
- | ||
19 | chown($path, $uid); |
- | ||
20 | chgrp($path, $gid); |
- | ||
21 | break; |
- | ||
22 | } |
- | ||
23 | } |
5 | /////////////////////////////////////////////////////////////////////////// |
|
24 | |
6 | |
|
Line 25... | Line 7... | |||
25 | require_once 'lib/recaptchalib.php'; |
7 | require_once 'lib/recaptchalib.php'; |
|
Line 46... | Line 28... | |||
46 | echo 'Sorry, wrong password.'; |
28 | echo 'Sorry, wrong password.'; |
|
47 | exit; |
29 | exit; |
|
48 | } |
30 | } |
|
49 | } |
31 | } |
|
50 | if (file_exists($file)) { |
32 | if (file_exists($file)) { |
|
51 | wasChown($file, 'opensim', 'opensim'); |
33 | chmod($file, 0644); |
|
52 | $req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file); |
34 | $req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file); |
|
53 | wasChown($file, 'www-data', 'www-data'); |
35 | chmod($file, 0600); |
|
54 | header('Location: welcome.php'); |
36 | header('Location: welcome.php'); |
|
55 | exit; |
37 | exit; |
|
56 | } |
38 | } |
|
57 | } |
39 | } |