$kernel->post( $src, $replypath, "You may not grant access exceeding your own.", $dest );
return;
}
- if( exists( $heap->{ 'privs' }->{ uc( $whom ) } ) ) {
+ if( exists( $heap->{ 'users' }->{ uc( $whom ) } ) ) {
$heap->{ 'useraccess' }->{ uc( $whom ) } = "~".$target;
DumpFile( "useraccess.yaml", $heap->{ 'useraccess' } );
$kernel->post( $src, $replypath, "Set.", $dest );
$kernel->post( $src, $replypath, "You may not grant access exceeding your own.", $dest );
return;
}
- if( exists( $heap->{ 'privs' }->{ uc( $whom ) } ) ) {
+ if( exists( $heap->{ 'users' }->{ uc( $whom ) } ) ) {
$heap->{ 'useraccess' }->{ uc( $whom ) } = $level;
DumpFile( "useraccess.yaml", $heap->{ 'useraccess' } );
$kernel->post( $src, $replypath, "Set.", $dest );
( $whom, $password ) = ( $who, $what );
}
- if( exists( $heap->{ 'privs' }->{ uc( $whom ) } ) ) {
- if( $heap->{ 'privs' }->{ uc( $whom ) } eq md5_hex( $password ) ) {
+ if( exists( $heap->{ 'users' }->{ uc( $whom ) } ) ) {
+ if( $heap->{ 'users' }->{ uc( $whom ) } eq md5_hex( $password ) ) {
$heap->{ 'identified' }->{ $src.uc( $who ) } = 1;
$kernel->post( $src, $replypath, "Hello, $who.", $dest );
} else {
print( STDERR "register( $whom, $password ) == $nargs\n" );
if( $password ) {
- $heap->{ 'privs' }->{ uc( $whom ) } = md5_hex( $password );
- DumpFile( "privs.yaml", $heap->{ 'privs' } );
+ $heap->{ 'users' }->{ uc( $whom ) } = md5_hex( $password );
+ DumpFile( "users.yaml", $heap->{ 'users' } );
$kernel->post( $src, $replypath, "Done.", $dest );
} else {
$kernel->post( $src, $replypath, "Bad password.", $dest );
use Digest::MD5 qw( md5_hex );
my( $kernel, $heap, $who, $what, $src, $dest, $replypath ) = @_;
my( $old, $new ) = split( / /, $what, 2 );
- if( exists( $heap->{ 'privs' }->{ uc( $who ) } ) ) {
- if( $heap->{ 'privs' }->{ uc( $who ) } eq md5_hex( $old ) ) {
- $heap->{ 'privs' }->{ uc( $who ) } = md5_hex( $new );
- DumpFile( "privs.yaml", $heap->{ 'privs' } );
+ if( exists( $heap->{ 'users' }->{ uc( $who ) } ) ) {
+ if( $heap->{ 'users' }->{ uc( $who ) } eq md5_hex( $old ) ) {
+ $heap->{ 'users' }->{ uc( $who ) } = md5_hex( $new );
+ DumpFile( "users.yaml", $heap->{ 'users' } );
$kernel->post( $src, $replypath, "Passwords changed.", $dest );
} else {
$kernel->post( $src, $replypath, "Old passwords do not match.", $dest );