Exemple #1
0
        /// <summary>
        /// Check if roles are synchronized and the user is added to them
        /// </summary>
        /// <param name="dnnUser">The Current DNN User</param>
        /// <param name="yafUserId">The YAF user id.</param>
        private void CheckForRoles(UserInfo dnnUser, int yafUserId)
        {
            // see if the roles have been synchronized...
            if (this.Session["{0}_rolesloaded".FormatWith(this.SessionUserKeyName)] != null)
            {
                return;
            }

            RoleSyncronizer.SynchronizeUserRoles(
                this.forum1.BoardID,
                this.CurrentPortalSettings.PortalId,
                yafUserId,
                dnnUser);

            this.Session["{0}_rolesloaded".FormatWith(this.SessionUserKeyName)] = true;
        }
Exemple #2
0
        /// <summary>
        /// Check if roles are synchronized and the user is added to them
        /// </summary>
        /// <param name="dnnUser">The Current DNN User</param>
        /// <param name="yafUserId">The YAF user id.</param>
        private void CheckForRoles([NotNull] UserInfo dnnUser, int yafUserId)
        {
            CodeContracts.VerifyNotNull(dnnUser);

            // see if the roles have been synchronized...
            if (this.Session[$"{this.SessionUserKeyName}_rolesloaded"] != null)
            {
                return;
            }

            RoleSyncronizer.SynchronizeUserRoles(
                this.forum1.BoardID,
                this.CurrentPortalSettings.PortalId,
                yafUserId,
                dnnUser);

            this.Session[$"{this.SessionUserKeyName}_rolesloaded"] = true;
        }