It may be, that your question is simpler than I'm making it; you might simply be asking how to tell if the user logged in as root or used su to switch to them in which case, a combination of the answers I've given would be appropriate.
Normally, a login shell is differentiated from a non-login-shell by whether various scripts got run. The reason many users start a non-login-shell is because it is a subshell of some program, or (as you note) because they use su to switch users. Those users will have $LOGNAME not equal to $USER
Unless, of course, they switch back. To detect those users, consider the following perl script:
open(P,"ps -ef|");while(<P>){m#^(\S+)\s+(\d+)\s+(\d+)#;$u{$2}=$1;$t{$2}=$3;}
$p=$$;while($t{$p}){$g{$u{$p}}=1;$p=$t{$p};}delete$g{root};$g{$u{$$}}=1;
print keys(%g),"\n";
If you want to restrict it to using su - you can use:
open(P,"ps -ef|");while(<P>){m#^(\S+)\s+(\d+)\s+(\d+).*su - #;$u{$2}=$1;$t{$2}=$3;}
$p=$$;while($t{$p}){$g{$u{$p}}=1;$p=$t{$p};}delete$g{root};$g{$u{$$}}=1;
print keys(%g),"\n";
If you want to really see login shells, note that login shells are started with argv[0] set with a leading dash, so you can use:
open(P,"ps -eo user,pid,ppid,comm|");while(<P>){m#^(\S+)\s+(\d+)\s+(\d+) -#;
$u{$2}=$1;$t{$2}=$3;}
$p=$$;while($t{$p}){$g{$u{$p}}=1;$p=$t{$p};}delete$g{root};$g{$u{$$}}=1;
print keys(%g),"\n";
but you'll miss out on the situation where someone ran ksh --login.