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 | |
|
7 | // Hostname or IP of your OpenSim MySQL server. |
25 | // Hostname or IP of your OpenSim MySQL server. |
|
8 | $MYSQL_HOSTNAME='localhost'; |
26 | $MYSQL_HOSTNAME='localhost'; |
|
9 | // Username of the OpenSim MySQL user. |
27 | // Username of the OpenSim MySQL user. |
|
Line 53... | Line 71... | |||
53 | } |
71 | } |
|
54 | while ($result = $query->fetchObject()) { |
72 | while ($result = $query->fetchObject()) { |
|
55 | if ($result->RegionName == $region) { |
73 | if ($result->RegionName == $region) { |
|
56 | if (file_exists($file)) { |
74 | if (file_exists($file)) { |
|
57 | $req->admin_console_command('change region '.$region); |
75 | $req->admin_console_command('change region '.$region); |
|
- | 76 | wasChown($file, 'opensim', 'opensim'); |
||
58 | $req->admin_console_command('load oar '.$file); |
77 | $req->admin_console_command('load oar '.$file); |
|
- | 78 | wasChown($file, 'www-data', 'www-data'); |
||
59 | header('Location: welcome.php'); |
79 | header('Location: welcome.php'); |
|
60 | exit; |
80 | exit; |
|
61 | } |
81 | } |
|
62 | } |
82 | } |
|
63 | } |
83 | } |