403Webshell
Server IP : 209.209.40.120  /  Your IP : 216.73.217.112
Web Server : Microsoft-IIS/10.0
System : Windows NT NEWWWW 10.0 build 17763 (Windows Server 2019) i586
User : NEWWWW$ ( 0)
PHP Version : 8.3.30
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/Program Files (x86)/Mail Enable/Bin/NETWebMail/SignUp/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/Program Files (x86)/Mail Enable/Bin/NETWebMail/SignUp/default.aspx
<%@ Page Language="vb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="vb" runat="server">
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
    ' Module: Signup Page
    ' 
    ' MailEnable Pty. Ltd. 2018-2021
    ' Note: This signup utility requires MailEnable Professional or MailEnable Enterprise Edition
    ' Licensing: You are free to change, modify, extend and integrate this code 
    ' It is recommended that you use external CSS and Javascript to modify/extend (rather than directly editing this file) because this file will be
    ' replaced when you upgrade the MailEnable software
    '
    ' If you wish to host this file outside it's default location on another IIS site you will need to copy the DLLs from the NETWebMail/Bin directory to your application.
    '
    ' To test:
    ' - The site needs to run under an account that has full permissions to the MailEnable directories (see IME_ADMIN Windows user permissions on the MailEnable directories to compare)
    '   
    ' - This is intended as base framework only. You should ensure that the page is properly secured before you allow public sign-ins.
    '
    ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''    
    Public oSettings As SignUpSettings = Nothing 'Constructed via serialization

    Public Class SignUpSettings
        Public DefaultMailboxQuota As Integer = -1       'default mailbox quota in kb
        Public ReferrerIPs As String = ""
        Public bPreAuthenticate As Boolean
        Public PageTitle As String
        Public MsgHeadingTitle As String
        Public RecaptchaEnabled As Boolean
        Public RecaptchaSiteKey As String
        Public RecaptchaSecret As String

        Public ActionButtonLabel As String
        Public MsgWelcome As String
        Public MsgInstruction As String
        Public SignUpPostoffice As String
        Public CSSURL As String                     ' URL path to CSS used to mark up page
        Public JSURL As String                      ' URL for Javascript Include
        Public JQueryURL As String                  ' Used to load jQuery
        Public DefaultSignUpPostoffice As String    ' Name of the postoffice to which people will be able to sign up (leave as empty string if we want to list all domains)    
        Public DefaultDomainName As String          ' last resort used incase there are no domains specified

        Public DomainList As New System.Collections.Generic.List(Of String) ' This is a list of all the domains that allow Auto-Signup    
        Public RedirectURL As String        ' URL to redirect after signup
        Public bPostCredentials As Boolean  ' Determines whether credentials are passed as URL parameters
        Public Signup_Base As String        ' This should be Mondo (unless you have created a custom webmail base)
        Public Signup_SkinName As String    ' This should be the name of the skin associated with the default base
        Public Webmail_Skin As String       ' This is the name of the skin that should be used when the user is redirected to their login page (or whatever the referred page is)
        Public RelativeBaseURL As String    ' This determines the relative BaseURL for the redirected target. eg: "/mewebmail or Application("MEWebAdminPath")
        Public DefaultLanguage As String
        '
        ' Send Limitations
        '
        Public EnableSendLimit As Boolean
        Public SendLimit As Integer
        Public DemoAccount As Boolean
        Public CanSend As Boolean
        Public AllowAutoResponser As Boolean
        Public AllowFilters As Boolean
        Public NoteText As String

        Public DomainNameLabel As String
        Public MailboxLabel As String
        Public PasswordLabel As String
        Public ConfirmPasswordLabel As String
        '
        ' Additional Considerations configuring Users
        '
        'Public Disclaimer As String
        'Public TermsOfUseURL As String    
        'Public AlternateEmail As String
        'Public AlternalteEmailConfirm As Boolean   'Send an e-mail asking for confirmation to an alternate address
        'Public UseBlacklist As Boolean = False     'Use SMTP Blacklist to Ban        
        'Public AdminEmailNotifyOnSignUp As Boolean 'Determines whether to notify the administrator on signup
        'Public AdminEmailAddress As String ' The e-mail address of the system administrator (whom may be notified on signup)

        Public Sub LoadDefaults()
            '
            ' Sets the defaults when we load a new serialization. If you make changes, remember this will be overwritten
            ' when you upgrade MailEnable
            '
            DefaultMailboxQuota = -1
            ReferrerIPs = ""
            PageTitle = "Account Sign-Up"
            MsgHeadingTitle = "Account Sign-Up"
            RecaptchaEnabled = True
            RecaptchaSiteKey = "6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI" 'Google Test Keys : https://developers.google.com/recaptcha/docs/faq
            RecaptchaSecret = "6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe" 'Google Test Keys
            MsgWelcome = "Welcome to the Account Sign-Up Wizard. This wizard allows you to create a mail account that can be used to send and receive e-mail."
            MsgInstruction = "Please select the username/mailbox name:"
            SignUpPostoffice = ""
            CSSURL = ""   'URL path to CSS used to mark up page
            DefaultSignUpPostoffice = "" ' Name of the postoffice to which people will be able to sign up (leave as empty string if we want to list all domains)    
            DefaultDomainName = ""  ' last resort used incase there are no domains specified                
            RedirectURL = "" 'webmail URL to redirect to after creating mailbox 
            bPostCredentials = False 'Determines whether credentials are passed as URL parameters
            Signup_Base = "Mondo" ' This should be Mondo (unless you have created a custom webmail base)
            Signup_SkinName = "Default" 'This should be the name of the skin associated with the default base
            Webmail_Skin = "Default" ' This is the name of the skin that should be used when the user is redirected to their login page (or whatever the referred page is)
            RelativeBaseURL = "" ' This determines the relative BaseURL for the redirected target. eg: "/mewebmail or Application("MEWebAdminPath")
            DefaultLanguage = "en"
            EnableSendLimit = True  ' Enforce Message Send Limit
            SendLimit = 20          ' 20 messages (per hour, unless otherwise configured)
            DemoAccount = False     ' Enables as demo account (which prevents changing/saving dubious settings)
            CanSend = True
            AllowAutoResponser = False
            AllowFilters = False
            ActionButtonLabel = "Create Account"
            NoteText = "When you login, you must append the domain after the mailbox name. e.g.: mailbox@example.com."
            DomainNameLabel = "Domain"
            MailboxLabel = "Mailbox"
            PasswordLabel = "Password"
            ConfirmPasswordLabel = "Confirm Password"
            CSSURL = "signup.css"
            JSURL = ""
            JQueryURL = "https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
        End Sub

        Public Shared Function Load(ByVal sConfigPath As String) As SignUpSettings
            Dim ser As New System.Xml.Serialization.XmlSerializer(GetType(SignUpSettings), "mailenable:signup")
            If System.IO.File.Exists(sConfigPath) Then
                Dim reader As System.IO.TextReader = Nothing
                Try
                    reader = New System.IO.StreamReader(sConfigPath)
                    Load = ser.Deserialize(reader)
                    reader.Close()
                Catch ex As Exception
                    If Not reader Is Nothing Then
                        reader.Close()
                    End If
                    Load = New SignUpSettings()
                    Load.LoadDefaults() ' load empty configuration (maybe call constructor to preload)
                End Try
            Else
                Load = New SignUpSettings()
                Load.LoadDefaults() ' load empty configuration (maybe call constructor to preload)
            End If
        End Function

        Public Sub Save(ByVal sConfigPath As String)
            'Serializes the item to disk
            Dim ser As New System.Xml.Serialization.XmlSerializer(GetType(SignUpSettings), "mailenable:signup")
            Dim writer As System.IO.TextWriter = New System.IO.StreamWriter(sConfigPath)
            ser.Serialize(writer, Me)
            writer.Close()
        End Sub

        Sub New()

        End Sub

        Sub LoadSettings(ByVal oRequest As HttpRequest, ByVal oSession As HttpSessionState)
            '
            ' This function defines the configuration settings for signup
            '
            DefaultMailboxQuota = -1                                                                  ' Set unlimited quota for new mailboxes
            ReferrerIPs = ""                                                                         ' This variable is optionally checked (If not blank) to ensure that the user has read your terms and conditions and has been directed from the correct server. List is comma delimited.
            '
            ' Configure any supplied postoffice
            '
            SignUpPostoffice = oSession("Signup_Postoffice")
            If String.IsNullOrEmpty(SignUpPostoffice) Then
                ' We may override this with a default so that we do not list all the domains on the system - we could optionally read it from the request object as well
                SignUpPostoffice = DefaultSignUpPostoffice
                oSession("Signup_Postoffice") = SignUpPostoffice ' Write it back successive requests remember
            End If
            '
            ' Load and determine any Redirected URL settings
            '				
            If String.IsNullOrEmpty(RedirectURL) Then
                If String.IsNullOrEmpty(RelativeBaseURL) Then
                    RelativeBaseURL = MailEnable.WebPath.GetVirtualDirectoryName(oRequest, Signup_Base, "") & "/"
                End If
                RedirectURL = RelativeBaseURL & Signup_Base & "/lang/sys/login.aspx"      ' Web URL to redirect the user to once registered	
            End If
        End Sub


        Public Shared Function AllowSignup() As Boolean
            '
            ' You need to set SignUp Status to 1 in the registry to enable this feature
            '
            Return MailEnable.Administration.GetRegistryLong("SOFTWARE\Mail Enable\Mail Enable", "SignUp Status", 0, "") = 1
        End Function


        Function LoadDomains() As Integer
            If DomainList.Count = 0 Then
                '
                ' If we did not denote domains to signup with, then we will populate the list ourselves
                '
                Using oDomain As New MailEnable.Administration.Domain
                    oDomain.AccountName = DefaultSignUpPostoffice
                    oDomain.DomainName = ""
                    oDomain.Status = -1
                    oDomain.DomainRedirectionHosts = ""
                    oDomain.DomainRedirectionStatus = -1
                    If oDomain.FindFirstDomain = 1 And oDomain.DomainRedirectionStatus <> 1 Then
                        DefaultDomainName = oDomain.DomainName
                        Do
                            DomainList.Add(oDomain.DomainName)
                            oDomain.AccountName = DefaultSignUpPostoffice
                            oDomain.DomainName = ""
                            oDomain.Status = -1
                            oDomain.DomainRedirectionHosts = ""
                            oDomain.DomainRedirectionStatus = -1
                        Loop While (oDomain.FindNextDomain = 1)
                    End If
                    oDomain.FindClose()
                End Using
            End If
            If DomainList.Count > 0 Then
                DefaultDomainName = DomainList.Item(0)
            End If
            Return DomainList.Count
        End Function

        Function WriteDomainSelector(Optional ByVal sName As String = "DomainName", Optional ByVal sId As String = "ddlDomainName") As String

            Dim sDomainName As String = ""

            WriteDomainSelector = "<select id=""" & sId & """ name=""" & sName & """ onchange=""SelectDomain()"">"
            For Each sDomainName In DomainList
                WriteDomainSelector &= "<option value=""" & sDomainName & """>" & sDomainName & "</option>"
            Next
            WriteDomainSelector &= "</select>"

        End Function

        Function DomainSignUpPermitted(ByVal sDomain As String) As Boolean
            '
            ' Checks the domain list to determine if the submitted domain is within our list
            '
            Return DomainList.Contains(sDomain)
        End Function
    End Class

    Public Prompt As String
    Public FrmMailbox As String
    Public FrmPassword As String
    Public FrmConfirmPassword As String
    Public FrmDomainName As String
    Public RecaptchaResponse As String = ""


    Function VerifyRecaptcha(ByVal SecretKey As String, ByVal RecaptchaClientResponse As String, ByVal RemoteIP As String) As Boolean
        If Not String.IsNullOrEmpty(RecaptchaClientResponse) Then
            Dim sCaptchaRequest As String = "https://www.google.com/recaptcha/api/siteverify?secret=" + SecretKey + "&response=" + RecaptchaClientResponse + "&remoteip=" + RemoteIP
            'Response.Write("<!-- Request:" & sCaptchaRequest & "-->")
            Dim req As System.Net.HttpWebRequest = System.Net.WebRequest.Create(sCaptchaRequest)
            Dim ResponseFromServer As String = ""
            Using resp As System.Net.WebResponse = req.GetResponse()
                Using dataStream As System.IO.Stream = resp.GetResponseStream()
                    If Not dataStream Is Nothing Then
                        Using reader As System.IO.StreamReader = New System.IO.StreamReader(dataStream)
                            ResponseFromServer = reader.ReadToEnd()
                        End Using
                    End If
                End Using
            End Using
            'Response.Write("<!-- Response:" & ResponseFromServer.ToLower & "-->")
            VerifyRecaptcha = Not ResponseFromServer.ToLower().Contains("""success"": false")
        Else
            VerifyRecaptcha = False 'Was not checked
        End If
    End Function

    Public Shared Function GetIPAddress(ByVal oRequest As System.Web.HttpRequest) As String
        Dim sIPAddress As String = oRequest.ServerVariables("HTTP_X_FORWARDED_FOR")
        If String.IsNullOrEmpty(sIPAddress) Then
            Return oRequest.ServerVariables("REMOTE_ADDR")
        Else
            Dim ipArray As String() = sIPAddress.Split(New [Char]() {","c})
            Return ipArray(0)
        End If
    End Function

    Public Function GetSignUpToken() As String
        Dim sToken As String = Session("SignUpToken")
        If String.IsNullOrEmpty(sToken) Then
            sToken = System.Guid.NewGuid().ToString("N")
            Session("SignUpToken") = sToken
        End If
        Return sToken
    End Function

    Public Function SetDefaults(ByVal Postoffice As String, ByVal Mailbox As String) As Boolean
        SetDefaults = True
        Try
            Dim sMailConfigDirectory As String = MailEnable.Administration.GetMailConfigDirectory()
            Dim PostOfficeDefaultMailboxConfigFile As New System.IO.FileInfo(sMailConfigDirectory & "\postoffices\" & Postoffice & "\mailbox.sys")
            If PostOfficeDefaultMailboxConfigFile.Exists Then
                PostOfficeDefaultMailboxConfigFile.CopyTo(sMailConfigDirectory & "\postoffices\" & Postoffice & "\mailboxes\" & Mailbox & ".sys")
            End If
        Catch ex As Exception
            SetDefaults = False
        End Try
    End Function

    Function IsValidSubmission() As Boolean
        Dim sFrmToken As String = Request("SignUpToken")
        IsValidSubmission = (sFrmToken = GetSignUpToken())
    End Function

    Function SerializeViolation(ByVal arrPolicyErrors As MailEnable.Administration.PasswordPolicy.PasswordPolicyViolations) As String
        SerializeViolation = ""
        For Each sItem As MailEnable.Administration.PasswordPolicy.PasswordPolicyReason In arrPolicyErrors
            If Not String.IsNullOrEmpty(SerializeViolation) Then
                SerializeViolation &= ","
            End If
            SerializeViolation &= sItem.ToString
        Next
    End Function

    Function GetDomainPostoffice(ByVal sDomainName As String) As String

        'Set the key lookup fields
        Using oDomain As New MailEnable.Administration.Domain
            With oDomain
                .AccountName = ""
                .AliasName = ""
                .DomainName = sDomainName
                .Status = -1
                .DomainRedirectionHosts = ""
                .DomainRedirectionStatus = -1
                If .GetDomain() Then
                    GetDomainPostoffice = .AccountName
                Else
                    GetDomainPostoffice = ""
                End If
            End With
        End Using
    End Function

    Sub Page_Load(sender As Object, e As EventArgs)
        Response.CacheControl = "no-cache"
        Response.AddHeader("Pragma", "no-cache")
        Response.Expires = True
        Response.ExpiresAbsolute = Now
        If SignUpSettings.AllowSignup() Then

            oSettings = SignUpSettings.Load(MailEnable.Administration.GetMailConfigDirectory() & "\signup.xml")
            '
            ' Load domain list - since we will need them for the form as well as verifying that the submitted domain is permitted for auto-signup
            '
            If oSettings.DomainList.Count = 0 Then
                oSettings.LoadDomains()
                oSettings.LoadSettings(Request, Session)
                oSettings.Save(MailEnable.Administration.GetMailConfigDirectory() & "\signup.xml")
            Else
                If Not oSettings.DomainList.Contains(oSettings.DefaultSignUpPostoffice) And oSettings.DomainList.Count > 0 Then
                    oSettings.DefaultDomainName = oSettings.DomainList(0)
                End If
            End If

            '
            ' We need to check for a form action before we show the form
            '
            Dim bCreated As Boolean = False
            If Request("FormAction") = "Create Account" Then
                '
                ' We will need to gate these to determine whether we allow them to be configured or not.
                ' Write a token into the request page so that we ensure that a robot cannot submit.

                Dim bValidSubmission As Boolean = IsValidSubmission()

                If bValidSubmission Then

                    If oSettings.RecaptchaEnabled Then
                        bValidSubmission = VerifyRecaptcha(oSettings.RecaptchaSecret, Request("g-recaptcha-response"), GetIPAddress(Request))
                    End If

                    If bValidSubmission Then
                        FrmMailbox = Request("Mailbox")
                        FrmDomainName = Request("DomainName")
                        FrmPassword = Request("Password")
                        FrmConfirmPassword = Request("ConfirmPassword")

                        '				
                        ' Ensure that the DomainName is within the list of domains we permitted for signup
                        '
                        oSettings.SignUpPostoffice = GetDomainPostoffice(FrmDomainName)

                        bValidSubmission = CBool(oSettings.SignUpPostoffice.Length > 0)

                        If bValidSubmission Then
                            bValidSubmission = oSettings.DomainSignUpPermitted(FrmDomainName)
                            Prompt = "Auto-signup not available to that domain. "
                        Else
                            Prompt = "No postoffice found for domain. "
                        End If

                        If Not ValidMailboxName(FrmMailbox) Then
                            bValidSubmission = False
                            Prompt = "Invalid mailbox name. "
                        End If

                        If bValidSubmission Then
                            '
                            ' We need to get the postoffice/account from the supplied domain name
                            '
                            Dim FrmPostoffice As String = oSettings.SignUpPostoffice
                            Dim FrmLoginID As String = FrmMailbox & "@" & oSettings.SignUpPostoffice

                            ' We can actually attempt to create the account
                            ' First we need to determine if the mail account already exists
                            If Not String.IsNullOrEmpty(FrmMailbox) And Not String.IsNullOrEmpty(FrmDomainName) And Not String.IsNullOrEmpty(FrmPassword) Then

                                '
                                ' Use the domain name to determine which postoffice should own the login, etc
                                '

                                If Not String.IsNullOrEmpty(oSettings.SignUpPostoffice) Then
                                    '
                                    ' Lets check the password policy
                                    '
                                    Dim bMeetsPasswordPolicy As Boolean = True
                                    Dim arrPolicyErrors As MailEnable.Administration.PasswordPolicy.PasswordPolicyViolations = Nothing
                                    If MailEnable.Administration.PasswordPolicy.PasswordPolicyStatus = True Then
                                        Dim oPasswordPolicy As New MailEnable.Administration.PasswordPolicy
                                        oPasswordPolicy.Load()
                                        arrPolicyErrors = oPasswordPolicy.ValidatePasswordPolicy(FrmPassword, oSettings.SignUpPostoffice, FrmMailbox)
                                        bMeetsPasswordPolicy = arrPolicyErrors.Count = 0
                                    End If

                                    If bMeetsPasswordPolicy Then
                                        Using oLogin As New MailEnable.Administration.Login
                                            oLogin.Account = FrmPostoffice
                                            oLogin.LastAttempt = -1
                                            oLogin.LastSuccessfulLogin = -1
                                            oLogin.LoginAttempts = -1
                                            oLogin.Password = ""
                                            oLogin.Rights = ""
                                            oLogin.Status = -1
                                            oLogin.UserName = FrmMailbox & "@" & FrmPostoffice
                                            If oLogin.GetLogin <> 1 Then
                                                oLogin.LastAttempt = 0
                                                oLogin.LastSuccessfulLogin = 0
                                                oLogin.LoginAttempts = 0
                                                oLogin.Password = FrmPassword
                                                oLogin.Rights = "USER"
                                                oLogin.Status = 1
                                                ' Since the mailbox name is available then we need to create the login
                                                If oLogin.AddLogin = 1 Then
                                                    ' Next we need to create the mailbox itself
                                                    '
                                                    Using oMailbox As New MailEnable.Administration.Mailbox
                                                        oMailbox.Postoffice = FrmPostoffice
                                                        oMailbox.MailboxName = FrmMailbox
                                                        oMailbox.RedirectAddress = ""
                                                        oMailbox.RedirectStatus = 0
                                                        oMailbox.Size = 0
                                                        oMailbox.Limit = oSettings.DefaultMailboxQuota
                                                        oMailbox.Status = 1
                                                        If oMailbox.AddMailbox = 1 Then
                                                            ' Copy default mailbox options
                                                            SetDefaults(oMailbox.Postoffice, oMailbox.MailboxName)
                                                            '
                                                            ' Override any explicit limits
                                                            '
                                                            If oSettings.EnableSendLimit Then
                                                                oMailbox.SetMailboxStringValue("SMTP-Inbound-Message-UsageRestrictionEnabled", "1")
                                                                oMailbox.SetMailboxStringValue("SMTP-Inbound-Message-UsageRestriction", CStr(oSettings.SendLimit))
                                                            End If
                                                            'Set as demo account                                        
                                                            If oSettings.DemoAccount Then
                                                                oMailbox.SetMailboxStringValue("Webmail-IsDemoAccount", "1")
                                                            End If
                                                            If Not oSettings.CanSend Then
                                                                oMailbox.SetMailboxStringValue("Webmail-Priv-CanSend", "0")
                                                            End If
                                                            If Not oSettings.AllowAutoResponser Then
                                                                oMailbox.SetMailboxStringValue("Webmail-Priv-CanConfigureAutoResponder", "0")
                                                            End If
                                                            If Not oSettings.AllowFilters Then
                                                                oMailbox.SetMailboxStringValue("Webmail-Filtering", "0")
                                                            End If

                                                            '
                                                            ' Ensure that postoffice exists in the Message Store
                                                            '
                                                            Try
                                                                System.IO.Directory.CreateDirectory(MailEnable.Administration.GetMailRoot() & "\" & FrmPostoffice & "\MAILROOT\" & FrmMailbox)
                                                            Catch ex As Exception

                                                            End Try

                                                            Try
                                                                '
                                                                ' Create essential folders for the mailbox
                                                                '
                                                                Dim oPOPFolders As New MailEnable.MailFolders

                                                                oPOPFolders.InitialiseFolders(FrmPostoffice, FrmMailbox, FrmPassword)
                                                                Session.Item("POSTOFFICE_ROOT_PATH") = oPOPFolders.PostofficeRootPath
                                                                oPOPFolders = Nothing
                                                            Catch ex As Exception
                                                            End Try

                                                            MailEnable.WebRequest.SetSessionKey(Request, Response, Session)



                                                            oMailbox.SetMailboxStringValue("DisplayName", FrmMailbox)
                                                            oMailbox.SetMailboxStringValue("DefaultAddress", FrmMailbox & "@" & FrmDomainName)

                                                            ' We need to assign address map(s) for the mailbox							
                                                            Using oAddressMap As New MailEnable.Administration.AddressMap
                                                                oAddressMap.Account = FrmPostoffice
                                                                oAddressMap.DestinationAddress = "[SF:" & FrmPostoffice & "/" & FrmMailbox & "]"
                                                                oAddressMap.SourceAddress = "[SMTP:" & FrmMailbox & "@" & FrmDomainName & "]"
                                                                oAddressMap.Scope = 0
                                                                If oAddressMap.AddAddressMap = 1 Then
                                                                    '
                                                                    ' Address Map was added too
                                                                    '
                                                                    bCreated = True
                                                                Else
                                                                    Prompt = "Unable to allocate user address."
                                                                End If
                                                            End Using

                                                        Else
                                                            Prompt = "Unable to create user mailbox."
                                                        End If
                                                    End Using

                                                Else
                                                    Prompt = "Unable to create user login."
                                                End If
                                            Else
                                                ' We need to inform the user that their mailbox creation failed
                                                Prompt = "The mailbox name " & oLogin.UserName & " you specified is not available. Please try another mailbox name."
                                            End If
                                        End Using


                                        If bCreated Then
                                            Dim sTargetParameters As String = ""
                                            If Not oSettings.RedirectURL.Contains("?") Then
                                                oSettings.RedirectURL &= "?"
                                            Else
                                                oSettings.RedirectURL &= "&"
                                            End If
                                            oSettings.RedirectURL &= "UserID=" & FrmLoginID
                                            If oSettings.bPostCredentials Then
                                                sTargetParameters &= "&Method=Auto&Password=" & FrmPassword & "&LanguageID=" & oSettings.DefaultLanguage & "&Skin=" & oSettings.Webmail_Skin
                                            End If
                                            Response.Redirect(oSettings.RedirectURL & sTargetParameters)
                                            Response.End()
                                        End If
                                    Else
                                        Prompt = "This password is too simple. "
                                        Prompt &= "Reason: " & SerializeViolation(arrPolicyErrors)
                                    End If
                                Else
                                    Prompt = "SignupPostoffice is not configured."
                                End If
                            Else
                                Prompt &= "Please re-enter your details to continue."
                            End If
                        Else
                            Prompt &= "Please re-enter your details to continue."
                        End If
                    Else
                        Prompt = "Google ReCAPTCHA validation failed."
                    End If
                Else
                    Prompt = "Invalid Session Token."
                End If
            Else
                If oSettings.ReferrerIPs <> "" Then
                    If InStr(1, oSettings.ReferrerIPs, Request.ServerVariables("REMOTE_ADDR")) <= 0 Then
                        Response.Write("You must accept terms and conditions before you can access this page.")
                        Response.End()
                    End If
                End If
            End If
        Else
            '
            ' Signups are not allowed
            '
            Response.StatusCode = 403
            Response.StatusDescription = "403 Forbidden"
            Response.End()
        End If
    End Sub

    Function ValidMailboxName(ByVal SName As String) As Boolean

        If String.IsNullOrEmpty(SName) Then
            Return False
        End If

        Dim nCount As Short

        If Left(SName, 1) = "." Or Right(SName, 1) = "." Then
            Return False
        End If

        For nCount = 1 To SName.Length()
            If InStr(1, "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890-._$", Mid(SName, nCount, 1)) = 0 Then
                'not a valid character for a domain
                Return False
            End If
        Next nCount

        If InStr(1, ",CON,AUX,COM1,COM2,COM3,COM4,LPT1,LPT2,LPT3,PRN,NUL,", "," & SName & ",", CompareMethod.Text) > 0 Then
            Return False
        End If

        Dim sTemp As String

        If Len(SName) > 3 Then
            sTemp = Left(SName, 4)

            If InStr(1, ",CON.,AUX.,PRN.,NUL.,", "," & sTemp & ",", CompareMethod.Text) > 0 Then
                Return False
            End If

            If Len(SName) > 4 Then
                sTemp = Left(SName, 5)
                If InStr(1, ",COM1.,COM2.,COM3.,COM4.,LPT1.,LPT2.,LPT3.,", "," & sTemp & ",", CompareMethod.Text) > 0 Then
                    Return False
                End If
            End If

        End If

        Return True

    End Function


</script>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title><%=oSettings.PageTitle%></title>
		<meta http-equiv="content-type" content="text/html;charset=iso-8859-1"/>
		<meta http-equiv="Expires" content="0"/>
		<meta http-equiv="Pragma" content="no-cache"/>
		<meta http-equiv="Cache-Control" content="no-cache"/>
        <%If oSettings.RecaptchaEnabled Then%>
        <script type="text/javascript" src="https://www.google.com/recaptcha/api.js" async defer></script>
        <%End If %>
        <%If Not String.IsNullOrEmpty(oSettings.JQueryURL) Then%>
            <script src="<%=oSettings.JQueryURL%>"></script>
        <%End If%>
        <%If Not String.IsNullOrEmpty(oSettings.JSURL) Then%>
        <script type="text/javascript" src="<%=oSettings.JSURL%>"></script>
        <%End If %>
        <%If Not String.IsNullOrEmpty(oSettings.CSSURL) Then%>
	        <link rel="stylesheet" type="text/css" href="<%=oSettings.CSSURL%>"/>
        <%End If %>
    </head>
    <body>
        <div class="login_bg">
            <div id="js_login_shell" class="login_shell" >
                <div class="login_panel">
	                <form method="post" id="SignUp" name="SignUp" onsubmit="return ValidateForm(document.SignUp);" action="default.aspx">
		                <center>
		                <table id="login_header" class="tbl_panel">
		                <tr><td><div class="login_header_banner"></div><div class="login_header_title"><%=oSettings.MsgHeadingTitle%></div></td>
		                </tr>
		                </table>
		                <table id="login_welcome" class="tbl_panel">
		                <tr>
			                <td class="ME_StandardText">
                                <% If Not String.IsNullOrEmpty(oSettings.MsgWelcome) Then%>
				                    <div id="dvWelcome"><%=oSettings.MsgWelcome%></div>
                                <%End If %>
                                <% If Not String.IsNullOrEmpty(oSettings.MsgInstruction) Then%>
				                    <div id="dvInstruction"><%=oSettings.MsgInstruction%></div>
                                <%End If %>				                
			                </td>
		                </tr>
		                </table>
		                </center>
		                <center>
                        <%If oSettings.DomainList.Count > 1 Then %>
		                    <table class="tbl_panel signup_input">
		                    <tr>
			                    <td class="tbl_td_label"><%=oSettings.DomainNameLabel%>:</td>
			                    <td colspan="3">
			                    <%=oSettings.WriteDomainSelector("DomainName", "ddlDomainName")%>
			                    </td>
		                    </tr>
                            </table>
                        <%Else%>
                            <input name="DomainName" type="hidden" value="<%=oSettings.DefaultDomainName%>" />
                        <%End If%>
                        <table class="tbl_panel signup_input">
		                <tr>
			                <td class="tbl_td_label"><%=oSettings.MailboxLabel%>:</td>
			                <td class="tbl_td_label"><input id="txtMailbox" name="Mailbox" class="tbl_input" autocomplete="username" onchange="ValidateMailboxName()" value="<%=Server.HtmlEncode(FrmMailbox)%>"/></td>
                            <td width="10"><div>@</div></td>
                            <td width="*"><div id="txtPostoffice"><%=Server.HtmlEncode(oSettings.DefaultDomainName)%></div></td>
		                </tr>
		                <tr>
			                <td class="tbl_td_label"><%=oSettings.PasswordLabel%>:</td>
			                <td colspan="3"><input id="txtPassword" type="password" class="tbl_input" name="Password" autocomplete="new-password" value="<%=Server.HtmlEncode(FrmPassword)%>"/></td>
		                </tr>
		                <tr>
			                <td class="tbl_td_label"><%=oSettings.ConfirmPasswordLabel%>:</td>
			                <td colspan="3"><input id="txtConfirm" type="password" class="tbl_input" name="ConfirmPassword" autocomplete="new-password" value="<%=Server.HtmlEncode(FrmConfirmPassword)%>"/></td>
		                </tr>
		                </table>
		                </center>
		                <center>
		                <table  class="tbl_panel" id="login_note">
		                <tr>
			                <td>
                            <div id="divNote">
			                <%
                                ' Show any note text
                                If Not String.IsNullOrEmpty(oSettings.NoteText) Then
                                    Response.Write(oSettings.NoteText)
                                End If

                                ' Show any errors if they have been set
                                If Not String.IsNullOrEmpty(Prompt) Then
                                    Response.Write("<div id=""divPrompt"">" & Prompt & "</div>")
                                End If
			                %>
                            </div>
			                </td>
		                </tr>
		                </table>
		                <br/>
		                <table class="tbl_panel">
		                <tr>
                            <%If oSettings.RecaptchaEnabled Then%>
                            <td><div class="g-recaptcha" data-sitekey="<%=oSettings.RecaptchaSiteKey%>"></div></td>
                            <%End If %>
			                <td align="right"><input name="FormAction" type="submit" class="login_btn" value="<%=oSettings.ActionButtonLabel%>" style="cursor:pointer"/></td>
		                </tr>
		                </table>

		                </center>
                        <input name="SignUpToken" type="hidden" value="<%=GetSignUpToken()%>" />
	                </form>


		                
                </div>

            </div>
        </div>

	    <script type="text/javascript" language="javascript">
	    <!--
	        function ValidateForm() {
	            if (ValidateMailboxName()) {
	                if (document.getElementById("txtPassword").value.length < 6) {
	                    alert("Please specify a valid password. Passwords cannot be blank and must contain at least 6 characters.");
	                    return false;
	                }
	                if (document.getElementById("txtPassword").value != window.document.all("txtConfirm").value) {
	                    alert("Your password and confirmed password do not match. Please re-enter.");
	                    return false;
	                }

                    <%If oSettings.RecaptchaEnabled Then %>
                        if (!RecaptchaValidated()) {
	                        alert("Please validate Recaptcha.");
                            return false;
                        }
                    <%End If %>
	                return true;
	            }
                return false;
	        }

	        function RecaptchaValidated() {
                var o = document.getElementById("g-recaptcha-response");
                if (o && o.value.length > 0)  {
                    return true;
                }
                return false;
            }

	        function SelectDomain() {
	            var e = document.getElementById("ddlDomainName");
	            if (e) {
	                var strDomain = e.options[e.selectedIndex].value;
	                document.getElementById("txtPostoffice").innerHTML = strDomain;	                
	            }
	            return false;
	        }

	        function ValidateMailboxName() {
	            if (document.getElementById("txtMailbox").value.length <= 0) {
                    alert("Please specify a mailbox name for your account.");
	                return false;
	            }
	            return true;
	        }

	    //-->
	    </script>
    </body>
</html>

Youez - 2016 - github.com/yon3zu
LinuXploit