Esempio n. 1
0
        public override bool Handle(RouteDispatchInfo dispatchInfo, ref string message)
        {
            if (dispatchInfo.GenericPairs != null)
            {
                string sessionId = (string) dispatchInfo.GenericPairs[CourseProviderContract.KEY_AUTH];
                if (! TextUtils.isEmpty(sessionId) && Session.Has(sessionId))
                {
                    return true;
                }
            }

            message = new GenericView().Error("Please login first!");

            return false;
        }
        public override bool Handle(RouteDispatchInfo dispatchInfo, ref string message)
        {
            string sessionId = dispatchInfo.GenericPairs[CourseProviderContract.KEY_AUTH] as string;

            if (! TextUtils.isEmpty(sessionId))
            {
                var user = Auth.User(sessionId);
                if (user != null && user.Mode == mode)
                {
                    return true;
                }
            }

            message = new GenericView().Error("Access denied!");
            return false;
        }
Esempio n. 3
0
 /// <summary>
 /// Handle a imcoming request in this method
 /// </summary>
 /// <param name="dispatchInfo"></param>
 /// <param name="message"></param>
 /// <returns>return True if the request can be continue to pass-throught or False to 
 /// interrupt the reuqest and display some message.
 /// </returns>
 public abstract bool Handle(RouteDispatchInfo dispatchInfo, ref string message);