clockwerk-www – Diff between revs 47 and 50
?pathlinks?
Rev 47 | Rev 50 | |||
---|---|---|---|---|
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 -... | Line 5... | |||
- | 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 | } |
||
5 | /////////////////////////////////////////////////////////////////////////// |
23 | } |
|
6 | |
24 | |
|
Line 7... | Line 25... | |||
7 | require_once 'lib/recaptchalib.php'; |
25 | require_once 'lib/recaptchalib.php'; |
|
Line 28... | Line 46... | |||
28 | echo 'Sorry, wrong password.'; |
46 | echo 'Sorry, wrong password.'; |
|
29 | exit; |
47 | exit; |
|
30 | } |
48 | } |
|
31 | } |
49 | } |
|
32 | if (file_exists($file)) { |
50 | if (file_exists($file)) { |
|
- | 51 | wasChown($file, 'opensim', 'opensim'); |
||
33 | $req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file); |
52 | $req->admin_console_command('load iar '.$file. ' '.$last.' / '.$file); |
|
- | 53 | wasChown($file, 'www-data', 'www-data'); |
||
34 | header('Location: welcome.php'); |
54 | header('Location: welcome.php'); |
|
35 | exit; |
55 | exit; |
|
36 | } |
56 | } |
|
37 | } |
57 | } |