From a4682ceae6774956461edd03b2485bbacea445f4 Mon Sep 17 00:00:00 2001 From: mharmsen Date: Tue, 4 Oct 2011 01:17:41 +0000 Subject: Bugzilla Bug #688225 - (dogtagIPAv2.1) TRACKER: of the Dogtag fixes for freeIPA 2.1 git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/tags/IPA_v2_RHEL_6_2_20111003@2252 c9f7a03b-bd48-0410-a16d-cbbf54688b0b --- pki/base/ra/forms/admin/group/add_member.cgi | 80 ++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100755 pki/base/ra/forms/admin/group/add_member.cgi (limited to 'pki/base/ra/forms/admin/group/add_member.cgi') diff --git a/pki/base/ra/forms/admin/group/add_member.cgi b/pki/base/ra/forms/admin/group/add_member.cgi new file mode 100755 index 000000000..d60fe965e --- /dev/null +++ b/pki/base/ra/forms/admin/group/add_member.cgi @@ -0,0 +1,80 @@ +#!/usr/bin/perl +# +# --- BEGIN COPYRIGHT BLOCK --- +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Copyright (C) 2007 Red Hat, Inc. +# All rights reserved. +# --- END COPYRIGHT BLOCK --- +# +# +# +# + +package op; + +use lib $ENV{DOCUMENT_ROOT} . "/../lib/perl"; + +use DBI; +use CGI; +use Template::Velocity; +use PKI::RA::GlobalVar; +use PKI::Base::Conf; +use PKI::Base::Util; +use PKI::Base::Registry; +use PKI::Request::Queue; + +use vars qw (@ISA); +use PKI::Service::Op; +@ISA = qw(PKI::Service::Op); + +sub new { + my $self = {}; + bless ($self); + return $self; +} + +sub process() +{ + my $self = shift; + my $q = CGI->new(); + + my $util = PKI::Base::Util->new(); + + my $cfg = PKI::Base::Registry->get_config(); + + $self->debug_params($cfg, $q); + + if (!$self->admin_auth($cfg)) { + print $q->redirect("/admin/error.cgi"); + return; + } + my $uid = $self->get_current_uid($cfg); + + my %context; + $context{uid} = $util->html_encode($uid); + + my $gid = $util->get_val($q->param('gid')); + my $userid = $util->get_val($q->param('uid')); + + my $store = PKI::Base::UserStore->new(); + $store->open($cfg); + $store->add_user_to_group($gid, $userid); + $store->close(); + + print $q->redirect("/admin/group/read.cgi?gid=" . $gid); +} + +my $op = op->new(); +$op->execute(); -- cgit