From e2a6e738be073573bfd056f05cb3b1c5581a0d56 Mon Sep 17 00:00:00 2001 From: pdbogen Date: Wed, 29 Aug 2007 21:37:59 +0000 Subject: [PATCH] Change "privs" to "users" git-svn-id: https://www.cernu.us/~pdbogen/svn/destult2@7 088b83a4-0077-4247-935c-42ec02c2848b --- commands.yaml | 20 ++++++++++---------- core.pl | 6 +++--- privs.yaml.example => users.yaml.example | 0 3 files changed, 13 insertions(+), 13 deletions(-) rename privs.yaml.example => users.yaml.example (100%) diff --git a/commands.yaml b/commands.yaml index 0364d0c..e68d11b 100644 --- a/commands.yaml +++ b/commands.yaml @@ -18,7 +18,7 @@ LINK: |- $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 ); @@ -39,7 +39,7 @@ ACCESS: |- $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 ); @@ -145,8 +145,8 @@ IDENTIFY: |- ( $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 { @@ -185,8 +185,8 @@ REGISTER: |- 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 ); @@ -198,10 +198,10 @@ PASSWORD: |- 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 ); diff --git a/core.pl b/core.pl index 3c7a254..1ee7795 100644 --- a/core.pl +++ b/core.pl @@ -72,11 +72,11 @@ sub on_start { $heap->{ 'cmdaccess' } = { }; } - if( -e "privs.yaml" ) { - $heap->{ 'privs' } = \%{ LoadFile( "privs.yaml" ) }; + if( -e "users.yaml" ) { + $heap->{ 'users' } = \%{ LoadFile( "users.yaml" ) }; print( "CORE: Users loaded.\n" ); } else { - $heap->{ 'privs' } = { }; + $heap->{ 'users' } = { }; print( "CORE: No users found.\n" ); } diff --git a/privs.yaml.example b/users.yaml.example similarity index 100% rename from privs.yaml.example rename to users.yaml.example -- 2.11.0