Project

General

Profile

Bug #1129

Direct contact to teacher (click on its name) produces PHP error

Added by Carlos Brolo about 9 years ago. Updated almost 9 years ago.

Status:
Feature implemented
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
30/04/2010
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Chamilo 1.8.7 B1

Click to teachers name instead of showing the "web form" shows this message:

Fatal error: require_once() [function.require]: Failed opening required '/var/www/campus/main/inc/lib/main.lib.inc.php' (include_path='/var/www/campus/main/inc/lib/htmlpurifier/library:.:/var/www/campus/main/inc/lib/pear:/usr/share/php:/usr/share/pear') in /var/www/campus/main/messaging/email_editor.php on line 16

History

#1

Updated by Carlos Brolo about 9 years ago

On file /main/messaging/email_editor.php
Change code line # 16
from:
require_once api_get_path(LIBRARY_PATH).'main.lib.inc.php';

To:
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';

#2

Updated by Carlos Brolo about 9 years ago

have some sugestions:

1.- To use api_mail_html so we can send more "cute" emails.
2.- use header('location:'.'../messages/outbox.php?f=social'); so we show the message has been sent.

/* For licensing terms, see /license.txt /
/
* * This script contains the code to edit and send an e-mail to one of * the platform's users. * It can be called from the JavaScript library email_links.lib.php which * overtakes the mailto: links to use the internal interface instead. * @author Yannick Warnier <>
*/

// name of the language file that needs to be included
$language_file = "index";

require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'usermanager.lib.php';
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';
if (empty($_user['user_id'])) {
api_not_allowed(true);
}

//api_protect_course_script(); //not a course script, so no protection

/* Process the form and redirect to origin */
if (!empty($_POST['submit_email']) && !empty($_POST['email_title']) && !empty($_POST['email_text'])) {

$destiny=Security::remove_XSS($_POST['dest']);
$emailSubject = "[ CONTACTO ] " . $_POST['email_title'];
$user_id=api_get_user_id();
$mail_body = "<br />\n";
$email_text = str_replace('src=\"../../','src=\"'.api_get_path(WEB_PATH).'', $_POST['email_text']);
$mail_body .= trim(stripslashes($email_text));
$sender_name = api_get_person_name($_SESSION['_user']['lastName'], $_SESSION['_user']['firstName'], null, PERSON_NAME_EMAIL_ADDRESS);
$sender_email = $_SESSION['_user']['mail'];
$mail_body .= "<br />-- <br />";
$mail_body .= api_get_person_name($_user['firstName'], $_user['lastName'], null, PERSON_NAME_EMAIL_ADDRESS)." \n";
$mail_body.= "<br /> \n".$sender_email;

$sender_name = api_get_person_name($_SESSION['_user']['lastName'], $_SESSION['_user']['firstName'], null, PERSON_NAME_EMAIL_ADDRESS);

if (!empty($_user['mail'])) {
api_mail_html($destiny, $destiny, stripslashes($emailSubject), $mail_body, $sender_name, $sender_email, null, null);
UserManager::send_message_in_outbox ($destiny,$user_id,$emailSubject, $mail_body);
} else {
api_mail_html($destiny, $destiny, stripslashes($emailSubject), $mail_body, get_lang('Anonymous'), get_lang('Anonymous'), null, null);
}

header('location:'.'../messages/outbox.php?f=social');
}

/* Header */
Display::display_header(get_lang('SendEmail'));

?>

#3

Updated by Yannick Warnier about 9 years ago

  • Status changed from New to Assigned
  • Assignee set to Carlos Vargas
  • Target version set to 1.8.7 RC1
#4

Updated by Julio Montoya about 9 years ago

  • Assignee changed from Carlos Vargas to Julio Montoya
  • Target version changed from 1.8.7 RC1 to 1.8.7.1

This change was already done
Carlos Brolo wrote:

On file /main/messaging/email_editor.php
Change code line # 16
from:
require_once api_get_path(LIBRARY_PATH).'main.lib.inc.php';

To:
require_once api_get_path(LIBRARY_PATH).'mail.lib.inc.php';

#5

Updated by Yannick Warnier almost 9 years ago

  • Assignee changed from Julio Montoya to Yannick Warnier

Carlos, did you already try your own code (below) on your own installation? (just to cut a bit of the testing work).

The email_editor.php file is now in main/inc/email_editor.php

#6

Updated by Curt Ricardo Rodriguez Salazar almost 9 years ago

  • Target version changed from 1.8.7.1 to 1.8.8 stable

Postponed for lack of feedback

#7

Updated by Julio Montoya almost 9 years ago

  • Status changed from Assigned to Feature implemented
  • Assignee deleted (Yannick Warnier)

Closing for lack of feedback. Feel free to re-open if the problem persists.

Also available in: Atom PDF