CreateGlobalDefaultBootMenu() public method

public CreateGlobalDefaultBootMenu ( ) : void
return void
Beispiel #1
0
    protected void CreateStandardMenu()
    {
        var listSettings = new List <Models.Setting>
        {
            new Models.Setting
            {
                Name  = "Ipxe Requires Login",
                Value = chkIpxeLogin.Checked.ToString(),
                Id    = Setting.GetSetting("Ipxe Requires Login").Id
            },
        };

        Setting.UpdateSetting(listSettings);

        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
        var pxeMode         = Settings.PxeMode;

        if (pxeMode.Contains("grub"))
        {
            defaultBootMenu.GrubUserName = txtGrubUsername.Text;
            defaultBootMenu.GrubPassword = txtGrubPassword.Text;
        }
        else
        {
            defaultBootMenu.DebugPwd = consoleSha.Value;
            defaultBootMenu.AddPwd   = addcomputerSha.Value;
            defaultBootMenu.OndPwd   = ondsha.Value;
            defaultBootMenu.DiagPwd  = diagsha.Value;
        }
        defaultBootMenu.Kernel    = ddlComputerKernel.SelectedValue;
        defaultBootMenu.BootImage = ddlComputerBootImage.SelectedValue;
        defaultBootMenu.Type      = "standard";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
Beispiel #2
0
    protected void CreateProxyMenu()
    {
        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
        defaultBootMenu.Kernel = "4.5";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type = "bios";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel = "4.5";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type = "efi32";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel = "4.5x64";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type = "efi64";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
Beispiel #3
0
    protected void CreateStandardMenu()
    {
        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();

        defaultBootMenu.Kernel    = "4.5x64";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type      = "standard";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
Beispiel #4
0
    protected void CreateProxyMenu()
    {
        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();

        defaultBootMenu.Kernel    = "4.5";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type      = "bios";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel    = "4.5";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type      = "efi32";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel    = "4.5x64";
        defaultBootMenu.BootImage = "initrd.xz";
        defaultBootMenu.Type      = "efi64";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
Beispiel #5
0
    protected void CreateProxyMenu()
    {
        var listSettings = new List <Models.Setting>
        {
            new Models.Setting
            {
                Name  = "Ipxe Requires Login",
                Value = chkIpxeProxy.Checked.ToString(),
                Id    = Setting.GetSetting("Ipxe Requires Login").Id
            },
        };

        Setting.UpdateSetting(listSettings);

        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu
        {
            DebugPwd     = consoleShaProxy.Value,
            AddPwd       = addcomputerShaProxy.Value,
            OndPwd       = ondshaProxy.Value,
            DiagPwd      = diagshaProxy.Value,
            GrubUserName = txtGrubProxyUsername.Text,
            GrubPassword = txtGrubProxyPassword.Text,
        };

        defaultBootMenu.Kernel    = ddlBiosKernel.SelectedValue;
        defaultBootMenu.BootImage = ddlBiosBootImage.SelectedValue;
        defaultBootMenu.Type      = "bios";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel    = ddlEfi32Kernel.SelectedValue;
        defaultBootMenu.BootImage = ddlEfi32BootImage.SelectedValue;
        defaultBootMenu.Type      = "efi32";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel    = ddlEfi64Kernel.SelectedValue;
        defaultBootMenu.BootImage = ddlEfi64BootImage.SelectedValue;
        defaultBootMenu.Type      = "efi64";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
    protected void CreateProxyMenu()
    {
        var listSettings = new List<Models.Setting>
        {
            new Models.Setting
            {
                Name = "Ipxe Requires Login",
                Value = chkIpxeProxy.Checked.ToString(),
                Id = Setting.GetSetting("Ipxe Requires Login").Id
            },
        };

        Setting.UpdateSetting(listSettings);

        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu
        {
            DebugPwd = consoleShaProxy.Value,
            AddPwd = addcomputerShaProxy.Value,
            OndPwd = ondshaProxy.Value,
            DiagPwd = diagshaProxy.Value,
            GrubUserName = txtGrubProxyUsername.Text,
            GrubPassword = txtGrubProxyPassword.Text,
        };

        defaultBootMenu.Kernel = ddlBiosKernel.SelectedValue;
        defaultBootMenu.BootImage = ddlBiosBootImage.SelectedValue;
        defaultBootMenu.Type = "bios";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel = ddlEfi32Kernel.SelectedValue;
        defaultBootMenu.BootImage = ddlEfi32BootImage.SelectedValue;
        defaultBootMenu.Type = "efi32";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        defaultBootMenu.Kernel = ddlEfi64Kernel.SelectedValue;
        defaultBootMenu.BootImage = ddlEfi64BootImage.SelectedValue;
        defaultBootMenu.Type = "efi64";
        defaultBootMenu.CreateGlobalDefaultBootMenu();
    }
Beispiel #7
0
 protected void CreateStandardMenu()
 {
     var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
     defaultBootMenu.Kernel = "4.5x64";
     defaultBootMenu.BootImage = "initrd.xz";
     defaultBootMenu.Type = "standard";
     defaultBootMenu.CreateGlobalDefaultBootMenu();
 }
Beispiel #8
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        string unixDist = null;

        if (ValidateForm())
        {
            var adminUser = BLL.User.GetUser("clonedeploy");
            adminUser.Salt     = Helpers.Utility.CreateSalt(64);
            adminUser.Password = Helpers.Utility.CreatePasswordHash(txtUserPwd.Text, adminUser.Salt);
            adminUser.Token    = Utility.GenerateKey();
            BLL.User.UpdateUser(adminUser);

            string tftpPath = null;
            if (Environment.OSVersion.ToString().Contains("Unix"))
            {
                string dist     = null;
                var    distInfo = new ProcessStartInfo
                {
                    UseShellExecute        = false,
                    FileName               = "uname",
                    RedirectStandardOutput = true,
                    RedirectStandardError  = true
                };

                using (var process = Process.Start(distInfo))
                    if (process != null)
                    {
                        dist = process.StandardOutput.ReadToEnd();
                    }

                unixDist = dist != null && dist.ToLower().Contains("bsd") ? "bsd" : "linux";
                tftpPath = unixDist == "bsd" ? "/usr/pbi/clonedeploy-amd64/tftpboot/" : "/tftpboot/";
            }
            else
            {
                tftpPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                           Path.DirectorySeparatorChar + "clonedeploy" +
                           Path.DirectorySeparatorChar + "tftpboot" + Path.DirectorySeparatorChar;
            }
            var listSettings = new List <Models.Setting>
            {
                new Models.Setting
                {
                    Name  = "Server IP",
                    Value = txtServerIP.Text,
                    Id    = Setting.GetSetting("Server IP").Id
                },
                new Models.Setting
                {
                    Name  = "Tftp Path",
                    Value = tftpPath,
                    Id    = Setting.GetSetting("Tftp Path").Id
                }
            };

            if (unixDist == "bsd")
            {
                listSettings.Add(new Models.Setting
                {
                    Name  = "Sender Args",
                    Value = "--interface " + txtServerIP.Text,
                    Id    = BLL.Setting.GetSetting("Sender Args").Id
                });
            }
            Setting.UpdateSetting(listSettings);

            var distributionPoint = new Models.DistributionPoint();
            distributionPoint.DisplayName = "Default";
            distributionPoint.Server      = "[server-ip]";
            distributionPoint.Protocol    = "SMB";
            distributionPoint.ShareName   = "cd_share";
            distributionPoint.Domain      = "Workgroup";
            distributionPoint.RwUsername  = "******";
            distributionPoint.RwPassword  = new Helpers.Encryption().EncryptText(txtReadWrite.Text);
            distributionPoint.RoUsername  = "******";
            distributionPoint.RoPassword  = new Helpers.Encryption().EncryptText(txtReadOnly.Text);
            distributionPoint.IsPrimary   = 1;
            if (Environment.OSVersion.ToString().Contains("Unix"))
            {
                distributionPoint.PhysicalPath = unixDist == "bsd" ? "/usr/pbi/clonedeploy-amd64/cd_dp" : "/cd_dp";
            }
            else
            {
                distributionPoint.PhysicalPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                                                 Path.DirectorySeparatorChar + "clonedeploy" +
                                                 Path.DirectorySeparatorChar + "cd_dp";
            }
            BLL.DistributionPoint.AddDistributionPoint(distributionPoint);

            var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
            defaultBootMenu.Kernel    = Settings.DefaultKernel32;
            defaultBootMenu.BootImage = "initrd.xz";
            defaultBootMenu.Type      = "standard";
            defaultBootMenu.CreateGlobalDefaultBootMenu();

            var cdVersion = BLL.CdVersion.Get(1);
            cdVersion.FirstRunCompleted = 1;

            if (BLL.CdVersion.Update(cdVersion))
            {
                EndUserMessage = "Setup Complete";
                Response.Redirect("~/views/dashboard/dash.aspx");
            }
        }
    }
Beispiel #9
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        if (ValidateForm())
        {
            var adminUser = BLL.User.GetUser("clonedeploy");
            adminUser.Salt = Helpers.Utility.CreateSalt(64);
            adminUser.Password = Helpers.Utility.CreatePasswordHash(txtUserPwd.Text, adminUser.Salt);
            adminUser.Token = Utility.GenerateKey();
            BLL.User.UpdateUser(adminUser);

            string tftpPath = null;
            if (Environment.OSVersion.ToString().Contains("Unix"))
            {
                tftpPath = "/tftpboot/";
            }
            else
            {
                tftpPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                Path.DirectorySeparatorChar + "clonedeploy" +
                Path.DirectorySeparatorChar + "tftpboot" + Path.DirectorySeparatorChar;
            }
            var listSettings = new List<Models.Setting>
            {
                new Models.Setting
                {
                    Name = "Server IP",
                    Value = txtServerIP.Text,
                    Id = Setting.GetSetting("Server IP").Id
                },
                new Models.Setting
                {
                    Name = "Tftp Path",
                    Value = tftpPath,
                    Id = Setting.GetSetting("Tftp Path").Id
                }

            };
            Setting.UpdateSetting(listSettings);

            var distributionPoint = new Models.DistributionPoint();
            distributionPoint.DisplayName = "Default";
            distributionPoint.Server = "[server-ip]";
            distributionPoint.Protocol = "SMB";
            distributionPoint.ShareName = "cd_share";
            distributionPoint.Domain = "Workgroup";
            distributionPoint.RwUsername = "******";
            distributionPoint.RwPassword = new Helpers.Encryption().EncryptText(txtReadWrite.Text);
            distributionPoint.RoUsername = "******";
            distributionPoint.RoPassword = new Helpers.Encryption().EncryptText(txtReadOnly.Text);
            distributionPoint.IsPrimary = 1;
            if (Environment.OSVersion.ToString().Contains("Unix"))
                distributionPoint.PhysicalPath = "/cd_dp";
            else
            {
                distributionPoint.PhysicalPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                                                 Path.DirectorySeparatorChar + "clonedeploy" +
                                                 Path.DirectorySeparatorChar + "cd_dp";
            }
            BLL.DistributionPoint.AddDistributionPoint(distributionPoint);

            var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
            defaultBootMenu.Kernel = Settings.DefaultKernel32;
            defaultBootMenu.BootImage = "initrd.xz";
            defaultBootMenu.CreateGlobalDefaultBootMenu();

            var cdVersion = BLL.CdVersion.Get(1);
            cdVersion.FirstRunCompleted = 1;

            if (BLL.CdVersion.Update(cdVersion))
            {
                EndUserMessage = "Setup Complete";
                Response.Redirect("~/views/dashboard/dash.aspx");
            }
        }
    }
Beispiel #10
0
    protected void btnSubmit_OnClick(object sender, EventArgs e)
    {
        string unixDist = null;
        if (ValidateForm())
        {
            var adminUser = BLL.User.GetUser("clonedeploy");
            adminUser.Salt = Helpers.Utility.CreateSalt(64);
            adminUser.Password = Helpers.Utility.CreatePasswordHash(txtUserPwd.Text, adminUser.Salt);
            adminUser.Token = Utility.GenerateKey();
            BLL.User.UpdateUser(adminUser);

            string tftpPath = null;
            if (Environment.OSVersion.ToString().Contains("Unix"))
            {
                string dist = null;
                var distInfo = new ProcessStartInfo
                {
                    UseShellExecute = false,
                    FileName = "uname",
                    RedirectStandardOutput = true,
                    RedirectStandardError = true
                };

                using (var process = Process.Start(distInfo))
                    if (process != null) dist = process.StandardOutput.ReadToEnd();

                unixDist = dist != null && dist.ToLower().Contains("bsd") ? "bsd" : "linux";
                tftpPath = unixDist == "bsd" ? "/usr/pbi/clonedeploy-amd64/tftpboot/" : "/tftpboot/";

            }
            else
            {
                tftpPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                Path.DirectorySeparatorChar + "clonedeploy" +
                Path.DirectorySeparatorChar + "tftpboot" + Path.DirectorySeparatorChar;
            }
            var listSettings = new List<Models.Setting>
            {
                new Models.Setting
                {
                    Name = "Server IP",
                    Value = txtServerIP.Text,
                    Id = Setting.GetSetting("Server IP").Id
                },
                new Models.Setting
                {
                    Name = "Tftp Path",
                    Value = tftpPath,
                    Id = Setting.GetSetting("Tftp Path").Id
                }
            };

            if (unixDist == "bsd")
            {
                listSettings.Add(new Models.Setting
                {
                    Name = "Sender Args",
                    Value = "--interface " + txtServerIP.Text,
                    Id = BLL.Setting.GetSetting("Sender Args").Id
                });
            }
            Setting.UpdateSetting(listSettings);

            var distributionPoint = new Models.DistributionPoint();
            distributionPoint.DisplayName = "Default";
            distributionPoint.Server = "[server-ip]";
            distributionPoint.Protocol = "SMB";
            distributionPoint.ShareName = "cd_share";
            distributionPoint.Domain = "Workgroup";
            distributionPoint.RwUsername = "******";
            distributionPoint.RwPassword = new Helpers.Encryption().EncryptText(txtReadWrite.Text);
            distributionPoint.RoUsername = "******";
            distributionPoint.RoPassword = new Helpers.Encryption().EncryptText(txtReadOnly.Text);
            distributionPoint.IsPrimary = 1;
            if (Environment.OSVersion.ToString().Contains("Unix"))
                distributionPoint.PhysicalPath = unixDist == "bsd" ? "/usr/pbi/clonedeploy-amd64/cd_dp" : "/cd_dp";
            else
            {
                distributionPoint.PhysicalPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86) +
                                                 Path.DirectorySeparatorChar + "clonedeploy" +
                                                 Path.DirectorySeparatorChar + "cd_dp";
            }
            BLL.DistributionPoint.AddDistributionPoint(distributionPoint);

            var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
            defaultBootMenu.Kernel = Settings.DefaultKernel32;
            defaultBootMenu.BootImage = "initrd.xz";
            defaultBootMenu.Type = "standard";
            defaultBootMenu.CreateGlobalDefaultBootMenu();

            var cdVersion = BLL.CdVersion.Get(1);
            cdVersion.FirstRunCompleted = 1;

            if (BLL.CdVersion.Update(cdVersion))
            {
                EndUserMessage = "Setup Complete";
                Response.Redirect("~/views/dashboard/dash.aspx");
            }
        }
    }
    protected void CreateStandardMenu()
    {
        var listSettings = new List<Models.Setting>
        {
            new Models.Setting
            {
                Name = "Ipxe Requires Login",
                Value = chkIpxeLogin.Checked.ToString(),
                Id = Setting.GetSetting("Ipxe Requires Login").Id
            },
        };

        Setting.UpdateSetting(listSettings);

        var defaultBootMenu = new BLL.Workflows.DefaultBootMenu();
        var pxeMode = Settings.PxeMode;
        if (pxeMode.Contains("grub"))
        {
            defaultBootMenu.GrubUserName = txtGrubUsername.Text;
            defaultBootMenu.GrubPassword = txtGrubPassword.Text;
        }
        else
        {
            defaultBootMenu.DebugPwd = consoleSha.Value;
            defaultBootMenu.AddPwd = addcomputerSha.Value;
            defaultBootMenu.OndPwd = ondsha.Value;
            defaultBootMenu.DiagPwd = diagsha.Value;
        }
        defaultBootMenu.Kernel = ddlComputerKernel.SelectedValue;
        defaultBootMenu.BootImage = ddlComputerBootImage.SelectedValue;
        defaultBootMenu.Type = "standard";
        defaultBootMenu.CreateGlobalDefaultBootMenu();

        
    }