Esempio n. 1
0
        public bool UserLoginExternal(ref User user)
        {
            bool loginsuccess = false;

            try
            {
                SessionManagement sm      = new SessionManagement();
                string            connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;

                SqlConnection dbconnection = new SqlConnection(connstr);

                SqlParameter[] param = new SqlParameter[3];

                dbconnection.Open();

                param[0] = new SqlParameter("@UserName", user.UserName);

                param[1]           = new SqlParameter("@UserID", null);
                param[1].DbType    = DbType.Int32;
                param[1].Direction = ParameterDirection.Output;

                param[2]           = new SqlParameter("@PersonID", null);
                param[2].DbType    = DbType.Int32;
                param[2].Direction = ParameterDirection.Output;


                //For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
                ExecuteSQLDataCommand(GetDBCommand(ref dbconnection, "[User.Account].[AuthenticateExternal]", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param));

                dbconnection.Close();
                try
                {
                    user.UserID = Convert.ToInt32(param[1].Value.ToString());

                    if (param[2].Value != DBNull.Value)
                    {
                        user.PersonID = Convert.ToInt32(param[2].Value.ToString());
                    }
                }
                catch { }
                if (user.UserID != 0)
                {
                    loginsuccess = true;
                    sm.Session().UserID    = user.UserID;
                    sm.Session().PersonID  = user.PersonID;
                    sm.Session().LoginDate = DateTime.Now;
                    Session session        = sm.Session();
                    SessionUpdate(ref session);
                    SessionActivityLog();
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(loginsuccess);
        }
Esempio n. 2
0
        //***************************************************************************************************************************************
        /// <summary>
        ///
        ///     Starts a Profiles instance of Profiles Session Management and Session State Information used for
        ///     security/data filters, tracking, auditing.
        ///
        /// </summary>
        /// <param name="sender"> .Net context object</param>
        /// <param name="e"> .Net Event Arguments</param>
        protected void Session_Start(object sender, EventArgs e)
        {
            SessionManagement session = new SessionManagement();

            session.SessionCreate();

            Framework.Utilities.DebugLogging.Log("SESSION CREATED for: " + session.Session().SessionID);
            session = null;
        }
Esempio n. 3
0
        private void DrawProfilesModule()
        {
            Proxy.Utilities.DataIO data = new Proxy.Utilities.DataIO();
            SessionManagement      sm   = new SessionManagement();
            string subject = sm.Session().SessionID.ToString();


            if (sm.Session().UserID == 0)
            {
                Response.Redirect(Root.Domain + "/search");
            }



            if (Request.QueryString["fname"] != null)
            {
                txtFirstName.Text = Request.QueryString["fname"];
                this.Fname        = Request.QueryString["fname"];
            }

            if (Request.QueryString["lname"] != null)
            {
                txtLastName.Text = Request.QueryString["lname"];
                this.Lname       = Request.QueryString["lname"];
            }

            drpInstitution.DataSource     = data.GetInstitutions();
            drpInstitution.DataTextField  = "Text";
            drpInstitution.DataValueField = "Value";
            drpInstitution.DataBind();
            drpInstitution.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["institution"] != null)
            {
                drpInstitution.SelectedIndex = drpInstitution.Items.IndexOf(drpInstitution.Items.FindByText(Request.QueryString["institution"]));
                this.Institution             = Request.QueryString["institution"];
            }

            drpDepartment.DataSource     = data.GetDepartments();
            drpDepartment.DataTextField  = "Text";
            drpDepartment.DataValueField = "Value";
            drpDepartment.DataBind();
            drpDepartment.Items.Insert(0, new ListItem("--Select--"));

            if (Request.QueryString["department"] != null)
            {
                drpDepartment.SelectedIndex = drpDepartment.Items.IndexOf(drpDepartment.Items.FindByText(Request.QueryString["department"]));
                this.Department             = Request.QueryString["department"];
            }

            this.Subject = Convert.ToInt64(Request.QueryString["subject"]);

            if (Request.QueryString["offset"] != null && Request.QueryString["totalrows"] != null)
            {
                this.ExecuteSearch(false);
            }
        }
Esempio n. 4
0
        /// <summary>
        ///     Used to create a custom Profiles Session instance.  This instance is used to track and store user activity as a form of Profiles Network.
        /// </summary>
        /// <param name="session">ref of Framework.Session object that stores the state of a Profiles user session</param>
        public void SessionUpdate(ref Session session)
        {
            string            connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            SessionManagement sm      = new SessionManagement();

            SqlConnection dbconnection = new SqlConnection(connstr);

            SqlParameter[] param;

            param = new SqlParameter[7];

            SqlCommand dbcommand = new SqlCommand();

            dbconnection.Open();

            dbcommand.CommandTimeout = this.GetCommandTimeout();

            param[0] = new SqlParameter("@SessionID", session.SessionID);
            param[1] = new SqlParameter("@UserID", session.UserID);

            param[2] = new SqlParameter("@LastUsedDate", DateTime.Now);

            param[3]           = new SqlParameter("@SessionPersonNodeID", 0);
            param[3].Direction = ParameterDirection.Output;

            param[4]           = new SqlParameter("@SessionPersonURI", SqlDbType.VarChar, 400);
            param[4].Direction = ParameterDirection.Output;

            // UCSF
            param[5]           = new SqlParameter("@ShortDisplayName", SqlDbType.VarChar, 400);
            param[5].Direction = ParameterDirection.Output;

            if (session.LogoutDate > DateTime.Now.AddDays(-5))
            {
                param[6] = new SqlParameter("@LogoutDate", session.LogoutDate.ToString());
            }

            dbcommand.Connection = dbconnection;

            try
            {
                //For Output Parameters you need to pass a connection object to the framework so you can close it before reading the output params value.
                ExecuteSQLDataCommand(GetDBCommand(ref dbconnection, "[User.Session].[UpdateSession]", CommandType.StoredProcedure, CommandBehavior.CloseConnection, param));
            }
            catch (Exception ex) { }

            try
            {
                dbcommand.Connection.Close();
                session.NodeID    = Convert.ToInt64(param[3].Value);
                session.PersonURI = param[4].Value.ToString();
            }
            catch (Exception ex)
            {
            }
        }
        /// <summary>
        /// addEmployeeDetail
        /// </summary>
        private void addEmployeeDetail()
        {
            employeeBL = new EmployeeBL();
            Employee emp = GetEmployee();
            int      row = employeeBL.AddEmpDetails(emp);

            lblMsg.Text = (row > 0) ? "Record Added successfuly" : "Record not Added";
            SessionManagement.SetUserSession(emp);
            Response.Redirect("~/MailDetailsForm.aspx");
        }
Esempio n. 6
0
        //replace this method so the
        public static string GetListCount()
        {
            SessionManagement sm = new SessionManagement();

            if (sm.Session().ListID == null || sm.Session().ListSize == null)
            {
                Profiles.Lists.Utilities.DataIO.GetList();
            }
            return(sm.Session().ListSize.ToString());
        }
Esempio n. 7
0
        public void DrawProfilesModule()
        {
            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();

            if (Request.QueryString["Subject"] == null)
            {
                return;
            }

            base.RDFTriple = new RDFTriple(Convert.ToInt64(Request.QueryString["Subject"]));



            dlGoogleMapLinks.DataSource = data.GetGoogleMapZoomLinks();
            dlGoogleMapLinks.DataBind();

            SqlDataReader reader  = null;
            SqlDataReader reader2 = null;

            Profiles.Framework.Utilities.SessionManagement session = new SessionManagement();

            GoogleMapHelper gmh = new GoogleMapHelper();

            if (base.GetModuleParamString("MapType") == "CoAuthor")
            {
                reader  = data.GetGMapUserCoAuthors(base.RDFTriple.Subject, 0, session.Session().SessionID);
                reader2 = data.GetGMapUserCoAuthors(base.RDFTriple.Subject, 1, session.Session().SessionID);
            }

            if (base.GetModuleParamString("MapType") == "SimilarTo")
            {
                reader  = data.GetGMapUserSimilarPeople(base.RDFTriple.Subject, false, session.Session().SessionID);
                reader2 = data.GetGMapUserSimilarPeople(base.RDFTriple.Subject, true, session.Session().SessionID);
            }



            string googleCode, tableText;

            gmh.MapPlotPeople(base.RDFTriple.Subject, reader, reader2, out googleCode, out tableText);
            litGoogleCode.Text  = googleCode;
            litNetworkText.Text = tableText;


            if (!reader.IsClosed)
            {
                reader.Close();
            }

            if (!reader2.IsClosed)
            {
                reader2.Close();
            }
        }
Esempio n. 8
0
        void AuthenticateUser(object sender, EventArgs e)
        {
            HttpApplication app     = sender as HttpApplication;
            HttpContext     context = app.Context;

            //Lê Cookie
            string sessionToken = null;
            var    cookies      = context.Request.Cookies;

            if (cookies["nsc-session"] != null)
            {
                sessionToken = cookies["nsc-session"].Value;
            }

            if (sessionToken != null)
            {
                sessionToken = Uri.UnescapeDataString(sessionToken.Replace(' ', '+'));

                Guid    tokenGuid;
                NSCInfo info;
                if (Token.VerifyToken(sessionToken, out tokenGuid, out info))
                {
                    //Token é válido, continuar verificando se o usuário pode ser logado
                    //if (info.TokenGenerationDate.AddDays(7.0) > DateTime.Now.ToUniversalTime())
                    if (info.TokenExpirationDate.ToUniversalTime() > DateTime.Now.ToUniversalTime())
                    {
                        //tenta pegar do cache de sessão
                        try
                        {
                            var sessionUser = new SessionManagement().GetNimbusPrincipal(info.UserId);
                            if (sessionUser != null)
                            {
                                context.User = sessionUser;
                            }
                        }
                        catch (Exception ex)
                        {
                            Debug.WriteLine(String.Format("Nimbus: context.Session exception on request to {0}: {1}",
                                                          context.Request.Path, ex.Message));
                        } //sessao nao inicializada
                    }
                    else  //token velho
                    {
                    }
                }
                else //token inválido
                {
                }
            }
            else
            {
            }        //token = null
        }
Esempio n. 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            sm = new SessionManagement();

            if (sm.Session().UserID == 0)
            {
                Response.Redirect(Root.Domain + "/search");
            }


            DrawProfilesModule();
        }
Esempio n. 10
0
 public User(SessionManagement sessionManagement, int counter, bool isAuto = true)
 {
     _page = new Page(counter, sessionManagement);
     new Thread(() =>
     {
         while (true)
         {
             Thread.Sleep(1000);
             _page.Refresh();
         }
     }).Start();
 }
Esempio n. 11
0
        internal void OnDisconnect()
        {
            if (this.Disconnected)
            {
                return;
            }

            this.Disconnected = true;

            ButterflyEnvironment.GetGame().GetClientManager().UnregisterClient(Id, Username);
            SessionManagement.IncreaseDisconnection();
            Logging.WriteLine(Username + " has logged out.");


            if (!HabboinfoSaved)
            {
                HabboinfoSaved = true;
                using (IQueryAdapter dbClient = ButterflyEnvironment.GetDatabaseManager().getQueryreactor())
                {
                    dbClient.runFastQuery("UPDATE users SET users.last_online = '" + DateTime.Now.ToString() + "', activity_points = " + ActivityPoints + ", activity_points_lastupdate = '" + LastActivityPointsUpdate + "', credits = " + Credits + ", achievement_points = " + AchievementPoints + " WHERE id = " + Id + " ;");
                }
            }

            if (InRoom && CurrentRoom != null)
            {
                CurrentRoom.GetRoomUserManager().RemoveUserFromRoom(mClient, false, false);
            }

            if (Messenger != null)
            {
                Messenger.AppearOffline = true;
                Messenger.Destroy();
            }

            if (SubscriptionManager != null)
            {
                SubscriptionManager.Clear();
            }

            if (AvatarEffectsInventoryComponent != null)
            {
                AvatarEffectsInventoryComponent.Dispose();
            }

            if (InventoryComponent != null)
            {
                InventoryComponent.SetIdleState();
                InventoryComponent.RunDBUpdate();
            }

            this.mClient = null;
        }
Esempio n. 12
0
            public Page(int counter, SessionManagement sessionManagementService)
            {
                _sessionId = Guid.NewGuid();
                _sessionManagementService = sessionManagementService;
                _counter = counter;

                sessionManagementService.SaveSession(new Session
                {
                    Id             = _sessionId,
                    LoggedInUserId = Guid.NewGuid(),
                    SessionInfo    = "this is session " + counter
                });
            }
        public JsonResult AddNewActivity(Activity objActivity)
        {
            ActivityServices service = new ActivityServices();

            if (ModelState.IsValid)
            {
                int loggedInUser = Convert.ToInt16(SessionManagement.GetValue("UserId"));
                objActivity.UserId = loggedInUser;
                service.SaveActivity(objActivity);
                return(Json(objActivity, JsonRequestBehavior.AllowGet));
            }
            return(Json("", JsonRequestBehavior.AllowGet));
        }
        public PropertyList(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            XmlDocument       presentationxml = base.PresentationXML;
            SessionManagement sm = new SessionManagement();

            Profiles.Profile.Utilities.DataIO data = new Profiles.Profile.Utilities.DataIO();


            this.PropertyListXML = data.GetPropertyList(pagedata, presentationxml, "", false, false, true);

            mp = new ModulesProcessing();
        }
Esempio n. 15
0
        public EditPersonalGadget(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            base.BaseData = pagedata;

            data = new Profiles.ORNG.Utilities.DataIO();
            Profiles.Edit.Utilities.DataIO    editdata = new Profiles.Edit.Utilities.DataIO();
            Profiles.Profile.Utilities.DataIO propdata = new Profiles.Profile.Utilities.DataIO();

            if (Request.QueryString["subject"] != null)
            {
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            }
            else if (base.GetRawQueryStringItem("subject") != null)
            {
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            }
            else
            {
                Response.Redirect("~/search");
            }

            this.PredicateURI    = Request.QueryString["predicateuri"].Replace("!", "#");
            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, this.PredicateURI, false, true, false);
            litBackLink.Text     = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";


            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, editdata.GetStoreNode(this.PredicateURI));

            base.RDFTriple.Expand      = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.

            // Profiles OpenSocial Extension by UCSF
            uri    = this.BaseData.SelectSingleNode("rdf:RDF/rdf:Description/@rdf:about", base.Namespaces).Value;
            uri    = uri.Substring(0, uri.IndexOf(Convert.ToString(this.SubjectID)) + Convert.ToString(this.SubjectID).Length);
            appId  = Convert.ToInt32(base.GetModuleParamString("AppId"));
            om     = OpenSocialManager.GetOpenSocialManager(uri, Page, true);
            gadget = om.AddGadget(appId, base.GetModuleParamString("View"), base.GetModuleParamString("OptParams"));

            securityOptions.Subject        = this.SubjectID;
            securityOptions.PredicateURI   = this.PredicateURI;
            securityOptions.PrivacyCode    = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);

            hasGadget = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@NumberOfConnections").Value) > 0;
        }
Esempio n. 16
0
        public bool AuthenticateUser(string argsClientId, string argsUserId, string argsPassword, string argsDatabase)
        {
            var loginPresenter = new UserAuthenticationManager();

            _userContext = loginPresenter.AuthenticateUser(argsClientId, argsUserId, argsPassword,
                                                           argsDatabase);
            if (_userContext == null)
            {
                return(false);
            }
            SessionManagement <UserContext> .SetValue(Constants.UserContextSessionKey, _userContext);

            return(true);
        }
        public void Clear()
        {
            // remove cart items
            SessionManagement s = new SessionManagement();

            s.RemoveCartItems(SessionID);

            // then delete this session
            if (SessionID != null)
            {
                HttpContext.Current.Session.Clear(); // remove stored Prods
                HttpContext.Current.Session.Abandon();
            }
        }
        public JsonResult GetActivities()
        {
            ActivityServices service = new ActivityServices();
            int loggedInUser         = Convert.ToInt16(SessionManagement.GetValue("UserId"));

            if (loggedInUser > 0)
            {
                return(Json(service.GetAllActivities(loggedInUser), JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json("", JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 19
0
        protected void Session_End()
        {
            //// remove current session
            //if (HttpContext.Current.Session != null)
            //{
            //    HttpContext.Current.Session.Clear();    // remove collection items
            //    HttpContext.Current.Session.Abandon();  // cancel current session
            //}

            // remove abandoned sessions
            SessionManagement s = new SessionManagement();

            s.RemoveExpiredSessions();
        }
        public JsonResult GetLoggedInUser()
        {
            AppUser user = new AppUser();

            user.UserId = Convert.ToInt16(SessionManagement.GetValue("UserId"));
            if (user.UserId > 0)
            {
                user.UserName = SessionManagement.GetValue("UserName");
            }
            else
            {
                user.UserName = "";
            }
            return(Json(user, JsonRequestBehavior.AllowGet));
        }
Esempio n. 21
0
        public IActionResult Index()
        {
            var user = SessionManagement.GetSession(HttpContext);

            if (user != null)
            {
                return(RedirectToAction("Index", "Annotations"));
            }

            if (TempData["ApplicationMessage"] != null)
            {
                ViewBag.ApplicationMessage = TempData["ApplicationMessage"].ToString();
            }

            return(View());
        }
Esempio n. 22
0
        public ActionResult PostProfile(int id, ProfilePageViewModel post, HttpPostedFileBase[] UploadedFile)
        {
            var currentUserRequesting = db.Users.Where(a => a.Email == User.Identity.Name).FirstOrDefault();

            if (SessionManagement.isUserLegitRequest(id, currentUserRequesting.UserId))
            {
                if (ModelState.IsValid)
                {
                    post.postM.UploadFiles = new List <UploadFile>();

                    foreach (HttpPostedFileBase file in UploadedFile)
                    {
                        if (file != null && file.ContentLength > 0)
                        {
                            var ToDbFile = new UploadFile
                            {
                                UploadFileType = file.ContentType,
                                Post           = post.postM
                            };

                            using (var reader = new BinaryReader(file.InputStream))
                            {
                                ToDbFile.UploadContent = reader.ReadBytes(file.ContentLength);
                            }
                            db.UploadFiles.Add(ToDbFile);
                        }
                    }
                    post.postM.DateofPost = DateTime.Now;
                    post.postM.UserId     = id;

                    db.Posts.Add(post.postM);
                    db.SaveChanges();
                    return(RedirectToAction("ProfilePage", "Profile", new { id = id }));
                }
                else
                {
                    ViewBag.Message3 = "Posting Failed";
                    return(RedirectToAction("ProfilePage", "Profile", new { id = id }));
                }
            }
            else
            {
                ViewBag.Message3 = "You are not the current user of this account";
                return(RedirectToAction("ProfilePage", "Profile", new { id = id }));
            }
        }
Esempio n. 23
0
        public CustomEditEagleI(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            base.BaseData = pagedata;

            Profiles.Profile.Utilities.DataIO propdata = new Profiles.Profile.Utilities.DataIO();
            data = new Edit.Utilities.DataIO();



            if (Request.QueryString["subject"] != null)
            {
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            }
            else if (base.GetRawQueryStringItem("subject") != null)
            {
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            }
            else
            {
                Response.Redirect("~/search");
            }

            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            litBackLink.Text     = "<a href='" + Root.Domain + "/edit/" + this.SubjectID.ToString() + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";


            //create a new network triple request.
            base.RDFTriple = new RDFTriple(this.SubjectID, data.GetStoreNode(predicateuri));

            base.RDFTriple.Expand      = true;
            base.RDFTriple.ShowDetails = true;
            base.GetDataByURI();//This will reset the data to a Network.



            securityOptions.Subject        = this.SubjectID;
            securityOptions.PredicateURI   = predicateuri;
            securityOptions.PrivacyCode    = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
        }
Esempio n. 24
0
        private bool AuthenticateUser(string argsClientId, string argsUserId, string argsPassword, string argsDatabase)
        {
            var loginPresenter = new UserAuthenticationManager();

            _userContext = loginPresenter.AuthenticateUser(argsClientId, argsUserId, argsPassword,
                                                           argsDatabase);
            if (_userContext == null)
            {
                return(false);
            }
            AuditLog.LogEvent(SysEventType.ERROR, "Session Creating", _userContext.UserProfile.Name, null);

            SessionManagement <UserContext> .SetValue(Constants.UserContextSessionKey, _userContext);

            AuditLog.LogEvent(SysEventType.ERROR, "Session Created", _userContext.UserProfile.Name, null);
            return(true);
        }
Esempio n. 25
0
        public SqlDataReader GetConceptTopJournal(RDFTriple request)
        {
            SessionManagement sm      = new SessionManagement();
            string            connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            var db = new SqlConnection(connstr);

            db.Open();

            SqlCommand dbcommand = new SqlCommand("[Profile.Data].[Concept.Mesh.GetJournals]", db);

            dbcommand.CommandType    = CommandType.StoredProcedure;
            dbcommand.CommandTimeout = base.GetCommandTimeout();
            // Add parameters
            dbcommand.Parameters.Add(new SqlParameter("@NodeId", request.Subject));
            // Return reader
            return(dbcommand.ExecuteReader(CommandBehavior.CloseConnection));
        }
        public FeaturedVideos(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            securityOptions.Subject        = base.SubjectID;
            securityOptions.PredicateURI   = base.PredicateURI.Replace("!", "#");
            securityOptions.PrivacyCode    = Convert.ToInt32(base.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);
            securityOptions.BubbleClick += SecurityDisplayed;

            this.PlugInName = "FeaturedVideos";
            this.data       = Profiles.Framework.Utilities.GenericRDFDataIO.GetSocialMediaPlugInData(this.SubjectID, this.PlugInName);


            litBackLink.Text = "<a href='" + Root.Domain + "/edit/default.aspx?subject=" + this.SubjectID + "'>Edit Menu</a> &gt; <b>" + PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@Label").Value + "</b>";
        }
Esempio n. 27
0
        public SqlDataReader GetProfileConnection(RDFTriple request, string storedproc)
        {
            SessionManagement sm      = new SessionManagement();
            string            connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            var db = new SqlConnection(connstr);

            db.Open();

            SqlCommand dbcommand = new SqlCommand(storedproc, db);

            dbcommand.CommandType    = CommandType.StoredProcedure;
            dbcommand.CommandTimeout = base.GetCommandTimeout();
            // Add parameters
            dbcommand.Parameters.Add(new SqlParameter("@subject", request.Subject));
            dbcommand.Parameters.Add(new SqlParameter("@object", request.Object));
            // Return reader
            return(dbcommand.ExecuteReader(CommandBehavior.CloseConnection));
        }
Esempio n. 28
0
        public SqlDataReader GetPublicationSupportHtml(RDFTriple request, bool editMode)
        {
            SessionManagement sm      = new SessionManagement();
            string            connstr = ConfigurationManager.ConnectionStrings["ProfilesDB"].ConnectionString;
            var db = new SqlConnection(connstr);

            db.Open();

            SqlCommand dbcommand = new SqlCommand("[Profile.Module].[Support.GetHTML]", db);

            dbcommand.CommandType    = CommandType.StoredProcedure;
            dbcommand.CommandTimeout = base.GetCommandTimeout();
            // Add parameters
            dbcommand.Parameters.Add(new SqlParameter("@NodeId", request.Subject));
            dbcommand.Parameters.Add(new SqlParameter("@EditMode", (editMode) ? 1 : 0));
            // Return reader
            return(dbcommand.ExecuteReader(CommandBehavior.CloseConnection));
        }
        public CustomEditGroupSettings(XmlDocument pagedata, List <ModuleParams> moduleparams, XmlNamespaceManager pagenamespaces)
            : base(pagedata, moduleparams, pagenamespaces)
        {
            SessionManagement sm = new SessionManagement();

            data     = new Profiles.Edit.Utilities.DataIO();
            propdata = new Profiles.Profile.Utilities.DataIO();
            string predicateuri = Request.QueryString["predicateuri"].Replace("!", "#");

            if (Request.QueryString["subject"] != null)
            {
                this.SubjectID = Convert.ToInt64(Request.QueryString["subject"]);
            }
            else if (base.GetRawQueryStringItem("subject") != null)
            {
                this.SubjectID = Convert.ToInt64(base.GetRawQueryStringItem("subject"));
            }
            else
            {
                Response.Redirect("~/search");
            }

            litBackLink.Text = "<a href='" + Root.Domain + "/edit/" + this.SubjectID + "'>Edit Menu</a> &gt; <b>Group Settings</b>";

            //btnEditProperty.Text = "Add " + PropertyLabel;
            imbAddArror.Visible = true;

            SqlDataReader reader = data.GetGroup(SubjectID);

            reader.Read();
            securityOptions.PrivacyCode = Convert.ToInt32(reader["ViewSecurityGroup"].ToString());
            reader.Close();

            //this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);

            //this.PropertyListXML = propdata.GetPropertyList(this.BaseData, base.PresentationXML, predicateuri, false, true, false);
            securityOptions.Subject      = this.SubjectID;
            securityOptions.PredicateURI = predicateuri;
            //securityOptions.PrivacyCode = Convert.ToInt32(this.PropertyListXML.SelectSingleNode("PropertyList/PropertyGroup/Property/@ViewSecurityGroup").Value);
            securityOptions.SecurityGroups = new XmlDataDocument();
            securityOptions.SecurityGroups.LoadXml(base.PresentationXML.DocumentElement.LastChild.OuterXml);

            //txtLabel.Attributes.Add("data-autocomplete-url", Root.Domain + "/edit/Modules/CustomEditFreetextKeyword/keywordAutocomplete.aspx?keys=");
        }
        public JsonResult UserAuthentication(String email, String password)
        {
            UserServices service      = new UserServices();
            User         existinguser = service.UserLogin(email, password);

            if (existinguser != null && existinguser.ID > 0)
            {
                SessionManagement.SetValue("UserId", existinguser.ID.ToString());
                SessionManagement.SetValue("UserName", existinguser.Name.ToString());
                return(Json(existinguser, JsonRequestBehavior.AllowGet));
            }

            else
            {
                Error err = new Error();
                err.ErrorMessage = "Username and password does not match";
                return(Json(err, JsonRequestBehavior.AllowGet));
            }
        }