# Features — SecOps

Evidence date: 2026-10-04. Source: `git@bitbucket.org:overdrive/secops.git`, `master` at `b6fa27b` (2022-03-30).

Status words used here:

- **Current** — present on `master` at `b6fa27b`.
- **Changed** — behaviour introduced or altered by a commit on `master`.
- **Unmerged stub** — present only on `basic_mvc_structure` at `cad6860`, and the action renders `dashboard`.
- **Theme demo** — an AdminLTE sample page. It is not wired to SecOps data.
- **Not in git** — named by the task-creation scan, and no file exists at that path in either branch.

Deployment of `master` is **Unknown / Requires Confirmation**.

## Current

### Sign-in and session

| Feature | Location | Notes |
|---|---|---|
| Login page | `application/controllers/Login.php`, `application/views/account/login.php` | Username or email, password, optional reCAPTCHA |
| Remember me | `Users_model::login` | 7-day cookies when `remember_me` is posted |
| Logout | `application/controllers/Logout.php` | Writes an activity row, clears session and cookies |
| Inactive account | `Users_model::attempt` | Status other than string `1` cannot sign in |
| Language forced to Spanish | `Users_model::login` `setUserlang('es')` | Runs on every successful sign-in |

### Password reset

| Feature | Location | Notes |
|---|---|---|
| Request reset | `Login::forget`, `Login::reset_password` | Known username or email |
| Template body | `Users_model::resetPassword`, `Templates_model` | Code `reset_password` |
| Choose a new password | `Login::new_password`, `Login::set_new_password` | Min length 5. Token cleared after save |

**Changed** in `511199b` / PR #1: the reset message is parsed from `email_templates` instead of a hardcoded HTML string.

### Users

| Feature | Location | Permission |
|---|---|---|
| List | `Users::index`, `views/users/list.php` | `users_list` |
| Add | `Users::add`, `Users::save`, `views/users/add.php` | `users_add` |
| View | `Users::view`, `views/users/view.php` | `users_view` |
| Edit | `Users::edit`, `Users::update`, `views/users/edit.php` | `users_edit` |
| Delete | `Users::delete` | `users_delete` |
| Duplicate check | `Users::check` | None beyond being signed in |
| Status toggle | `Users::change_status` | None beyond being signed in |
| Avatar upload | `Uploadlib`, `uploads/users/` | gif, jpg, png, jpeg |

### Roles and permissions

| Feature | Location | Permission |
|---|---|---|
| Role list, add, edit | `Roles.php`, `views/roles/` | `roles_list`, `roles_add`, `roles_edit` |
| Permission list, add, edit, delete | `Permissions.php`, `views/permissions/` | `permissions_list`, `permissions_add`, `permissions_edit`, `permissions_delete` |
| Unique permission code check | `Permissions::checkIfUnique` | None beyond being signed in |
| Sidebar hiding | `views/includes/nav.php` `hasPermissions` | Hides admin links the role lacks |

Seeded codes on `master` are the 18 rows in `main.sql` (`users_*`, `activity_log_*`, `roles_*`, `permissions_*`, `company_settings`, `backup_db`, `email_templates`, `general_settings`). There is no `roles_delete` code and no role-delete action.

### Settings and profile

| Feature | Location | Permission |
|---|---|---|
| General settings | `Settings::general`, `generalUpdate` | `general_settings` |
| Company name and email | `Settings::company`, `companyUpdate` | `company_settings` |
| Email template list and edit | `Settings::email_templates`, `edit_email_templates` | `email_templates` |
| Email template save | `Settings::update_email_templates` | Checks `login_theme`, which is not seeded |
| Login theme methods | `Settings::login_theme`, `loginthemeUpdate` | Checks `login_theme`. View file is absent |
| Own profile, password, picture, language | `Profile.php`, `views/account/profile.php` | Any signed-in user |

### Activity and backup

| Feature | Location | Permission |
|---|---|---|
| Activity list and filters | `Activity_logs::index` | `activity_log_list` |
| Activity detail | `Activity_logs::view` | `activity_log_view` |
| Backup page and zip download | `Backup.php`, `views/export.php` | `backup_db` |

### Dashboard

| Feature | Location | Notes |
|---|---|---|
| Home | `Dashboard::index`, `views/dashboard.php` | AdminLTE sample. Numbers are written in the view. Default route |

### Languages

| Feature | Location | Notes |
|---|---|---|
| English, Spanish, Hindi packs | `application/language/{en,es,hi}/` | `basic_lang.php` plus CodeIgniter stock files |
| Language cookie | `getUserlang`, `Profile::change_language` | 30 days |

## Theme demo

`application/controllers/adminlte/` and `application/views/adminlte/` ship AdminLTE 3.0.5 examples: dashboards, widgets, layouts, charts, UI, forms, tables, mailbox, calendar, gallery, invoices, and extra login pages. `views/includes/nav.php` links them for every signed-in user. `Ci_examples` includes DataTables, form validation, and file-upload samples that write under the upload path. These are **not** SecOps domain features.

`notAllowedDemo()` in `basic_helper.php` flashes `This action is disabled in Demo` and redirects. No controller on `master` calls it.

## Unmerged stub

Branch `basic_mvc_structure`, not contained in `master`.

| Feature | Location | What it does |
|---|---|---|
| Clients | `projects/Clients::index` | Permission `clients`, then `dashboard` |
| Manage sites | `projects/Sites::index` | Permission `manage_sites`, then `dashboard` |
| SonarQube / nmap / FIM history | `projects/History` | Title changes, view is `dashboard` |
| Generate PDF | `projects/Reporting::generate_pdf` | Permission `reporting`, view is `dashboard` |
| Tool schedule, setup, scan, results | `projects/Tools` | Permission per tool, view is `dashboard` |
| Role `User` and extra permission rows | Branch `main.sql` | See `project-plan.md` |
| Navigation refactor | Branch `views/includes/nav.php` | Not compared line by line beyond the new controllers |

## Changed

| When | What |
|---|---|
| 2022-03-29 `511199b` | Password reset uses the `reset_password` email template and shortcodes |
| 2022-03-30 `b6fa27b` | That commit merged to `master` as pull request #1 |

No other product change is on `master`. Nothing in git history on `master` is a removed feature.

## Not in git

| Name | Notes |
|---|---|
| `sonar-project.properties` | Listed at task creation next to `README.md`. Absent from both branches |
| `sonarqube_scan.bat` | Same |

## Deprecated / removed

None recorded. The login-theme screen is unfinished on `master` (controller without a view or a seeded permission), not deleted.
