]> git.proxmox.com Git - pmg-api.git/commitdiff
PMG/UserConfig.pm: use better property names
authorDietmar Maurer <dietmar@proxmox.com>
Mon, 27 Mar 2017 07:32:04 +0000 (09:32 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Mon, 27 Mar 2017 07:32:04 +0000 (09:32 +0200)
PMG/UserConfig.pm

index 8835ee9bd70a26791d4d53cd89d98e21a8299a45..0038bce1ae6baba734706cf12382ea8c7aef6a9c 100644 (file)
@@ -76,13 +76,13 @@ our $schema = {
            type => 'string',
            enum => ['root', 'admin', 'qmanager', 'quser', 'audit'],
        },
-       first => {
+       firstname => {
            description => "First name.",
            type => 'string',
            maxLength => 64,
            optional => 1,
        },
-       'last' => {
+       lastname => {
            description => "Last name.",
            type => 'string',
            maxLength => 64,
@@ -144,8 +144,8 @@ sub read_user_conf {
                (?<crypt_pass>(?:[^\s:]*)) :
                (?<role>[a-z]+) :
                (?<email>(?:[^\s:]*)) :
-               (?<first>(?:[^:]*)) :
-               (?<last>(?:[^:]*)) :
+               (?<firstname>(?:[^:]*)) :
+               (?<lastname>(?:[^:]*)) :
                (?<keys>(?:[^:]*)) :
                $/x
            ) {
@@ -157,7 +157,7 @@ sub read_user_conf {
                };
                $d->{comment} = $comment if $comment;
                $comment = '';
-               foreach my $k (qw(crypt_pass email first last keys)) {
+               foreach my $k (qw(crypt_pass email firstname lastname keys)) {
                    $d->{$k} = $+{$k} if $+{$k};
                }
                eval {
@@ -206,7 +206,7 @@ sub write_user_conf {
 
        my $line = "$+{username}:";
 
-       for my $k (qw(enable expire crypt_pass role email first last keys)) {
+       for my $k (qw(enable expire crypt_pass role email firstname lastname keys)) {
            $line .= ($d->{$k} // '') . ':';
        }
        if (my $comment = $d->{comment}) {