Browse code

kamctl: added show command to display user attributes in subscriber table

Daniel-Constantin Mierla authored on 14/06/2013 06:42:37
Showing 2 changed files
... ...
@@ -2151,6 +2151,28 @@ subscriber() {
2151 2151
 			fi
2152 2152
 			;;
2153 2153
 
2154
+		show)
2155
+			if [ $# -ne 2 ] ; then
2156
+				usage_subscriber
2157
+				exit 1
2158
+			fi
2159
+			shift
2160
+
2161
+			set_user $1
2162
+
2163
+			case $DBENGINE in
2164
+				MYSQL|mysql|MySQL)
2165
+					QUERY="SELECT * FROM $SUB_TABLE \
2166
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN'\G"
2167
+				;;
2168
+				*)
2169
+					QUERY="SELECT * FROM $SUB_TABLE \
2170
+WHERE $SUBSCRIBER_COLUMN='$OSERUSER' AND $REALM_COLUMN='$OSERDOMAIN';"
2171
+				;;
2172
+			esac
2173
+			$DBROCMD "$QUERY"
2174
+			;;
2175
+
2154 2176
 		passwd)
2155 2177
 			if [ $# -ne 3 ] ; then
2156 2178
 				usage_subscriber
... ...
@@ -2516,6 +2538,10 @@ case $1 in
2516 2538
 		subscriber "$@"
2517 2539
 		;;
2518 2540
 
2541
+	show)
2542
+		subscriber "$@"
2543
+		;;
2544
+
2519 2545
 	passwd)
2520 2546
 		subscriber "$@"
2521 2547
 		;;
... ...
@@ -422,6 +422,7 @@ usage_subscriber() {
422 422
 	echo
423 423
 cat <<EOF
424 424
  add <username> <password> .......... add a new subscriber (*)
425
+ show <username> .................... show subscriber attributes (*)
425 426
  passwd <username> <passwd> ......... change user's password (*)
426 427
  rm <username> ...................... delete a user (*)
427 428
 EOF