From 119ad9f35451fccf486d5ba6a140143322eb8a05 Mon Sep 17 00:00:00 2001
From: Ivan Tcholakov
Date: Thu, 15 Oct 2009 16:17:47 +0300
Subject: [PATCH] Feature #5397 - Replacing deprecated get_setting() with
api_get_setting().
---
main/auth/lost_password.lib.php | 10 +++++-----
main/user/user.php | 2 +-
user_portal.php | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
mode change 100755 => 100644 main/auth/lost_password.lib.php
mode change 100755 => 100644 main/user/user.php
mode change 100755 => 100644 user_portal.php
diff --git a/main/auth/lost_password.lib.php b/main/auth/lost_password.lib.php
old mode 100755
new mode 100644
index f7f23c830a..4e477686de
--- a/main/auth/lost_password.lib.php
+++ b/main/auth/lost_password.lib.php
@@ -98,7 +98,7 @@ function send_password_to_user($user, $by_username = false) {
/*
$emailHeaders = get_email_headers(); // Email Headers
*/
- $email_subject = "[".get_setting('siteName')."] ".get_lang('LoginRequest'); // SUBJECT
+ $email_subject = "[".api_get_setting('siteName')."] ".get_lang('LoginRequest'); // SUBJECT
if ($by_username) { // Show only for lost password
$user_account_list = get_user_account_list($user, false, $by_username); // BODY
@@ -119,13 +119,13 @@ function send_password_to_user($user, $by_username = false) {
$email_body = get_lang('YourAccountParam')." ".$portal_url."\n\n$user_account_list";
// SEND MESSAGE
- $sender_name = api_get_person_name(get_setting('administratorName'), get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
- $email_admin = get_setting('emailAdministrator');
+ $sender_name = api_get_person_name(api_get_setting('administratorName'), api_get_setting('administratorSurname'), null, PERSON_NAME_EMAIL_ADDRESS);
+ $email_admin = api_get_setting('emailAdministrator');
if (@api_mail('', $email_to, $email_subject, $email_body, $sender_name, $email_admin) == 1) {
Display::display_confirmation_message(get_lang('YourPasswordHasBeenEmailed'));
} else {
- $message = get_lang('SystemUnableToSendEmailContact').' '.Display :: encrypted_mailto_link(get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".
";
+ $message = get_lang('SystemUnableToSendEmailContact').' '.Display :: encrypted_mailto_link(api_get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".";
}
}
@@ -166,7 +166,7 @@ function handle_encrypted_password($user, $by_username = false) {
if (@api_mail('', $email_to, $email_subject, $email_body, $sender_name, $email_admin) == 1) {
Display::display_confirmation_message(get_lang('YourPasswordHasBeenEmailed'));
} else {
- $message = get_lang('SystemUnableToSendEmailContact').' '.Display :: encrypted_mailto_link(get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".";
+ $message = get_lang('SystemUnableToSendEmailContact').' '.Display :: encrypted_mailto_link(api_get_setting('emailAdministrator'), get_lang('PlatformAdmin')).".";
Display::display_error_message($message, false);
}
}
diff --git a/main/user/user.php b/main/user/user.php
old mode 100755
new mode 100644
index aada13d83a..9cbd170396
--- a/main/user/user.php
+++ b/main/user/user.php
@@ -618,7 +618,7 @@ if (!empty($_GET['keyword']) && !empty($_GET['submit'])) {
echo '
'.get_lang('SearchResultsFor').' '.$keyword_name.'
';
}
-if (get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_is_allowed_to_edit() && $origin != 'learnpath') { // only course administrators see this line
+if (api_get_setting('allow_user_headings') == 'true' && $is_courseAdmin && api_is_allowed_to_edit() && $origin != 'learnpath') { // only course administrators see this line
echo "", "", "
\n";
}
diff --git a/user_portal.php b/user_portal.php
old mode 100755
new mode 100644
index f4714cc78a..64d18ca82f
--- a/user_portal.php
+++ b/user_portal.php
@@ -491,7 +491,7 @@ function get_logged_user_course_html($course, $session_id = 0, $class='courses')
$result .= $course_display_title." "." ".get_lang('CourseClosed')."";
}
// show the course_code and teacher if chosen to display this
- if (api_get_setting('display_coursecode_in_courselist') == 'true' OR get_setting('display_teacher_in_courselist') == 'true') {
+ if (api_get_setting('display_coursecode_in_courselist') == 'true' || api_get_setting('display_teacher_in_courselist') == 'true') {
$result .= '
';
}
if (api_get_setting('display_coursecode_in_courselist') == 'true') {