68 Commits (db51e813fbf0f0d286aaa429df157deb7834462e)

Author SHA1 Message Date
Adriaan de Groot 8949b079e1 [users] Fix autologin-setting from config file
SEE #1668
5 years ago
Adriaan de Groot 4ffa79d4cf [users] In code, consistently [aA]utoLogin as name
There was a mix of autologin and autoLogin, leading to confusion
in the code. QML is sensitive to this, so go to one consistent name.
(Although the names of the settings in the `.conf` file are
different again)
5 years ago
Adriaan de Groot b4a21d7aca [libcalamares] Add macro CONFIG_PREVENT_EDITING to handle uneditable fields
Boilerplate code for avoiding accidental setting of an internal
field when the UI is editable and the underlying data isn't.
5 years ago
Adriaan de Groot 3ea796d009 [users] 'undo' changes to values if the UI is wonky
- you can still call set*(), eg. from the UI, when the field is
  not editable. Although the code previously ignored the change,
  this would lead to a mismatch between what the UI is showing
  (the changed value) and what the Config has (old value).
  Emit a changed-signal (notify) with the old value so that the
  UI is changed *back* as soon as possible.
5 years ago
Adriaan de Groot 2e90a8d829 [libcalamares] Report preset mis-configurations
- warn about fields applied twice (program error)
- warn about fields not used (configuration error)
- add operator<< for "clean" looking preset application
5 years ago
Adriaan de Groot d8dff3dc65 [libcalamares] Replace loadPresets() with an applicative style
Build up the list of known presets by what the Config-object
expects, not by what the Config file provides. This allows
early detection of mis-matched configurations.

Presets can only apply to Q_PROPERTY properties, and the
preset must match the property name.
5 years ago
Adriaan de Groot 448e478b6d [users] Use base Config and its Preset-handling 5 years ago
Adriaan de Groot 381a4f9b53 [users] Add preset to users module Config 5 years ago
Adriaan de Groot a383aa974a [users] Need <memory> for unique_ptr
- Although unique_ptr is only used when ICU is enabled, include it
  always because it is likely that we'll use more unique_ptr
  in the implementation at some point.
5 years ago
Adriaan de Groot b503aa645b
Merge pull request #1563 from LordTermor/calamares
[users] Full name transliteration support for user creation
5 years ago
Artem Grinev 16eca3c1be [users] Apply code format 5 years ago
Artem Grinev ca033583a4 Simplified logic a bit, made punctuation handling more correct 5 years ago
Artem Grinev da5fb2d3e1 Improved comment 5 years ago
Artem Grinev d5e678157d Changed TRANSLITERATOR_ID type to array 5 years ago
Adriaan de Groot 43e271dfec [users] Missing negation 5 years ago
Artem Grinev 94f7efb89f [users] Remove ' from transliterated string 5 years ago
Artem Grinev f20d0a7593 [users] Name cleanup after transliteration 5 years ago
Artem Grinev aa5ef7a6b8 [users] New transliterator ID 5 years ago
Artem Grinev 4e54a2aefe [users] Cleaned error handling a bit 5 years ago
Artem Grinev 8e07bb00f9 [users] Construct icu::UnicodeString from QString's utf16 chars directly 5 years ago
Artem Grinev 48eae463cc [users] Full name transliteration support for user creation 5 years ago
Adriaan de Groot f1772a7eae [users] Create groups in a separate job 5 years ago
Adriaan de Groot 03541470d5 [users] Handle system-group creating specially 5 years ago
Adriaan de Groot 29e6934672 [users] Factor out Sudo creation into separate job 5 years ago
Adriaan de Groot 328a5bbbfb [users] Don't allow continuing with an empty login name
The status for an empty login name is '' (empty), for ok -- this is
so that there is no complaint about it. But it's not ok to
continue with an empty name.
5 years ago
Adriaan de Groot 4d3f20f4a7 [users] Don't allow continuing with an empty login name
The status for an empty login name is '' (empty), for ok -- this is
so that there is no complaint about it. But it's not ok to
continue with an empty name.
5 years ago
Adriaan de Groot 89e279c96a [users] Set auto- and sudo-groups correctly
- Was updating GS only, not internals
- restructure all to update internals, then GS, then emit change signals
5 years ago
Adriaan de Groot f726634c2f [users] Fix tests for setting shell
- The EXPECT_FAIL value "Abort" stops the test (I wanted 'if this
  unexpectedly passes, raise an error' -- should have read the
  documentation more closely).
- Set the shell in the config object, not just in GS.
5 years ago
Adriaan de Groot 6b2d7f6a42 [users] Protect against JobQueue or GS being NULL
- Avoid SIGSEGV in tests, make sure JobQueue exists, GS optional
5 years ago
Adriaan de Groot ef70b2c32e [users] Run CreateUserJob off of the Config object
- don't pass in copies or bits of the Config, hand over the whole Config
- don't pluck some parts of the Config from Global Storage
5 years ago
Adriaan de Groot 02e9872a99 [users] Handle detailed groups list
Groups can be specified with must_exist and/or system set,
so they fill in the groups list more carefully.
5 years ago
Adriaan de Groot ff9abdfc08 [users] The fallback groups are all **system** groups 5 years ago
Adriaan de Groot ceeab7087c [users] Fix implementation so existing tests pass 5 years ago
Adriaan de Groot d3135898fd [users] More fine-grained group descriptions
Describe groups with more detail:
 - groups can be system groups (low GID) or not
 - groups may be pre-configured (e.g. come from the unpackfs stage)
5 years ago
Adriaan de Groot ec0b68084f [users] Refactor setting GS
- both changing the autologin and changing the user (login) name
  affect global storage, and both may need to change the autologin
  username; split it into a free function.
- the fullname change was bypassing the login in changing the
  login name, **but** then it needs a back-workaround to keep
  the "custom" setting off (when custom is off, auto-fill username
  and hostname is active).
- after loading the config, fill GS already.
- when finalizing GS, get the autologin settings again.
5 years ago
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
5 years ago
Adriaan de Groot 30a85668b7 REUSE: (GPL-3.0-or-later) C++ modules 5 years ago
Adriaan de Groot ab3e393d45 [users] Protect against a nullptr deref
- there is typically no GS during tests
5 years ago
Adriaan de Groot fd2399f702 [users] Re-check password validity on change of conditions
- if the user password is reused (or not) then check the
  status of the passwords against the new reuse-setting
- if the allow-weak-passwords setting is changed, then
  check the status of passwords (both of them) against
  the new weakness setting
5 years ago
Adriaan de Groot 2c72524f29 [users] Move job-creation to Config
- this makes Config entirely stand-alone: it has all the business
  logic and can be hooked up to alternate UIs or used from
  other view steps or jobs
5 years ago
Adriaan de Groot abae942e55 [users] Complete isReady move to Config
- give Config slots and signals for ready-status
- disconnect the page from the viewstep and use the Config object
  ready-status instead
5 years ago
Adriaan de Groot eb44d0c6be [users] Move GlobalStorage wrangling to config
- the whole fill-GS method is a bit weird, since you might want
  to reflect that "live" in GS instead.
5 years ago
Adriaan de Groot 34946ecdee [users] Refactor validity-checking
- provide a structured datatype for password status
5 years ago
Adriaan de Groot 1a7b2668dc [users] Emit password status changes 5 years ago
Adriaan de Groot a16ecba2bd [users] Inline isPasswordAcceptable
- the way isPasswordAcceptable was being used was buggy, leading
  to test failures (now fixed)
- don't expose the function, anyway: it's an implementation
  detail for passwordStatus() which in itself is an implementation
  detail for status notifications.
5 years ago
Adriaan de Groot 1dcf56761f [users] Apply validation to the passwords config knows about
- avoid update loops by checking values before emitting *Changed()
- check validity of user and root passwords when asked
- if root isn't going to be written, or re-uses the user password,
  defer to those status checks.
5 years ago
Adriaan de Groot b49b9a66e6 [users] Drop data-access from the Page
- get username, password etc. from the config object, not the page
- jobs now depend entirely on config
- handle logic of "what's the root password" in Config
6 years ago
Adriaan de Groot eb72d662d1 [users] Add password fields to Config
- no checking is done for validity, and there is no password-status
6 years ago
Adriaan de Groot 900deb5dc8 [users] Move the configuration of password checks to Config
- the Widget (Page) does not need to know the password checks,
  that's business logic that belongs to Config.
6 years ago
Adriaan de Groot 2efce1ac7a [users] Move the hostname-setting config
- The configuration for writing the hostname (to /etc/hostname,
  to /etc/hosts and possibly to systemd-hostname) is read-only,
  because it comes from the config file and won't change after.
6 years ago