diff --git a/Source/DnnDocuments/EditDocs.ascx.vb b/Source/DnnDocuments/EditDocs.ascx.vb
index c9ea135..d0bf737 100644
--- a/Source/DnnDocuments/EditDocs.ascx.vb
+++ b/Source/DnnDocuments/EditDocs.ascx.vb
@@ -1,23 +1,23 @@
-'
-' DotNetNukeŽ - http://www.dotnetnuke.com
-' Copyright (c) 2002-2011
-' by DotNetNuke Corporation
-'
-' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
-' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
-' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
-' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-'
-' The above copyright notice and this permission notice shall be included in all copies or substantial portions
-' of the Software.
-'
-' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
-' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
-' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-' DEALINGS IN THE SOFTWARE.
-'
-
+'
+' DotNetNukeŽ - http://www.dotnetnuke.com
+' Copyright (c) 2002-2011
+' by DotNetNuke Corporation
+'
+' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+' documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+'
+' The above copyright notice and this permission notice shall be included in all copies or substantial portions
+' of the Software.
+'
+' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
+' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+' DEALINGS IN THE SOFTWARE.
+'
+
Imports System.IO
Imports System.Linq
Imports System.Web
@@ -40,10 +40,10 @@ Namespace DotNetNuke.Modules.Documents
'''
''' -----------------------------------------------------------------------------
Public MustInherit Class EditDocs
- Inherits Entities.Modules.PortalModuleBase
-
+ Inherits Entities.Modules.PortalModuleBase
+
#Region "Controls"
-
+
Protected WithEvents plName As UI.UserControls.LabelControl
Protected WithEvents txtName As System.Web.UI.WebControls.TextBox
Protected WithEvents valName As System.Web.UI.WebControls.RequiredFieldValidator
@@ -69,29 +69,29 @@ Namespace DotNetNuke.Modules.Documents
Protected WithEvents valSortIndex As System.Web.UI.WebControls.RangeValidator
Protected WithEvents lblOwner As System.Web.UI.WebControls.Label
Protected WithEvents lnkChange As System.Web.UI.WebControls.LinkButton
- Protected WithEvents lblAudit As System.Web.UI.WebControls.Label
-
+ Protected WithEvents lblAudit As System.Web.UI.WebControls.Label
+
#End Region
-
+
#Region "Private Members"
-
- Private mintItemId As Integer
-
+
+ Private mintItemId As Integer
+
#End Region
-
+
#Region "Event Handlers"
-
- ''' -----------------------------------------------------------------------------
- '''
- ''' Page_Load runs when the control is loaded
- '''
- '''
- '''
- '''
- ''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support
- ''' and localisation
- '''
- ''' -----------------------------------------------------------------------------
+
+ ''' -----------------------------------------------------------------------------
+ '''
+ ''' Page_Load runs when the control is loaded
+ '''
+ '''
+ '''
+ '''
+ ''' [cnurse] 9/22/2004 Updated to reflect design changes for Help, 508 support
+ ''' and localisation
+ '''
+ ''' -----------------------------------------------------------------------------
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objDocumentsSettings As DocumentsSettingsInfo
@@ -246,8 +246,8 @@ Namespace DotNetNuke.Modules.Documents
If Not objFile Is Nothing Then
' Get file's folder security
Dim moduleRoles As ModulePermissionCollection = ModulePermissionController.GetModulePermissions(ModuleId, TabId)
- Dim fileRoles As FolderPermissionCollection = Security.Permissions.FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalId, objFile.Folder)
- Return CheckRolesMatch(moduleRoles, fileRoles)
+ Dim fileRoles As FolderPermissionCollection = Security.Permissions.FolderPermissionController.GetFolderPermissionsCollectionByFolder(PortalId, objFile.Folder)
+ Return CheckRolesMatch(moduleRoles, fileRoles)
End If
End Select
Return True
@@ -272,9 +272,11 @@ Namespace DotNetNuke.Modules.Documents
Dim fileRolesList As List(Of PermissionInfoBase) = FileRoles.ToList()
Dim fileReadRoles As IEnumerable(Of PermissionInfoBase) = From fileRole In fileRolesList Where fileRole.PermissionKey = "READ"
For Each fileRole As FolderPermissionInfo In fileReadRoles
- objFileRoles.Add(fileRole.RoleName, fileRole.RoleName)
- If fileRole.RoleName = DotNetNuke.Common.Globals.glbRoleAllUsersName Then
- Return True
+ If Not fileRole.RoleName = "" Then
+ objFileRoles.Add(fileRole.RoleName, fileRole.RoleName)
+ If fileRole.RoleName = DotNetNuke.Common.Globals.glbRoleAllUsersName Then
+ Return True
+ End If
End If
Next
@@ -292,13 +294,13 @@ Namespace DotNetNuke.Modules.Documents
Next
If blnNotMatching Then
' Warn user that roles do not match
- DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
- DotNetNuke.Services.Localization.Localization.GetString("msgFileSecurityWarning.Text", Me.LocalResourceFile).Replace("[$ROLELIST]", IIf(strRolesForMessage.IndexOf(",") >= 0, "s", "").ToString & "'" & strRolesForMessage & "'"), _
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
+ DotNetNuke.Services.Localization.Localization.GetString("msgFileSecurityWarning.Text", Me.LocalResourceFile).Replace("[$ROLELIST]", IIf(strRolesForMessage.IndexOf(",") >= 0, "s", "").ToString & "'" & strRolesForMessage & "'"),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
Else
Return True
- End If
+ End If
End Function
''' -----------------------------------------------------------------------------
@@ -312,14 +314,14 @@ Namespace DotNetNuke.Modules.Documents
'''
''' -----------------------------------------------------------------------------
Private Function CheckFileExists(ByVal Url As String) As Boolean
- Dim intFileId As Integer
+ Dim intFileId As Integer
Dim objFile As New DotNetNuke.Services.FileSystem.FileInfo
Dim blnAddWarning As Boolean
If Url = String.Empty Then
' File not selected
- DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
- DotNetNuke.Services.Localization.Localization.GetString("msgNoFileSelected.Text", Me.LocalResourceFile), _
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
+ DotNetNuke.Services.Localization.Localization.GetString("msgNoFileSelected.Text", Me.LocalResourceFile),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
Else
@@ -350,8 +352,8 @@ Namespace DotNetNuke.Modules.Documents
If blnAddWarning Then
' Display a "file not found" warning
- DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me, _
- DotNetNuke.Services.Localization.Localization.GetString("msgFileDeleted.Text", Me.LocalResourceFile), _
+ DotNetNuke.UI.Skins.Skin.AddModuleMessage(Me,
+ DotNetNuke.Services.Localization.Localization.GetString("msgFileDeleted.Text", Me.LocalResourceFile),
DotNetNuke.UI.Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Return False
End If
@@ -455,10 +457,10 @@ Namespace DotNetNuke.Modules.Documents
Me.cmdUpdate.Visible = False
' '' Display page-level warning instructing users to click update again if they want to ignore the warning
- DotNetNuke.UI.Skins.Skin.AddPageMessage( _
- Me.Page, _
- DotNetNuke.Services.Localization.Localization.GetString("msgFileWarningHeading.Text", Me.LocalResourceFile), _
- DotNetNuke.Services.Localization.Localization.GetString("msgFileWarning.Text", Me.LocalResourceFile), _
+ DotNetNuke.UI.Skins.Skin.AddPageMessage(
+ Me.Page,
+ DotNetNuke.Services.Localization.Localization.GetString("msgFileWarningHeading.Text", Me.LocalResourceFile),
+ DotNetNuke.Services.Localization.Localization.GetString("msgFileWarning.Text", Me.LocalResourceFile),
Skins.Controls.ModuleMessage.ModuleMessageType.YellowWarning)
Exit Sub
End If
@@ -537,10 +539,10 @@ Namespace DotNetNuke.Modules.Documents
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
- End Sub
-
+ End Sub
+
#End Region
-
+
#Region "Private methods"
Private Property ItemID() As Integer
Get
@@ -564,12 +566,12 @@ Namespace DotNetNuke.Modules.Documents
End If
Return objDocumentsSettings
- End Function
+ End Function
#End Region
-
+
#Region " Web Form Designer Generated Code "
-
- 'This call is required by the Web Form Designer.
+
+ 'This call is required by the Web Form Designer.
Private Sub InitializeComponent()
End Sub
@@ -578,10 +580,10 @@ Namespace DotNetNuke.Modules.Documents
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
- End Sub
-
+ End Sub
+
#End Region
-
+
Private Sub lnkChange_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lnkChange.Click
lblOwner.Visible = False
lnkChange.Visible = False
@@ -612,21 +614,14 @@ Namespace DotNetNuke.Modules.Documents
End Sub
Private Sub PopulateOwnerList()
- ' populate owner list
- lstOwner.DataSource = UserController.GetUsers(False, False, PortalId).Cast(Of UserInfo).OrderBy(Function(i As UserInfo) i.DisplayName)
-
- lstOwner.DataTextField = "DisplayName"
- lstOwner.DataValueField = "UserId"
-
- lstOwner.DataBind()
-
- ' .GetUsers doesn't return super-users, but they can own documents
- ' so add them to the list
- Dim objSuperUser As DotNetNuke.Entities.Users.UserInfo
- For Each objSuperUser In UserController.GetUsers(Null.NullInteger)
- lstOwner.Items.Insert(0, New System.Web.UI.WebControls.ListItem(objSuperUser.DisplayName, objSuperUser.UserID.ToString))
- Next
-
+ ' populate owner list
+ lstOwner.DataSource = UserController.GetUsers(PortalId).Cast(Of UserInfo).Distinct().OrderBy(Function(i As UserInfo) i.DisplayName)
+
+ lstOwner.DataTextField = "DisplayName"
+ lstOwner.DataValueField = "UserId"
+
+ lstOwner.DataBind()
+
lstOwner.Items.Insert(0, New System.Web.UI.WebControls.ListItem(Services.Localization.Localization.GetString("None_Specified"), "-1"))
'' End With
End Sub