clockwerk-www – Diff between revs 68 and 70
?pathlinks?
Rev 68 | Rev 70 | |||
---|---|---|---|---|
Line 53... | Line 53... | |||
53 | if ($member->name == "success" && $member->value->boolean == "0") { |
53 | if ($member->name == "success" && $member->value->boolean == "0") { |
|
54 | echo 'Sorry, wrong password.'; |
54 | echo 'Sorry, wrong password.'; |
|
55 | goto last; |
55 | goto last; |
|
56 | } |
56 | } |
|
57 | } |
57 | } |
|
58 | try { |
58 | /* try { |
|
59 | $mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD); |
59 | $mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD); |
|
60 | $mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
60 | $mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); |
|
61 | $query = $mysql->prepare("SELECT Name FROM land WHERE OwnerUUID=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)"); |
61 | $query = $mysql->prepare("SELECT Name FROM land WHERE OwnerUUID=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)"); |
|
62 | $query->bindParam(':first', $first); |
62 | $query->bindParam(':first', $first); |
|
63 | $query->bindParam(':last', $last); |
63 | $query->bindParam(':last', $last); |
|
Line 66... | Line 66... | |||
66 | catch(PDOException $e) { |
66 | catch(PDOException $e) { |
|
67 | print 'The given agent is not the owner of the region to download.'; |
67 | print 'The given agent is not the owner of the region to download.'; |
|
68 | return 1; |
68 | return 1; |
|
69 | } |
69 | } |
|
70 | while ($result = $query->fetchObject()) { |
70 | while ($result = $query->fetchObject()) { |
|
71 | if ($result->RegionName == $region) { |
71 | if ($result->RegionName == $region) { */ |
|
72 | $oar_path = '/var/lib/oar/'.$region.'/'.$region.'.oar'; |
72 | $oar_path = '/var/lib/oar/'.$region.'/'.$region.'.oar'; |
|
73 | if (file_exists($oar_path)) { |
73 | if (file_exists($oar_path)) { |
|
74 | header('Content-Description: File Transfer'); |
74 | header('Content-Description: File Transfer'); |
|
75 | header('Content-Type: application/x-gzip-compressed'); |
75 | header('Content-Type: application/x-gzip-compressed'); |
|
76 | header('Content-Disposition: attachment; filename='.basename($oar_path)); |
76 | header('Content-Disposition: attachment; filename='.basename($oar_path)); |
|
Line 82... | Line 82... | |||
82 | readfile($oar_path); |
82 | readfile($oar_path); |
|
83 | goto last; |
83 | goto last; |
|
84 | } |
84 | } |
|
85 | echo '<p>Sorry, the OAR file is not available yet.</p>'; |
85 | echo '<p>Sorry, the OAR file is not available yet.</p>'; |
|
86 | goto last; |
86 | goto last; |
|
87 | } |
87 | /* } |
|
88 | } |
88 | } */ |
|
89 | } |
89 | } |
|
Line 90... | Line 90... | |||
90 | |
90 | |
|
Line 91... | Line 91... | |||
91 | echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |
91 | echo '<p>Sorry, incorrect CAPTCHA. Please try again.</p>'; |