synapse/cmd.sh
changeset 10 aaa61e5b4526
parent 9 c636ea2e8ee1
equal deleted inserted replaced
9:c636ea2e8ee1 10:aaa61e5b4526
    74 if [ "$MODE" = "user" ]; then
    74 if [ "$MODE" = "user" ]; then
    75 	egy_arg 'user'
    75 	egy_arg 'user'
    76 
    76 
    77 	echo "=== User data ==="
    77 	echo "=== User data ==="
    78 	$CMD "SELECT display_name FROM user_directory WHERE user_id='$ARG'"
    78 	$CMD "SELECT display_name FROM user_directory WHERE user_id='$ARG'"
       
    79 	$CMD "SELECT name,password_hash,to_timestamp(creation_ts) AS creation,admin,is_guest,deactivated,shadow_banned FROM users WHERE name='$ARG'"
    79 	$CMD "SELECT medium, address, unts(validated_at) AS validated_at, unts(added_at) AS added_at FROM user_threepids WHERE user_id='$ARG'"
    80 	$CMD "SELECT medium, address, unts(validated_at) AS validated_at, unts(added_at) AS added_at FROM user_threepids WHERE user_id='$ARG'"
    80 	$CMD "SELECT joined_rooms FROM user_stats_current WHERE user_id='$ARG'"
    81 	$CMD "SELECT joined_rooms FROM user_stats_current WHERE user_id='$ARG'"
    81 	
    82 	
    82  	echo "=== Logins ==="
    83  	echo "=== Logins ==="
    83  	$CMD "SELECT user_id,device_id,ip,unts(last_seen) AS last_seen,user_agent FROM user_ips WHERE user_id='$ARG'"
    84  	$CMD "SELECT user_id,device_id,ip,unts(last_seen) AS last_seen,user_agent FROM user_ips WHERE user_id='$ARG' ORDER BY last_seen DESC"
    84  	$CMD "SELECT device_id, user_agent, unts(timestamp) FROM user_daily_visits WHERE user_id='$ARG' ORDER BY 1 ASC, 3 DESC LIMIT 10"
    85  	$CMD "SELECT device_id, user_agent, unts(timestamp) AS stamp FROM user_daily_visits WHERE user_id='$ARG' ORDER BY 1 ASC, 3 DESC LIMIT 10"
    85  	
    86  	
    86  	echo "=== Shared private rooms ==="
    87  	echo "=== Shared private rooms ==="
    87  	$CMD "select * from users_who_share_private_rooms where user_id='$ARG'"
    88  	$CMD "select * from users_who_share_private_rooms where user_id='$ARG' ORDER BY room_id,other_user_id"
    88  	
    89  	
    89  	echo "=== Rooms the user has been ==="
    90  	echo "=== Rooms the user has been ==="
    90  	$CMD "SELECT rm.room_id, rm.event_id, rm.sender, rm.membership, 
    91  	$CMD "SELECT rm.room_id, rm.event_id, rm.sender, rm.membership, 
    91        rss.canonical_alias, rss.join_rules, rss.encryption, 
    92        rss.canonical_alias, rss.join_rules, rss.encryption, 
    92        unts(e.origin_server_ts), rss.name
    93        unts(e.origin_server_ts), rss.name
    93  FROM room_memberships  rm
    94  FROM room_memberships  rm
    94  JOIN room_stats_state rss USING(room_id) 
    95  JOIN room_stats_state rss USING(room_id) 
    95  JOIN events e USING(event_id)
    96  JOIN events e USING(event_id)
    96  WHERE user_id='$ARG'
    97  WHERE user_id='$ARG'
    97  ORDER BY e.origin_server_ts" | more
    98  ORDER BY e.origin_server_ts DESC" | more
    98 	
    99 	
    99  	exit
   100  	exit
   100 fi
   101 fi
   101 
   102 
   102 
   103