Changeset 22479 in osm for applications/editors/josm/plugins/remotecontrol
- Timestamp:
- 2010-07-29T09:55:12+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/remotecontrol
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/remotecontrol/build.xml
r22472 r22479 28 28 29 29 <!-- set before publising --> 30 <property name="commit.message" value=" Added version info capable of jsonp. Also made header CORS aware" />30 <property name="commit.message" value="version command evaluates permission flags" /> 31 31 <property name="plugin.main.version" value="2830" /> 32 32 -
applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RemoteControlPreferences.java
r19298 r22479 29 29 private JCheckBox permissionChangeSelection = new JCheckBox(tr("change the selection")); 30 30 private JCheckBox permissionChangeViewport = new JCheckBox(tr("change the viewport")); 31 private JCheckBox permissionReadProtocolversion = new JCheckBox(tr("read protocol version")); 31 32 private JCheckBox alwaysAskUserConfirm = new JCheckBox(tr("confirm all Remote Control actions manually")); 32 33 … … 44 45 perms.add(permissionChangeSelection, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 45 46 perms.add(permissionChangeViewport, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 47 perms.add(permissionReadProtocolversion, GBC.eol().insets(0,5,0,0).fill(GBC.HORIZONTAL)); 46 48 remote.add(perms, GBC.eol().fill(GBC.HORIZONTAL)); 47 49 … … 54 56 permissionChangeViewport.setSelected(Main.pref.getBoolean("remotecontrol.permission.change-viewport", true)); 55 57 permissionCreateObjects.setSelected(Main.pref.getBoolean("remotecontrol.permission.create-objects", true)); 58 permissionReadProtocolversion.setSelected(Main.pref.getBoolean("remotecontrol.permission.read-protocolversion", true)); 56 59 alwaysAskUserConfirm.setSelected(Main.pref.getBoolean("remotecontrol.always-confirm", false)); 57 60 … … 63 66 Main.pref.put("remotecontrol.permission.change-viewport", permissionChangeViewport.isSelected()); 64 67 Main.pref.put("remotecontrol.permission.create-objects", permissionCreateObjects.isSelected()); 68 Main.pref.put("remotecontrol.permission.read-protocolversion", permissionReadProtocolversion.isSelected()); 65 69 Main.pref.put("remotecontrol.always-confirm", alwaysAskUserConfirm.isSelected()); 66 70 // FIXME confirm return value - really no restart needed? -
applications/editors/josm/plugins/remotecontrol/src/org/openstreetmap/josm/plugins/remotecontrol/RequestProcessor.java
r22472 r22479 289 289 // TODO: select/zoom to downloaded 290 290 } else if (command.equals("/version")) { 291 if (!Main.pref.getBoolean("remotecontrol.permission.read-protocolversion", true)) { 292 sendForbidden(out); 293 System.out.println("RemoteControl: /version forbidden by preferences"); 294 return; 295 } 296 if (Main.pref.getBoolean("remotecontrol.always-confirm", false)) { 297 if (JOptionPane.showConfirmDialog(Main.parent, 298 "<html>" + tr("Remote Control has been asked to report its protocol version. This enables web sites to detect a running JOSM.") + 299 "<br>" + tr("Do you want to allow this?"), 300 tr("Confirm Remote Control action"), 301 JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) { 302 sendForbidden(out); 303 return; 304 } 305 } 306 291 307 content = RequestProcessor.PROTOCOLVERSION; 292 308 contentType = "application/json";
Note:
See TracChangeset
for help on using the changeset viewer.