#!/bin/bash
#
# Usage: isRemoteUser <username>
#
# returns:
#	0 = local authentication
# 	1 = kerberos authentication
#	2 = ldap authentication
#	3 = kerberos authentication w/ LDAP user data. This also means that
#           the user account is created automatically.
#	>2 = error
#

if [ -z ${1} ];then
	exit 255
fi

# check for user's kerberos .k5login file
if [ -e /home/${1}/.auto_created ];then
        exit 3
elif [ -e /home/${1}/.k5login ];then
	exit 1
elif [ -e /home/${1}/.hmcldapauth ];then
	exit 2
else
	exit 0
fi
