diff --git a/System/UserSystem.cs b/System/UserSystem.cs index 474a7ca..52197f1 100644 --- a/System/UserSystem.cs +++ b/System/UserSystem.cs @@ -309,6 +309,48 @@ namespace CMLeonOS Console.WriteLine("===================================="); Console.WriteLine(" First Time Setup"); Console.WriteLine("===================================="); + Console.WriteLine(); + + Console.WriteLine("User Terms and Conditions:"); + Console.WriteLine("===================================="); + Console.WriteLine("1. This operating system is provided as-is without warranty"); + Console.WriteLine("2. You are responsible for your data and backups"); + Console.WriteLine("3. Unauthorized access attempts may be logged"); + Console.WriteLine("4. System administrators have full access to all data"); + Console.WriteLine("5. By using this system, you agree to these terms"); + Console.WriteLine("6. Data privacy: Your personal data is stored locally"); + Console.WriteLine("7. System updates may be installed automatically"); + Console.WriteLine("8. No liability for data loss or corruption"); + Console.WriteLine("9. Support available at: leonmmcoset@outlook.com"); + Console.WriteLine("10. This license is for personal use only"); + Console.WriteLine("===================================="); + Console.WriteLine(); + + bool termsAccepted = false; + while (!termsAccepted) + { + Console.Write("Do you accept the User Terms? (yes/no): "); + string response = Console.ReadLine()?.ToLower(); + + if (response == "yes" || response == "y") + { + termsAccepted = true; + Console.WriteLine("Terms accepted."); + Console.WriteLine(); + } + else if (response == "no" || response == "n") + { + Console.WriteLine("You must accept the User Terms to continue."); + Console.WriteLine("Please restart the setup process."); + Thread.Sleep(2000); + Sys.Power.Reboot(); + } + else + { + Console.WriteLine("Invalid response. Please enter 'yes' or 'no'."); + } + } + Console.WriteLine("Please set admin username and password:"); Console.Write("Username: "); diff --git a/shell/Commands/System/SettingsCommand.cs b/shell/Commands/System/SettingsCommand.cs index bd7bcaf..f9ec4bc 100644 --- a/shell/Commands/System/SettingsCommand.cs +++ b/shell/Commands/System/SettingsCommand.cs @@ -5,6 +5,13 @@ namespace CMLeonOS.Commands { public static class SettingsCommand { + private static UserSystem userSystem; + + public static void SetUserSystem(UserSystem system) + { + userSystem = system; + } + public static void ProcessSettings(string args) { if (string.IsNullOrWhiteSpace(args)) @@ -13,6 +20,12 @@ namespace CMLeonOS.Commands return; } + if (userSystem == null || userSystem.CurrentLoggedInUser == null || !userSystem.CurrentLoggedInUser.IsAdmin) + { + Console.WriteLine("Error: Only administrators can change settings."); + return; + } + string[] parts = args.Split(new char[] { ' ' }, 2, StringSplitOptions.RemoveEmptyEntries); if (parts.Length == 1) diff --git a/shell/Shell.cs b/shell/Shell.cs index 2c96c88..dada5bb 100644 --- a/shell/Shell.cs +++ b/shell/Shell.cs @@ -59,6 +59,7 @@ namespace CMLeonOS envManager = EnvironmentVariableManager.Instance; Commands.AliasCommand.LoadAliases(); + Commands.SettingsCommand.SetUserSystem(userSystem); User currentUser = userSystem.CurrentLoggedInUser; if (currentUser != null && !string.IsNullOrWhiteSpace(currentUser.Username))