clockwerk-www – Diff between revs 71 and 72

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 71 Rev 72
Line 54... Line 54...
54 foreach($rep->params->param->value->struct->member as $member) { 54 foreach($rep->params->param->value->struct->member as $member) {
55 switch($member->name) { 55 switch($member->name) {
56 case "success": 56 case "success":
57 switch((bool)$member->value->boolean) { 57 switch((bool)$member->value->boolean) {
58 case TRUE: 58 case TRUE:
59 /* try { 59 try {
60 $mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD); 60 $mysql = new PDO('mysql:host='.$MYSQL_HOSTNAME.';dbname='.$MYSQL_DATABASE.';', $MYSQL_USERNAME, $MYSQL_PASSWORD);
61 $mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); 61 $mysql->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
62 $query = $mysql->prepare("SELECT Name FROM land WHERE OwnerUUID=(SELECT PrincipalID FROM UserAccounts WHERE FirstName=:first AND LastName=:last)"); 62 $query = $mysql->prepare("SELECT UserLevel FROM UserAccounts WHERE FirstName=:first AND LastName=:last");
63 $query->bindParam(':first', $first); 63 $query->bindParam(':first', $first);
64 $query->bindParam(':last', $last); 64 $query->bindParam(':last', $last);
65 $query->execute(); 65 $query->execute();
-   66 $result=$query->fetch(PDO::FETCH_ASSOC);
66 } 67 }
67 catch(PDOException $e) { 68 catch(PDOException $e) {
-   69 print '<p>Sorry, a database error occurred.</p>';
-   70 goto last;
-   71 }
-   72 if($result['UserLevel'] < 100) {
68 print '<p>Sorry, the authenticated agent is not the owner of the region to download.</p>'; 73 print '<p>Sorry, the authenticated agent does not have the necessary level to apply OARs.</p>';
-   74 goto last;
-   75 }
-   76 if (file_exists($file)) {
-   77 $req->admin_console_command('change region '.$region);
-   78 chmod($file, 0644);
-   79 $req->admin_console_command('load oar '.$file);
-   80 chmod($file, 0600);
-   81 echo '<p>OAR uploaded successfully.</p>';
69 goto last; 82 goto last;
70 } 83 }
71 while ($result = $query->fetchObject()) { -  
72 if ($result->RegionName == $region) { */ -  
73 if (file_exists($file)) { -  
74 $req->admin_console_command('change region '.$region); -  
75 chmod($file, 0644); -  
76 $req->admin_console_command('load oar '.$file); -  
77 chmod($file, 0600); -  
78 echo '<p>OAR uploaded successfully.</p>'; -  
79 goto last; -  
80 } -  
81 /* } -  
82 } */ -  
83 goto last; 84 goto last;
84 default: 85 default:
85 echo '<p>Sorry, wrong password.</p>'; 86 echo '<p>Sorry, wrong password.</p>';
86 goto last; 87 goto last;
87 } 88 }