/**
  * Returns an instance of the authentication controller
  *
  * @param string $type this is the type of authetnication you want to use default is SugarAuthenticate
  * @return an instance of the authetnciation controller
  */
 public static function getInstance($type = 'SugarAuthenticate')
 {
     if (empty(self::$authcontrollerinstance)) {
         self::$authcontrollerinstance = new AuthenticationController($type);
     }
     return self::$authcontrollerinstance;
 }
 /**
  * Set currect instance (for testing)
  * @param AuthenticationController $instance
  */
 public static function setInstance($instance)
 {
     self::$authcontrollerinstance = $instance;
 }