Aptivi - Manual
ProjectsWebsiteBlog
Nitrocid KS v0.1.0 - Rolling Manual
Nitrocid KS v0.1.0 - Rolling Manual
  • Welcome!
  • Version Release Notes
  • Installation and Maintenance
    • Installing the Kernel
      • Windows
      • macOS
      • Linux
      • Android
    • Upgrading the Kernel
      • Windows
      • macOS
      • Linux
      • Android
    • Dependency Information
  • Fundamentals
    • What is the Kernel?
    • What is Nitrocid KS?
    • Simulated Kernel Features
      • Extra Features
        • More Networking
          • FTP Client
          • SFTP Client
          • RSS Client
          • HTTP Client
          • Mail Client
        • Games and Amusements
          • Hangman
          • BackRace
          • Meteor
          • Russian Roulette
          • ShipDuet
          • Snaker
          • Solver
          • SpeedPress
          • Wordle
        • More Editors
          • JSON Editor
          • SQL Editor
        • Common Programs
          • Archive
          • Caffeine
          • Calendar
          • Calculator
          • Contacts
          • Dictionary
          • Git Shell
          • Music Player
          • Notes
          • SSH Connection
          • Timers
          • To-do List
          • Unit Converter
          • Weather
        • Docking
        • Language Studio
        • Theme Studio
      • Accounts
        • Groups
        • Permissions
      • Editors
        • Text Editor
        • Hex Editor
      • Shells
        • Commands List
        • Addon Commands List
      • Files and Folders
        • Hashing and Encryption
      • Networking
      • Languages
      • Screensavers
  • Advanced and Power Users
    • Building the Kernel
      • Building on Windows
      • Building on macOS
      • Building on Linux
      • Building on Android
    • Kernel Modifications
      • Building your Mod
      • Analyzing your Mod
        • Text - NKS0001
        • ConsoleBase - NKS0002
        • ConsoleBase - NKS0003
        • ConsoleBase - NKS0004
        • ConsoleBase - NKS0005
        • ConsoleBase - NKS0006
        • ConsoleBase - NKS0007
        • ConsoleBase - NKS0008
        • ConsoleBase - NKS0009
        • Files - NKS0010
        • Files - NKS0011
        • Files - NKS0012
        • Files - NKS0013
        • Files - NKS0014
        • Files - NKS0015
        • Files - NKS0016
        • Files - NKS0017
        • Files - NKS0018
        • Files - NKS0019
        • Files - NKS0020
        • Files - NKS0021
        • Files - NKS0022
        • Files - NKS0023
        • Kernel - NKS0024
        • Kernel - NKS0025
        • Kernel - NKS0026
        • Kernel - NKS0027
        • Kernel - NKS0031
        • Kernel - NKS0032
        • Kernel - NKS0033
        • Kernel - NKS0037
        • Kernel - NKS0038
        • Kernel - NKS0039
        • Kernel - NKS0040
        • Kernel - NKS0041
        • Kernel - NKS0042
        • Kernel - NKS0043
        • Kernel - NKS0052
        • Kernel - NKS0053
        • Languages - NKS0044
        • Languages - NKS0045
        • Languages - NKS0046
        • Network - NKS0051
        • Text - NKS0047
        • Text - NKS0048
        • Text - NKS0049
        • Text - NKS0050
        • Text - NKS0054
        • Text - NKS0055
      • Managing your Mod
        • Inter-Mod Communication
        • Inter-Addon Communication
    • Diagnostics
      • Debugging
        • Local Debugging
        • Remote Debugging
      • Testing
      • Other Diagnostics
    • Inner Workings
      • Kernel Settings
        • Mechanics of Settings App
        • Settings Format
        • Custom Settings
      • Shell Structure
        • Help System
        • Command Parsing
        • Command Information
        • Command Switch Management
        • Command Switch Information
        • Shell History
        • Shell Scripting
        • Shell Presets
        • Extra Shell Features
      • Multilingual Kernel
        • Custom Languages
      • Inner Essentials
        • Kernel Drivers
          • Console Drivers
          • Debug Logger Drivers
          • Encoding Drivers
          • Encryption Drivers
          • Filesystem Drivers
          • Hardware Prober Drivers
          • Input Drivers
          • Network Drivers
          • RNG Drivers
          • Regular Expression Drivers
          • Sorting Drivers
        • Kernel Placeholders
        • The Permissions
        • The Users
        • Kernel Threads
        • Kernel Arguments
        • Kernel Journaling
        • Remote Procedure
        • Nitrocid Filesystem
        • Screensaver Internals
        • Splash Internals
        • Kernel Platform
        • Theme Internals
        • Color Internals
        • Privacy Consents
        • System Notifications
        • MAL and MOTD
        • Progress Handlers
        • Assembly Signing
        • Assembly Reflection
        • Random Number Generation
        • Network Tools
        • Date and Time
        • Mod Manual Pages
      • Miscellaneous APIs
  • Project Dependencies
  • Report an issue
  • Source code
  • API Reference
Powered by GitBook
On this page
  • User locking
  • Login handlers
  • Registering handlers
  • Unregistering handlers
Edit on GitHub
  1. Advanced and Power Users
  2. Inner Workings
  3. Inner Essentials

The Users

This page describes the internal workings of the username management

Nitrocid KS provides you with a rich user management that does basic and advanced operations, such as creating a user, removing a user, listing users, and so on.

User locking

You can lock the modification of a user by using the following functions:

UserManagement.cs
public static void LockUser(string User)
public static void UnlockUser(string User)
public static bool IsLocked(string User)

When a user is locked, the following functions can't be run on that user to protect it. This is used by the sudo command to protect users running sudo from removing the root user or the current user.

  • InitializeUser()

  • RemoveUser()

  • ChangeUsername()

  • ChangePassword()

Trying to run any of the four functions above results in a KernelException if they're executed against a locked user.

Login handlers

Login handlers are login interfaces in which Nitrocid summons in order to commence a login process, just after all the necessary components of the kernel have finished loading. They provide three login flows:

  • LoginScreen()

    • This is the first step for every login handler to stylize their login screen. It can be simple (textual) or modern (interactive). The return value determines whether to proceed to the user selector screen or to refresh itself (useful for shutdown/reboot options).

  • UserSelector()

    • This is the second stage in which the login handler must prompt for the username and return the correct username that exists. Additionally, you can make it return the username that the user input.

  • PasswordHandler(user)

    • This is the final stage in which the handler should ask the password for any selected user. For security reasons, we've chosen not to allow auto-logins for passwordless users, except the modern logon handler provided by Nitrocid.

Be honest when dealing with the return values for both UserSelector and PasswordHandler. Make sure that you use the correct values for both of them. PasswordHandler returns either true or false in the following conditions:

  • true: if the password is valid

  • false: if the password is invalid

Registering handlers

You can now add or remove your custom login handlers to make your kernel use your login screen. To add your handler, you can use the RegisterHandler() function to add it to the list of available handlers. This allows you to customize your login screen to the one that you made.

public static void RegisterHandler(string name, BaseLoginHandler handler)

After that, you should be able to find your login handler when trying to change your login screen using the settings command.

If you want your mod to automatically populate your custom login handler on startup, you may use the RegisterHandler() function, but make sure to unregister it using the UnregisterHandler() function when your mod is being unloaded.

Unregistering handlers

Similarly, if you want to unregister your login handler, you can do so by using the UnregisterHandler() function.

public static void UnregisterHandler(string name)

Last updated 1 year ago