clockwerk-www – Diff between revs 50 and 53

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