Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 38... Línea 38...
38
 
38
 
39
    /** @var int Issuer is displayed on both login page and in the services lists */
39
    /** @var int Issuer is displayed on both login page and in the services lists */
40
    const EVERYWHERE = 1;
40
    const EVERYWHERE = 1;
41
    /** @var int Issuer is displayed on the login page only */
41
    /** @var int Issuer is displayed on the login page only */
-
 
42
    const LOGINONLY = 2;
-
 
43
    /** @var int Issuer is used for sending email using SMTP with XOAUTH2 */
42
    const LOGINONLY = 2;
44
    const SMTPWITHXOAUTH2 = 3;
43
    /** @var int Issuer is displayed only in the services lists and can not be used for login */
45
    /** @var int Issuer is displayed only in the services lists and can not be used for login */
Línea 44... Línea 46...
44
    const SERVICEONLY = 0;
46
    const SERVICEONLY = 0;
Línea 125... Línea 127...
125
            'loginpagename' => array(
127
            'loginpagename' => array(
126
                'type' => PARAM_TEXT,
128
                'type' => PARAM_TEXT,
127
                'null' => NULL_ALLOWED,
129
                'null' => NULL_ALLOWED,
128
                'default' => null,
130
                'default' => null,
129
            ),
131
            ),
-
 
132
            'systememail' => [
-
 
133
                'type' => PARAM_EMAIL,
-
 
134
                'null' => NULL_ALLOWED,
-
 
135
                'default' => null,
-
 
136
            ],
130
        );
137
        );
131
    }
138
    }
Línea 132... Línea 139...
132
 
139
 
133
    /**
140
    /**
Línea 198... Línea 205...
198
     */
205
     */
199
    public function is_available_for_login(): bool {
206
    public function is_available_for_login(): bool {
200
        return $this->get('id') &&
207
        return $this->get('id') &&
201
            $this->is_configured() &&
208
            $this->is_configured() &&
202
            $this->get('showonloginpage') != self::SERVICEONLY &&
209
            $this->get('showonloginpage') != self::SERVICEONLY &&
-
 
210
            $this->get('showonloginpage') != self::SMTPWITHXOAUTH2 &&
203
            $this->get('enabled') &&
211
            $this->get('enabled') &&
204
            !empty($this->get_endpoint_url('userinfo'));
212
            !empty($this->get_endpoint_url('userinfo'));
205
    }
213
    }
Línea 206... Línea 214...
206
 
214
 
Línea 266... Línea 274...
266
     * @return string
274
     * @return string
267
     */
275
     */
268
    public function get_display_name(): string {
276
    public function get_display_name(): string {
269
        return $this->get('loginpagename') ? $this->get('loginpagename') : $this->get('name');
277
        return $this->get('loginpagename') ? $this->get('loginpagename') : $this->get('name');
270
    }
278
    }
-
 
279
 
-
 
280
    /**
-
 
281
     * Get the system email address for this issuer.
-
 
282
     *
-
 
283
     * @return string|null The system email address or null if not set.
-
 
284
     */
-
 
285
    public function get_system_email(): ?string {
-
 
286
        return $this->get('systememail') ? $this->get('systememail') : null;
-
 
287
    }
271
}
288
}