[pve-devel] r6249 - in pve-access-control/trunk: . PVE PVE/API2

svn-commits at proxmox.com svn-commits at proxmox.com
Thu Jul 7 06:33:09 CEST 2011


Author: dietmar
Date: 2011-07-07 06:33:09 +0200 (Thu, 07 Jul 2011)
New Revision: 6249

Modified:
   pve-access-control/trunk/PVE/API2/User.pm
   pve-access-control/trunk/PVE/AccessControl.pm
   pve-access-control/trunk/README
Log:
s/enabled/enable/


Modified: pve-access-control/trunk/PVE/API2/User.pm
===================================================================
--- pve-access-control/trunk/PVE/API2/User.pm	2011-07-07 04:20:32 UTC (rev 6248)
+++ pve-access-control/trunk/PVE/API2/User.pm	2011-07-07 04:33:09 UTC (rev 6249)
@@ -20,7 +20,7 @@
 
     my $res = {};
 
-    foreach my $prop (qw(enabled expire firstname lastname email comment)) {
+    foreach my $prop (qw(enable expire firstname lastname email comment)) {
 	$res->{$prop} = $data->{$prop} if defined($data->{$prop});
     }
 
@@ -115,8 +115,8 @@
 		PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password})
 		    if $param->{password};
 
-		my $enabled = defined($param->{enable}) ? $param->{enable} : 1;
-		$usercfg->{users}->{$username} = { enabled => $enabled };
+		my $enable = defined($param->{enable}) ? $param->{enable} : 1;
+		$usercfg->{users}->{$username} = { enable => $enable };
 		$usercfg->{users}->{$username}->{expire} = $param->{expire} if $param->{expire};
 
 		if ($param->{groups}) {
@@ -154,7 +154,7 @@
     returns => {
    	additionalProperties => 0,
 	properties => {
-	    enabled => { type => 'boolean' },
+	    enable => { type => 'boolean' },
 	    expire => { type => 'integer' },
 	    firstname => { type => 'string', optional => 1 },
 	    lastname => { type => 'string', optional => 1 },
@@ -230,7 +230,7 @@
 		PVE::AccessControl::domain_set_password($realm, $ruid, $param->{password})
 		    if $param->{password};
 
-		$usercfg->{users}->{$username}->{enabled} = $param->{enable} if defined($param->{enable});
+		$usercfg->{users}->{$username}->{enable} = $param->{enable} if defined($param->{enable});
 
 		$usercfg->{users}->{$username}->{expire} = $param->{expire} if defined($param->{expire});
 

Modified: pve-access-control/trunk/PVE/AccessControl.pm
===================================================================
--- pve-access-control/trunk/PVE/AccessControl.pm	2011-07-07 04:20:32 UTC (rev 6248)
+++ pve-access-control/trunk/PVE/AccessControl.pm	2011-07-07 04:33:09 UTC (rev 6249)
@@ -337,7 +337,7 @@
     return undef if !$username;
  
     return 1 if $usercfg && $usercfg->{users}->{$username} &&
-	$usercfg->{users}->{$username}->{enabled};
+	$usercfg->{users}->{$username}->{enable};
 
     return 1 if $username eq 'root at pam'; # root is always enabled
 
@@ -718,7 +718,7 @@
     # fixme: remove 'root' group (not required)?
 
     # add root user 
-    $cfg->{users}->{'root at pam'}->{enabled} = 1;
+    $cfg->{users}->{'root at pam'}->{enable} = 1;
 }
 
 sub parse_user_config {
@@ -745,7 +745,7 @@
 	my $et = shift @data;
 
 	if ($et eq 'user') {
-	    my ($user, $enabled, $expire, $firstname, $lastname, $email, $comment) = @data;
+	    my ($user, $enable, $expire, $firstname, $lastname, $email, $comment) = @data;
 
 	    my (undef, undef, $realm) = verify_username($user, 1);
 	    if (!$realm) {
@@ -753,7 +753,7 @@
 		next;
 	    }
 
-	    $enabled = $enabled ? 1 : 0;
+	    $enable = $enable ? 1 : 0;
 
 	    $expire = 0 if !$expire;
 
@@ -769,7 +769,7 @@
 	    #}
 
 	    $cfg->{users}->{$user} = {
-		enabled => $enabled,
+		enable => $enable,
 		# group => $group,
 	    };
 	    $cfg->{users}->{$user}->{firstname} = decode_text($firstname) if $firstname;
@@ -1071,8 +1071,8 @@
 	my $email = $d->{email} || '';
 	my $comment = $d->{comment} ? encode_text($d->{comment}) : '';
 	my $expire = int($d->{expire}) || 0;
-	my $enabled = $d->{enabled} ? 1 : 0;
-	$data .= "user:$user:$enabled:$expire:$firstname:$lastname:$email:$comment:\n";
+	my $enable = $d->{enable} ? 1 : 0;
+	$data .= "user:$user:$enable:$expire:$firstname:$lastname:$email:$comment:\n";
     }
 
     $data .= "\n";

Modified: pve-access-control/trunk/README
===================================================================
--- pve-access-control/trunk/README	2011-07-07 04:20:32 UTC (rev 6248)
+++ pve-access-control/trunk/README	2011-07-07 04:33:09 UTC (rev 6249)
@@ -48,7 +48,7 @@
 users:
 
 	login_name: email address (user at domain)
-	enabled: 1 = TRUE, 0 = FALSE
+	enable: 1 = TRUE, 0 = FALSE
 	expire: <integer> (account expiration date)
 	domid: reference to authentication domain
 	firstname: user first name



More information about the pve-devel mailing list