--- ChivanetModcon/modcon 2025/01/31 13:38:51 1.2 +++ ChivanetModcon/modcon 2025/01/31 15:39:06 1.3 @@ -4,13 +4,16 @@ # ChivaNet Moderator Console # Copyright (C) 2025 Coherent Logic Development LLC # -# $Id: modcon,v 1.2 2025/01/31 13:38:51 snw Exp $ +# $Id: modcon,v 1.3 2025/01/31 15:39:06 snw Exp $ # # Author: Serena Willis # # Licensed AGPL-3.0 # # $Log: modcon,v $ +# Revision 1.3 2025/01/31 15:39:06 snw +# Minor fixes +# # Revision 1.2 2025/01/31 13:38:51 snw # Initial basic functions working # @@ -31,12 +34,10 @@ my $online = 0; my $modcon_version = '0.0.1'; my $cnclient = ''; my $rasclient = ''; - my $wchar = ''; my $hchar = ''; my $wpixels = ''; my $hpixels = ''; - my $account = ''; sub list_sso_users { @@ -83,8 +84,6 @@ sub select_sso_user { $cnclient->GET("/chivanet/validate_user?id=$id"); my $json = $cnclient->responseContent(); my $hashref = decode_json($json); - - #print Dumper($hashref); if($hashref->{exists} == 1) { @@ -97,8 +96,7 @@ sub select_sso_user { else { print ">>> invalid SSO user $id [$hashref->{error}]\n"; return "---"; - } - + } } sub select_ras_user { @@ -127,8 +125,7 @@ sub trace_ras_sn { my $result = $record->{id}; print "RAS screen name $user belongs to SSO account $result; switching to SSO mode\n"; - return $result; - + return $result; } sub list_ras_sessions { @@ -158,8 +155,7 @@ sub list_ras_sessions { } } - print "$sessions->{count} current sessions\n"; - + print "$sessions->{count} current sessions\n"; } sub list_ras_screennames { @@ -171,6 +167,9 @@ sub list_ras_screennames { my $hashref = decode_json($json); my $arrayref = $hashref->{screen_names}; my $ct = 0; + my $total = 0; + + print "\n"; foreach my $sn (@{$arrayref}) { my $name = "$sn->{screen_name}\n"; @@ -196,7 +195,8 @@ sub list_ras_screennames { print "$name: $public $bot; created $sn->{create_ts}\n"; $ct = $ct + 1; - + $total = $total + 1; + if($ct > $hchar - 2) { print "ENTER to continue, Q to quit..."; my $resp = ; @@ -211,6 +211,8 @@ sub list_ras_screennames { } } + print "\nSSO user $id has $total screen names\n\n"; + } sub print_sso_user {