logo


is_valid) { $req = new wasRemoteAdmin('http://127.0.0.1:10000', 'opensim'); $ret = $req->admin_authenticate_user($first, $last, MD5($password), '1'); $rep = new SimpleXMLElement($ret); foreach($rep->params->param->value->struct->member as $member) { if ($member->name == "success" && $member->value->boolean == "0") { echo 'Sorry, wrong password.'; goto last; } } try { $mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD); $mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $query = $mysql->prepare("SELECT UserLevel FROM UserAccounts WHERE FirstName=:first AND LastName=:last"); $query->bindParam(':first', $first); $query->bindParam(':last', $last); $query->execute(); $result=$query->fetch(PDO::FETCH_ASSOC); } catch(PDOException $e) { print '

Sorry, a database error occurred.

'; goto last; } if($result['UserLevel'] < 100) { print '

Sorry, the authenticated agent does not have the necessary level to download OARs.

'; goto last; } $oar_path = '/var/lib/oar/'.$region.'/'.$region.'.oar'; if (file_exists($oar_path)) { header('Content-Description: File Transfer'); header('Content-Type: application/x-gzip-compressed'); header('Content-Disposition: attachment; filename='.basename($oar_path)); header('Content-Transfer-Encoding: binary'); header('Expires: 0'); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Length: '.filesize($oar_path)); readfile($oar_path); goto last; } echo '

Sorry, the OAR file is not available yet.

'; goto last; } echo '

Sorry, incorrect CAPTCHA. Please try again.

'; last: ?>