i'm not sure what the goal is here, but it seems convoluted. if the goal is simply to run ldapsearch and print the output:
#!/bin/bash
function verify_user(){
user=$(whoami)
base_dn='dc=ifce,dc=edu,dc=br'
ldapsearch -xWD "uid=${user},ou=people,${base_dn}" -b "${base_dn}" "(uid=${user})"
}
verify_user
exit 0