Allow authentication with Microsoft's Azure Active Directory
Allow authentication (with OAuth2) with Microsoft's Azure Active Directory.
> This plugin use the [`thenetworg/oauth2-azure`](https://github.com/TheNetworg/oauth2-azure) package.
### To configure Azure Active Directory
* [Create an Azure AD B2C tenant](https://azure.microsoft.com/en-us/documentation/articles/active-directory-b2c-get-started/)
* [Register your application](https://azure.microsoft.com/en-us/documentation/articles/active-directory-b2c-app-registration/)
* [Configure Facebook, Google+, Microsoft account, Amazon, and LinkedIn accounts for use in your consumer-facing applications](https://azure.microsoft.com/en-us/documentation/articles/active-directory-b2c-overview/#how-to-articles)
* Create and configure an application.
* In _Authentication_ section, set an _Reply URL_ with `https://{CHAMILO_URL}/plugin/azure_active_directory/src/callback.php`.
* In _Certificates & secrets_, create a secret string (or application password). And keep copied.
### To configure this plugin
* Enable
* Application ID: Enter the Application Id assinged to your app by the Azure portal, e.g. 580e250c-8f26-49d0-bee8-1c078add1609
* Tenant: Enter the name of your B2C directory, e.g. contoso.onmicrosoft.com
* Sign up policy: Enter your sign up policy name, e.g. b2c_1_sign_up
* Sign in policy: Enter your sign in policy name, e.g. b2c_1_sign_in
* Block name: (Optional) The name to show above the buttons
* _Enable_
* _Application ID_: Enter the Application Id assinged to your app by the Azure portal.
* _Application secret_: Enter the client secret created.
* _Block name_: (Optional) The name to show above the login button.
* _Force logout button_: (Optional) Add a button to force logout from Azure.
* _Management login_: (Optional) Disable the chamilo login and enable an alternative login page for users.
You will need copy the `/plugin/azure_active_directory/layout/login_form.tpl` file to `/main/template/overrides/layout/` directory.
* _Name for the management login_: A name for the management login. By default is "Management Login".
$strings['management_login_enable_help'] = 'Disable the chamilo login and enable an alternative login page for users.<br>'
.'You will need copy the <code>/plugin/azure_active_directory/layout/login_form.tpl</code> file to <code>/main/template/overrides/layout/</code> directory.';
$strings['management_login_name'] = 'Name for the management login';
$strings['management_login_name_help'] = 'By default is "Management Login".';
@ -30,7 +30,8 @@ $strings['ServerIsNotConfigured'] = "Videoconference server is not configured";
$strings['XUsersOnLine'] = "%s user(s) online";
$strings['host'] = 'BigBlueButton host';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running. Might be localhost, an IP address (e.g. 192.168.13.54) or a domain name (e.g. my.video.com).';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running.
Might be localhost, an IP address (e.g. http://192.168.13.54) or a domain name (e.g. http://my.video.com).';
$strings['salt'] = 'BigBlueButton salt';
$strings['salt_help'] = 'This is the security key of your BigBlueButton server, which will allow your server to authentify the Chamilo installation. Refer to the BigBlueButton documentation to locate it. Try bbb-conf --salt';
@ -74,3 +75,5 @@ $strings['ParticipantsWillUseSameInterface'] = 'Participants will use the same i
$strings['SetByStudent'] = 'Set by student';
$strings['SetByTeacher'] = 'Set by teacher';
$strings['SetByDefault'] = 'Set to default interface';
@ -30,7 +30,8 @@ $strings['ServerIsNotConfigured'] = "Le serveur de vidéoconférence n'est pas c
$strings['XUsersOnLine'] = "%s utilisateurs dans la salle";
$strings['host'] = 'Hôte de BigBlueButton';
$strings['host_help'] = "C'est le nom du serveur où le serveur de vidéoconférence a été habilité. Cela peut être localhost, une adresse IP (du genre 192.168.13.54) ou un nom de domaine (du genre ma.video.com).";
$strings['host_help'] = "C'est le nom du serveur où le serveur de vidéoconférence a été habilité.
Cela peut être localhost, une adresse IP (du genre http://192.168.13.54) ou un nom de domaine (du genre http://ma.video.com).";
$strings['salt'] = 'Clef BigBlueButton';
$strings['salt_help'] = "C'est la clef de sécurité de votre serveur BigBlueButton (appelée 'salt' en anglais) qui permet à votre serveur de vérifier l'identité de votre installation de Chamilo et ainsi l'autoriser à se connecter. Veuillez vous référer à la documentation de BigBlueButton pour la localiser, ou utilisez la commande 'bbb-conf --salt' si vous disposez d'un accès en ligne de commande au serveur de vidéoconférence.";
@ -72,3 +73,4 @@ $strings['ParticipantsWillUseSameInterface'] = 'Les apprenants utiliseront la m
$strings['SetByDefault'] = 'Lancement de l\'interface par défaut';
$strings['SetByTeacher'] = 'Choisi par le professeur';
$strings['SetByStudent'] = 'Choisi par l\'apprenant';
$strings['bbb_force_record_generation'] = 'Forcer la génération de l\'enregistrement à la fin de la session';
@ -30,7 +30,7 @@ $strings['ServerIsNotConfigured'] = "Videokonferenzserver ist nicht konfiguriert
$strings['XUsersOnLine'] = "%s Benutzer online";
$strings['host'] = 'BigBlueButton host';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running. Might be localhost, an IP address (e.g. 192.168.13.54) or a domain name (e.g. my.video.com).';
$strings['host_help'] = 'This is the name of the server where your BigBlueButton server is running. Might be localhost, an IP address (e.g. http://192.168.13.54) or a domain name (e.g. http://my.video.com).';
$strings['salt'] = 'BigBlueButton salt';
$strings['salt_help'] = 'This is the security key of your BigBlueButton server, which will allow your server to authentify the Chamilo installation. Refer to the BigBlueButton documentation to locate it. Try bbb-conf --salt';
@ -30,7 +30,7 @@ $strings['ServerIsNotConfigured'] = "El servidor de videoconferencia no está co
$strings['XUsersOnLine'] = "%s usuario(s) en la sala";
$strings['host'] = 'Host de BigBlueButton';
$strings['host_help'] = 'Este es el nombre del servidor donde su servidor BigBlueButton está corriendo. Puede ser localhost, una dirección IP (ej: 192.168.13.54) o un nombre de dominio (ej: mi.video.com).';
$strings['host_help'] = 'Este es el nombre del servidor donde su servidor BigBlueButton está corriendo. Puede ser localhost, una dirección IP (ej: http://192.168.13.54) o un nombre de dominio (ej: http://mi.video.com).';
$strings['salt'] = 'Clave BigBlueButton';
$strings['salt_help'] = 'Esta es la llave de seguridad de su servidor BigBlueButton (llamada "salt" en inglés), que permitirá a su servidor de autentifica la instalación de Chamilo (como autorizada). Refiérese a la documentación de BigBlueButton para ubicarla, o use el comando "bbb-conf --salt" si tiene acceso al servidor en línea de comando.';
$strings['BankAccountInformation'] = "Detalhes da conta bancária";
$strings['BankAccount'] = "Contas bancárias";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Uma vez confirmada, você receberá um e-mail com os dados bancários e uma referência de ordem.";
$strings['SubscriptionToCourseXSuccessful'] = "Sua inscrição para \"%s\ foi concluída com sucesso.";
$strings['SubscriptionToCourseXSuccessful'] = "Sua inscrição para <ahref=\"%s\"><strong>\"%s\"</strong></a> foi concluída com sucesso.";
$strings['OrderCanceled'] = "Ordem cancelada";
$strings['OrderStatus'] = "Status do pedido";
$strings['SearchByStatus'] = "Pesquisar por estado";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Eenmaal bevestigd, ontvangt u een e-mail met de bankgegevens en een orderreferentie.";
$strings['SubscriptionToCourseXSuccessful'] = "Uw aankoop op \"%s\" werd met succes afgerond.";
$strings['SubscriptionToCourseXSuccessful'] = "Uw aankoop op <ahref=\"%s\"><strong>\"%s\"</strong></a> werd met succes afgerond.";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Once confirmed, you will receive an e-mail with the bank details and an order reference.";
$strings['SubscriptionToCourseXSuccessful'] = "Your subscription to \"%s\" was completed successfully.";
$strings['SubscriptionToCourseXSuccessful'] = "Your subscription to <ahref=\"%s\"><strong>\"%s\"</strong></a> was completed successfully.";
@ -82,7 +82,7 @@ $strings['CancelOrder'] = "Annuler la commande";
$strings['BankAccountInformation'] = "Détails du compte bancaire";
$strings['BankAccount'] = "Compte bancaire";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Une fois confirmée, vous recevrez un e-mail avec les données bancaires et la référence de la commande";
$strings['SubscriptionToCourseXSuccessful'] = "Votre inscription au \"%s\" est terminée.";
$strings['SubscriptionToCourseXSuccessful'] = "Votre inscription au <ahref=\"%s\"><strong>\"%s\"</strong></a> est terminée.";
$strings['InfoCommissions'] = "Ingrese aquí la comisión de ventas, en porcentaje (%), para la organización que controla la plataforma. Este porcentaje se deducirá del monto percibido por los docentes por cada curso o sessión vendido en la plataforma.";
$strings['InfoCommissions'] = "Ingrese aquí la comisión de ventas, en porcentaje (%), para la organización que controla la plataforma. Este porcentaje se deducirá del monto percibido por los docentes por cada curso o sesión vendido en la plataforma.";
$strings['NeedToSelectPaymentType'] = "Necesita seleccionar el tipo de pago";
$strings['BankAccountInformation'] = "Información de la Cuenta Bancaria";
$strings['BankAccount'] = "Cuenta Bancaria";
$strings['OnceItIsConfirmedYouWillReceiveAnEmailWithTheBankInformationAndAnOrderReference'] = "Una vez confirmado, recibira un e-mail con los datos bancarios y una referencia del pedido.";
$strings['SubscriptionToCourseXSuccessful'] = "Tu subscripción a \"%s\" se realizó correctamente.";
$strings['SubscriptionToCourseXSuccessful'] = "<pclass=\"lead\">Tu subscripción a <ahref=\"%s\"><strong>\"%s\"</strong></a> se realizó correctamente.</p>";
$strings['OrderCanceled'] = "Pedido cancelado";
$strings['OrderStatus'] = "Estado del pedido";
$strings['PayoutStatus'] = "Estado del pago";
@ -173,3 +175,37 @@ $strings['DeleteThisService'] = 'Eliminar este servicio';
$strings['YourCoursesNeedAtLeastOneLearningPath'] = 'Los cursos en los que estás registrado necesitan tener al menos una lección que contenga un item de cerficado final';
$strings['NoPaymentOptionAvailable'] = 'No existen opciones de pago. Por favor reporte este problema al administrador.';
$strings['XIsOnlyPaymentMethodAvailable'] = '%s es el único método de pago disponible para esta compra.';
$strings['GlobalTaxPerc'] = "Porcentaje del impuesto global";
$strings['GlobalTaxPercDescription'] = "Porcentaje por defecto que se usará, excepto si existe un impuesto específico en el curso, sesión o servicio.";
$strings['TaxPerc'] = "Porcentaje del impuesto";
$strings['TaxPercDescription'] = "Si se deja vacío se usará valor global por defecto.";
LEFT JOIN $tableUser c ON b.platform_user_id=c.user_id
WHERE a.specialty_id = $specialtyId";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
@ -440,7 +469,9 @@ function tutorsList($specialtyId)
function getListSpecialtyTutorial($specialtyId)
{
global $tableSepeParticipantsSpecialtyTutorials;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials WHERE participant_specialty_id = $specialtyId";
$specialtyId = (int) $specialtyId;
$sql = "SELECT * FROM $tableSepeParticipantsSpecialtyTutorials
WHERE participant_specialty_id = $specialtyId";
$res = Database::query($sql);
$aux = [];
while ($row = Database::fetch_assoc($res)) {
@ -457,9 +488,10 @@ function listCourseAction()
{
global $tableSepeActions;
global $tableSepeCourseActions;
$sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code
FROM $tableSepeCourseActions, course, $tableSepeActions
WHERE $tableSepeCourseActions.course_id=course.id
$sql = "SELECT $tableSepeCourseActions.*, course.title AS title, $tableSepeActions.action_origin AS action_origin, $tableSepeActions.action_code AS action_code
FROM $tableSepeCourseActions, course, $tableSepeActions
WHERE $tableSepeCourseActions.course_id=course.id
AND $tableSepeActions.id=$tableSepeCourseActions.action_id";
$res = Database::query($sql);
$aux = [];
@ -474,9 +506,10 @@ function listCourseFree()
{
global $tableCourse;
global $tableSepeCourseActions;
$sql = "SELECT id, title FROM $tableCourse
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
$sql = "SELECT id, title FROM $tableCourse
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions
WHERE $tableCourse.id = $tableSepeCourseActions.course_id)
;";
$res = Database::query($sql);
while ($row = Database::fetch_assoc($res)) {
@ -490,9 +523,9 @@ function listActionFree()
{
global $tableSepeActions;
global $tableSepeCourseActions;
$sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.id = $tableSepeCourseActions.action_id)
$sql = "SELECT id, action_origin, action_code FROM $tableSepeActions
WHERE NOT EXISTS (
SELECT * FROM $tableSepeCourseActions WHERE $tableSepeActions.id = $tableSepeCourseActions.action_id)
;";
$res = Database::query($sql);
$aux = [];
@ -508,8 +541,11 @@ function listActionFree()
function getSpecialtyTutorId($specialtyId, $tutorId)
{
global $tableSepeSpecialtyTutors;
$sql = "SELECT id
FROM $tableSepeSpecialtyTutors
$specialtyId = (int) $specialtyId;
$tutorId = (int) $tutorId;
$sql = "SELECT id
FROM $tableSepeSpecialtyTutors
WHERE specialty_id = $specialtyId AND tutor_id = $tutorId";
$res = Database::query($sql);
$row = Database::fetch_assoc($res);
@ -520,6 +556,8 @@ function getSpecialtyTutorId($specialtyId, $tutorId)
function checkInsertNewLog($platformUserId, $actionId)
{
global $tableSepeLogParticipant;
$platformUserId = (int) $platformUserId;
$actionId = (int) $actionId;
$sql = "SELECT * FROM $tableSepeLogParticipant WHERE platform_user_id = $platformUserId AND action_id = $actionId";
$res = Database::query($sql);
if (Database::num_rows($res) > 0) {
@ -532,6 +570,8 @@ function checkInsertNewLog($platformUserId, $actionId)
function getUserPlatformFromParticipant($participantId)
{
global $tableSepeParticipants;
$participantId = (int) $participantId;
$sql = "SELECT * FROM $tableSepeParticipants WHERE id = $participantId";