Fixing terms and conditions if the platform language is also unknown (no english/spanish)

skala
Julio Montoya 16 years ago
parent 43dfa8a427
commit 3ad6ec1788
  1. 37
      main/auth/inscription.php

@ -1,29 +1,5 @@
<?php
// $Id: inscription.php 22567 2009-08-02 23:10:29Z iflorespaz $
/*
==============================================================================
Dokeos - elearning and course management software
Copyright (c) 2004-2009 Dokeos SPRL
Copyright (c) 2003 Ghent University (UGent)
Copyright (c) 2001 Universite catholique de Louvain (UCL)
Copyright (c) various contributors
Copyright (c) Bart Mollet, Hogeschool Gent
For a full list of contributors, see "credits.txt".
The full license can be read in "license.txt".
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
See the GNU General Public License for more details.
Contact address: Dokeos, rue du Corbeau, 108, B-1030 Brussels, Belgium
Mail: info@dokeos.com
==============================================================================
*/
/* For licensing terms, see /dokeos_license.txt */
/**
==============================================================================
* This script displays a form for registering new users.
@ -308,13 +284,18 @@ if (get_setting('allow_terms_conditions')=='true') {
$language = api_get_interface_language();
$language = api_get_language_id($language);
$term_preview= LegalManager::get_last_condition($language);
if ($term_preview==false) {
//we load from the platform
$language = api_get_setting('platformLanguage');
$language = api_get_language_id($language);
$term_preview= LegalManager::get_last_condition($language);
}
$term_preview= LegalManager::get_last_condition($language);
//if is false we load from english
if ($term_preview==false){
$language = api_get_language_id('english'); //this must work
$term_preview= LegalManager::get_last_condition($language);
}
}
// Version and language //password
$form->addElement('hidden', 'legal_accept_type',$term_preview['version'].':'.$term_preview['language_id']);
$form->addElement('hidden', 'legal_info',$term_preview['legal_id'].':'.$term_preview['language_id']);

Loading…
Cancel
Save