forked from cannod/moodle-drupalservices
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.html
153 lines (136 loc) · 5.87 KB
/
config.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
global $OUTPUT;
// set to defaults if undefined
if (!isset($config->hostname)) {
$config->hostname = 'http://';
}
if (!isset($config->endpoint)) {
$config->endpoint = '/';
}
if (!isset($config->remote_user)) {
$config->remote_user = '';
}
if (!isset($config->remote_pw)) {
$config->remote_pw = '';
}
if (!isset($config->removeuser)) {
$config->removeuser = AUTH_REMOVEUSER_KEEP;
}
if (empty($config->cohorts)) {
$config->cohorts = 0;
}
if (!isset($config->cohort_view)) {
$config->cohort_view = '';
}
//does not work.
$config->field_lock_idnumber = 'locked';
$yesno = array( get_string('no'), get_string('yes') );
?>
<div id="testmessages">
<div>The following messages are the results of tests of the configuration below. Use these to guide you through the setup and configuration of the Drupal Services plugin. If you see any items with 'fail', you'll need to resolve them in order for this plugin to work.</div>
<?php foreach($tests as $testresult):?>
<div class="testmessage">
<span class="status <?php print ($testresult['success'])?"success":"fail";?>"><b><?php print ($testresult['success'])?"Success":"Fail";?> :</b> </span>
<span class="message"><?php print ($testresult['message']);?></span>
</div>
<?php endforeach?>
</div>
<table cellspacing="0" cellpadding="5" border="0">
<tr valign="top" class="required">
<td align="right"><label for="hostname"><?php print_string("auth_drupalserviceshostname_key", "auth_drupalservices") ?></label></td>
<td>
<input id="hostname" name="hostname" type="text" size="30" value="<?php echo $config->hostname?>" />
<?php
if (isset($err["hostname"])) {
echo $OUTPUT->error_text($err["hostname"]);
}
?>
</td>
<td><?php print_string("auth_drupalserviceshostname", "auth_drupalservices") ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="cookiedomain"><?php print_string("auth_drupalservicescookiedomain_key", "auth_drupalservices") ?></label></td>
<td>
<input id="cookiedomain" name="cookiedomain" type="text" size="30" value="<?php echo $config->cookiedomain?>" />
<?php
if (isset($err["cookiedomain"])) {
echo $OUTPUT->error_text($err["cookiedomain"]);
}
?>
</td>
<td><?php print_string("auth_drupalservicescookiedomain", "auth_drupalservices") ?></td>
</tr>
<tr valign="top" class="required">
<td align="right"><label for="endpoint"><?php print_string("auth_drupalservicesendpoint_key", "auth_drupalservices") ?></label></td>
<td>
<input id="endpoint" name="endpoint" type="text" size="30" value="<?php echo $config->endpoint?>" />
<?php
if (isset($err["endpoint"])) {
echo $OUTPUT->error_text($err["endpoint"]);
}
?>
</td>
<td><?php print_string("auth_drupalservicesendpoint", "auth_drupalservices") ?></td>
</tr>
<tr valign="top">
<td align="right"><label for="menuremoveuser"><?php print_string('auth_drupalservicesremove_user_key','auth_drupalservices') ?></label></td>
<td>
<?php
$deleteopt = array();
$deleteopt[AUTH_REMOVEUSER_KEEP] = get_string('auth_remove_keep','auth');
$deleteopt[AUTH_REMOVEUSER_SUSPEND] = get_string('auth_remove_suspend','auth');
$deleteopt[AUTH_REMOVEUSER_FULLDELETE] = get_string('auth_remove_delete','auth');
echo html_writer::select($deleteopt, 'removeuser', $config->removeuser, false);
?>
</td>
<td>
<?php print_string('auth_drupalservicesremove_user','auth_drupalservices') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">
<label for="remote_user"><?php print_string('auth_drupalservices_remote_user_key', 'auth_drupalservices') ?></label>
</td>
<td>
<input name="remote_user" id="remote_user" type="text" size="30" value="<?php echo $config->remote_user?>" />
<?php if (isset($err['remote_user'])) { echo $OUTPUT->error_text($err['remote_user']); } ?>
</td>
<td>
<?php print_string('auth_drupalservices_remote_user', 'auth_drupalservices') ?>
</td>
</tr>
<tr valign="top" class="required">
<td align="right">
<label for="remote_pw"><?php print_string('auth_drupalservices_remote_pw_key', 'auth_drupalservices') ?></label>
</td>
<td>
<input name="remote_pw" id="remote_pw" type="password" size="30" value="<?php echo $config->remote_pw?>" />
<?php if (isset($err['remote_pw'])) { echo $OUTPUT->error_text($err['remote_pw']); } ?>
</td>
<td>
<?php print_string('auth_drupalservices_remote_pw', 'auth_drupalservices') ?>
</td>
</tr>
<tr valign="top">
<td align="right"><label for="menuupdatecohorts"><?php print_string("auth_drupalservices_cohorts_key", "auth_drupalservices") ?></label></td>
<td>
<?php echo html_writer::select($yesno, 'cohorts', $config->cohorts, false); ?>
</td>
<td><?php print_string("auth_drupalservices_cohorts", "auth_drupalservices") ?></td>
</tr>
<tr valign="top">
<td align="right">
<label for="cohort_view"><?php print_string('auth_drupalservices_cohort_view_key', 'auth_drupalservices') ?></label>
</td>
<td>
<input name="cohort_view" id="cohort_view" type="text" size="30" value="<?php echo $config->cohort_view?>" />
<?php if (isset($err['cohort_view'])) { echo $OUTPUT->error_text($err['cohort_view']); } ?>
</td>
<td>
<?php print_string('auth_drupalservices_cohort_view', 'auth_drupalservices') ?>
</td>
</tr>
<?php
print_auth_lock_options($this->authtype, $user_fields, get_string('auth_fieldlocks_help', 'auth'), false, false);
?>
</table>