commit/galaxy-central: 2 new changesets
2 new changesets in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/871ae4a9e95c/ changeset: r5470:871ae4a9e95c user: fubar date: 2011-04-28 17:48:37 summary: missing quote in picard_wrapper affected #: 1 file (1 byte) --- a/tools/picard/picard_wrapper.py Thu Apr 28 11:10:41 2011 -0400 +++ b/tools/picard/picard_wrapper.py Thu Apr 28 11:48:37 2011 -0400 @@ -527,7 +527,7 @@ s,stdouts = pic.runCL(cl=cl2,output_dir=opts.outdir) else: s = 'Unable to find expected pdf file %s<br/>\n' % pdfpath - s += This <b>always happens if single ended data was provided</b> to this tool,\n' + s += 'This <b>always happens if single ended data was provided</b> to this tool,\n' s += 'so please double check that your input data really is paired-end NGS data.<br/>\n' s += 'If your input was paired data this may be a bug worth reporting to the galaxy-bugs list\n<br/>' stdouts = '' http://bitbucket.org/galaxy/galaxy-central/changeset/ea9a898b73be/ changeset: r5471:ea9a898b73be user: fubar date: 2011-04-28 17:48:52 summary: branch merge affected #: 5 files (3.6 KB) --- a/lib/galaxy/web/controllers/user.py Thu Apr 28 11:48:37 2011 -0400 +++ b/lib/galaxy/web/controllers/user.py Thu Apr 28 11:48:52 2011 -0400 @@ -735,6 +735,38 @@ webapp=webapp, message=message, status=status ) + # For REMOTE_USER, we need the ability to just edit the username + @web.expose + @web.require_login( "to manage the public name" ) + def edit_username( self, trans, cntrller, **kwd ): + params = util.Params( kwd ) + is_admin = cntrller == 'admin' and trans.user_is_admin() + webapp = params.get( 'webapp', 'galaxy' ) + message = util.restore_text( params.get( 'message', '' ) ) + status = params.get( 'status', 'done' ) + user_id = params.get( 'user_id', None ) + if user_id and is_admin: + user = trans.sa_session.query( trans.app.model.User ).get( trans.security.decode_id( user_id ) ) + else: + user = trans.user + if user and params.get( 'change_username_button', False ): + username = kwd.get( 'username', '' ) + if username: + message = self.__validate_username( trans, username, user ) + if message: + status = 'error' + else: + user.username = username + trans.sa_session.add( user ) + trans.sa_session.flush() + message = 'The username has been updated with the changes.' + return trans.fill_template( '/user/username.mako', + cntrller=cntrller, + user=user, + username=user.username, + webapp=webapp, + message=message, + status=status ) @web.expose def edit_info( self, trans, cntrller, **kwd ): params = util.Params( kwd ) @@ -743,12 +775,15 @@ message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) user_id = params.get( 'user_id', None ) - #new_kwd = dict( webapp=webapp ) - if user_id: + if user_id and is_admin: user = trans.sa_session.query( trans.app.model.User ).get( trans.security.decode_id( user_id ) ) + elif user_id and ( not trans.user or trans.user.id != trans.security.decode_id( user_id ) ): + message = 'Invalid user id' + status = 'error' + user = None else: user = trans.user - if params.get( 'login_info_button', False ): + if user and params.get( 'login_info_button', False ): # Editing email and username email = util.restore_text( params.get( 'email', '' ) ) username = util.restore_text( params.get( 'username', '' ) ).lower() @@ -769,7 +804,7 @@ trans.sa_session.add_all( ( user, private_role ) ) trans.sa_session.flush() message = 'The login information has been updated with the changes.' - elif params.get( 'change_password_button', False ): + elif user and params.get( 'change_password_button', False ): # Editing password. Do not sanitize passwords, so get from kwd # and not params (which were sanitized). password = kwd.get( 'password', '' ) @@ -794,7 +829,7 @@ trans.sa_session.flush() trans.log_event( "User change password" ) message = 'The password has been changed.' - elif params.get( 'edit_user_info_button', False ): + elif user and params.get( 'edit_user_info_button', False ): # Edit user information - webapp MUST BE 'galaxy' user_type_fd_id = params.get( 'user_type_fd_id', 'none' ) if user_type_fd_id not in [ 'none' ]: @@ -809,7 +844,7 @@ else: values = {} flush_needed = False - if user.values: + if user.values: # Editing the user info of an existing user with existing user info user.values.content = values trans.sa_session.add( user.values ) @@ -823,7 +858,7 @@ trans.sa_session.add( user ) trans.sa_session.flush() message = "The user information has been updated with the changes." - if webapp == 'galaxy' and is_admin: + if user and webapp == 'galaxy' and is_admin: kwd[ 'user_id' ] = trans.security.encode_id( user.id ) kwd[ 'id' ] = user_id if message: --- a/lib/galaxy/web/framework/__init__.py Thu Apr 28 11:48:37 2011 -0400 +++ b/lib/galaxy/web/framework/__init__.py Thu Apr 28 11:48:52 2011 -0400 @@ -437,10 +437,18 @@ if not user.default_permissions: self.app.security_agent.user_set_default_permissions( user, history=True, dataset=True ) elif user is None: + username = remote_user_email.split( '@', 1 )[0] random.seed() user = self.app.model.User( email=remote_user_email ) user.set_password_cleartext( ''.join( random.sample( string.letters + string.digits, 12 ) ) ) user.external = True + # Find a unique username - user can change it later + if ( self.sa_session.query( self.app.model.User ).filter_by( username=username ).first() ): + i = 0 + while ( self.sa_session.query( self.app.model.User ).filter_by( username=(username + '-' + str(i) ) ).first() ): + i += 1 + username += '-' + str(i) + user.username = username self.sa_session.add( user ) self.sa_session.flush() self.app.security_agent.create_private_user_role( user ) --- a/lib/galaxy/web/framework/middleware/remoteuser.py Thu Apr 28 11:48:37 2011 -0400 +++ b/lib/galaxy/web/framework/middleware/remoteuser.py Thu Apr 28 11:48:52 2011 -0400 @@ -97,6 +97,8 @@ pass # admins can create users elif path_info.startswith( '/user/api_keys' ): pass # api keys can be managed when remote_user is in use + elif path_info.startswith( '/user/edit_username' ): + pass # username can be managed when remote_user is in use elif path_info.startswith( '/user/dbkeys' ): pass # dbkeys can be managed when remote_user is in use elif path_info.startswith( '/user' ): --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/user/username.mako Thu Apr 28 11:48:52 2011 -0400 @@ -0,0 +1,23 @@ +<%inherit file="/base.mako"/> + +<% is_admin = cntrller == 'admin' and trans.user_is_admin() %> + +<h2>Manage Public Name</h2> +<div class="toolForm"> + <form name="username" id="username" action="${h.url_for( controller='user', action='edit_username', cntrller=cntrller, user_id=trans.security.encode_id( user.id ) )}" method="post" > + <input type="hidden" name="webapp" value="${webapp}" size="40"/> + <div class="toolFormTitle">Login Information</div> + <div class="form-row"> + <label>Public name:</label> + <input type="text" name="username" size="40" value="${username}"/> + <div class="toolParamHelp" style="clear: both;"> + Your public name is an optional identifier that will be used to generate addresses for information + you share publicly. Public names must be at least four characters in length and contain only lower-case + letters, numbers, and the '-' character. + </div> + </div> + <div class="form-row"> + <input type="submit" name="change_username_button" value="Save"/> + </div> + </form> +</div> --- a/templates/webapps/galaxy/base_panels.mako Thu Apr 28 11:48:37 2011 -0400 +++ b/templates/webapps/galaxy/base_panels.mako Thu Apr 28 11:48:52 2011 -0400 @@ -149,6 +149,8 @@ menu_options.append( [ 'Saved Pages', h.url_for( controller='/page', action='list' ), "_top" ] ) if app.config.enable_api: menu_options.append( [ 'API Keys', h.url_for( controller='/user', action='api_keys', cntrller='user' ), "galaxy_main" ] ) + if app.config.use_remote_user: + menu_options.append( [ 'Public Name', h.url_for( controller='/user', action='edit_username', cntrller='user' ), "galaxy_main" ] ) extra_class = "loggedin-only" visible = ( trans.user != None ) 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