@@ -137,6 +137,9 @@ private enum RoleType
137137 Owner = 3 ,
138138 }
139139
140+ /// <summary>
141+ /// Forces the secure connection.
142+ /// </summary>
140143 public static void ForceSecureConnection ( )
141144 {
142145 // get current url
@@ -163,6 +166,11 @@ public static void ForceSecureConnection()
163166 }
164167 }
165168
169+ /// <summary>
170+ /// Gets the cookie domain for the portal group or from web.config.
171+ /// </summary>
172+ /// <param name="portalId">The portal identifier.</param>
173+ /// <returns>Cookie domain for the portal group or from web.config.</returns>
166174 public static string GetCookieDomain ( int portalId )
167175 {
168176 string cookieDomain = string . Empty ;
@@ -193,13 +201,29 @@ public static string GetCookieDomain(int portalId)
193201 return cookieDomain ;
194202 }
195203
204+ /// <summary>
205+ /// Determines whether the current user is denied for the given role(s).
206+ /// </summary>
207+ /// <param name="roles">The semicolon separated list of roles.</param>
208+ /// <returns>
209+ /// <c>true</c> if the current user is denied from the provided specified roles; otherwise, <c>false</c>.
210+ /// </returns>
196211 public static bool IsDenied ( string roles )
197212 {
198213 UserInfo objUserInfo = UserController . Instance . GetCurrentUserInfo ( ) ;
199214 PortalSettings settings = PortalController . Instance . GetCurrentPortalSettings ( ) ;
200215 return IsDenied ( objUserInfo , settings , roles ) ;
201216 }
202217
218+ /// <summary>
219+ /// Determines whether the specified user is denied for the given roles.
220+ /// </summary>
221+ /// <param name="objUserInfo">The user information.</param>
222+ /// <param name="settings">The settings.</param>
223+ /// <param name="roles">The semicolon separated list of roles.</param>
224+ /// <returns>
225+ /// <c>true</c> if the specified user is denied; otherwise, <c>false</c>.
226+ /// </returns>
203227 public static bool IsDenied ( UserInfo objUserInfo , PortalSettings settings , string roles )
204228 {
205229 // super user always has full access
@@ -238,6 +262,13 @@ public static bool IsDenied(UserInfo objUserInfo, PortalSettings settings, strin
238262 return isDenied ;
239263 }
240264
265+ /// <summary>
266+ /// Determines whether the current user belonds to the specified role.
267+ /// </summary>
268+ /// <param name="role">The role name.</param>
269+ /// <returns>
270+ /// <c>true</c> if user belongs to the specified role; otherwise, <c>false</c>.
271+ /// </returns>
241272 public static bool IsInRole ( string role )
242273 {
243274 if ( ! string . IsNullOrEmpty ( role ) && role == Globals . glbRoleUnauthUserName && ! HttpContext . Current . Request . IsAuthenticated )
@@ -248,13 +279,29 @@ public static bool IsInRole(string role)
248279 return IsInRoles ( UserController . Instance . GetCurrentUserInfo ( ) , PortalController . Instance . GetCurrentPortalSettings ( ) , role ) ;
249280 }
250281
282+ /// <summary>
283+ /// Determines whether the current user belongs to the specified roles.
284+ /// </summary>
285+ /// <param name="roles">The semicolon separated list of roles.</param>
286+ /// <returns>
287+ /// <c>true</c> if user belongs to the specified roles; otherwise, <c>false</c>.
288+ /// </returns>
251289 public static bool IsInRoles ( string roles )
252290 {
253291 UserInfo objUserInfo = UserController . Instance . GetCurrentUserInfo ( ) ;
254292 PortalSettings settings = PortalController . Instance . GetCurrentPortalSettings ( ) ;
255293 return IsInRoles ( objUserInfo , settings , roles ) ;
256294 }
257295
296+ /// <summary>
297+ /// Determines whether the provided user belongs to the specified roles.
298+ /// </summary>
299+ /// <param name="objUserInfo">The user information.</param>
300+ /// <param name="settings">The settings.</param>
301+ /// <param name="roles">The semicolon separated list of roles.</param>
302+ /// <returns>
303+ /// <c>true</c> if the provided user belongs to the specific roles; otherwise, <c>false</c>.
304+ /// </returns>
258305 public static bool IsInRoles ( UserInfo objUserInfo , PortalSettings settings , string roles )
259306 {
260307 // super user always has full access
@@ -280,20 +327,41 @@ public static bool IsInRoles(UserInfo objUserInfo, PortalSettings settings, stri
280327 return isInRoles ;
281328 }
282329
330+ /// <summary>
331+ /// Determines whether the specified user is a friend of the current user.
332+ /// </summary>
333+ /// <param name="userId">The user identifier.</param>
334+ /// <returns>
335+ /// <c>true</c> if the specified user is a friend of the current user; otherwise, <c>false</c>.
336+ /// </returns>
283337 public static bool IsFriend ( int userId )
284338 {
285339 UserInfo objUserInfo = UserController . Instance . GetCurrentUserInfo ( ) ;
286340 PortalSettings settings = PortalController . Instance . GetCurrentPortalSettings ( ) ;
287341 return IsInRoles ( objUserInfo , settings , RoleFriendPrefix + userId ) ;
288342 }
289343
344+ /// <summary>
345+ /// Determines whether the specified user is a follower of the current user.
346+ /// </summary>
347+ /// <param name="userId">The user identifier.</param>
348+ /// <returns>
349+ /// <c>true</c> if the specified user is a follower of the current user; otherwise, <c>false</c>.
350+ /// </returns>
290351 public static bool IsFollower ( int userId )
291352 {
292353 UserInfo objUserInfo = UserController . Instance . GetCurrentUserInfo ( ) ;
293354 PortalSettings settings = PortalController . Instance . GetCurrentPortalSettings ( ) ;
294355 return IsInRoles ( objUserInfo , settings , RoleFollowerPrefix + userId ) ;
295356 }
296357
358+ /// <summary>
359+ /// Determines whether the specified user is an owner.
360+ /// </summary>
361+ /// <param name="userId">The user identifier.</param>
362+ /// <returns>
363+ /// <c>true</c> if the specified user is an owner; otherwise, <c>false</c>.
364+ /// </returns>
297365 public static bool IsOwner ( int userId )
298366 {
299367 UserInfo objUserInfo = UserController . Instance . GetCurrentUserInfo ( ) ;
@@ -315,21 +383,45 @@ public string CreateKey(int numBytes)
315383 }
316384 }
317385
386+ /// <summary>
387+ /// Decrypts the provided string data using a supplied key.
388+ /// </summary>
389+ /// <param name="strKey">The encryption key.</param>
390+ /// <param name="strData">The encrypted data.</param>
391+ /// <returns>The decrypted string.</returns>
318392 public string Decrypt ( string strKey , string strData )
319393 {
320394 return CryptographyProvider . Instance ( ) . DecryptParameter ( strData , strKey ) ;
321395 }
322396
397+ /// <summary>
398+ /// Decrypts a string using a provided passphrase.
399+ /// </summary>
400+ /// <param name="message">The encrypted message.</param>
401+ /// <param name="passphrase">The passphrase.</param>
402+ /// <returns>The decrypted string.</returns>
323403 public string DecryptString ( string message , string passphrase )
324404 {
325405 return CryptographyProvider . Instance ( ) . DecryptString ( message , passphrase ) ;
326406 }
327407
408+ /// <summary>
409+ /// Encrypts the specified key.
410+ /// </summary>
411+ /// <param name="key">The key.</param>
412+ /// <param name="data">The data.</param>
413+ /// <returns>The encrypted string.</returns>
328414 public string Encrypt ( string key , string data )
329415 {
330416 return CryptographyProvider . Instance ( ) . EncryptParameter ( data , key ) ;
331417 }
332418
419+ /// <summary>
420+ /// Encrypts a string using a provided passphrase.
421+ /// </summary>
422+ /// <param name="message">The message.</param>
423+ /// <param name="passphrase">The passphrase.</param>
424+ /// <returns>The encrypted string.</returns>
333425 public string EncryptString ( string message , string passphrase )
334426 {
335427 return CryptographyProvider . Instance ( ) . EncryptString ( message , passphrase ) ;
@@ -500,6 +592,11 @@ public string Remove(string inputString, ConfigType configType, string configSou
500592 return inputString ;
501593 }
502594
595+ /// <summary>
596+ /// Signs the provided user in and sets a persistent login cookie if needed.
597+ /// </summary>
598+ /// <param name="user">The user info.</param>
599+ /// <param name="createPersistentCookie">if set to <c>true</c> [create persistent cookie].</param>
503600 public void SignIn ( UserInfo user , bool createPersistentCookie )
504601 {
505602 if ( PortalController . IsMemberOfPortalGroup ( user . PortalID ) || createPersistentCookie )
@@ -574,6 +671,9 @@ public void SignIn(UserInfo user, bool createPersistentCookie)
574671 HttpContext . Current . Items [ "DNN_UserSignIn" ] = true ;
575672 }
576673
674+ /// <summary>
675+ /// Signs the current user out.
676+ /// </summary>
577677 public void SignOut ( )
578678 {
579679 InvalidateAspNetSession ( HttpContext . Current ) ;
0 commit comments