Imports System.Globalization
Imports System.Threading

Module Init

	ReadOnly Property getDB()
		Get
            Return "server=5.199.135.228\sqlexpress,2303; initial catalog=atsunami.cz; user id=Tsunami; password=Studio#914;"
        End Get
	End Property


    ''' <summary>
    ''' Hlavní inicializace proměnných a zjištění jestli je uživatel přihlášen.
    ''' </summary>
    ''' <remarks></remarks>
    Sub Initialize()

		If Not HttpContext.Current.Server.MapPath("").Contains("Projekty") And Not HttpContext.Current.Server.MapPath("").Contains("Dropbox") Then

            _PathAdminRelative = "http://admin.atsunami.cz"
            _PathFotoRelative = "http://www.atsunami.cz/Foto"
            _PathFoto = "C:\Web\tanecek\atsunami.cz\Web\foto"
            _PathAdmin = "C:\Web\tanecek\atsunami.cz\Web\admin"
            _Path = "C:\Web\tanecek\atsunami.cz\Web"

        Else

			Dim sPath As String = HttpContext.Current.Server.MapPath("/").Replace("\_Admin\Admin", "\_Web")

			_PathAdminRelative = "http://localhost:17330"
			_PathFotoRelative = "http://localhost:17330/Foto"
			_PathFoto = sPath & "\www\foto"
			_PathAdmin = sPath & "\admin"
			_Path = sPath & "\www"

			_Path = _Path.Replace("\\", "\")
			_PathFoto = _PathFoto.Replace("\\", "\")
			_PathAdmin = _PathAdmin.Replace("\\", "\")


			'_UserID = "1"
			'_UserName = "admin"

		End If



		If _UserID = "" Then 'Pokud neni uzivatel prihlasen, tak na hlavni stranu

			If Not HttpContext.Current.Request.Url.ToString.Contains(_PathAdminRelative & "/Prihlasit.aspx") Then 'pokud uz na hlavni strane neni

				HttpContext.Current.Response.Redirect(_PathAdminRelative & "/Prihlasit.html")

			End If
		End If

	End Sub



End Module
