VUser::Radius - vuser extension to manage RADIUS users


VUser-Radius documentation  | view source Contained in the VUser-Radius distribution.

Index



	# radius-listusers
	$eh->register_action ('radius', 'listusers', 'List all user accounts');

	# radius-userinfo
	$eh->register_action ('radius', 'userinfo', 'Get details for a RADIUS user');
	$eh->register_option ('radius', 'userinfo', $meta{'username'}, 'req');
	$eh->register_option ('radius', 'userinfo', $meta{'realm'});

>>>>>>> 1.8 # radius-addattrib $eh->register_action ('radius', 'addattrib', 'Add an attribute to a RADIUS user'); $eh->register_option ('radius', 'addattrib', $meta{'username'}, 1); $eh->register_option ('radius', 'addattrib', $meta{'realm'}); $eh->register_option ('radius', 'addattrib', $meta{'attribute'}, 1); $eh->register_option ('radius', 'addattrib', $meta{'value'}, 1);

    # radius-modattrib
    $eh->register_action ('radius', 'modattrib', 'Modify an attribute for a RADIUS user');
    $eh->register_option ('radius', 'modattrib', $meta{'username'}, 1);
    $eh->register_option ('radius', 'modattrib', $meta{'realm'});
    $eh->register_option ('radius', 'modattrib', $meta{'attribute'}, 1);
    $eh->register_option ('radius', 'modattrib', $meta{'value'});

    # radius-rmattrib
    $eh->register_action ('radius', 'rmattrib', 'Remove an attribute from a RADIUS user');
    $eh->register_option ('radius', 'rmattrib', $meta{'username'}, 1);
    $eh->register_option ('radius', 'rmattrib', $meta{'realm'});
    $eh->register_option ('radius', 'rmattrib', $meta{'attribute'}, 1);
<<<<<<< Radius.pm

    # radius-listattrib
    $eh->register_action ('radius', 'listattrib', 'List the attribute(s) for a RADIUS user');
    $eh->register_option ('radius', 'listattrib', $meta{'username'}, 1);
    $eh->register_option ('radius', 'listattrib', $meta{'realm'});
    $eh->register_option ('radius', 'listattrib', $meta{'attribute'});
=======

    # radius-listattrib
    $eh->register_action ('radius', 'listattrib', 'List attributes for a RADIUS user');
    $eh->register_option ('radius', 'listattrib', $meta{'username'}, 1);
    $eh->register_option ('radius', 'listattrib', $meta{'realm'});
    $eh->register_option ('radius', 'listattrib', $meta{'type'}, 1);
<<<<<<< Radius.pm
>>>>>>> 1.8
=======

    # radius-allowedattribs
    $eh->register_action ('radius', 'allowedattribs', 'List allowed attributes for RADIUS');
    $eh->register_task ('radius', 'allowedattribs', \&radius_allowedattribs);
>>>>>>> 1.10
}

sub meta { return %meta; } sub c_sec { return $c_sec; }

sub radius_allowedattribs { my ($cfg, $opts, $action, $eh) = @_;

    my @attribs = ();

    my $rs = VUser::ResultSet->new();
    $rs->add_meta($meta{'attribute'});
    $rs->add_meta($meta{'type'});

    # Name[:check|reply] (defaults to 'reply')
    my $values = strip_ws($cfg->{c_sec()}{'allowed attributes'});

    if (defined $values) {
        my @attrib_pairs = split (/ /, $values);
        foreach my $attrib_pair (@attrib_pairs) {
            my ($attrib, $type) = split (':', $attrib_pair);
            if (not defined ($type)
                or ($type ne 'reply' and $type ne 'check')) {
                $type = 'reply';
            }
            $rs->add_data([$attrib, $type]); 
        }
    }
    return $rs;
}

1;

__END__

NAME

Top

VUser::Radius - vuser extension to manage RADIUS users

DESCRIPTION

Top

VUser::Radius is an extension to vuser that allows one to manage RADIUS users. VUser::Radius is not meant to be used by itself but, instead, registers the basic keywords, actions and options that other VUser::Radius::* extensions will use. Other options may be added by RADIUS server specific extensions.

CONFIGURATION

Top

 [Extension Radius]
 # List of allowed RADIUS attributes. The attributes are seperated by whitespace.
 # Each attribute may, optionally, be follwed by a ':' and the words 'reply' or 'check'
 # to identify the attribute type. 'reply' is assumed if no type (or an unknown type)
 # is specified.
 #
 # Note: This is list is not currently used by radius|addattrib and friends to test
 # if the passed attribute is allowed. 
 allowed attributes = Framed-IP-Address Framed-Netmask Simultaneous-Use:check

Any Radius::* extensions will automatically load Radius. There is no need to add Radius to vuser|extensions. Other VUser::Radius::* extensions may have their own configuration.

META SHORTCUTS

Top

VUser::Radius provides a few VUser::Meta objects that may be used by other radius extensions. The safest way to access them is to call VUser::Radius::meta() from within the extension's init() function.

Provided keys: username, password, realm, attribute, type, value

AUTHOR

Top

Randy Smith <perlstalker@vuser.org>

LICENSE

Top

 This file is part of VUser-Radius.

 VUser-Radius 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; either version 2 of the License, or
 (at your option) any later version.

 VUser-Radius 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 vuser; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA


VUser-Radius documentation  | view source Contained in the VUser-Radius distribution.