Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

subform pseudo code (retry) #16

Open
wants to merge 1 commit into
base: 2.0.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion onelogin/saml_joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,8 @@ function get_user_from_joomla($matcher, $username, $email) {
}

function get_mapped_groups($saml_groups) {
$prefix = '';
/*
$prefix = '';
if ($this->plugin == 'onelogin_saml_backend') {
$prefix = 'onelogin_saml_backend_';
$max = 11;
Expand Down Expand Up @@ -195,5 +196,32 @@ function get_mapped_groups($saml_groups) {
}

return array_unique($groups);
*/

$prefix = '';
if ($this->plugin == 'onelogin_saml_backend') {
$mappings = $params->get(onelogin_saml_backend_.'mappings');
} else {
$mappings = $params->get('mappings');
}


$arr = (array) $mappings;

$groups = array();
$i=0;

foreach ($arr as $value)
{
if (!empty($value->group) and !empty(trim($value->group)) ) {
$groups[$i]['group'] = $value->group;
$groups[$i]['group_map'] = $value->group_map;
}

$i++;
}

return array_unique($groups);

}
}
206 changes: 26 additions & 180 deletions plg_system_oneloginsaml/oneloginsaml.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,186 +136,32 @@
/>
</fieldset>
<fieldset name="group_mapping">
<field name="group1" type="usergroup"
label="Group1"
multiple="false"
/>
<field name="group1_map" type="text"
label="Group1 Mapping"
size="40"
default=""
/>
<field name="group2" type="usergroup"
label="Group2"
multiple="false"
/>
<field name="group2_map" type="text"
label="Group2 Mapping"
size="40"
default=""
/>
<field name="group3" type="usergroup"
label="Group3"
multiple="false"
/>
<field name="group3_map" type="text"
label="Group3 Mapping"
size="40"
default=""
/>
<field name="group4" type="usergroup"
label="Group4"
multiple="false"
/>
<field name="group4_map" type="text"
label="Group4 Mapping"
size="40"
default=""
/>
<field name="group5" type="usergroup"
label="Group5"
multiple="false"
/>
<field name="group5_map" type="text"
label="Group5 Mapping"
size="40"
default=""
/>
<field name="group6" type="usergroup"
label="Group6"
multiple="false"
/>
<field name="group6_map" type="text"
label="Group6 Mapping"
size="40"
default=""
/>
<field name="group7" type="usergroup"
label="Group7"
multiple="false"
/>
<field name="group7_map" type="text"
label="Group7 Mapping"
size="40"
default=""
/>
<field name="group8" type="usergroup"
label="Group8"
multiple="false"
/>
<field name="group8_map" type="text"
label="Group8 Mapping"
size="40"
default=""
/>
<field name="group9" type="usergroup"
label="Group9"
multiple="false"
/>
<field name="group9_map" type="text"
label="Group9 Mapping"
size="40"
default=""
/>
<field name="group10" type="usergroup"
label="Group10"
multiple="false"
/>
<field name="group10_map" type="text"
label="Group10 Mapping"
size="40"
default=""
/>
<field name="group11" type="usergroup"
label="Group11"
multiple="false"
/>
<field name="group11_map" type="text"
label="Group11 Mapping"
size="40"
default=""
/>
<field name="group12" type="usergroup"
label="Group12"
multiple="false"
/>
<field name="group12_map" type="text"
label="Group12 Mapping"
size="40"
default=""
/>
<field name="group13" type="usergroup"
label="Group13"
multiple="false"
/>
<field name="group13_map" type="text"
label="Group13 Mapping"
size="40"
default=""
/>
<field name="group14" type="usergroup"
label="Group14"
multiple="false"
/>
<field name="group14_map" type="text"
label="Group14 Mapping"
size="40"
default=""
/>
<field name="group15" type="usergroup"
label="Group15"
multiple="false"
/>
<field name="group15_map" type="text"
label="Group15 Mapping"
size="40"
default=""
/>
<field name="group16" type="usergroup"
label="Group16"
multiple="false"
/>
<field name="group16_map" type="text"
label="Group16 Mapping"
size="40"
default=""
/>
<field name="group17" type="usergroup"
label="Group17"
multiple="false"
/>
<field name="group17_map" type="text"
label="Group17 Mapping"
size="40"
default=""
/>
<field name="group18" type="usergroup"
label="Group18"
multiple="false"
/>
<field name="group18_map" type="text"
label="Group18 Mapping"
size="40"
default=""
/>
<field name="group19" type="usergroup"
label="Group19"
multiple="false"
/>
<field name="group19_map" type="text"
label="Group19 Mapping"
size="40"
default=""
/>
<field name="group20" type="usergroup"
label="Group20"
multiple="false"
/>
<field name="group20_map" type="text"
label="Group20 Mapping"
size="40"
default=""
/>

<field
name="mappings"
type="subform"
default=''
label="Group mapping"
description=""
multiple="true"
min="0"
max="50"
>
<form>
<field name="group"
type="usergroup"
label="Group"
multiple="false"
/>
<field name="group_map"
type="text"
label="Group Mapping"
size="40"
default=""
/>
</form>
</field>

</fieldset>
<fieldset name="advanced">
<field name="onelogin_saml_advanced_settings_debug" type="radio"
Expand Down
123 changes: 23 additions & 100 deletions plg_system_oneloginsaml_backend/oneloginsaml_backend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -150,106 +150,29 @@
/>
</fieldset>
<fieldset name="group_mapping">
<field name="onelogin_saml_backend_group1" type="usergroup"
label="Group1"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group1_map" type="text"
label="Group1 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group2" type="usergroup"
label="Group2"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group2_map" type="text"
label="Group2 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group3" type="usergroup"
label="Group3"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group3_map" type="text"
label="Group3 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group4" type="usergroup"
label="Group4"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group4_map" type="text"
label="Group4 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group5" type="usergroup"
label="Group5"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group5_map" type="text"
label="Group5 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group6" type="usergroup"
label="Group6"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group6_map" type="text"
label="Group6 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group7" type="usergroup"
label="Group7"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group7_map" type="text"
label="Group7 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group8" type="usergroup"
label="Group8"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group8_map" type="text"
label="Group8 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group9" type="usergroup"
label="Group9"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group9_map" type="text"
label="Group9 Mapping"
size="40"
default=""
/>
<field name="onelogin_saml_backend_group10" type="usergroup"
label="Group10"
multiple="false"
default="7"
/>
<field name="onelogin_saml_backend_group10_map" type="text"
label="Group10 Mapping"
size="40"
default=""
/>
<field
name="mappings"
type="subform"
default=''
label="Group mapping"
description=""
multiple="true"
min="0"
max="50"
>
<form>
<field name="group"
type="usergroup"
label="Group"
multiple="false"
/>
<field name="group_map"
type="text"
label="Group Mapping"
size="40"
default=""
/>
</form>
</fieldset>
<fieldset name="advanced">
<field name="onelogin_saml_backend_advanced_settings_debug" type="radio"
Expand Down