|
|
|
|
@ -1,26 +1,8 @@ |
|
|
|
|
<?php // $Id$
|
|
|
|
|
/* |
|
|
|
|
============================================================================== |
|
|
|
|
Dokeos - elearning and course management software |
|
|
|
|
|
|
|
|
|
Copyright (c) 2006 Dokeos S.A. |
|
|
|
|
|
|
|
|
|
For a full list of contributors, see "credits.txt". |
|
|
|
|
The full license can be read in "license.txt". |
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or |
|
|
|
|
modify it under the terms of the GNU General Public License |
|
|
|
|
as published by the Free Software Foundation; either version 2 |
|
|
|
|
of the License, or (at your option) any later version. |
|
|
|
|
|
|
|
|
|
See the GNU General Public License for more details. |
|
|
|
|
|
|
|
|
|
Contact: Dokeos, 44 rue des Palais, B-1030 Brussels, Belgium, info@dokeos.com |
|
|
|
|
============================================================================== |
|
|
|
|
*/ |
|
|
|
|
<?php |
|
|
|
|
/* For licensing terms, see /license.txt */ |
|
|
|
|
/** |
|
|
|
|
* This script contains the code to edit and send an e-mail to one of |
|
|
|
|
* Dokeos' users. |
|
|
|
|
* 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 <ywarnier@beeznest.org> |
|
|
|
|
@ -32,8 +14,7 @@ $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).'main.lib.inc.php'; |
|
|
|
|
if(empty($_user['user_id'])) |
|
|
|
|
{ |
|
|
|
|
if (empty($_user['user_id'])) { |
|
|
|
|
api_not_allowed(true); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@ -45,8 +26,7 @@ if(empty($_SESSION['origin_url'])){ |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/* Process the form and redirect to origin */ |
|
|
|
|
if(!empty($_POST['submit_email']) && !empty($_POST['email_title']) && !empty($_POST['email_text'])) |
|
|
|
|
{ |
|
|
|
|
if (!empty($_POST['submit_email']) && !empty($_POST['email_title']) && !empty($_POST['email_text'])) { |
|
|
|
|
$text = Security::remove_XSS($_POST['email_text'])."\n\n---\n".get_lang('EmailSentFromDokeos')." ".api_get_path(WEB_PATH); |
|
|
|
|
$email_administrator=Security::remove_XSS($_POST['dest']); |
|
|
|
|
$user_id=api_get_user_id(); |
|
|
|
|
|