| Línea 64... |
Línea 64... |
| 64 |
* @param mixed $attributes
|
64 |
* @param mixed $attributes
|
| 65 |
* @param bool $editable
|
65 |
* @param bool $editable
|
| 66 |
* @param array $ajaxformdata
|
66 |
* @param array $ajaxformdata
|
| 67 |
*/
|
67 |
*/
|
| 68 |
public function __construct($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null,
|
68 |
public function __construct($action = null, $customdata = null, $method = 'post', $target = '', $attributes = null,
|
| 69 |
$editable = true, array $ajaxformdata = null) {
|
69 |
$editable = true, ?array $ajaxformdata = null) {
|
| 70 |
// The type variable defines, if we are in the creation process of a standard issuer.
|
70 |
// The type variable defines, if we are in the creation process of a standard issuer.
|
| 71 |
if (array_key_exists('type', $customdata)) {
|
71 |
if (array_key_exists('type', $customdata)) {
|
| 72 |
$this->type = $customdata['type'];
|
72 |
$this->type = $customdata['type'];
|
| 73 |
}
|
73 |
}
|
| 74 |
parent::__construct($action, $customdata, $method, $target, $attributes, $editable, $ajaxformdata);
|
74 |
parent::__construct($action, $customdata, $method, $target, $attributes, $editable, $ajaxformdata);
|
| Línea 127... |
Línea 127... |
| 127 |
// Show on login page.
|
127 |
// Show on login page.
|
| 128 |
$options = [
|
128 |
$options = [
|
| 129 |
\core\oauth2\issuer::EVERYWHERE => get_string('issueruseineverywhere', 'tool_oauth2'),
|
129 |
\core\oauth2\issuer::EVERYWHERE => get_string('issueruseineverywhere', 'tool_oauth2'),
|
| 130 |
\core\oauth2\issuer::LOGINONLY => get_string('issueruseinloginonly', 'tool_oauth2'),
|
130 |
\core\oauth2\issuer::LOGINONLY => get_string('issueruseinloginonly', 'tool_oauth2'),
|
| 131 |
\core\oauth2\issuer::SERVICEONLY => get_string('issueruseininternalonly', 'tool_oauth2'),
|
131 |
\core\oauth2\issuer::SERVICEONLY => get_string('issueruseininternalonly', 'tool_oauth2'),
|
| - |
|
132 |
\core\oauth2\issuer::SMTPWITHXOAUTH2 => get_string('issueruseinsmtpwithoauth', 'tool_oauth2'),
|
| 132 |
];
|
133 |
];
|
| 133 |
$mform->addElement('select', 'showonloginpage', get_string('issuerusein', 'tool_oauth2'), $options);
|
134 |
$mform->addElement('select', 'showonloginpage', get_string('issuerusein', 'tool_oauth2'), $options);
|
| 134 |
$mform->addHelpButton('showonloginpage', 'issuerusein', 'tool_oauth2');
|
135 |
$mform->addHelpButton('showonloginpage', 'issuerusein', 'tool_oauth2');
|
| Línea 135... |
Línea 136... |
| 135 |
|
136 |
|
| 136 |
// Name on login page.
|
137 |
// Name on login page.
|
| 137 |
$mform->addElement('text', 'loginpagename', get_string('issuerloginpagename', 'tool_oauth2'));
|
138 |
$mform->addElement('text', 'loginpagename', get_string('issuerloginpagename', 'tool_oauth2'));
|
| 138 |
$mform->addRule('loginpagename', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
139 |
$mform->addRule('loginpagename', get_string('maximumchars', '', 255), 'maxlength', 255, 'client');
|
| 139 |
$mform->addHelpButton('loginpagename', 'issuerloginpagename', 'tool_oauth2');
|
140 |
$mform->addHelpButton('loginpagename', 'issuerloginpagename', 'tool_oauth2');
|
| - |
|
141 |
$mform->hideIf('loginpagename', 'showonloginpage', 'eq', \core\oauth2\issuer::SERVICEONLY);
|
| - |
|
142 |
$mform->hideIf('loginpagename', 'showonloginpage', 'eq', \core\oauth2\issuer::SMTPWITHXOAUTH2);
|
| - |
|
143 |
|
| - |
|
144 |
// Connected email for XOAUTH2.
|
| - |
|
145 |
$mform->addElement('text', 'systememail', get_string('issuersmtpsystememail', 'tool_oauth2'));
|
| - |
|
146 |
$mform->setType('systememail', PARAM_EMAIL);
|
| - |
|
147 |
$mform->addHelpButton('systememail', 'issuersmtpsystememail', 'tool_oauth2');
|
| Línea 140... |
Línea 148... |
| 140 |
$mform->hideIf('loginpagename', 'showonloginpage', 'eq', \core\oauth2\issuer::SERVICEONLY);
|
148 |
$mform->hideIf('systememail', 'showonloginpage', 'ne', \core\oauth2\issuer::SMTPWITHXOAUTH2);
|
| 141 |
|
149 |
|
| 142 |
// Login scopes.
|
150 |
// Login scopes.
|
| 143 |
$mform->addElement('text', 'loginscopes', get_string('issuerloginscopes', 'tool_oauth2'));
|
151 |
$mform->addElement('text', 'loginscopes', get_string('issuerloginscopes', 'tool_oauth2'));
|