Skip to content

Conversation

@simonLeary42
Copy link
Collaborator

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors operator tracking by storing operator information in the session ($_SESSION["OPERATOR"] and $_SESSION["OPERATOR_IP"]) instead of passing it as method parameters. The addLog() method now retrieves operator information directly from the session, simplifying method signatures across UnityUser, UnityGroup, and UnitySQL classes.

Key changes:

  • Operator information is now stored in session variables during initialization in resources/init.php
  • The addLog() method signature simplified to only require action_type and recipient parameters
  • Multiple methods in UnityUser class (setFirstname, setLastname, setMail, setSSHKeys, setLoginShell, setHomeDir) no longer require an $operator parameter
  • Test helper functions updated to remove $OPERATOR from global variable declarations

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
resources/init.php Adds session storage for operator uid and IP address during SSO initialization
resources/lib/UnitySQL.php Simplifies addLog() to read operator info from session; removes operator parameter from addNotice() and editPage()
resources/lib/UnityUser.php Removes operator parameters from setter methods (setFirstname, setLastname, setMail, setSSHKeys, setLoginShell, setHomeDir)
resources/lib/UnityGroup.php Updates approveGroup() and denyGroup() implementations to use session-based logging
webroot/panel/account.php Updates method calls to setSSHKeys() and setLoginShell() to remove operator argument
webroot/admin/pi-mgmt.php Attempts to pass $_SESSION["OPERATOR"] to approveGroup() and denyGroup() (introduces type mismatch issue)
test/phpunit-bootstrap.php Removes $OPERATOR from global variable declarations in test helper functions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@simonLeary42 simonLeary42 marked this pull request as ready for review December 31, 2025 16:41
@simonLeary42 simonLeary42 merged commit a380c5a into main Dec 31, 2025
3 checks passed
@simonLeary42 simonLeary42 deleted the operator-global branch December 31, 2025 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants