mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 21:27:40 +00:00
Merge branch 'unstable' of ssh://git.code.sf.net/p/guacamole/code into unstable
This commit is contained in:
@@ -95,7 +95,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.sourceforge.guacamole</groupId>
|
<groupId>net.sourceforge.guacamole</groupId>
|
||||||
<artifactId>guacamole-common-js</artifactId>
|
<artifactId>guacamole-common-js</artifactId>
|
||||||
<version>0.7.0</version>
|
<version>0.7.1</version>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@@ -19,6 +19,7 @@ package net.sourceforge.guacamole.net.basic.xml.user_mapping;
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sourceforge.guacamole.net.basic.auth.Authorization;
|
import net.sourceforge.guacamole.net.basic.auth.Authorization;
|
||||||
|
import net.sourceforge.guacamole.net.basic.auth.UserMapping;
|
||||||
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
||||||
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
||||||
import org.xml.sax.Attributes;
|
import org.xml.sax.Attributes;
|
||||||
@@ -44,6 +45,22 @@ public class AuthorizeTagHandler implements TagHandler {
|
|||||||
*/
|
*/
|
||||||
private GuacamoleConfiguration default_config = null;
|
private GuacamoleConfiguration default_config = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The UserMapping this authorization belongs to.
|
||||||
|
*/
|
||||||
|
private UserMapping parent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new AuthorizeTagHandler that parses an Authorization owned
|
||||||
|
* by the given UserMapping.
|
||||||
|
*
|
||||||
|
* @param parent The UserMapping that owns the Authorization this handler
|
||||||
|
* will parse.
|
||||||
|
*/
|
||||||
|
public AuthorizeTagHandler(UserMapping parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Attributes attributes) throws SAXException {
|
public void init(Attributes attributes) throws SAXException {
|
||||||
|
|
||||||
@@ -70,23 +87,16 @@ public class AuthorizeTagHandler implements TagHandler {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parent.addAuthorization(this.asAuthorization());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public TagHandler childElement(String localName) throws SAXException {
|
public TagHandler childElement(String localName) throws SAXException {
|
||||||
|
|
||||||
// "connection" tag
|
// "connection" tag
|
||||||
if (localName.equals("connection")) {
|
if (localName.equals("connection"))
|
||||||
|
return new ConnectionTagHandler(authorization);
|
||||||
// Get tag handler for connection tag
|
|
||||||
ConnectionTagHandler tagHandler = new ConnectionTagHandler();
|
|
||||||
|
|
||||||
// Store configuration stub
|
|
||||||
GuacamoleConfiguration config_stub = tagHandler.asGuacamoleConfiguration();
|
|
||||||
authorization.addConfiguration(tagHandler.getName(), config_stub);
|
|
||||||
|
|
||||||
return tagHandler;
|
|
||||||
}
|
|
||||||
|
|
||||||
// "param" tag
|
// "param" tag
|
||||||
if (localName.equals("param")) {
|
if (localName.equals("param")) {
|
||||||
|
@@ -18,6 +18,7 @@ package net.sourceforge.guacamole.net.basic.xml.user_mapping;
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import net.sourceforge.guacamole.net.basic.auth.Authorization;
|
||||||
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
||||||
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
import net.sourceforge.guacamole.protocol.GuacamoleConfiguration;
|
||||||
import org.xml.sax.Attributes;
|
import org.xml.sax.Attributes;
|
||||||
@@ -40,9 +41,26 @@ public class ConnectionTagHandler implements TagHandler {
|
|||||||
*/
|
*/
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The Authorization this connection belongs to.
|
||||||
|
*/
|
||||||
|
private Authorization parent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a new ConnectionTagHandler that parses a Connection owned by
|
||||||
|
* the given Authorization.
|
||||||
|
*
|
||||||
|
* @param parent The Authorization that will own this Connection once
|
||||||
|
* parsed.
|
||||||
|
*/
|
||||||
|
public ConnectionTagHandler(Authorization parent) {
|
||||||
|
this.parent = parent;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(Attributes attributes) throws SAXException {
|
public void init(Attributes attributes) throws SAXException {
|
||||||
name = attributes.getValue("name");
|
name = attributes.getValue("name");
|
||||||
|
parent.addConfiguration(name, this.asGuacamoleConfiguration());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -18,7 +18,6 @@ package net.sourceforge.guacamole.net.basic.xml.user_mapping;
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import net.sourceforge.guacamole.net.basic.auth.Authorization;
|
|
||||||
import net.sourceforge.guacamole.net.basic.auth.UserMapping;
|
import net.sourceforge.guacamole.net.basic.auth.UserMapping;
|
||||||
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
import net.sourceforge.guacamole.net.basic.xml.TagHandler;
|
||||||
import org.xml.sax.Attributes;
|
import org.xml.sax.Attributes;
|
||||||
@@ -45,18 +44,8 @@ public class UserMappingTagHandler implements TagHandler {
|
|||||||
public TagHandler childElement(String localName) throws SAXException {
|
public TagHandler childElement(String localName) throws SAXException {
|
||||||
|
|
||||||
// Start parsing of authorize tags, add to list of all authorizations
|
// Start parsing of authorize tags, add to list of all authorizations
|
||||||
if (localName.equals("authorize")) {
|
if (localName.equals("authorize"))
|
||||||
|
return new AuthorizeTagHandler(user_mapping);
|
||||||
// Get tag handler for authorize tag
|
|
||||||
AuthorizeTagHandler tagHandler = new AuthorizeTagHandler();
|
|
||||||
|
|
||||||
// Store authorization stub in map of authorizations
|
|
||||||
Authorization auth_stub = tagHandler.asAuthorization();
|
|
||||||
user_mapping.addAuthorization(auth_stub);
|
|
||||||
|
|
||||||
return tagHandler;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user