kamctl: added show command to display user attributes in subscriber table
authorDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 14 Jun 2013 06:42:37 +0000 (08:42 +0200)
committerDaniel-Constantin Mierla <miconda@gmail.com>
Fri, 14 Jun 2013 06:42:37 +0000 (08:42 +0200)
utils/kamctl/kamctl
utils/kamctl/kamctl.base

index 01c99c9..42d031e 100755 (executable)
@@ -2151,6 +2151,28 @@ subscriber() {
                        fi
                        ;;
 
+               show)
+                       if [ $# -ne 2 ] ; then
+                               usage_subscriber
+                               exit 1
+                       fi
+                       shift
+
+                       set_user $1
+
+                       case $DBENGINE in
+                               MYSQL|mysql|MySQL)
+                                       QUERY="SELECT * FROM $SUB_TABLE \
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN'\G"
+                               ;;
+                               *)
+                                       QUERY="SELECT * FROM $SUB_TABLE \
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN';"
+                               ;;
+                       esac
+                       $DBROCMD "$QUERY"
+                       ;;
+
                passwd)
                        if [ $# -ne 3 ] ; then
                                usage_subscriber
@@ -2516,6 +2538,10 @@ case $1 in
                subscriber "$@"
                ;;
 
+       show)
+               subscriber "$@"
+               ;;
+
        passwd)
                subscriber "$@"
                ;;
index 589e0a0..034ac51 100644 (file)
@@ -422,6 +422,7 @@ usage_subscriber() {
        echo
 cat <<EOF
  add <username> <password> .......... add a new subscriber (*)
+ show <username> .................... show subscriber attributes (*)
  passwd <username> <passwd> ......... change user's password (*)
  rm <username> ...................... delete a user (*)
 EOF