Issues changing states

In my scenario I have a player with a box collider and a rigidbody, and a door with another box collider. This door has a script attached to it and what it does is that it checks if the player collided with it. If the player collides with it, I update the door state to Open, and if it detects no further collision then it move sto CLOSED. But the problem is that while it is detecting collision (yay), my player can phase through the door (ugh) and the door state doesn’t change from CLOSED to OPEN like it should (ugh-ugh) thus remains closed. Here is my code:

using UnityEngine;
using System.Collections;

public class DoorManager : MonoBehaviour {
	private enum DoorStateEnum { OPEN, CLOSED }
	private DoorStateEnum CurrentDoorState = DoorStateEnum.CLOSED;
	protected Animator animator;

	void Start()
	{
		animator = GetComponent<Animator>();
	}
	void OnCollisionEnter(Collision col)
	{
        if (col.gameObject.name == "char_ethan_body")
		{
			CurrentDoorState = DoorStateEnum.OPEN;
            Debug.Log("Detected collision between " + gameObject.name + " and " + col.collider.name);
		}
		else
		{
			CurrentDoorState = DoorStateEnum.CLOSED;
            Debug.Log("No collision between " + gameObject.name + " and " + col.collider.name);
		}
	}

	void Update()
	{
		if (animator)
		{
			//get the current state
			AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);

            if (stateInfo.nameHash == Animator.StringToHash("Base Layer.Opened") || stateInfo.nameHash == Animator.StringToHash("Base Layer.Closed"))
			{
				switch(CurrentDoorState)
				{
				    case DoorStateEnum.OPEN:
                        animator.SetInteger("Index", 1);
					    break;
				    case DoorStateEnum.CLOSED:
                        animator.SetInteger("Index", 0);
					    break;
				}
			}
		}
	}
}

So my question is: What do I need to do in order to get my door to change states? Many thanks in advance!

You need to make sure that the Index is the condition of the transitions.
Click the line between the animation states and change the condition to Index and the value to whatever you need.