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