Add dual user classes: admin + tech users with PIN login

- Add tech user management (JSON-backed CRUD with PIN auth)
- Dual login: tabbed Tech Login (username+PIN) / Admin Login (NC credentials)
- Admin panel: tappable user list with detail modal (enable/disable, reset PIN, reset NC password, delete)
- Auto-provision Nextcloud accounts for tech users
- Admin guard: tech users redirected away from admin panel
- New data volume for persistent tech_users.json storage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 00:17:26 -06:00
parent ca03f6e143
commit 99fb5ff7e7
13 changed files with 1143 additions and 493 deletions

View File

@@ -352,3 +352,21 @@ class NextcloudClient:
return {'success': True}
except Exception as e:
return {'success': False, 'error': str(e)}
def ocs_set_password(self, username: str, password: str) -> Dict[str, Any]:
"""Set a user's password via OCS API."""
url = f"{self.ocs_root}/cloud/users/{username}"
params = {"format": "json"}
data = {"key": "password", "value": password}
try:
response = self._make_request("PUT", url, params=params, data=data, headers=self._ocs_headers)
result = response.json()
meta = result.get("ocs", {}).get("meta", {})
if meta.get("statuscode") != 100:
return {"success": False, "error": meta.get("message", "Failed to set password")}
return {"success": True}
except Exception as e:
return {"success": False, "error": str(e)}