Subversion Repositories wimsdev

Rev

Rev 17180 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
12048 obado 1
 
633 bpr 2
!form reply
17180 bpr 3
  <input type="hidden" name="up_$job" id="" value="authtype">
633 bpr 4
 
12033 obado 5
  <fieldset class="property_fields blockcenter">
6
    <legend>$wims_name_configb</legend>
7
    <div class="field box">
8
      <div class="formHelp">$name_intro_authtype</div>
12887 obado 9
      !set wims_ref_class=wims_button_help float_right
10
      !href cmd=help&special_parm=config&special_parm2=authtype $wims_name_help
11
      !formselect up_authidp list $authidp_method_list prompt $name_method_list
12033 obado 12
    </div>
13
  </fieldset>
5012 obado 14
 
12033 obado 15
  <fieldset id="cas_settings" class="property_fields blockcenter">
16
    <legend>CAS Settings</legend>
17
    <div class="field box">
12887 obado 18
      !! also in public_html/modules/adm/class/regclass/proc/newclass.phtml
19
 
20
      !if $jquery_defined=yes
21
        !if $auth_cas_url_list!=$empty
22
          <script>
23
            $$(function() {
24
              !if $class_cas_auth notitemof $auth_cas_url_list
25
                !! set the actual selected option
13305 obado 26
                $$('#up_cas_auth_select').val("other");
12887 obado 27
              !endif
13305 obado 28
              $$('#up_cas_auth_select').on('change', function() {
12887 obado 29
                var check = this.value === "other";
30
                var text_input = $$(this).next();
31
                text_input.prop('required', check).toggle(check);
32
                !! only the select OR the input will be sent
33
                if(check){
34
                  $$(this).prop('name', "");
35
                  text_input.prop('name', "up_cas_auth");
36
                }else{
37
                  $$(this).prop('name', "up_cas_auth");
38
                  text_input.prop('name', "");
39
                }
40
              }).change();
41
            });
42
          </script>
13305 obado 43
          <label for="up_cas_auth_select">CAS URL</label>
44
          !formselect up_cas_auth_select list $auth_cas_url_list,other prompt $auth_cas_name_list,$wims_name_otherurl
12887 obado 45
        !endif
17180 bpr 46
        <input size="40" type="url" name="up_cas_auth" value="$class_cas_auth" placeholder="https://ent.fr/cas" id="up_cas_auth">
12887 obado 47
      !else
48
        !! no jquery
13305 obado 49
        <label for="up_cas_auth">CAS URL</label>
17180 bpr 50
        <input size="40" type="url" name="up_cas_auth" value="$class_cas_auth" placeholder="https://ent.fr/cas" id="up_cas_auth">
12887 obado 51
        !if $auth_cas_list != $empty
52
          <div class="formHelp">$auth_cas_list</div>
53
        !endif
12410 bpr 54
      !endif
12887 obado 55
    </div>
12033 obado 56
  </fieldset>
5012 obado 57
 
12033 obado 58
  <fieldset id="php_settings" class="property_fields blockcenter">
59
    <legend>PHP Settings</legend>
60
    <div class="field box">
61
      <label for="up_php_auth">PHP</label>
17180 bpr 62
      <input size="30" name="up_php_auth" id="up_php_auth" value="$class_php_auth">
12033 obado 63
    </div>
64
    <div class="field box">
65
      !set wims_ref_class=wims_button_help float_right
66
      !href cmd=help&special_parm=config&special_parm2=authtype2 $wims_name_help
67
      <label for="up_connections">connections</label>
17180 bpr 68
      <input size="30" name="up_connections" id="up_connections" value="$class_connections">
12033 obado 69
    </div>
70
  </fieldset>
633 bpr 71
 
12033 obado 72
  <fieldset id="ldap_settings" class="property_fields blockcenter">
73
    <legend>LDAP Settings</legend>
74
    <div class="field box">
75
      <label for="up_ldap_auth">ldap auth <span class="field_required">*</span></label>
17180 bpr 76
      <input size="30" name="up_ldap_auth" id="up_ldap_auth" value="$class_ldap_auth" placeholder="ldap.u-psud.fr">
12033 obado 77
    </div>
78
    <div class="field box">
79
      <label for="up_ldap_port">ldap port</label>
17180 bpr 80
      <input size="30" name="up_ldap_port" id="up_ldap_port" value="$class_ldap_port" placeholder="389">
12033 obado 81
    </div>
82
    <div class="field box">
83
      <label for="up_ldap_version">ldap version</label>
17180 bpr 84
      <input size="30" name="up_ldap_version" id="up_ldap_version" value="$class_ldap_version" placeholder="3">
12033 obado 85
    </div>
86
    <div class="field box">
87
      <label for="up_ldap_base">ldap base <span class="field_required">*</span></label>
17180 bpr 88
      <input size="30" name="up_ldap_base" id="up_ldap_base" value="$class_ldap_base" placeholder="ou=people,dc=u-psud,dc=fr">
12033 obado 89
    </div>
90
    <div class="field box">
91
      <label for="up_ldap_branch">ldap branch <span class="field_required">*</span></label>
17180 bpr 92
      <input size="30" name="up_ldap_branch" id="up_ldap_branch" value="$class_ldap_branch" placeholder="ou=people,dc=u-psud,dc=fr">
12033 obado 93
    </div>
94
    <div class="field box">
13324 georgesk 95
      <label for="up_ldap_accreditation">ldap accreditation</label>
18625 lemaire 96
      <input size="50" name="up_ldap_accreditation" id="up_ldap_accreditation" value='' placeholder='accreditation (nothing, or -D some_path -w some_password)'>
13324 georgesk 97
    </div>
98
    <div class="field box">
12033 obado 99
      <label for="up_ldap_uid">ldap uid</label>
17180 bpr 100
      <input size="30" name="up_ldap_uid" id="up_ldap_uid" value="$class_ldap_uid" placeholder="uid">
12033 obado 101
    </div>
102
    <div class="field box">
103
      <label for="up_ldap_login">ldap login</label>
17180 bpr 104
      <input size="30" name="up_ldap_login" id="up_ldap_login" value="$class_ldap_login" placeholder="uid">
12033 obado 105
    </div>
106
    <div class="field box">
107
      <label for="up_ldap_regnum">ldap regnum</label>
17180 bpr 108
      <input size="30" name="up_ldap_regnum" id="up_ldap_regnum" value="$class_ldap_regnum">
12033 obado 109
    </div>
110
    <div class="field box">
111
      <label for="up_ldap_email">ldap email</label>
17180 bpr 112
      <input size="30" name="up_ldap_email" id="up_ldap_email" value="$class_ldap_email">
12033 obado 113
    </div>
114
    <div class="field box">
115
      <label for="up_ldap_photourl">ldap photourl</label>
17180 bpr 116
      <input size="30" name="up_ldap_photourl" id="up_ldap_photourl" value="$class_ldap_photourl">
12033 obado 117
    </div>
118
  </fieldset>
119
 
120
  <div class="wimscenter actions">
17180 bpr 121
    <input type="submit" name="save" id="authtype_save" value="$wims_name_tosave">
12048 obado 122
    $ $
12410 bpr 123
!set wims_ref_class=wims_button wims_secondary_button
124
!href cmd=reply&job=$job $wims_name_giveup
12033 obado 125
  </div>
126
 
5926 bpr 127
!formend
128
 
12033 obado 129
!if $jquery_defined=yes
130
  <script>
13304 obado 131
    $$(function() {
132
 
133
      !! define which input must be required in each case
134
      var required_inputs = {'cas':['up_cas_auth'],
135
                             'ldap': ['up_ldap_auth', 'up_ldap_base', 'up_ldap_branch'],
136
                             'php': []
137
                            }
138
 
139
      !! init (hide all settings but the selected)
12033 obado 140
      !for type in cas,php,ldap
13304 obado 141
        !if $type notin $up_authidp
142
          $$("#$(type)_settings").hide();
13305 obado 143
        !else
13304 obado 144
          required_inputs["$(type)"].forEach(function(element) {
145
            $$("#"+element).prop('required', true);
146
          });
147
        !endif
12033 obado 148
      !next
13304 obado 149
      !! when user select another auth type, display the right inputs and change the required one
150
      $$("#up_authidp").change(function() {
151
        var value=$$(this).val();
152
        !for type in cas,php,ldap
153
          if (value.indexOf("$type") >= 0){
154
            $$("#$(type)_settings").show("slow");
155
            required_inputs["$type"].forEach(function(element) {
156
              $$("#"+element).prop('required', true);
157
            });
158
          }
159
          else{
160
            $$("#$(type)_settings").hide("slow");
161
            required_inputs["$type"].forEach(function(element) {
162
              $$("#"+element).prop('required', false);
163
            });
164
          }
165
        !next
166
      });
12033 obado 167
    });
168
  </script>
169
!endif
170
 
7805 czzmrn 171
!reset up_authidp up_cas_auth up_php_auth up_connections up_ldap_auth up_ldap_port up_ldap_version up_ldap_base up_ldap_branch up_ldap_uid up_ldap_login \
13324 georgesk 172
  up_ldap_email up_ldap_regnum up_ldap_photourl up_ldap_accreditation