diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755
diff --git a/.travis.yml b/.travis.yml
old mode 100644
new mode 100755
diff --git a/404.php b/404.php
old mode 100644
new mode 100755
diff --git a/README.txt b/README.txt
old mode 100644
new mode 100755
diff --git a/apple-touch-icon.png b/apple-touch-icon.png
old mode 100644
new mode 100755
diff --git a/certificates/index.php b/certificates/index.php
old mode 100644
new mode 100755
diff --git a/composer.json b/composer.json
old mode 100644
new mode 100755
diff --git a/custompages/README b/custompages/README
old mode 100644
new mode 100755
diff --git a/custompages/first_login.php b/custompages/first_login.php
old mode 100644
new mode 100755
diff --git a/custompages/images/footer.png b/custompages/images/footer.png
old mode 100644
new mode 100755
diff --git a/custompages/images/header.png b/custompages/images/header.png
old mode 100644
new mode 100755
diff --git a/custompages/images/login-form-submit-bg.jpg b/custompages/images/login-form-submit-bg.jpg
old mode 100644
new mode 100755
diff --git a/custompages/images/page-background.png b/custompages/images/page-background.png
old mode 100644
new mode 100755
diff --git a/custompages/index-logged.php b/custompages/index-logged.php
old mode 100644
new mode 100755
diff --git a/custompages/index-unlogged.php b/custompages/index-unlogged.php
old mode 100644
new mode 100755
diff --git a/custompages/language.inc.php b/custompages/language.inc.php
old mode 100644
new mode 100755
diff --git a/custompages/language.php b/custompages/language.php
old mode 100644
new mode 100755
diff --git a/custompages/loggedout.php b/custompages/loggedout.php
old mode 100644
new mode 100755
diff --git a/custompages/lostpassword.php b/custompages/lostpassword.php
old mode 100644
new mode 100755
diff --git a/custompages/registration-feedback.php b/custompages/registration-feedback.php
old mode 100644
new mode 100755
diff --git a/custompages/registration.php b/custompages/registration.php
old mode 100644
new mode 100755
diff --git a/custompages/style-ie6.css b/custompages/style-ie6.css
old mode 100644
new mode 100755
diff --git a/custompages/style.css b/custompages/style.css
old mode 100644
new mode 100755
diff --git a/custompages/url-images/README b/custompages/url-images/README
old mode 100644
new mode 100755
diff --git a/documentation/changelog.html b/documentation/changelog.html
old mode 100644
new mode 100755
diff --git a/documentation/credits.html b/documentation/credits.html
old mode 100644
new mode 100755
diff --git a/documentation/default.css b/documentation/default.css
old mode 100644
new mode 100755
diff --git a/documentation/dependencies.html b/documentation/dependencies.html
old mode 100644
new mode 100755
diff --git a/documentation/index.html b/documentation/index.html
old mode 100644
new mode 100755
diff --git a/documentation/installation_guide.html b/documentation/installation_guide.html
old mode 100644
new mode 100755
diff --git a/documentation/installation_guide_es_ES.html b/documentation/installation_guide_es_ES.html
old mode 100644
new mode 100755
diff --git a/documentation/license.html b/documentation/license.html
old mode 100644
new mode 100755
diff --git a/documentation/migration-checklist.html b/documentation/migration-checklist.html
old mode 100644
new mode 100755
diff --git a/documentation/optimization.html b/documentation/optimization.html
old mode 100644
new mode 100755
diff --git a/documentation/readme.html b/documentation/readme.html
old mode 100644
new mode 100755
diff --git a/documentation/security.html b/documentation/security.html
old mode 100644
new mode 100755
diff --git a/favicon.ico b/favicon.ico
old mode 100644
new mode 100755
diff --git a/htaccess b/htaccess
old mode 100644
new mode 100755
diff --git a/index.php b/index.php
old mode 100644
new mode 100755
diff --git a/license.txt b/license.txt
old mode 100644
new mode 100755
diff --git a/main/admin/db.php b/main/admin/db.php
old mode 100644
new mode 100755
diff --git a/main/admin/extra_field_options.php b/main/admin/extra_field_options.php
old mode 100644
new mode 100755
diff --git a/main/admin/extra_field_workflow.php b/main/admin/extra_field_workflow.php
old mode 100644
new mode 100755
diff --git a/main/admin/extra_fields.php b/main/admin/extra_fields.php
old mode 100644
new mode 100755
diff --git a/main/auth/set_temp_password.php b/main/auth/set_temp_password.php
old mode 100644
new mode 100755
diff --git a/main/chat/chat_message.php b/main/chat/chat_message.php
index 834fdefa8b..86355b274a 100755
--- a/main/chat/chat_message.php
+++ b/main/chat/chat_message.php
@@ -215,21 +215,19 @@ if (!empty($course) && !empty($_user['user_id'])) {
$fp = fopen($chat_path.$basename_chat.'.log.html', 'a');
// view user picture
- $user_image = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
- $user_photo = $user_image['dir'].'medium_'.$user_image['file'];
- $file_photo = '';
+ $userImage = UserManager::get_user_picture_path_by_id($user_id, 'web', false, true);
+ if (substr($userImage['file'],0,7) != 'unknown') {
+ $userPhoto = $userImage['dir'].'medium_'.$userImage['file'];
+ } else {
+ $userPhoto = $userImage['dir'].$userImage['file'];
+ }
+ $filePhoto = '
';
if ($isMaster) {
-
- // $photo = '
';
- fputs($fp, '