+sub usrlist {
+ my $reqstr = '<?XML version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="usrlist"></REQ></RMCSEQ>';
+ my $res = _req($reqstr);
+ my @users = ();
+
+ if ($res->{RESP}->{RC} ne '0x0') {
+ print "FAILED:".$res->{RESP}->{RC}."\n";
+ ();
+ } else {
+ if (ref($res->{RESP}->{USRLIST}->{USER}) eq 'ARRAY') {
+ foreach my $usr (@{$res->{RESP}->{USRLIST}->{USER}}) {
+ push @users, $usr->{NAME};
+ }
+ } else {
+ push @users, $res->{RESP}->{USRLIST}->{USER}->{NAME};
+ }
+ }
+ @users;
+}
+
+sub getusrprops {
+ my $usr = shift;
+
+ my $reqstr = '<?XML version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="usrpropget"><USER NAME="'.$usr.'"></USER></REQ></RMCSEQ>';
+ my $res = _req($reqstr)->{RESP}->{USER}->{PROP};
+
+ $res;
+}
+
+sub usradd {
+ my $usr = shift;
+
+ my $reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="usradd"><USER NAME="michael"/></REQ></RMCSEQ>';
+ my $res = _req($reqstr);
+ if ($res->{RESP}->{RC} ne '0x0') {
+ print "FAILED:".$res->{RESP}->{RC}."\n";
+ }
+}
+
+sub setusrprop {
+ my $usr = shift;
+ my $property = shift;
+ my $value = shift;
+
+ my $reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="usrpropget"><USER NAME="'.$usr.'"><PROP NAME="'.$property.'"></PROP></USER></REQ></RMCSEQ>';
+ my $res = _req($reqstr);
+
+ my $oldval = ${res}->{RESP}->{USER}->{PROP}->{VAL};
+
+ if ($value eq $oldval) {
+ print "${property} is already ${value}\n" if ($verbose);
+ return;
+ }
+
+ $reqstr='<?xml version="1.0"?><?RMCXML version="1.0"?><RMCSEQ><REQ CMD="usrpropset"><USER NAME="'.$usr.'"><PROP NAME="'.$property.'"><VAL>'.$value.'</VAL></PROP></USER></REQ></RMCSEQ>';
+ $res = _req($reqstr);
+
+ if ($res->{RESP}->{RC} ne '0x0') {
+ print "Error setting ${property} to ${value}: ".$res->{RESP}->{RC}."\n";
+ undef;
+ } else {
+ print "${property}: ${oldval} -> ${value}\n" if ($verbose);
+ $oldval;
+ }
+}
+