Ejemplo n.º 1
0
 public NotificationPanelViewComponent(RokonocontrolContext context, IConfiguration config, IAutherizationManager autherizationManager, IHttpContextAccessor httpContextAccessor)
 {
     Context              = context;
     Configuration        = config;
     AutherizationManager = (AutherizationManager)autherizationManager;
     UserId = AutherizationManager.GetCurrentUser(UserId, httpContextAccessor.HttpContext.Request);
 }
Ejemplo n.º 2
0
 public MessageHub(RokonocontrolContext dbContext, IConfiguration config, IAutherizationManager autherizationManager, IHttpContextAccessor httpContextAccessor)
 {
     DatabaseContext      = dbContext;
     Configuration        = config;
     AutherizationManager = (AutherizationManager)autherizationManager;
     UserId = AutherizationManager.GetCurrentUser(UserId, httpContextAccessor.HttpContext.Request);
 }
 public ChangelogController(RokonocontrolContext context, IConfiguration currentConfig, IAutherizationManager autherizationManager, IHttpContextAccessor httpContextAccessor)
 {
     Context = context;
     Config  = currentConfig;
     AutherizationManager = (AutherizationManager)autherizationManager;
     UserId = AutherizationManager.GetCurrentUser(UserId, httpContextAccessor.HttpContext.Request);
 }
 public BlogController(RokonocontrolContext context, IConfiguration config, IAutherizationManager autherizationManager, IHttpContextAccessor httpContextAccessor, IHubContext <MessageHub> hubContext)
 {
     Context              = context;
     Configuration        = config;
     AutherizationManager = (AutherizationManager)autherizationManager;
     UserId         = AutherizationManager.GetCurrentUser(UserId, httpContextAccessor.HttpContext.Request);
     MessageContext = hubContext;
 }
Ejemplo n.º 5
0
        public DashboardController(RokonocontrolContext context, IConfiguration config, IAutherizationManager autherizationManager, IHttpContextAccessor httpContextAccessor)
        {
            Context              = context;
            Configuration        = config;
            AutherizationManager = (AutherizationManager)autherizationManager;
            var user = this.User;

            UserId = AutherizationManager.GetCurrentUser(UserId, httpContextAccessor.HttpContext.Request);
        }
 public IActionResult GetUserProfile(int projectId)
 {
     ViewData["ProjectId"] = projectId;
     using (var context = new UsersContext(Context, Configuration))
     {
         ViewData["UserData"]   = context.GetUserAccount(UserId);
         ViewData["UserRights"] = AutherizationManager.ValidateUserRights(projectId, UserId, context);
     }
     return(View());
 }
        public IActionResult Index(string data)
        {
            using (var context = new DatabaseController(Context, Configuration))
            {
                var projectId = context.GetProjectByOrganization(data);
                ViewData["ProjectId"] = projectId;
                AutherizationManager.SignOut(HttpContext);

                if (projectId == 0)
                {
                    return(View("Error"));
                }
            }

            var buildData = System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString();

            ViewData["OrganizationName"] = data;
            ViewData["BuildVersion"]     = buildData;

            return(View());
        }
Ejemplo n.º 8
0
        public List <OutgoingIterationModel> GetPersons([FromBody] IncomingIterationRequest request)
        {
            var result = new List <OutgoingIterationModel>();

            using (var context = new UsersContext(Context, Configuration))
            {
                var dataResult = new List <UserAccounts>();

                var userRights = AutherizationManager.ValidateUserRights(request.ProjectId, UserId, context);
                if (userRights != null)
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "All",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person=0"
                    });
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = "@Mine",
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={userRights.Id}"
                    });
                    dataResult = context.GetProjectPersons(request.ProjectId);
                }
                dataResult.ForEach(x =>
                {
                    result.Add(new OutgoingIterationModel
                    {
                        Text    = x.GitUsername,
                        IconCss = "e-ddb-icons e-settings",
                        Url     = $"/Boards/Sprints?projectId={request.ProjectId}&&workItemType=7&&iteration={request.Iteration}&&person={x.Id}"
                    });
                });
            }
            return(result);
        }