This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
radiusdesk:login_pages:other_profile [2023/01/25 20:57] admin created |
radiusdesk:login_pages:other_profile [2023/01/25 23:11] (current) admin [Tweak sConnect.js] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== User Registration - Other Profile Option ====== | ====== User Registration - Other Profile Option ====== | ||
| - | * When User Registration is configured on a Login Page you have to define a Profile and Realm the registered user will be assigned to. | + | * When User Registration is configured on a Login Page you define a **Profile** and **Realm** the registered user will be assigned to. |
| - | * There might however be times that you want to assign the user to a different profile (for whatever reason) | + | * There might however be times that you want to assign the user to a different profile (for whatever reason). |
| * We have added this **hidden** feature and documented it here. | * We have added this **hidden** feature and documented it here. | ||
| - | * | + | ===== Create other profile ===== |
| - | ===== Start off by adding | + | |
| + | * You can use the Profile name or Profile ID in the Login Page. | ||
| + | |||
| + | ===== Tweak sConnect.js ===== | ||
| + | * In our example we will reward users that register with a phone number that starts with **083** and has a total of 10 digits. | ||
| + | * Edit **/ | ||
| + | * Look for this part: | ||
| + | <code javascript> | ||
| + | /* | ||
| + | //=== Proof of Concept Hack === | ||
| + | //=== other_profile_name = ' | ||
| + | var other_profile_name = ' | ||
| + | //var other_profile_id = 56; // | ||
| + | var phone = $("# | ||
| + | if(/ | ||
| + | formData[' | ||
| + | // | ||
| + | } | ||
| + | //=== END Proof of Concept Hack === | ||
| + | */ | ||
| + | </ | ||
| + | * Now for our requirement we change it to the following: | ||
| + | <code javascript> | ||
| + | //=== Proof of Concept Hack === | ||
| + | //=== other_profile_name = ' | ||
| + | var other_profile_name = ' | ||
| + | //var other_profile_id = 56; // | ||
| + | var phone = $("# | ||
| + | if(/ | ||
| + | formData[' | ||
| + | // | ||
| + | } | ||
| + | //=== END Proof of Concept Hack === | ||
| + | </ | ||
| + | * This means that if during registration a match on the phone number requirement is found, the user will be registered with the other profile. | ||
| + | * You can create your own criteria and simply tweak the **sConnect.js** file. | ||
| + | * This feature comes in handy if you want to give certain users special treatment based on the value of one of the supplied fields during user registration. | ||
| + | |||