Merge with a003da5ee4f5e63b2b0c5633573833c67fe37e97

skala
Ivan Tcholakov 14 years ago
commit 690380a753
  1. 2
      main/admin/add_users_to_group.php
  2. 2
      main/admin/add_users_to_session.php
  3. 20
      main/admin/calendar.lib.php
  4. 18
      main/admin/dashboard_add_courses_to_user.php
  5. 18
      main/admin/dashboard_add_sessions_to_user.php
  6. 24
      main/admin/dashboard_add_users_to_user.php
  7. 8
      main/admin/ldap_import_students.php
  8. 4
      main/admin/ldap_import_students_to_session.php
  9. 4
      main/admin/ldap_synchro.php
  10. 2
      main/admin/session_add.php
  11. 6
      main/admin/user_list.php
  12. 22
      main/calendar/agenda.inc.php
  13. 2
      main/conference/api.php
  14. 2
      main/inc/lib/access_url_edit_courses_to_url_functions.lib.php
  15. 2
      main/inc/lib/access_url_edit_sessions_to_url_functions.lib.php
  16. 2
      main/inc/lib/access_url_edit_users_to_url_functions.lib.php
  17. 2
      main/inc/lib/add_courses_to_session_functions.lib.php
  18. 2
      main/inc/lib/add_many_session_to_category_functions.lib.php
  19. 8
      main/inc/lib/message.lib.php
  20. 4
      main/newscorm/learnpath.class.php
  21. 4
      main/newscorm/lp_stats.php
  22. 4
      main/newscorm/openoffice_presentation.class.php
  23. 2
      main/newscorm/openoffice_text_document.class.php
  24. 8
      main/social/group_invitation.php

@ -106,7 +106,7 @@ function search_users($needle,$type,$relation_type) {
if (!empty($needle) && !empty($type)) { if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$user_anonymous=api_get_anonymous_id(); $user_anonymous=api_get_anonymous_id();

@ -80,7 +80,7 @@ function search_users($needle,$type)
if (!empty($needle) && !empty($type)) { if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$user_anonymous=api_get_anonymous_id(); $user_anonymous=api_get_anonymous_id();

@ -682,7 +682,7 @@ function display_agenda_items()
if (is_allowed_to_edit() && !api_is_anonymous()) { if (is_allowed_to_edit() && !api_is_anonymous()) {
$sql="SELECT * FROM ".$TABLEAGENDA; $sql="SELECT * FROM ".$TABLEAGENDA;
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
@ -1689,14 +1689,14 @@ function display_upcoming_events() {
{*/ {*/
//echo "course admin"; //echo "course admin";
$sqlquery = "SELECT DISTINCT * FROM ".$TABLEAGENDA; $sqlquery = "SELECT DISTINCT * FROM ".$TABLEAGENDA;
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
$sqlquery .= "WHERE access_url_id = $current_access_url_id "; $sqlquery .= "WHERE access_url_id = $current_access_url_id ";
$sqlquery .= " ORDER BY start_date "; $sqlquery .= " ORDER BY start_date ";
//} //}
// if the user is not an administrator of that course // if the user is not an administrator of that course
@ -2855,13 +2855,13 @@ function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end
if ($count > 0) { if ($count > 0) {
return false; return false;
} }
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
$sql = "INSERT INTO ".$t_agenda." (title,content, start_date, end_date, access_url_id) $sql = "INSERT INTO ".$t_agenda." (title,content, start_date, end_date, access_url_id)
VALUES ('".$title."','".$content."', '".$start_date."','".$end_date."', '".$current_access_url_id."')"; VALUES ('".$title."','".$content."', '".$start_date."','".$end_date."', '".$current_access_url_id."')";
@ -2940,16 +2940,16 @@ function agenda_add_item($course_info, $title, $content, $db_start_date, $db_end
$sql="SELECT DISTINCT * $sql="SELECT DISTINCT *
FROM ".$TABLEAGENDA." agenda FROM ".$TABLEAGENDA." agenda
WHERE MONTH(start_date)='".$month."' AND YEAR(start_date)='".$year."'"; WHERE MONTH(start_date)='".$month."' AND YEAR(start_date)='".$year."'";
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
$sql .= " AND access_url_id = '$current_access_url_id' "; $sql .= " AND access_url_id = '$current_access_url_id' ";
$sql .= "GROUP BY id ORDER BY start_date "; $sql .= "GROUP BY id ORDER BY start_date ";
$result=Database::query($sql); $result=Database::query($sql);
while ($row=Database::fetch_array($result)) { while ($row=Database::fetch_array($result)) {
@ -3062,7 +3062,7 @@ function agenda_add_repeat_item($course_info,$orig_id,$type,$end,$orig_dest)
function agenda_import_ical($course_info,$file) { function agenda_import_ical($course_info,$file) {
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$filepath = api_get_path(SYS_ARCHIVE_PATH).$file['name']; $filepath = api_get_path(SYS_ARCHIVE_PATH).$file['name'];
if(!@move_uploaded_file($file['tmp_name'],$filepath)) if(!@move_uploaded_file($file['tmp_name'],$filepath))
{ {

@ -73,7 +73,7 @@ function search_courses($needle,$type) {
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id); $assigned_courses_to_hrm = CourseManager::get_courses_followed_by_drh($user_id);
@ -88,7 +88,7 @@ function search_courses($needle,$type) {
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$sql = "SELECT c.code, c.title FROM $tbl_course c LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code) $sql = "SELECT c.code, c.title FROM $tbl_course c LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code)
WHERE c.code LIKE '$needle%' $without_assigned_courses AND access_url_id = ".api_get_current_access_url_id().""; WHERE c.code LIKE '$needle%' $without_assigned_courses AND access_url_id = ".api_get_current_access_url_id()."";
} else { } else {
$sql = "SELECT c.code, c.title FROM $tbl_course c $sql = "SELECT c.code, c.title FROM $tbl_course c
WHERE c.code LIKE '$needle%' $without_assigned_courses "; WHERE c.code LIKE '$needle%' $without_assigned_courses ";
@ -207,13 +207,13 @@ if (isset($_POST['firstLetterCourse'])) {
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$sql = " SELECT c.code, c.title FROM $tbl_course c LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code) $sql = " SELECT c.code, c.title FROM $tbl_course c LEFT JOIN $tbl_course_rel_access_url a ON (a.course_code = c.code)
WHERE c.code LIKE '$needle' $without_assigned_courses AND access_url_id = ".api_get_current_access_url_id().""; WHERE c.code LIKE '$needle' $without_assigned_courses AND access_url_id = ".api_get_current_access_url_id()."";
} else { } else {
$sql = " SELECT c.code, c.title FROM $tbl_course c $sql = " SELECT c.code, c.title FROM $tbl_course c
WHERE c.code LIKE '$needle' $without_assigned_courses "; WHERE c.code LIKE '$needle' $without_assigned_courses ";
} }
$result = Database::query($sql); $result = Database::query($sql);
?> ?>
@ -234,15 +234,15 @@ if(!empty($msg)) {
<td width="45%" align="center"><b><?php echo get_lang('CoursesListInPlatform') ?> :</b></td> <td width="45%" align="center"><b><?php echo get_lang('CoursesListInPlatform') ?> :</b></td>
<td width="10%">&nbsp;</td> <td width="10%">&nbsp;</td>
<td align="center" width="45%"><b> <td align="center" width="45%"><b>
<?php <?php
if (UserManager::is_admin($user_id)) { if (UserManager::is_admin($user_id)) {
echo get_lang('AssignedCoursesListToPlatformAdministrator'); echo get_lang('AssignedCoursesListToPlatformAdministrator');
} else if ($user_info['status'] == SESSIONADMIN) { } else if ($user_info['status'] == SESSIONADMIN) {
echo get_lang('AssignedCoursesListToSessionsAdministrator'); echo get_lang('AssignedCoursesListToSessionsAdministrator');
} else { } else {
echo get_lang('AssignedCoursesListToHumanResourcesManager'); echo get_lang('AssignedCoursesListToHumanResourcesManager');
} }
?> ?>
:</b></td> :</b></td>
</tr> </tr>

@ -68,11 +68,11 @@ if (!api_is_platform_admin() && !api_is_session_admin()) {
function search_sessions($needle,$type) { function search_sessions($needle,$type) {
global $_configuration, $tbl_session_rel_access_url, $tbl_session, $user_id; global $_configuration, $tbl_session_rel_access_url, $tbl_session, $user_id;
$xajax_response = new XajaxResponse(); $xajax_response = new XajaxResponse();
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id); $assigned_sessions_to_hrm = SessionManager::get_sessions_followed_by_drh($user_id);
$assigned_sessions_id = array_keys($assigned_sessions_to_hrm); $assigned_sessions_id = array_keys($assigned_sessions_to_hrm);
@ -87,9 +87,9 @@ function search_sessions($needle,$type) {
WHERE s.name LIKE '$needle%' $without_assigned_sessions AND access_url_id = ".api_get_current_access_url_id().""; WHERE s.name LIKE '$needle%' $without_assigned_sessions AND access_url_id = ".api_get_current_access_url_id()."";
} else { } else {
$sql = "SELECT s.id, s.name FROM $tbl_session s $sql = "SELECT s.id, s.name FROM $tbl_session s
WHERE s.name LIKE '$needle%' $without_assigned_sessions "; WHERE s.name LIKE '$needle%' $without_assigned_sessions ";
} }
$rs = Database::query($sql); $rs = Database::query($sql);
$return .= '<select id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20" style="width:340px;">'; $return .= '<select id="origin" name="NoAssignedSessionsList[]" multiple="multiple" size="20" style="width:340px;">';
@ -208,7 +208,7 @@ if ($_configuration['multiple_access_urls']) {
$sql = " SELECT s.id, s.name FROM $tbl_session s $sql = " SELECT s.id, s.name FROM $tbl_session s
WHERE s.name LIKE '$needle%' $without_assigned_sessions "; WHERE s.name LIKE '$needle%' $without_assigned_sessions ";
} }
$result = Database::query($sql); $result = Database::query($sql);
?> ?>
<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>> <form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?user=<?php echo $user_id ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
@ -228,15 +228,15 @@ if(!empty($msg)) {
<td width="45%" align="center"><b><?php echo get_lang('SessionsListInPlatform') ?> :</b></td> <td width="45%" align="center"><b><?php echo get_lang('SessionsListInPlatform') ?> :</b></td>
<td width="10%">&nbsp;</td> <td width="10%">&nbsp;</td>
<td align="center" width="45%"><b> <td align="center" width="45%"><b>
<?php <?php
if (UserManager::is_admin($user_id)) { if (UserManager::is_admin($user_id)) {
echo get_lang('AssignedSessionsListToPlatformAdministrator'); echo get_lang('AssignedSessionsListToPlatformAdministrator');
} else if ($user_info['status'] == SESSIONADMIN) { } else if ($user_info['status'] == SESSIONADMIN) {
echo get_lang('AssignedSessionsListToSessionsAdministrator'); echo get_lang('AssignedSessionsListToSessionsAdministrator');
} else { } else {
echo get_lang('AssignedSessionsListToHumanResourcesManager'); echo get_lang('AssignedSessionsListToHumanResourcesManager');
} }
?> ?>
: </b></td> : </b></td>
</tr> </tr>

@ -71,27 +71,27 @@ function search_users($needle,$type) {
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$assigned_users_to_hrm = UserManager::get_users_followed_by_drh($user_id); $assigned_users_to_hrm = UserManager::get_users_followed_by_drh($user_id);
$assigned_users_id = array_keys($assigned_users_to_hrm); $assigned_users_id = array_keys($assigned_users_to_hrm);
$without_assigned_users = ''; $without_assigned_users = '';
if (count($assigned_users_id) > 0) { if (count($assigned_users_id) > 0) {
$without_assigned_users = " AND user_id NOT IN(".implode(',',$assigned_users_id).")"; $without_assigned_users = " AND user_id NOT IN(".implode(',',$assigned_users_id).")";
} }
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$sql = "SELECT user.user_id, username, lastname, firstname FROM $tbl_user user LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id) $sql = "SELECT user.user_id, username, lastname, firstname FROM $tbl_user user LEFT JOIN $tbl_access_url_rel_user au ON (au.user_id = user.user_id)
WHERE ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND status NOT IN(".DRH.", ".SESSIONADMIN.") AND user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id) $without_assigned_users AND access_url_id = ".api_get_current_access_url_id().""; WHERE ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND status NOT IN(".DRH.", ".SESSIONADMIN.") AND user.user_id NOT IN ($user_anonymous, $current_user_id, $user_id) $without_assigned_users AND access_url_id = ".api_get_current_access_url_id()."";
} else { } else {
$sql = "SELECT user_id, username, lastname, firstname FROM $tbl_user user $sql = "SELECT user_id, username, lastname, firstname FROM $tbl_user user
WHERE ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND status NOT IN(".DRH.", ".SESSIONADMIN.") AND user_id NOT IN ($user_anonymous, $current_user_id, $user_id) $without_assigned_users"; WHERE ".(api_sort_by_first_name() ? 'firstname' : 'lastname')." LIKE '$needle%' AND status NOT IN(".DRH.", ".SESSIONADMIN.") AND user_id NOT IN ($user_anonymous, $current_user_id, $user_id) $without_assigned_users";
} }
$rs = Database::query($sql); $rs = Database::query($sql);
$return .= '<select id="origin" name="NoAssignedUsersList[]" multiple="multiple" size="20" style="width:340px;">'; $return .= '<select id="origin" name="NoAssignedUsersList[]" multiple="multiple" size="20" style="width:340px;">';
@ -181,7 +181,7 @@ echo '<div class="actions" style="height:22px;">
<span style="float: right;margin:0px;padding:0px;"> <span style="float: right;margin:0px;padding:0px;">
<a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.Display::return_icon('course_add.gif', get_lang('AssignCourses'), array('style'=>'vertical-align:middle')).' '.get_lang('AssignCourses').'</a> <a href="dashboard_add_courses_to_user.php?user='.$user_id.'">'.Display::return_icon('course_add.gif', get_lang('AssignCourses'), array('style'=>'vertical-align:middle')).' '.get_lang('AssignCourses').'</a>
<a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions'), array('style'=>'vertical-align:middle')).' '.get_lang('AssignSessions').'</a></span> <a href="dashboard_add_sessions_to_user.php?user='.$user_id.'">'.Display::return_icon('view_more_stats.gif', get_lang('AssignSessions'), array('style'=>'vertical-align:middle')).' '.get_lang('AssignSessions').'</a></span>
<span style="vertical-align:middle">'.sprintf(get_lang('AssignUsersToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])).'</span></div>'; <span style="vertical-align:middle">'.sprintf(get_lang('AssignUsersToX'), api_get_person_name($user_info['firstname'], $user_info['lastname'])).'</span></div>';
// ******************* // *******************
@ -206,7 +206,7 @@ if ($_configuration['multiple_access_urls']) {
$sql = "SELECT user_id, username, lastname, firstname FROM $tbl_user user $sql = "SELECT user_id, username, lastname, firstname FROM $tbl_user user
WHERE $without_assigned_users user_id NOT IN ($user_anonymous, $current_user_id, $user_id) AND status NOT IN(".DRH.", ".SESSIONADMIN.") $search_user "; WHERE $without_assigned_users user_id NOT IN ($user_anonymous, $current_user_id, $user_id) AND status NOT IN(".DRH.", ".SESSIONADMIN.") $search_user ";
} }
$result = Database::query($sql); $result = Database::query($sql);
?> ?>
@ -227,11 +227,11 @@ if(!empty($msg)) {
<td width="45%" align="center"><b><?php echo get_lang('UserListInPlatform') ?> :</b></td> <td width="45%" align="center"><b><?php echo get_lang('UserListInPlatform') ?> :</b></td>
<td width="10%">&nbsp;</td> <td width="10%">&nbsp;</td>
<td align="center" width="45%"><b> <td align="center" width="45%"><b>
<?php <?php
if (UserManager::is_admin($user_id)) { if (UserManager::is_admin($user_id)) {
echo get_lang('AssignedUsersListToPlatformAdministrator'); echo get_lang('AssignedUsersListToPlatformAdministrator');
} else if ($user_info['status'] == SESSIONADMIN) { } else if ($user_info['status'] == SESSIONADMIN) {
echo get_lang('AssignedUsersListToSessionsAdministrator'); echo get_lang('AssignedUsersListToSessionsAdministrator');
} else { } else {
echo get_lang('AssignedUsersListToHumanResourcesManager'); echo get_lang('AssignedUsersListToHumanResourcesManager');
} }

@ -109,7 +109,7 @@ elseif ($annee <> "" && $composante == "" && $etape == "") // form 2 annee != 0;
for($i = 0; $i < $info['count']; $i ++) for($i = 0; $i < $info['count']; $i ++)
{ {
//presupose LDAP server is UTF-8 //presupose LDAP server is UTF-8
$composante[$info[$i]['ou'][0]] = api_utf8_decode($info[$i]['description'][0], api_get_setting('platform_charset')); $composante[$info[$i]['ou'][0]] = api_utf8_decode($info[$i]['description'][0], api_get_system_encoding());
} }
$oucompotab3=$composante; $oucompotab3=$composante;
@ -189,7 +189,7 @@ elseif ($annee <> "" && $composante <> "" && $etape == "") // form3 :annee!=0com
if ($ouetapetab[$key] != $tempcomp) { if ($ouetapetab[$key] != $tempcomp) {
$etape = $ouetapetab2[$key]; $etape = $ouetapetab2[$key];
$tempcomp = '"'.$ouetapetab[$key].'"'; $tempcomp = '"'.$ouetapetab[$key].'"';
$tempcomp = api_utf8_decode($tempcomp, api_get_setting('platform_charset')); $tempcomp = api_utf8_decode($tempcomp, api_get_system_encoding());
$annee = str_word_count($etape, 1); $annee = str_word_count($etape, 1);
echo '<option value="'.$etape.'">'.$tempcomp.'</option>'; echo '<option value="'.$etape.'">'.$tempcomp.'</option>';
@ -255,8 +255,8 @@ elseif (!empty($annee) && !empty($course) && empty($_POST['confirmed']))
$info = ldap_get_entries($ds, $sr); $info = ldap_get_entries($ds, $sr);
for ($key = 0; $key < $info["count"]; $key ++) { for ($key = 0; $key < $info["count"]; $key ++) {
$nom_form[] = $info[$key]["sn"][0];//api_utf8_decode($info[$key]["sn"][0], api_get_setting('platform_charset')); $nom_form[] = $info[$key]["sn"][0];//api_utf8_decode($info[$key]["sn"][0], api_get_system_encoding());
$prenom_form[] = $info[$key]["givenname"][0];//api_utf8_decode($info[$key]["givenname"][0], api_get_setting('platform_charset')); $prenom_form[] = $info[$key]["givenname"][0];//api_utf8_decode($info[$key]["givenname"][0], api_get_system_encoding());
$email_form[] = $info[$key]["mail"][0]; $email_form[] = $info[$key]["mail"][0];
// Get uid from dn // Get uid from dn
//$dn_array=ldap_explode_dn($info[$key]["dn"],1); //$dn_array=ldap_explode_dn($info[$key]["dn"],1);

@ -130,8 +130,8 @@ elseif (!empty($annee) && !empty($id_session) && empty($_POST['confirmed']))
$info = ldap_get_entries($ds, $sr); $info = ldap_get_entries($ds, $sr);
for ($key = 0; $key < $info["count"]; $key ++) { for ($key = 0; $key < $info["count"]; $key ++) {
$nom_form[] = $info[$key]["sn"][0];//api_utf8_decode($info[$key]["sn"][0], api_get_setting('platform_charset')); $nom_form[] = $info[$key]["sn"][0];//api_utf8_decode($info[$key]["sn"][0], api_get_system_encoding());
$prenom_form[] = $info[$key]["givenname"][0];//api_utf8_decode($info[$key]["givenname"][0], api_get_setting('platform_charset')); $prenom_form[] = $info[$key]["givenname"][0];//api_utf8_decode($info[$key]["givenname"][0], api_get_system_encoding());
$email_form[] = $info[$key]["mail"][0]; $email_form[] = $info[$key]["mail"][0];
// Get uid from dn // Get uid from dn
//$dn_array=ldap_explode_dn($info[$key]["dn"],1); //$dn_array=ldap_explode_dn($info[$key]["dn"],1);

@ -109,8 +109,8 @@ foreach($Sessions as $session){
echo "<pre>"; echo "<pre>";
print_r($info[$key]); print_r($info[$key]);
echo "</pre>"; echo "</pre>";
$lastname = api_utf8_decode($info[$key]["sn"][0], api_get_setting('platform_charset')); $lastname = api_utf8_decode($info[$key]["sn"][0], api_get_system_encoding());
$firstname = api_utf8_decode($info[$key]["givenname"][0], api_get_setting('platform_charset')); $firstname = api_utf8_decode($info[$key]["givenname"][0], api_get_system_encoding());
$email = $info[$key]["mail"][0]; $email = $info[$key]["mail"][0];
// Get uid from dn // Get uid from dn
$dn_array=ldap_explode_dn($info[$key]["dn"],1); $dn_array=ldap_explode_dn($info[$key]["dn"],1);

@ -45,7 +45,7 @@ function search_coachs($needle) {
if(!empty($needle)) { if(!empty($needle)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username'; $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';

@ -148,7 +148,7 @@ function courses_of_user($arg) {
{ {
$newContent .= '- '.get_lang('None').' -<br />'; $newContent .= '- '.get_lang('None').' -<br />';
} }
$newContent = api_convert_encoding($newContent,'utf-8',api_get_setting('platform_charset')); $newContent = api_convert_encoding($newContent,'utf-8',api_get_system_encoding());
// Instantiate the xajaxResponse object // Instantiate the xajaxResponse object
$objResponse = new xajaxResponse(); $objResponse = new xajaxResponse();
@ -605,9 +605,9 @@ function modify_filter($user_id,$url_params,$row) {
$result .= Display::return_icon('edit_na.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;'; $result .= Display::return_icon('edit_na.gif', get_lang('Edit')).'</a>&nbsp;&nbsp;';
} }
if ($delete_user_available) { if ($delete_user_available) {
if ($row[0] != $_user['user_id'] && !$user_is_anonymous) { if ($row[0] != $_user['user_id'] && !$user_is_anonymous) {
// you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore. // you cannot lock yourself out otherwise you could disable all the accounts including your own => everybody is locked out and nobody can change it anymore.
$result .= '<a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>'; $result .= '<a href="user_list.php?action=delete_user&amp;user_id='.$user_id.'&amp;'.$url_params.'&amp;sec_token='.$_SESSION['sec_token'].'" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"),ENT_QUOTES,$charset))."'".')) return false;">'.Display::return_icon('delete.gif', get_lang('Delete')).'</a>';
} else { } else {
$result .= Display::return_icon('delete_na.gif', get_lang('Delete')); $result .= Display::return_icon('delete_na.gif', get_lang('Delete'));
} }

@ -259,20 +259,20 @@ function get_calendar_items($month, $year) {
$data[$datum_item][$datum_item][] = $row; $data[$datum_item][$datum_item][] = $row;
} }
} }
/* Check global agenda events */ /* Check global agenda events */
$table_agenda_system = Database :: get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); $table_agenda_system = Database :: get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
$sql = "SELECT DISTINCT * FROM ".$table_agenda_system." $sql = "SELECT DISTINCT * FROM ".$table_agenda_system."
WHERE WHERE
MONTH(start_date)='".$month."' MONTH(start_date)='".$month."'
AND YEAR(start_date)='".$year."' AND YEAR(start_date)='".$year."'
AND access_url_id = '$current_access_url_id' AND access_url_id = '$current_access_url_id'
ORDER BY start_date "; ORDER BY start_date ";
$result=Database::query($sql); $result=Database::query($sql);
@ -2052,7 +2052,7 @@ function display_agenda_items($select_month, $select_year) {
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
$sql = "SELECT DISTINCT id, title, content , start_date, end_date FROM ".$table_agenda_system." $sql = "SELECT DISTINCT id, title, content , start_date, end_date FROM ".$table_agenda_system."
WHERE 1=1 ".$show_all_current." AND access_url_id = $current_access_url_id WHERE 1=1 ".$show_all_current." AND access_url_id = $current_access_url_id
ORDER BY start_date "; ORDER BY start_date ";
@ -4614,7 +4614,7 @@ function agenda_add_repeat_item($course_info,$orig_id,$type,$end,$orig_dest,$fil
*/ */
function agenda_import_ical($course_info,$file) { function agenda_import_ical($course_info,$file) {
require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php'; require_once api_get_path(LIBRARY_PATH).'fileUpload.lib.php';
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$filepath = api_get_path(SYS_ARCHIVE_PATH).$file['name']; $filepath = api_get_path(SYS_ARCHIVE_PATH).$file['name'];
if(!@move_uploaded_file($file['tmp_name'],$filepath)) { if(!@move_uploaded_file($file['tmp_name'],$filepath)) {
error_log('Problem moving uploaded file: '.$file['error'].' in '.__FILE__.' line '.__LINE__); error_log('Problem moving uploaded file: '.$file['error'].' in '.__FILE__.' line '.__LINE__);
@ -4701,21 +4701,21 @@ function agenda_import_ical($course_info,$file) {
*/ */
function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "", $week = "", $type) { function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "", $week = "", $type) {
global $_user, $_configuration; global $_user, $_configuration;
$tbl_global_agenda= Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR); $tbl_global_agenda= Database::get_main_table(TABLE_MAIN_SYSTEM_CALENDAR);
$month=Database::escape_string($month); $month=Database::escape_string($month);
$year=Database::escape_string($year); $year=Database::escape_string($year);
$week=Database::escape_string($week); $week=Database::escape_string($week);
$day=Database::escape_string($day); $day=Database::escape_string($day);
// 1. creating the SQL statement for getting the personal agenda items in MONTH view // 1. creating the SQL statement for getting the personal agenda items in MONTH view
global $_configuration; global $_configuration;
$current_access_url_id = 1; $current_access_url_id = 1;
if ($_configuration['multiple_access_urls']) { if ($_configuration['multiple_access_urls']) {
$current_access_url_id = api_get_current_access_url_id(); $current_access_url_id = api_get_current_access_url_id();
} }
if ($type == "month_view" or $type == "") { if ($type == "month_view" or $type == "") {
// We are in month view // We are in month view
$sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date)='".$month."' AND YEAR(start_date) = '".$year."' AND access_url_id = $current_access_url_id ORDER BY start_date ASC"; $sql = "SELECT * FROM ".$tbl_global_agenda." WHERE MONTH(start_date)='".$month."' AND YEAR(start_date) = '".$year."' AND access_url_id = $current_access_url_id ORDER BY start_date ASC";
@ -4743,7 +4743,7 @@ function get_global_agenda_items($agendaitems, $day = "", $month = "", $year = "
$end_filter = $year."-".$month."-".$day." 23:59:59"; $end_filter = $year."-".$month."-".$day." 23:59:59";
$sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND access_url_id = $current_access_url_id"; $sql = " SELECT * FROM ".$tbl_global_agenda." WHERE start_date>='".$start_filter."' AND start_date<='".$end_filter."' AND access_url_id = $current_access_url_id";
} }
$result = Database::query($sql); $result = Database::query($sql);
while ($item = Database::fetch_array($result)) { while ($item = Database::fetch_array($result)) {

@ -177,7 +177,7 @@ else if ($action == "service")
api_strlen($files[$k]['title']) > 32 ? api_strlen($files[$k]['title']) > 32 ?
api_substr($files[$k]['title'],0, 32)."..." : api_substr($files[$k]['title'],0, 32)."..." :
$files[$k]['title'], $files[$k]['title'],
'utf-8',api_get_setting('platform_charset')); 'utf-8',api_get_system_encoding());
// removing '<', '>' and '_' // removing '<', '>' and '_'
$files[$k]['title'] = str_replace(array('<','>','_'),' ', $files[$k]['title']); $files[$k]['title'] = str_replace(array('<','>','_'),' ', $files[$k]['title']);
} }

@ -24,7 +24,7 @@ class Accessurleditcoursestourl {
if(!empty($needle)) { if(!empty($needle)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
// search courses where username or firstname or lastname begins likes $needle // search courses where username or firstname or lastname begins likes $needle

@ -24,7 +24,7 @@ class Accessurleditsessionstourl {
if(!empty($needle)) { if(!empty($needle)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
// search sessiones where username or firstname or lastname begins likes $needle // search sessiones where username or firstname or lastname begins likes $needle

@ -25,7 +25,7 @@ class Accessurledituserstourl{
if(!empty($needle)) { if(!empty($needle)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
// search users where username or firstname or lastname begins likes $needle // search users where username or firstname or lastname begins likes $needle

@ -14,7 +14,7 @@ class AddCourseToSession {
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$cond_course_code = ''; $cond_course_code = '';

@ -11,7 +11,7 @@ class AddManySessionToCategoryFunctions {
$return = ''; $return = '';
if(!empty($needle) && !empty($type)) { if(!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);

@ -298,7 +298,7 @@ class MessageManager
return $result; return $result;
} else { } else {
return get_lang('UserDoesNotExist'); return get_lang('UserDoesNotExist');
} }
} }
/** /**
@ -704,7 +704,7 @@ class MessageManager
$band=1; $band=1;
$row[5] = Security::remove_XSS($row[5]); $row[5] = Security::remove_XSS($row[5]);
$message_content = ' $message_content = '
<table class="message_view_table"> <table class="message_view_table">
<tr> <tr>
@ -744,7 +744,7 @@ class MessageManager
</tr> </tr>
</table> </table>
<br /> <br />
<table height=209 width="100%" bgColor=#ffffff> <table height=209 width="100%" bgColor=#ffffff>
<tr> <tr>
<td vAlign=top class="view-message-content">'.str_replace("\\","",$row[6]).'</td> <td vAlign=top class="view-message-content">'.str_replace("\\","",$row[6]).'</td>
</tr> </tr>
@ -1095,7 +1095,7 @@ class MessageManager
function inbox_display() { function inbox_display() {
global $charset; global $charset;
// $charset = api_get_setting('platform_charset'); // $charset = api_get_system_encoding();
$table_message = Database::get_main_table(TABLE_MESSAGE); $table_message = Database::get_main_table(TABLE_MESSAGE);
$request=api_is_xml_http_request(); $request=api_is_xml_http_request();
if ($_SESSION['social_exist']===true) { if ($_SESSION['social_exist']===true) {

@ -2360,7 +2360,7 @@ class learnpath {
*/ */
public function get_iv_interactions_array($lp_iv_id = 0) { public function get_iv_interactions_array($lp_iv_id = 0) {
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$list = array (); $list = array ();
$table = Database :: get_course_table(TABLE_LP_IV_INTERACTION); $table = Database :: get_course_table(TABLE_LP_IV_INTERACTION);
@ -2585,7 +2585,7 @@ class learnpath {
$is_allowed_to_edit = api_is_allowed_to_edit(null, true); $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$display_action_links_with_icons = false; $display_action_links_with_icons = false;
if ($this->debug > 0) { if ($this->debug > 0) {

@ -37,7 +37,7 @@ if ($origin != 'tracking') {
if (!empty ($stats_charset)) { if (!empty ($stats_charset)) {
$lp_charset = $stats_charset; $lp_charset = $stats_charset;
} else { } else {
$lp_charset = api_get_setting('platform_charset'); $lp_charset = api_get_system_encoding();
} }
$charset = $lp_charset; $charset = $lp_charset;
//$w = $tablewidth -20; //$w = $tablewidth -20;
@ -61,7 +61,7 @@ if ($origin != 'tracking') {
} }
// The Chamilo interface's encoding // The Chamilo interface's encoding
$dokeos_charset = api_get_setting('platform_charset'); $dokeos_charset = api_get_system_encoding();
$output = ''; $output = '';
// if display in fullscreen required. // if display in fullscreen required.
if (!empty($_GET['fs']) && strcmp($_GET['fs'], 'true') == 0) { if (!empty($_GET['fs']) && strcmp($_GET['fs'], 'true') == 0) {

@ -198,8 +198,8 @@ class OpenofficePresentation extends OpenofficeDocument {
list($slide_name,$file_name) = explode('||',$file); // '||' is used as separator between slide name (with accents) and file name (without accents). list($slide_name,$file_name) = explode('||',$file); // '||' is used as separator between slide name (with accents) and file name (without accents).
$slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset); $slide_name = api_htmlentities($slide_name, ENT_COMPAT, $this->original_charset);
$slide_name = str_replace('&rsquo;', '\'', $slide_name); $slide_name = str_replace('&rsquo;', '\'', $slide_name);
$slide_name = api_convert_encoding($slide_name, api_get_setting('platform_charset'), $this->original_charset); $slide_name = api_convert_encoding($slide_name, api_get_system_encoding(), $this->original_charset);
$slide_name = api_html_entity_decode($slide_name, ENT_COMPAT, api_get_setting('platform_charset')); $slide_name = api_html_entity_decode($slide_name, ENT_COMPAT, api_get_system_encoding());
$did = add_document($_course, $this->created_dir.'/'.urlencode($file_name), 'file', filesize($this->base_work_dir.$this->created_dir.'/'.$file_name), $slide_name); $did = add_document($_course, $this->created_dir.'/'.urlencode($file_name), 'file', filesize($this->base_work_dir.$this->created_dir.'/'.$file_name), $slide_name);
if ($did) if ($did)

@ -53,7 +53,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument {
// The file is utf8 encoded and it seems to make problems with special quotes. // The file is utf8 encoded and it seems to make problems with special quotes.
// then we htmlentities that, we replace these quotes and html_entity_decode that in good charset. // then we htmlentities that, we replace these quotes and html_entity_decode that in good charset.
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$content = api_htmlentities($content, ENT_COMPAT, $this->original_charset); $content = api_htmlentities($content, ENT_COMPAT, $this->original_charset);
$content = str_replace('&rsquo;', '\'', $content); $content = str_replace('&rsquo;', '\'', $content);
$content = api_convert_encoding($content, $charset, $this->original_charset); $content = api_convert_encoding($content, $charset, $this->original_charset);

@ -86,7 +86,7 @@ function search_users($needle,$type) {
if (!empty($needle) && !empty($type)) { if (!empty($needle) && !empty($type)) {
// xajax send utf8 datas... datas in db can be non-utf8 datas // xajax send utf8 datas... datas in db can be non-utf8 datas
$charset = api_get_setting('platform_charset'); $charset = api_get_system_encoding();
$needle = Database::escape_string($needle); $needle = Database::escape_string($needle);
$needle = api_convert_encoding($needle, $charset, 'utf-8'); $needle = api_convert_encoding($needle, $charset, 'utf-8');
$user_anonymous=api_get_anonymous_id(); $user_anonymous=api_get_anonymous_id();
@ -399,9 +399,9 @@ if ($add_type=='multiple') {
if(!empty($errorMsg)) { if(!empty($errorMsg)) {
Display::display_error_message($errorMsg); //main API Display::display_error_message($errorMsg); //main API
} }
echo '<div class="social-box-container2">'; echo '<div class="social-box-container2">';
echo '<div>'.Display::return_icon('content-post-group1.jpg',get_lang('SubscribeUsersToGroup')).'</div>'; echo '<div>'.Display::return_icon('content-post-group1.jpg',get_lang('SubscribeUsersToGroup')).'</div>';
echo '<div id="div_content_table" class="social-box-content2">'; echo '<div id="div_content_table" class="social-box-content2">';
?> ?>
<table border="0" cellpadding="5" cellspacing="0" width="100%"> <table border="0" cellpadding="5" cellspacing="0" width="100%">
@ -516,7 +516,7 @@ if (is_array($members) && count($members)>0) {
Display::display_sortable_grid('invitation_profile', array(), $members, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, false, true,true)); Display::display_sortable_grid('invitation_profile', array(), $members, array('hide_navigation'=>true, 'per_page' => 100), $query_vars, false, array(true, false, true,true));
} }
echo '</div>';//end class social-box-content2 echo '</div>';//end class social-box-content2
echo '</div>';// end class social-box-container2 echo '</div>';// end class social-box-container2
echo '</div>'; // end layout right echo '</div>'; // end layout right
echo '</div>'; // echo '</div>'; //

Loading…
Cancel
Save