#NEWLINE# def render_admin_panel( self , req , category , page , path_info ) : #NEWLINE# #INDENT# req . perm . require ( 'VERSIONCONTROL_ADMIN' ) #NEWLINE# if ( req . method == 'POST' ) : #NEWLINE# #INDENT# if ( 'add_user' in req . args ) : #NEWLINE# #INDENT# username = req . args [ 'name' ] #NEWLINE# pubkey = req . args [ 'sshkey' ] . file #NEWLINE# utils . save_file ( self . gitolite_admin_ssh_path , ( 'keydir/%s.pub' % username ) , pubkey . read ( ) , _ ( ( 'Adding new user %s' % username ) ) ) #NEWLINE# add_notice ( req , _ ( ( 'User "%s" has been added.  Visit the repository permissions panel to set up the new user\'s read/write permissions.' % username ) ) ) #NEWLINE# req . redirect ( req . href . admin ( category , page ) ) #NEWLINE# #UNINDENT# users = [ ( 'keydir/%s.pub' % username ) for username in req . args . get ( 'remove_user' , [ ] ) ] #NEWLINE# if users : #NEWLINE# #INDENT# utils . remove_files ( self . gitolite_admin_ssh_path , users , _ ( 'Removing users' ) ) #NEWLINE# add_notice ( req , _ ( 'The selected users have been removed and no longer have SSH access to your repositories.  Note that if they have Trac accounts, they may still be able to browse the source code through the web.' ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# add_warning ( req , _ ( 'No users were selected.' ) ) #NEWLINE# #UNINDENT# req . redirect ( req . href . admin ( category , page ) ) #NEWLINE# #UNINDENT# data = { #NEWLINE# #INDENT# 'users' : self . get_users ( ) , #NEWLINE# #UNINDENT# } #NEWLINE# return ( 'admin_repository_users.html' , data )