clockwerk-www

Subversion Repositories:
Compare Path: Rev
With Path: Rev
?path1? @ 49  →  ?path2? @ 50
/applyoar.php
@@ -4,6 +4,24 @@
// Copyright (C) Wizardry and Steamworks 2014 - License: MIT //
///////////////////////////////////////////////////////////////////////////
 
///////////////////////////////////////////////////////////////////////////
// Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 //
///////////////////////////////////////////////////////////////////////////
function wasChown($path, $uid, $gid) {
switch(filetype($path)) {
case 'dir':
if(($dir = opendir($path)) === false) break;
while(false !== ($file = readdir($dir))) {
if($file == '.' || $file == '..') continue;
wasChown($path.'/'.$file, $uid, $gid);
}
case 'file':
chown($path, $uid);
chgrp($path, $gid);
break;
}
}
 
// Hostname or IP of your OpenSim MySQL server.
$MYSQL_HOSTNAME='localhost';
// Username of the OpenSim MySQL user.
@@ -55,7 +73,9 @@
if ($result->RegionName == $region) {
if (file_exists($file)) {
$req->admin_console_command('change region '.$region);
wasChown($file, 'opensim', 'opensim');
$req->admin_console_command('load oar '.$file);
wasChown($file, 'www-data', 'www-data');
header('Location: welcome.php');
exit;
}