commit/galaxy-central: greg: Encode application name and link name when sending as request params to display application.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/33c780b4c145/ changeset: 33c780b4c145 user: greg date: 2012-02-14 17:58:51 summary: Encode application name and link name when sending as request params to display application. affected #: 4 files diff -r 95876f2552d354bf88320521dcf5083f31147bf0 -r 33c780b4c1455628ec135b0ba98e285efcb89ed8 lib/galaxy/datatypes/display_applications/application.py --- a/lib/galaxy/datatypes/display_applications/application.py +++ b/lib/galaxy/datatypes/display_applications/application.py @@ -1,4 +1,5 @@ #Contains objects for using external display applications +import logging, urllib from galaxy.util import parse_xml, string_as_bool from galaxy.util.odict import odict from galaxy.util.template import fill_template @@ -8,6 +9,8 @@ from util import encode_dataset_user from copy import deepcopy +log = logging.getLogger( __name__ ) + #Any basic functions that we want to provide as a basic part of parameter dict should be added to this dict BASE_PARAMS = { 'qp': quote_plus, 'url_for':url_for } #url_for has route memory... @@ -37,7 +40,13 @@ self.name = None def get_display_url( self, data, trans ): dataset_hash, user_hash = encode_dataset_user( trans, data, None ) - return url_for( controller = '/dataset', action = "display_application", dataset_id = dataset_hash, user_id = user_hash, app_name = self.display_application.id, link_name = self.id, app_action = None ) + return url_for( controller='/dataset', + action="display_application", + dataset_id=dataset_hash, + user_id=user_hash, + app_name=urllib.quote_plus( self.display_application.id ), + link_name=urllib.quote_plus( self.id ), + app_action=None ) def get_inital_values( self, data, trans ): if self.other_values: rval = odict( self.other_values ) diff -r 95876f2552d354bf88320521dcf5083f31147bf0 -r 33c780b4c1455628ec135b0ba98e285efcb89ed8 lib/galaxy/datatypes/display_applications/parameters.py --- a/lib/galaxy/datatypes/display_applications/parameters.py +++ b/lib/galaxy/datatypes/display_applications/parameters.py @@ -1,4 +1,5 @@ #Contains parameters that are used in Display Applications +import logging, urllib from galaxy.util import string_as_bool from galaxy.util.bunch import Bunch from galaxy.util.template import fill_template @@ -161,7 +162,15 @@ base_url = self.trans.request.base if self.parameter.strip_https and base_url[ : 5].lower() == 'https': base_url = "http%s" % base_url[ 5: ] - return "%s%s" % ( base_url, url_for( controller = '/dataset', action = "display_application", dataset_id = self._dataset_hash, user_id = self._user_hash, app_name = self.parameter.link.display_application.id, link_name = self.parameter.link.id, app_action = self.action_name, action_param = self._url ) ) + return "%s%s" % ( base_url, + url_for( controller='/dataset', + action="display_application", + dataset_id=self._dataset_hash, + user_id=self._user_hash, + app_name=urllib.quote_plus( self.parameter.link.display_application.id ), + link_name=urllib.quote_plus( self.parameter.link.id ), + app_action=self.action_name, + action_param=self._url ) ) @property def action_name( self ): return self.ACTION_NAME diff -r 95876f2552d354bf88320521dcf5083f31147bf0 -r 33c780b4c1455628ec135b0ba98e285efcb89ed8 lib/galaxy/datatypes/registry.py --- a/lib/galaxy/datatypes/registry.py +++ b/lib/galaxy/datatypes/registry.py @@ -514,7 +514,7 @@ display_app.repository_owner = installed_repository_dict[ 'repository_owner' ] display_app.installed_changeset_revision = installed_repository_dict[ 'installed_changeset_revision' ] display_app.old_id = display_app.id - # The converter should be included in the list of tools defined in tool_dicts. + # The display application should be included in the list of tools defined in tool_dicts. tool_dicts = installed_repository_dict[ 'tool_dicts' ] for tool_dict in tool_dicts: if tool_dict[ 'id' ] == display_app.id: diff -r 95876f2552d354bf88320521dcf5083f31147bf0 -r 33c780b4c1455628ec135b0ba98e285efcb89ed8 lib/galaxy/web/controllers/dataset.py --- a/lib/galaxy/web/controllers/dataset.py +++ b/lib/galaxy/web/controllers/dataset.py @@ -815,9 +815,11 @@ user_roles = user.all_roles() else: user_roles = [] + # Decode application name and link name + app_name = urllib.unquote_plus( app_name ) + link_name = urllib.unquote_plus( link_name ) if None in [ app_name, link_name ]: return trans.show_error_message( "A display application name and link name must be provided." ) - if trans.app.security_agent.can_access_dataset( user_roles, data.dataset ): msg = [] refresh = False Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket