public ActionResult Link(string token)
        {
            if (token == null)
            {
                return(RedirectToAction("/pages/login"));
            }
            var            mgr       = new AdminMembersRepository();
            bool           isValid   = mgr.CheckTokenValidity(token);
            AddMemberToken fulltoken = mgr.GetToken(token);

            if (!isValid)
            {
                return(RedirectToAction("invalidToken"));
            }
            if (fulltoken.UserId != null)
            {
                mgr.SetupMemberRel(token, null, int.Parse(User.Identity.Name));
                return(RedirectToAction("success"));
            }
            else
            {
                //MemberViewModel vm = new MemberViewModel();
                //vm.Token = fulltoken;
                return(View(fulltoken));
            }
        }
        public ActionResult SignUp(string name, string email, string password, string cpassword, string phone, string token, int permission)
        {
            var  mgr  = new UserAuthRepository();
            var  mgr2 = new AdminMembersRepository();
            User u    = mgr.AddUser(name, password, phone, email);

            mgr2.SetupMemberRel(token, u.Id, int.Parse(User.Identity.Name));
            return(RedirectToAction("Login", "Pages"));
        }