AFS

 view release on metacpan or  search on metacpan

pod/v2/afsperlpts.pod  view on Meta::CPAN

      printf("%20s =>  %s\n", $key, $$entry{$key});
  }
  $ok = $pts->delete('guest');
  undef $pts;   # destroy server connection

  $pts   = AFS::PTS->new;
  $entry = $pts->dumpentry(67136, 1, 1);
  foreach my $key ( sort keys %$entry) {
      printf("%20s =>  %s\n", $key, $$entry{$key});
  }

  my $over  = 1;
  my @names = $pts->getcps('nog', 1, $over);
  print "OVER = $over \n";
  print "cps for NOG\n";
  foreach my $mem (sort @names) {
      print "  $mem\n";
  }

  AFS::PTS->convert_numeric_names(1);
  my @ids = (28053, 1, 105, 32000, 32766);
  @names  = $pts->PR_IDToName(\@ids);
  foreach my $name (@names) {
      print "name = $name\n";
  }

  print "Convert(nog): ", $pts->id('nog'), "\n";

=head1 DESCRIPTION

This class is used to communicate with the B<AFS Protection Server> in
order to maintain and to administer the Protection Database maintained
by the Protection Server.  The Protection Database stores information
about AFS users, client machines, and groups which the File Server
process uses to determine whether clients are authorized to access AFS
data.

This class provides methods to map back and forth between user account
names and their internal numerical AFS identifiers. It also manages
the creation, manipulation, and update of user-defined groups suitable
for use on ACLs.  It has methods to query the information held for any
given AFS user or group and to create, modify, and delete the records
in the PDB where the above information is held.

Before you can access any PDB records you must establish a connection
to the Protection Server.  This is done by the constructor method
C<new> which returns a PTS object.  A PTS object is essentially a
handle to talk to the Protection Server in a given cell.  Such a PTS
object is required before any of the other PTS instance methods can be
called.

All PR_* methods are essentially the same as the low-level AFS PTS
APIs and are considered as I<low-level> methods.  The other methods
(considered as high-level) are more I<user friendly> and perl-like.
Whereas the low-level (PR_*) methods only accept numerical values for
names or groups the high-level methods accept either numeric IDs or
names.

=head1 COMPATIBILITY

B<This release does NOT support any features and interfaces
from version 1.>

=head1 METHODS

=over 4

=item B<CONSTRUCTOR>

=item S< >

=item B<$pts = AFS::PTS-E<gt>new(([SEC [, CELL]]);>

Creates a new object of the class AFS::PTS.  An AFS::PTS object is
essentially a handle to talk to the Protection Server in a given
CELL.  Internally an AFS::PTS object is a pointer to a ubik_client
structure, although this may change and the value returned from
AFS::PTS::new should always be treaded as an opaque handle.

CELL defaults to NULL.  The security level SEC (default 1) is a number
from 0 to 2:

   0    un-authenticated connection should be made
   1    try authenticated first, fall back to un-authenticated
   2    fail if an authenticated connection can't be made

=item B<DESTRUCTOR>

=item S< >

=item B<$pts-E<gt>DESTROY;>

Destroys the ubik connection to the Protection Server and frees the ubik
connection structure.

=item B<CLASS METHODS>

=item S< >

=item B<$bits = AFS::PTS-E<gt>ascii2ptsaccess(FLAGS);>

Converts the privacy flags FLAGS (a string of five characters) into
its corresponding five privacy bits. The privacy flags indicate who
can display or administer certain aspects of a PTS entry.

=item B<$flags = AFS::PTS-E<gt>ptsaccess2ascii(BITS);>

Converts the five PTS privacy bits BITS into its corresponding privacy
flags (a string of five characters).  The privacy flags indicate who
can display or administer certain aspects of a PTS entry.

=item B<$value = AFS::PTS-E<gt>convert_numeric_names;>

=item B<AFS::PTS-E<gt>convert_numeric_names(NEWVAL);>

Gets or sets the global flag for converting names into numeric AFS ids.
If conversion is 'on' (default) all names NOT looking like a numeric
value are converted into its AFS id. If you set NEWVAL to 0 (conversion
is 'off'), B<NO> conversion is done.  You'll probably want to leave
conversion 'on' unless you create PTS names that look exactly like
numbers. (not a good idea to begin with :-)

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.466 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )