Beispiel #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse DoSetupDatabase(IApiRequest pApiReq)
        {
            Func <object> getResp = (() => {
                var op = new InternalInitDbOperation();
                op.Perform(pApiReq.OpCtx, pApiReq.GetQueryValue("pass", false));
                return(op.GetResult());
            });

            var exec = new JsonExecutor <object>(pApiReq, getResp);

            return(exec.Execute());
        }
Beispiel #2
0
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse ExecuteAcc(IApiRequest pApiReq, string pGrantType, string pClientId,
                                               string pSecret, string pCode, string pRefresh, string pRedirUri)
        {
            Func <FabOauthAccess> getResp = (() => {
                var op = new OauthAccessOperation();
                return(op.Execute(pApiReq.OpCtx, new OauthAccessTasks(), pGrantType,
                                  pClientId, pSecret, pCode, pRefresh, pRedirUri));
            });

            var exec = new JsonExecutor <FabOauthAccess>(pApiReq, getResp);

            exec.OnException = OnAccessExecption;
            return(exec.Execute());
        }
Beispiel #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse GetLogout(IApiRequest pApiReq)
        {
            Func <FabOauthLogout> getResp = (() => {
                string token = pApiReq.GetQueryValue(LogoutAccessTokenParam, false);

                var op = new OauthLogoutOperation();
                return(op.Execute(pApiReq.OpCtx, new OauthLogoutTasks(), token));
            });

            var          exec = new JsonExecutor <FabOauthLogout>(pApiReq, getResp);
            IApiResponse resp = exec.Execute();

            resp.SetUserCookie(null, false);
            return(resp);
        }
Beispiel #4
0
        /*--------------------------------------------------------------------------------------------*/
        private static IApiResponse DoRemoveMember(IApiRequest pApiReq)
        {
            Func <object> getResp = (() => {
                var op = new InternalRemoveMemberOperation();
                op.Perform(pApiReq.OpCtx,
                           pApiReq.GetQueryValue("pass", false),
                           pApiReq.GetQueryValue("memId", false),
                           pApiReq.GetQueryValue("delete", false));
                return(op.GetResult());
            });

            var exec = new JsonExecutor <object>(pApiReq, getResp);

            return(exec.Execute());
        }