@ -243,8 +243,9 @@ class UserManager {
if ($_configuration['multiple_access_urls']) {
require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
$url_id = 1;
if (api_get_current_access_url_id()!=-1)
if (api_get_current_access_url_id() != -1) {
$url_id = api_get_current_access_url_id();
}
UrlManager::delete_url_rel_user($user_id, $url_id);
}
@ -476,6 +477,7 @@ class UserManager {
}
return $return_array;
}
/**
* Get a list of users of which the given conditions match with a LIKE '%cond%'
* @param array $conditions a list of condition (exemple : status=>STUDENT)
@ -505,7 +507,6 @@ class UserManager {
return $return_array;
}
/**
* Get user information
* @param string The username
@ -564,6 +565,7 @@ class UserManager {
* @param array Content the list ID of user_id selected
*/
//for survey
// TODO: Ivan, 14-SEP-2009: It seems that this method is not used at all (it can be located in a test unit only. To be deprecated?
public static function get_teacher_list($course_id, $sel_teacher = '') {
$user_course_table = Database :: get_main_table(TABLE_MAIN_COURSE_USER);
$user_table = Database :: get_main_table(TABLE_MAIN_USER);
@ -949,6 +951,7 @@ class UserManager {
2 => $rowf['field_type'],
//3 => (empty($rowf['field_display_text']) ? '' : get_lang($rowf['field_display_text'], '')),
// Temporarily removed auto-translation. Need update to get_lang() to know if translation exists (todo)
// Ivan, 15-SEP-2009: get_lang() has been modified accordingly in order this issue to be solved.
3 => (empty($rowf['field_display_text']) ? '' : $rowf['field_display_text']),
4 => $rowf['field_default_value'],
5 => $rowf['field_order'],
@ -1880,10 +1883,10 @@ class UserManager {
*/
public static function resize_picture($file, $max_size_for_picture) {
if (!class_exists('image')) {
require_once( api_get_path(LIBRARY_PATH).'image.lib.php') ;
require_once api_get_path(LIBRARY_PATH).'image.lib.php';
}
$temp = new image($file);
$picture_infos = getimagesize($file); // TODO: Unsafe call when $file is URL actually.
$picture_infos = @getimagesize(api_url_to_local_path($file));
if ($picture_infos[0] > $max_size_for_picture) {
$thumbwidth = $max_size_for_picture;
if (empty($thumbwidth) or $thumbwidth == 0) {
@ -1945,11 +1948,10 @@ class UserManager {
* @param string The content message
*/
public static function send_message_in_outbox($email_administrator, $user_id, $title, $content) {
global $charset;
$table_message = Database::get_main_table(TABLE_MESSAGE);
$table_user = Database::get_main_table(TABLE_MAIN_USER);
$title = api_convert_encoding($title, $charset, 'UTF-8' );
$content = api_convert_encoding($content, $charset, 'UTF-8' );
$title = api_utf8_decode($title );
$content = api_utf8_decode($content );
//message in inbox
$sql_message_outbox = 'SELECT user_id from '.$table_user.' WHERE email="'.$email_administrator.'" ';
//$num_row_query = Database::num_rows($sql_message_outbox);