|
| 1 | +--- |
| 2 | +title: Selective tenant activation |
| 3 | +description: Enable Level Up XP+ for selected tenants when XP is deployed across your infrastructure. |
| 4 | +sidebar_position: 99 |
| 5 | +slug: selective-activation |
| 6 | +--- |
| 7 | + |
| 8 | +import RequiresXpPlus from '@site/src/components/RequiresXpPlus'; |
| 9 | + |
| 10 | +<RequiresXpPlus plan="Enterprise" /> |
| 11 | + |
| 12 | +Selective activation is intended for **hosting providers** and **Moodle Partners** running multi-tenant Moodle deployments where XP and XP+ are deployed broadly, but XP+ should only be enabled for selected tenants. |
| 13 | + |
| 14 | +## Overview |
| 15 | + |
| 16 | +By default, when XP+ is present it **activates automatically**. Selective activation works by disabling that default behaviour globally, and then explicitly enabling XP+ only for a subset of tenants. |
| 17 | + |
| 18 | +## Tenant-specific configuration file |
| 19 | + |
| 20 | +A deployment must support: |
| 21 | + |
| 22 | +- A **global** `config.php` shared by all tenants. |
| 23 | +- A **tenant-specific** config file that can set `$CFG` values for that tenant only. |
| 24 | + |
| 25 | +## Configuration |
| 26 | + |
| 27 | +### Global config (all tenants) |
| 28 | + |
| 29 | +In the global `config.php`, disable automatic activation so XP+ does not turn on by default: |
| 30 | + |
| 31 | +```php |
| 32 | +$CFG->local_xp_disable_automatic_activation = true; |
| 33 | +``` |
| 34 | + |
| 35 | +After this, XP+ will not activate for any tenant unless explicitly enabled for that tenant. |
| 36 | + |
| 37 | +### Per-tenant config |
| 38 | + |
| 39 | +For each tenant where XP+ **should be enabled**, add this to that tenant-specific config file: |
| 40 | + |
| 41 | +```php |
| 42 | +// config-for-tenant-happykoala.php |
| 43 | + |
| 44 | +$CFG->local_xp_activate = true; |
| 45 | +``` |
| 46 | + |
| 47 | +Only tenants with this setting will have XP+ active. |
| 48 | + |
| 49 | +## Licence and limits |
| 50 | + |
| 51 | +Each tenant where XP+ is activated counts as one website towards the [number of websites limitation](./websites-limitation). The number of activated tenants must not exceed the number of websites allowed by the licence. |
| 52 | + |
| 53 | +## Behaviour |
| 54 | + |
| 55 | +The selective activation of XP+ does not prevent its installation, such as the creation of database tables, the registration of its scheduled tasks and web services, etc. However, the execution of any of its services will not have any effect. |
0 commit comments