On Tue, Jan 12, 2010 at 10:14:35AM -0000, Mark Farrington wrote: > Ok, > > I've got somewhere with this following falcone's advice.
Jason If you have time to turn this into a patch and send it along to bug-RT-Authen-ExternalAuth at rt.cpan.org it'd make it a lot easier for us to see in context and try to include it in a future release. -kevin > If it's any use to anyone else, I added the following to ExternalAuth.pm > (mostly borrowed from the LDAPImport Extension) - it's creating a group based > on the name of the Auth service in RTSiteConfig and adding the user to it. > > It needs some debug added (as there currently is none) - but if it can be of > use to anyone feel free to borrow it. > > M* > > ##### Added By MRF > > # Creates Groups based on $service > > my $rt_group = RT::Group->new($RT::SystemUser); > > $rt_group->LoadUserDefinedGroup( $service ); > unless ($rt_group->Id) { > my ($gp_id,$gp_msg) = $rt_group->CreateUserDefinedGroup( Name => > $service ); > unless ($gp_id) { > #$self->_error("Can't create group $group_name [$msg]") > } > } > > #group already exists (or does now) - so we can add user to it > > #Adds Users to groups > > #my $principal = $UserObj->PrincipalObj; > if ($rt_group->HasMember($session->{'CurrentUser'})) { > #$self->_debug($user->Name . " already a member of " . $group->Name); > return; > } > > $rt_group->AddMember($session->{'CurrentUser'}->Id); > > > > ##### Snip > > > > Mark Farrington > Broadcast Engineer > Global Traffic Network UK > > > > Please note: Our office address has now changed to: > Global Traffic Network (UK) Ltd, 5th Floor, 5 Golden Square, London, W1F 9BS > > Global Traffic Network (UK) is a limited Company registered in England and > Wales. Registered number: 5867987 Registered office: 179 Great Portland > Street, London, UK. > > Global Traffic Network (UK) Commercial is a limited Company registered in > England and Wales. Registered number: 2229296 Registered office: 179 Great > Portland Street, London, UK. > > This email is intended for the addressee only. If you have received this > email in error, then please notify the sender immediately and delete the > email without copying, storing or disclosing its contents to any other person. > > Copyright of this email and its attachment(s) are the property of Global > Traffic Network (UK) and/or Global Traffic Network (UK) Commercial, unless > otherwise stated. > ______________________________________________________________________ > This email has been scanned by MessageLabs > and is free of all known viruses and spyware. > ______________________________________________________________________ > _______________________________________________ > http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users > > Community help: http://wiki.bestpractical.com > Commercial support: sa...@bestpractical.com > > > Discover RT's hidden secrets with RT Essentials from O'Reilly Media. > Buy a copy at http://rtbook.bestpractical.com >
pgpc9YEhZa7tN.pgp
Description: PGP signature
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: sa...@bestpractical.com 2010 RT Training Sessions! San Francisco, CA, USA - Feb 22 & 23 Dublin, Ireland - Mar 15 & 16 Boston, MA, USA - April 5 & 6 Washington DC, USA - Oct 25 & 26 Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com