FIx Paths see BT #11047

ofaj
jmontoyaa 10 years ago
parent 439eb12f74
commit a1bc3c2d52
  1. 6
      main/coursecopy/classes/CourseRestorer.class.php
  2. 9
      main/cron/notification.php
  3. 3
      main/document/create_document.php
  4. 49
      main/document/edit_draw.php
  5. 36
      main/exercice/export/exercise_import.php
  6. 7
      main/glossary/glossary_ajax_request.php
  7. 7
      main/inc/ajax/nanogong.ajax.php
  8. 8
      main/inc/global.inc.php
  9. 4
      main/inc/global_error_message.inc.php
  10. 370
      main/inc/lib/api.lib.php
  11. 9
      main/inc/lib/course_home.lib.php
  12. 3
      main/inc/lib/glossary.lib.php
  13. 8
      main/inc/lib/online.inc.php
  14. 3
      main/inc/lib/pdf.lib.php
  15. 13
      main/inc/lib/system_announcements.lib.php
  16. 3
      main/inc/lib/template.lib.php
  17. 5
      main/inc/lib/usermanager.lib.php
  18. 15
      main/inc/lib/userportal.lib.php
  19. 2
      main/install/install.lib.php
  20. 8
      main/newscorm/learnpath.class.php
  21. 2
      main/newscorm/lp_list.php
  22. 2
      main/newscorm/scorm_api.php
  23. 4
      main/wiki/wiki.inc.php
  24. 4
      src/Chamilo/UserBundle/Entity/User.php

@ -2766,9 +2766,9 @@ class CourseRestorer
} }
} }
$destination = '../../courses/'.$this->course->destination_path.'/work/'; $destination = '../..'.api_get_path(REL_COURSE_PATH).$this->course->destination_path.'/work/';
$origin = '../../courses/'.$this->course->info['path'].'/work/'; $origin = '../..'.api_get_path(REL_COURSE_PATH).$this->course->info['path'].'/work/';
self::allow_create_all_directory($origin,$destination,false); self::allow_create_all_directory($origin, $destination, false);
} }
/** /**

@ -4,14 +4,13 @@
* @package chamilo.notification * @package chamilo.notification
* @author Julio Montoya <gugli100@gmail.com> * @author Julio Montoya <gugli100@gmail.com>
*/ */
/**
* Initialization if (PHP_SAPI != 'cli') {
*/
if (PHP_SAPI!='cli') {
die('Run this script through the command line or comment this line in the code'); die('Run this script through the command line or comment this line in the code');
} }
require_once '../inc/global.inc.php'; require_once __DIR__.'/../inc/global.inc.php';
/** /**
* Notification sending * Notification sending
*/ */

@ -489,7 +489,8 @@ if ($form->validate()) {
} }
if ($fp = @fopen($filepath.$filename.'.'.$extension, 'w')) { if ($fp = @fopen($filepath.$filename.'.'.$extension, 'w')) {
$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].'/courses/', $content); //$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].'/courses/', $content);
$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].api_get_path(REL_COURSE_PATH), $content);
fputs($fp, $content); fputs($fp, $content);
fclose($fp); fclose($fp);

@ -9,6 +9,7 @@
* @author Juan Carlos Ra<EFBFBD>a Trabado * @author Juan Carlos Ra<EFBFBD>a Trabado
* @since 25/september/2010 * @since 25/september/2010
*/ */
require_once '../inc/global.inc.php'; require_once '../inc/global.inc.php';
$_SESSION['whereami'] = 'document/editdraw'; $_SESSION['whereami'] = 'document/editdraw';
@ -28,26 +29,25 @@ if (empty($document_data)) {
$parent_id = DocumentManager::get_document_id(api_get_course_info(), $dir); $parent_id = DocumentManager::get_document_id(api_get_course_info(), $dir);
$my_cur_dir_path = Security::remove_XSS($_GET['curdirpath']); $my_cur_dir_path = Security::remove_XSS($_GET['curdirpath']);
} }
//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261)
$dir= str_replace('\\', '/',$dir);//and urlencode each url $curdirpath (hack clean $curdirpath under Windows - Bug #3261) $dir = str_replace('\\', '/', $dir);
/* Constants & Variables */ /* Constants & Variables */
$current_session_id=api_get_session_id(); $current_session_id=api_get_session_id();
$group_id = api_get_group_id(); $group_id = api_get_group_id();
//path for svg-edit save //path for svg-edit save
$_SESSION['draw_dir']=Security::remove_XSS($dir); $_SESSION['draw_dir'] = Security::remove_XSS($dir);
if ($_SESSION['draw_dir']=='/'){ if ($_SESSION['draw_dir'] == '/') {
$_SESSION['draw_dir'] = ''; $_SESSION['draw_dir'] = '';
} }
$_SESSION['draw_file']=basename(Security::remove_XSS($file_path)); $_SESSION['draw_file'] = basename(Security::remove_XSS($file_path));
$get_file = Security::remove_XSS($file_path); $get_file = Security::remove_XSS($file_path);
$file = basename($get_file); $file = basename($get_file);
$temp_file = explode(".",$file); $temp_file = explode(".", $file);
$filename=$temp_file[0]; $filename = $temp_file[0];
$nameTools = get_lang('EditDocument') . ': '.$filename; $nameTools = get_lang('EditDocument') . ': ' . $filename;
$courseDir = $_course['path'] . '/document';
$courseDir = $_course['path'].'/document';
$is_allowed_to_edit = api_is_allowed_to_edit(null, true); $is_allowed_to_edit = api_is_allowed_to_edit(null, true);
/* Other initialization code */ /* Other initialization code */
@ -79,8 +79,10 @@ if (!is_dir($filepath)) {
//groups //TODO:clean //groups //TODO:clean
if (!empty($group_id)) { if (!empty($group_id)) {
$req_gid = '&amp;gidReq='.$group_id; $interbreadcrumb[] = array(
$interbreadcrumb[] = array ('url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?gidReq='.$group_id, 'name' => get_lang('GroupSpace')); 'url' => api_get_path(WEB_CODE_PATH).'group/group_space.php?'.api_get_cidreq(),
'name' => get_lang('GroupSpace'),
);
$group_document = true; $group_document = true;
$noPHP_SELF = true; $noPHP_SELF = true;
} }
@ -88,15 +90,18 @@ if (!empty($group_id)) {
$is_certificate_mode = DocumentManager::is_certificate_mode($dir); $is_certificate_mode = DocumentManager::is_certificate_mode($dir);
if (!$is_certificate_mode) if (!$is_certificate_mode)
$interbreadcrumb[]= array("url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).$req_gid, "name"=> get_lang('Documents')); $interbreadcrumb[] = array(
"url" => "./document.php?curdirpath=".urlencode($my_cur_dir_path).'&'.api_get_cidreq(),
"name" => get_lang('Documents'),
);
else else
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook')); $interbreadcrumb[] = array('url' => '../gradebook/'.$_SESSION['gradebook_dest'], 'name' => get_lang('Gradebook'));
// Interbreadcrumb for the current directory root path // Interbreadcrumb for the current directory root path
if (empty($document_data['parents'])) { if (empty($document_data['parents'])) {
$interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']); $interbreadcrumb[] = array('url' => '#', 'name' => $document_data['title']);
} else { } else {
foreach($document_data['parents'] as $document_sub_data) { foreach ($document_data['parents'] as $document_sub_data) {
if ($document_data['title'] == $document_sub_data['title']) { if ($document_data['title'] == $document_sub_data['title']) {
continue; continue;
} }
@ -115,8 +120,10 @@ Event::event_access_tool(TOOL_DOCUMENT);
Display :: display_header($nameTools, 'Doc'); Display :: display_header($nameTools, 'Doc');
echo '<div class="actions">'; echo '<div class="actions">';
echo '<a href="document.php?id='.$parent_id.'">'.Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>'; echo '<a href="document.php?id='.$parent_id.'">'.
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.$req_gid.'&origin=editdraw">'.Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>'; Display::return_icon('back.png',get_lang('BackTo').' '.get_lang('DocumentsOverview'),'',ICON_SIZE_MEDIUM).'</a>';
echo '<a href="edit_document.php?'.api_get_cidreq().'&id='.$document_id.'&origin=editdraw">'.
Display::return_icon('edit.png',get_lang('Rename').'/'.get_lang('Comments'),'',ICON_SIZE_MEDIUM).'</a>';
echo '</div>'; echo '</div>';
if (api_browser_support('svg')) { if (api_browser_support('svg')) {
@ -125,13 +132,11 @@ if (api_browser_support('svg')) {
$langsvgedit = api_get_language_isocode(); $langsvgedit = api_get_language_isocode();
$langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit; $langsvgedit = isset($svgedit_code_translation_table[$langsvgedit]) ? $svgedit_code_translation_table[$langsvgedit] : $langsvgedit;
$langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en'; $langsvgedit = file_exists(api_get_path(LIBRARY_PATH).'svg-edit/locale/lang.'.$langsvgedit.'.js') ? $langsvgedit : 'en';
//$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit;
$svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../../courses/'.$courseDir.$dir.$file.'&amp;lang='.$langsvgedit; $svg_url= api_get_path(WEB_LIBRARY_PATH).'svg-edit/svg-editor.php?url=../../../..'.api_get_path(REL_COURSE_PATH).$courseDir.$dir.$file.'&lang='.$langsvgedit;
?> ?>
<script type="text/javascript"> <script type="text/javascript">
document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'); document.write ('<iframe id="frame" frameborder="0" scrolling="no" src="<?php echo $svg_url; ?>" width="100%" height="100%"><noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>');
function resizeIframe() { function resizeIframe() {
var height = window.innerHeight -50; var height = window.innerHeight -50;
@ -143,9 +148,7 @@ if (api_browser_support('svg')) {
}; };
document.getElementById('frame').onload = resizeIframe; document.getElementById('frame').onload = resizeIframe;
window.onresize = resizeIframe; window.onresize = resizeIframe;
</script> </script>
<?php <?php
echo '<noscript>'; echo '<noscript>';
echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>'; echo '<iframe style="height: 550px; width: 100%;" scrolling="no" frameborder="0\' src="'.$svg_url.'"<noframes><p>Sorry, your browser does not handle frames</p></noframes></iframe>';

@ -1,14 +1,10 @@
<?php // $Id: $ <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* @copyright (c) 2001-2006 Universite catholique de Louvain (UCL) * @copyright (c) 2001-2006 Universite catholique de Louvain (UCL)
* @package chamilo.exercise * @package chamilo.exercise
* @author claro team <cvs@claroline.net> * @author claro team <cvs@claroline.net>
*/ */
/**
* Code
*/
require '../../inc/global.inc.php'; require '../../inc/global.inc.php';
//SECURITY CHECK //SECURITY CHECK
@ -30,15 +26,9 @@ $tbl_rel_exercise_question = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION
//Tool title //Tool title
$nameTools = get_lang('ImportExercise'); $nameTools = get_lang('ImportExercise');
//bredcrump
$interbredcrump[] = array('url' => '../exercise.php', 'name' => get_lang('Exercises')); $interbredcrump[] = array('url' => '../exercise.php', 'name' => get_lang('Exercises'));
//----------------------------------
// EXECUTE COMMAND // EXECUTE COMMAND
//----------------------------------
$cmd = (isset($_REQUEST['cmd'])? $_REQUEST['cmd'] : 'show_import'); $cmd = (isset($_REQUEST['cmd'])? $_REQUEST['cmd'] : 'show_import');
switch ($cmd) { switch ($cmd) {
@ -75,33 +65,22 @@ switch ($cmd) {
break; break;
} }
//----------------------------------
// FIND INFORMATION
//----------------------------------
//empty!
//----------------------------------
// DISPLAY // DISPLAY
//----------------------------------
include api_get_path(INCLUDE_PATH) . '/header.inc.php'; include api_get_path(INCLUDE_PATH) . '/header.inc.php';
//display title
// Tool introduction // Tool introduction
// TODO: These settings to be checked when it is possible. // TODO: These settings to be checked when it is possible.
Display::display_introduction_section(TOOL_QUIZ, array( Display::display_introduction_section(
TOOL_QUIZ,
array(
'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/',
'CreateDocumentDir' => '../../../courses/'.api_get_course_path().'/document/', 'CreateDocumentDir' => '../../..'.api_get_path(REL_COURSE_PATH).api_get_course_path().'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/' 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/'
) )
); );
// Display Forms or dialog box(if needed)
//Display Forms or dialog box(if needed)
if (isset($dialogBox)) { if (isset($dialogBox)) {
echo Display::display_normal_message($dialogBox, false); echo Display::display_normal_message($dialogBox, false);
} }
@ -112,7 +91,4 @@ if (isset($display)) {
echo $display; echo $display;
} }
//footer display
include api_get_path(INCLUDE_PATH) . '/footer.inc.php'; include api_get_path(INCLUDE_PATH) . '/footer.inc.php';
?>

@ -16,14 +16,13 @@ $charset = api_get_system_encoding();
//replace image path //replace image path
$path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path(); $path_image = api_get_path(WEB_COURSE_PATH).api_get_course_path();
$path_image_search = '../../courses/'.api_get_course_path(); $path_image_search = '../..'.api_get_path(REL_COURSE_PATH).api_get_course_path();
if (isset($_POST['glossary_id']) && if (isset($_POST['glossary_id']) &&
$_POST['glossary_id'] == strval(intval($_POST['glossary_id'])) $_POST['glossary_id'] == strval(intval($_POST['glossary_id']))
) { ) {
$glossary_id= Security::remove_XSS($_POST['glossary_id']);
$glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id( $glossary_description_by_id = GlossaryManager::get_glossary_term_by_glossary_id(
$glossary_id $_POST['glossary_id']
); );
$glossary_description_by_id = str_replace( $glossary_description_by_id = str_replace(
$path_image_search, $path_image_search,
@ -31,7 +30,7 @@ if (isset($_POST['glossary_id']) &&
$glossary_description_by_id $glossary_description_by_id
); );
echo api_xml_http_response_encode($glossary_description_by_id); echo api_xml_http_response_encode($glossary_description_by_id);
} elseif (isset($_POST['glossary_data']) && $_POST['glossary_data']=='true') { } elseif (isset($_POST['glossary_data']) && $_POST['glossary_data'] == 'true') {
//get_glossary_terms //get_glossary_terms
$glossary_data = GlossaryManager::get_glossary_terms(); $glossary_data = GlossaryManager::get_glossary_terms();
$glossary_all_data = array(); $glossary_all_data = array();

@ -1,15 +1,14 @@
<?php <?php
/* For licensing terms, see /license.txt */ /* For licensing terms, see /license.txt */
/** /**
* Responses to AJAX calls * Responses to AJAX calls
*/ */
require_once '../global.inc.php'; require_once '../global.inc.php';
//@todo for some reason nanogong doesn't like this variables //@todo for some reason nanogong doesn't like this variables
//api_protect_course_script(true);
$action = $_REQUEST['a']; $action = $_REQUEST['a'];
unset($_REQUEST['a']); unset($_REQUEST['a']);
$js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/'; $js_path = api_get_path(WEB_LIBRARY_PATH).'javascript/';
@ -33,7 +32,6 @@ switch ($action) {
case 'get_file': case 'get_file':
if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) { if ($nano->get_param_value('user_id') == api_get_user_id() || api_is_allowed_to_edit()) {
$file_path = $nano->load_filename_if_exists(); $file_path = $nano->load_filename_if_exists();
//$file_path = '/var/www/rocio/courses/GREAT123/exercises/0/2/5/1/1-0-1-2-5-38.mp3';
if ($file_path) { if ($file_path) {
$info = pathinfo($file_path); $info = pathinfo($file_path);
$user_info = api_get_user_info($nano->params['user_id']); $user_info = api_get_user_info($nano->params['user_id']);
@ -69,8 +67,7 @@ switch ($action) {
echo $nano->return_form(); echo $nano->return_form();
break; break;
case 'save_file': case 'save_file':
//User access same as upload.php // User access same as upload.php
$return = $nano->upload_file($is_nano); $return = $nano->upload_file($is_nano);
if ($is_nano) { if ($is_nano) {

@ -43,11 +43,14 @@ if (file_exists($kernel->getConfigurationFile())) {
$_configuration = array(); $_configuration = array();
} }
// Recalculate a system absolute path symlinks insensible.
$includePath = $_configuration['root_sys'].'main/inc/';
//Redirects to the main/install/ page //Redirects to the main/install/ page
if (!$alreadyInstalled) { if (!$alreadyInstalled) {
$global_error_code = 2; $global_error_code = 2;
// The system has not been installed yet. // The system has not been installed yet.
require $includePath.'/global_error_message.inc.php'; require_once $includePath.'/global_error_message.inc.php';
die(); die();
} }
@ -58,7 +61,8 @@ if (!isset($GLOBALS['_configuration'])) {
} }
// Include the main Chamilo platform library file. // Include the main Chamilo platform library file.
require_once $includePath.'/lib/api.lib.php';
require_once $_configuration['root_sys'].'main/inc/lib/api.lib.php';
$passwordEncryption = api_get_configuration_value('password_encryption'); $passwordEncryption = api_get_configuration_value('password_encryption');
if ($passwordEncryption == 'bcrypt') { if ($passwordEncryption == 'bcrypt') {

@ -78,9 +78,9 @@ if (is_int($global_error_code) && $global_error_code > 0) {
$pos = $test_pos + 1; $pos = $test_pos + 1;
} }
$root_rel = substr($root_rel, 0, $pos); $root_rel = substr($root_rel, 0, $pos);
} elseif (strpos($root_rel, '/courses/') !== false) { } elseif (strpos($root_rel, api_get_path(REL_COURSE_PATH)) !== false) {
$pos = 0; $pos = 0;
while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), '/courses/')) !== false) { while (($test_pos = strpos(substr($root_rel, $pos, strlen($root_rel)), api_get_path(REL_COURSE_PATH))) !== false) {
$pos = $test_pos + 1; $pos = $test_pos + 1;
} }
$root_rel = substr($root_rel, 0, $pos); $root_rel = substr($root_rel, 0, $pos);

@ -272,6 +272,22 @@ define('REPEATED_SLASHES_PURIFIER', '/\/{2,}/'); // $path = p
define('VALID_WEB_PATH', '/https?:\/\/[^\/]*(\/.*)?/i'); // $is_valid_path = preg_match(VALID_WEB_PATH, $path); define('VALID_WEB_PATH', '/https?:\/\/[^\/]*(\/.*)?/i'); // $is_valid_path = preg_match(VALID_WEB_PATH, $path);
define('VALID_WEB_SERVER_BASE', '/https?:\/\/[^\/]*/i'); // $new_path = preg_replace(VALID_WEB_SERVER_BASE, $new_base, $path); define('VALID_WEB_SERVER_BASE', '/https?:\/\/[^\/]*/i'); // $new_path = preg_replace(VALID_WEB_SERVER_BASE, $new_base, $path);
// Constants for api_get_path() and api_get_path_type(), etc. - registered path types.
// basic (leaf elements)
define('REL_AJAX_PATH', 'REL_AJAX_PATH');
define('REL_ARCHIVE_PATH', 'REL_ARCHIVE_PATH');
define('REL_CODE_PATH', 'REL_CODE_PATH');
define('REL_COURSE_PATH', 'REL_COURSE_PATH');
define('REL_CSS_PATH', 'REL_CSS_PATH');
define('REL_HOME_PATH', 'REL_HOME_PATH');
define('REL_IMG_PATH', 'REL_IMG_PATH');
define('REL_LANG_PATH', 'REL_LANG_PATH');
define('REL_LIBRARY_PATH', 'REL_LIBRARY_PATH');
define('REL_PLUGIN_PATH', 'REL_PLUGIN_PATH');
define('REL_TEMPLATE_PATH', 'REL_TEMPLATE_PATH');
define('REL_TEST_PATH', 'REL_TEST_PATH');
// Constants for api_get_path() and api_get_path_type(), etc. - registered path types. // Constants for api_get_path() and api_get_path_type(), etc. - registered path types.
define('WEB_PATH', 'WEB_PATH'); define('WEB_PATH', 'WEB_PATH');
define('WEB_APP_PATH', 'WEB_APP_PATH'); define('WEB_APP_PATH', 'WEB_APP_PATH');
@ -285,8 +301,6 @@ define('WEB_SERVER_ROOT_PATH', 'WEB_SERVER_ROOT_PATH');
define('SYS_SERVER_ROOT_PATH', 'SYS_SERVER_ROOT_PATH'); define('SYS_SERVER_ROOT_PATH', 'SYS_SERVER_ROOT_PATH');
define('WEB_COURSE_PATH', 'WEB_COURSE_PATH'); define('WEB_COURSE_PATH', 'WEB_COURSE_PATH');
define('SYS_COURSE_PATH', 'SYS_COURSE_PATH'); define('SYS_COURSE_PATH', 'SYS_COURSE_PATH');
define('REL_COURSE_PATH', 'REL_COURSE_PATH');
define('REL_CODE_PATH', 'REL_CODE_PATH');
define('REL_UPLOAD_PATH', 'REL_UPLOAD_PATH'); define('REL_UPLOAD_PATH', 'REL_UPLOAD_PATH');
define('WEB_CODE_PATH', 'WEB_CODE_PATH'); define('WEB_CODE_PATH', 'WEB_CODE_PATH');
define('SYS_CODE_PATH', 'SYS_CODE_PATH'); define('SYS_CODE_PATH', 'SYS_CODE_PATH');
@ -310,6 +324,9 @@ define('SYS_TEST_PATH', 'SYS_TEST_PATH');
define('WEB_TEMPLATE_PATH', 'WEB_TEMPLATE_PATH'); define('WEB_TEMPLATE_PATH', 'WEB_TEMPLATE_PATH');
define('SYS_TEMPLATE_PATH', 'SYS_TEMPLATE_PATH'); define('SYS_TEMPLATE_PATH', 'SYS_TEMPLATE_PATH');
define('SYS_PUBLIC_PATH', 'SYS_PUBLIC_PATH'); define('SYS_PUBLIC_PATH', 'SYS_PUBLIC_PATH');
define('SYS_HOME_PATH', 'SYS_HOME_PATH');
define('WEB_HOME_PATH', 'WEB_HOME_PATH');
define('WEB_FONTS_PATH', 'WEB_FONTS_PATH'); define('WEB_FONTS_PATH', 'WEB_FONTS_PATH');
define('SYS_FONTS_PATH', 'SYS_FONTS_PATH'); define('SYS_FONTS_PATH', 'SYS_FONTS_PATH');
@ -674,11 +691,64 @@ require_once __DIR__.'/internationalization.lib.php';
* api_get_path(TO_WEB, $_SERVER['REQUEST_URI']) * api_get_path(TO_WEB, $_SERVER['REQUEST_URI'])
* api_get_path(TO_SYS, $_SERVER['PHP_SELF']) * api_get_path(TO_SYS, $_SERVER['PHP_SELF'])
* api_get_path(TO_REL, __FILE__) * api_get_path(TO_REL, __FILE__)
* ...
*/ * Vchamilo changes : allow using an alternate configuration
function api_get_path($path_type, $path = null) * to get vchamilo instance paths
*/
function api_get_path($path_type, $path = null, $configuration = null)
{ {
static $paths = array( global $catcher;
global $paths;
// get proper configuration data if exists
global $_configuration;
if (is_null($configuration)) {
$configuration = $_configuration;
}
$course_folder = 'courses/';
$code_folder = 'main/';
// Resolve master hostname.
if (!is_null($configuration) && array_key_exists('root_web', $configuration)) {
$root_web = $configuration['root_web'];
} else {
// Try guess it from server.
if (defined('SYSTEM_INSTALLATION') && SYSTEM_INSTALLATION) {
if (($pos = strpos(($requested_page_rel = api_get_self()), 'main/install')) !== false) {
$root_rel = substr($requested_page_rel, 0, $pos);
// See http://www.mediawiki.org/wiki/Manual:$wgServer
$server_protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$server_name =
isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME']
: (isset($_SERVER['HOSTNAME']) ? $_SERVER['HOSTNAME']
: (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST']
: (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR']
: 'localhost')));
if (isset($_SERVER['SERVER_PORT']) && !strpos($server_name, ':')
&& (($server_protocol == 'http'
&& $_SERVER['SERVER_PORT'] != 80 ) || ($server_protocol == 'https' && $_SERVER['SERVER_PORT'] != 443 ))) {
$server_name .= ":" . $_SERVER['SERVER_PORT'];
}
$root_web = $server_protocol.'://'.$server_name.$root_rel;
$root_sys = str_replace('\\', '/', realpath(__DIR__.'/../../../')).'/';
}
// Here we give up, so we don't touch anything.
}
}
// define caches the path cache will know about effective root_web, from explicit configuration,
// or guess it from server information (install or early process time)
static $resourcePaths = null;
if (empty($paths)) {
$paths = [];
}
// Initialise cache with default values.
if (!array_key_exists($root_web, $paths)) {
$paths[$root_web] = array(
WEB_PATH => '', WEB_PATH => '',
SYS_PATH => '', SYS_PATH => '',
REL_PATH => '', REL_PATH => '',
@ -687,211 +757,199 @@ function api_get_path($path_type, $path = null)
WEB_COURSE_PATH => '', WEB_COURSE_PATH => '',
SYS_COURSE_PATH => '', SYS_COURSE_PATH => '',
REL_COURSE_PATH => '', REL_COURSE_PATH => '',
REL_CODE_PATH => '', WEB_CODE_PATH => 'main/',
WEB_CODE_PATH => '', SYS_CODE_PATH => 'main/',
SYS_CODE_PATH => '', REL_CODE_PATH => '/main/',
SYS_LANG_PATH => 'lang/', SYS_LANG_PATH => 'lang/',
REL_LANG_PATH => 'main/lang/',
WEB_IMG_PATH => 'img/', WEB_IMG_PATH => 'img/',
REL_IMG_PATH => 'img/',
WEB_CSS_PATH => 'web/css/', WEB_CSS_PATH => 'web/css/',
SYS_CSS_PATH => 'app/Resources/public/css/', SYS_CSS_PATH => 'app/Resources/public/css/',
REL_CSS_PATH => 'css/',
SYS_PLUGIN_PATH => 'plugin/', SYS_PLUGIN_PATH => 'plugin/',
WEB_PLUGIN_PATH => 'plugin/', WEB_PLUGIN_PATH => 'plugin/',
REL_PLUGIN_PATH => 'plugin/',
SYS_ARCHIVE_PATH => 'app/cache/', SYS_ARCHIVE_PATH => 'app/cache/',
PLUGIN_PATH => 'plugin/',
WEB_ARCHIVE_PATH => 'app/cache/', WEB_ARCHIVE_PATH => 'app/cache/',
REL_ARCHIVE_PATH => 'app/cache/',
SYS_HOME_PATH => 'app/home/',
WEB_HOME_PATH => 'app/home/',
SYS_APP_PATH => 'app/', SYS_APP_PATH => 'app/',
WEB_APP_PATH => 'app/', WEB_APP_PATH => 'app/',
SYS_UPLOAD_PATH => 'app/upload/', SYS_UPLOAD_PATH => 'app/upload/',
REL_UPLOAD_PATH => 'app/upload/', REL_UPLOAD_PATH => 'app/upload/',
REL_HOME_PATH => 'home/',
INCLUDE_PATH => 'inc/', INCLUDE_PATH => 'inc/',
LIBRARY_PATH => 'inc/lib/',
CONFIGURATION_PATH => 'app/config/', CONFIGURATION_PATH => 'app/config/',
LIBRARY_PATH => 'inc/lib/',
WEB_LIBRARY_PATH => 'inc/lib/', WEB_LIBRARY_PATH => 'inc/lib/',
WEB_LIBRARY_JS_PATH => 'inc/lib/javascript/', WEB_LIBRARY_JS_PATH => 'inc/lib/javascript/',
REL_LIBRARY_PATH => 'inc/lib/',
REL_AJAX_PATH => 'inc/ajax/',
WEB_AJAX_PATH => 'inc/ajax/', WEB_AJAX_PATH => 'inc/ajax/',
SYS_TEST_PATH => 'tests/', SYS_TEST_PATH => 'tests/',
REL_TEST_PATH => 'tests/',
WEB_TEMPLATE_PATH => 'template/', WEB_TEMPLATE_PATH => 'template/',
SYS_TEMPLATE_PATH => 'template/',
REL_TEMPLATE_PATH => 'template/',
WEB_UPLOAD_PATH => 'app/upload/', WEB_UPLOAD_PATH => 'app/upload/',
WEB_PUBLIC_PATH => 'web/', WEB_PUBLIC_PATH => 'web/',
SYS_TEMPLATE_PATH => 'template/',
SYS_PUBLIC_PATH => 'web/', SYS_PUBLIC_PATH => 'web/',
WEB_FONTS_PATH => 'fonts/', WEB_FONTS_PATH => 'fonts/',
SYS_FONTS_PATH => 'fonts/', SYS_FONTS_PATH => 'fonts/',
); );
static $resource_paths = array( $resourcePaths[$root_web] = array(
FLASH_PLAYER_AUDIO => 'inc/lib/mediaplayer/player.swf', FLASH_PLAYER_AUDIO => 'inc/lib/mediaplayer/player.swf',
FLASH_PLAYER_VIDEO => 'inc/lib/mediaplayer/player.swf', FLASH_PLAYER_VIDEO => 'inc/lib/mediaplayer/player.swf',
SCRIPT_SWFOBJECT => 'inc/lib/swfobject/swfobject.js', SCRIPT_SWFOBJECT => 'inc/lib/swfobject/swfobject.js',
SCRIPT_ASCIIMATHML => 'inc/lib/javascript/asciimath/ASCIIMathML.js', SCRIPT_ASCIIMATHML => 'inc/lib/javascript/asciimath/ASCIIMathML.js',
DRAWING_ASCIISVG => 'inc/lib/javascript/asciimath/d.svg' DRAWING_ASCIISVG => 'inc/lib/javascript/asciimath/d.svg',
); );
}
static $is_this_function_initialized; static $isInitialized = [];
static $server_base_web; // No trailing slash.
static $server_base_sys; // No trailing slash.
static $root_web;
static $root_sys;
static $root_rel;
// Always load root_web modifications for multiple url features // Configuration data for all installed systems is unique.
global $_configuration; if (empty($root_sys)) {
//default $_configuration['root_web'] configuration $root_sys = $configuration['root_sys'];
$root_web = $_configuration['root_web']; }
$code_folder = 'main/';
$course_folder = 'courses/';
// Configuration data for already installed system. $loadNewConfig = false;
$root_sys = $_configuration['root_sys'];
$load_new_config = false;
// To avoid that the api_get_access_url() function fails since global.inc.php also calls the main_api.lib.php // To avoid that the api_get_access_url() function fails since global.inc.php also calls the main_api.lib.php
if ($path_type == WEB_PATH) { if ($path_type == WEB_PATH) {
if (isset($_configuration['access_url']) && $_configuration['access_url'] != 1) { if (isset($configuration['access_url']) && $configuration['access_url'] != 1) {
//we look into the DB the function api_get_access_url //we look into the DB the function api_get_access_url
$url_info = api_get_access_url($_configuration['access_url']); $url_info = api_get_access_url($configuration['access_url']);
$root_web = $url_info['active'] == 1 ? $url_info['url'] : $_configuration['root_web']; $root_web = $url_info['active'] == 1 ? $url_info['url'] : $configuration['root_web'];
$load_new_config = true; $loadNewConfig = true;
} }
} }
if (!$is_this_function_initialized) { if (isset($configuration['course_folder'])) {
global $_configuration; $course_folder = $configuration['course_folder'];
}
$root_rel = $_configuration['url_append']; $configuration['code_append'] = isset($configuration['code_append']) ? $configuration['code_append'] : 'main';
if (preg_match('#https?://([^\.]+)#', $root_web, $matches)) {
$web_host = $matches[1];
} else {
die('malformed root_web url');
}
// Web server base and system server base.
$root_rel = isset($configuration['url_append']) ? $configuration['url_append'] : '';
$server_base_web = preg_replace('@'.$root_rel.'$@', '', $root_web); // No trailing slash.
$server_base_sys = preg_replace('@'.$root_rel.'$@', '', $root_sys); // No trailing slash.
if (!array_key_exists($root_web, $isInitialized)) {
// process absolute global roots
//$root_rel = $configuration['url_append'];
if (!is_null($configuration)) {
$code_folder = $configuration['code_append'];
} else {
$code_folder = $paths[$root_web][REL_CODE_PATH];
}
// Support for the installation process. // Support for the installation process.
// Developers might use the function api_get_path() directly or indirectly (this is difficult to be traced), at the moment when // Developers might use the function api_get_path() directly or indirectly (this is difficult to be traced), at the moment when
// configuration has not been created yet. This is why this function should be upgraded to return correct results in this case. // configuration has not been created yet. This is why this function should be upgraded to return correct results in this case.
if (defined('SYSTEM_INSTALLATION') && SYSTEM_INSTALLATION) {
if (($pos = strpos(($requested_page_rel = api_get_self()), 'main/install')) !== false) {
$root_rel = substr($requested_page_rel, 0, $pos);
// See http://www.mediawiki.org/wiki/Manual:$wgServer
$server_protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
$server_name =
isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME']
: (isset($_SERVER['HOSTNAME']) ? $_SERVER['HOSTNAME']
: (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST']
: (isset($_SERVER['SERVER_ADDR']) ? $_SERVER['SERVER_ADDR']
: 'localhost')));
if (isset($_SERVER['SERVER_PORT']) && !strpos($server_name, ':')
&& (($server_protocol == 'http'
&& $_SERVER['SERVER_PORT'] != 80 ) || ($server_protocol == 'https' && $_SERVER['SERVER_PORT'] != 443 ))) {
$server_name .= ":" . $_SERVER['SERVER_PORT'];
}
$root_web = $server_protocol.'://'.$server_name.$root_rel;
$root_sys = str_replace('\\', '/', realpath(__DIR__.'/../../../')).'/';
$code_folder = 'main/';
}
// Here we give up, so we don't touch anything.
}
// Dealing with trailing slashes. // Dealing with trailing slashes.
$root_web = api_add_trailing_slash($root_web); $slashed_root_web = api_add_trailing_slash($root_web);
$root_sys = api_add_trailing_slash($root_sys); $root_sys = api_add_trailing_slash($root_sys);
$root_rel = api_add_trailing_slash($root_rel); $root_rel = api_add_trailing_slash($root_rel);
$code_folder = api_add_trailing_slash($code_folder); $code_folder = api_add_trailing_slash($code_folder);
$course_folder = api_add_trailing_slash($course_folder); $course_folder = api_add_trailing_slash($course_folder);
// Web server base and system server base.
$server_base_web = preg_replace('@'.$root_rel.'$@', '', $root_web); // No trailing slash.
$server_base_sys = preg_replace('@'.$root_rel.'$@', '', $root_sys); // No trailing slash.
// Initialization of a table that contains common-purpose paths. // Initialization of a table that contains common-purpose paths.
$paths[WEB_PATH] = $root_web; $paths[$root_web][WEB_PATH] = $slashed_root_web;
$paths[SYS_PATH] = $root_sys; $paths[$root_web][SYS_PATH] = $root_sys;
$paths[REL_PATH] = $root_rel; $paths[$root_web][REL_PATH] = $root_rel;
$paths[WEB_SERVER_ROOT_PATH] = $server_base_web.'/'; $paths[$root_web][WEB_SERVER_ROOT_PATH] = $server_base_web.'/';
$paths[SYS_SERVER_ROOT_PATH] = $server_base_sys.'/'; $paths[$root_web][SYS_SERVER_ROOT_PATH] = $server_base_sys.'/';
$paths[$root_web][WEB_COURSE_PATH] = $slashed_root_web.$course_folder;
$paths[WEB_COURSE_PATH] = $root_web.$course_folder;
$paths[REL_COURSE_PATH] = $root_rel.$course_folder; $paths[$root_web][REL_COURSE_PATH] = $root_rel.$course_folder;
$paths[REL_CODE_PATH] = $root_rel.$code_folder; $paths[$root_web][WEB_CODE_PATH] = $slashed_root_web.$code_folder;
$paths[WEB_CODE_PATH] = $root_web.$code_folder; $paths[$root_web][SYS_CODE_PATH] = $root_sys.$code_folder;
$paths[SYS_CODE_PATH] = $root_sys.$code_folder; $paths[$root_web][REL_UPLOAD_PATH] = $root_rel.$paths[$root_web][SYS_UPLOAD_PATH];
$paths[REL_UPLOAD_PATH] = $root_rel.$paths[SYS_UPLOAD_PATH];
$paths[WEB_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[WEB_CODE_PATH].'default_course_document/'; $paths[$root_web][WEB_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[$root_web][WEB_CODE_PATH].'default_course_document/';
$paths[REL_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[REL_PATH].'main/default_course_document/'; $paths[$root_web][REL_DEFAULT_COURSE_DOCUMENT_PATH] = $paths[$root_web][REL_PATH].'main/default_course_document/';
// Now we can switch into api_get_path() "terminology". // Now we can switch into api_get_path() "terminology".
$paths[SYS_LANG_PATH] = $paths[SYS_CODE_PATH].$paths[SYS_LANG_PATH]; $paths[$root_web][SYS_LANG_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_LANG_PATH];
$paths[$root_web][SYS_PLUGIN_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_PLUGIN_PATH];
$paths[$root_web][PLUGIN_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_PLUGIN_PATH];
$paths[$root_web][SYS_ARCHIVE_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_ARCHIVE_PATH];
$paths[$root_web][SYS_APP_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][SYS_APP_PATH];
$paths[$root_web][SYS_COURSE_PATH] = $paths[$root_web][SYS_APP_PATH].$course_folder;
$paths[$root_web][WEB_APP_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_APP_PATH];
$paths[$root_web][SYS_UPLOAD_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][SYS_UPLOAD_PATH];
// PATCH : Take VChamilo into account
/*global $VCHAMILO;
if (!empty($VCHAMILO) || !empty($configuration['virtual'])){
$paths[$root_web][SYS_ARCHIVE_PATH] .= $web_host.'/';
$paths[$root_web][SYS_HOME_PATH] .= $web_host.'/';
}*/
$paths[SYS_APP_PATH] = $paths[SYS_PATH].$paths[SYS_APP_PATH]; $paths[$root_web][SYS_TEST_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][SYS_TEST_PATH];
$paths[WEB_APP_PATH] = $paths[WEB_PATH].$paths[WEB_APP_PATH]; $paths[$root_web][SYS_TEMPLATE_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][REL_TEMPLATE_PATH];
$paths[SYS_UPLOAD_PATH] = $paths[SYS_PATH].$paths[SYS_UPLOAD_PATH];
$paths[SYS_PLUGIN_PATH] = $paths[SYS_PATH].$paths[SYS_PLUGIN_PATH]; //$paths[$root_web][WEB_CSS_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][REL_CSS_PATH];
$paths[SYS_ARCHIVE_PATH] = $paths[SYS_PATH].$paths[SYS_ARCHIVE_PATH]; //$paths[$root_web][WEB_IMG_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][REL_IMG_PATH];
$paths[SYS_TEST_PATH] = $paths[SYS_PATH].$paths[SYS_TEST_PATH]; //$paths[$root_web][WEB_LIBRARY_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][REL_LIBRARY_PATH];
$paths[SYS_TEMPLATE_PATH] = $paths[SYS_CODE_PATH].$paths[SYS_TEMPLATE_PATH]; //$paths[$root_web][WEB_AJAX_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][REL_AJAX_PATH];
$paths[SYS_PUBLIC_PATH] = $paths[SYS_PATH].$paths[SYS_PUBLIC_PATH];
$paths[SYS_CSS_PATH] = $paths[SYS_PATH].$paths[SYS_CSS_PATH];
$paths[SYS_FONTS_PATH] = $paths[SYS_CODE_PATH].$paths[SYS_FONTS_PATH];
$paths[WEB_CSS_PATH] = $paths[WEB_PATH].$paths[WEB_CSS_PATH]; $paths[$root_web][WEB_PLUGIN_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_PLUGIN_PATH];
$paths[WEB_IMG_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_IMG_PATH]; $paths[$root_web][WEB_ARCHIVE_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_ARCHIVE_PATH];
$paths[WEB_LIBRARY_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_LIBRARY_PATH];
$paths[WEB_LIBRARY_JS_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_LIBRARY_JS_PATH];
$paths[WEB_AJAX_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_AJAX_PATH]; $paths[$root_web][SYS_PUBLIC_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][SYS_PUBLIC_PATH];
$paths[WEB_FONTS_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_FONTS_PATH]; $paths[$root_web][SYS_CSS_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][SYS_CSS_PATH];
$paths[$root_web][SYS_FONTS_PATH] = $paths[$root_web][SYS_CODE_PATH].$paths[$root_web][SYS_FONTS_PATH];
$paths[WEB_PLUGIN_PATH] = $paths[WEB_PATH].$paths[WEB_PLUGIN_PATH]; $paths[$root_web][WEB_CSS_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_CSS_PATH];
$paths[WEB_ARCHIVE_PATH] = $paths[WEB_PATH].$paths[WEB_ARCHIVE_PATH]; $paths[$root_web][WEB_IMG_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_IMG_PATH];
$paths[$root_web][WEB_LIBRARY_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_LIBRARY_PATH];
$paths[$root_web][WEB_LIBRARY_JS_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_LIBRARY_JS_PATH];
$paths[WEB_TEMPLATE_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_TEMPLATE_PATH]; $paths[$root_web][WEB_AJAX_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_AJAX_PATH];
$paths[WEB_UPLOAD_PATH] = $paths[WEB_PATH].$paths[WEB_UPLOAD_PATH]; $paths[$root_web][WEB_FONTS_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_FONTS_PATH];
$paths[WEB_PUBLIC_PATH] = $paths[WEB_PATH].$paths[WEB_PUBLIC_PATH];
$paths[INCLUDE_PATH] = $paths[SYS_CODE_PATH].$paths[INCLUDE_PATH]; //$paths[$root_web][WEB_PLUGIN_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_PLUGIN_PATH];
$paths[LIBRARY_PATH] = $paths[SYS_CODE_PATH].$paths[LIBRARY_PATH]; //$paths[$root_web][WEB_ARCHIVE_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_ARCHIVE_PATH];
$paths[CONFIGURATION_PATH] = $paths[SYS_PATH].$paths[CONFIGURATION_PATH];
$paths[SYS_COURSE_PATH] = $paths[SYS_APP_PATH].$course_folder;
$is_this_function_initialized = true; $paths[$root_web][WEB_TEMPLATE_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_TEMPLATE_PATH];
} else { $paths[$root_web][WEB_UPLOAD_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_UPLOAD_PATH];
if ($load_new_config) { $paths[$root_web][WEB_PUBLIC_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][WEB_PUBLIC_PATH];
// Redefining variables to work well with the "multiple url" feature
// All web paths need to be here
$web_paths = array(
WEB_PATH => '',
WEB_SERVER_ROOT_PATH => '',
WEB_COURSE_PATH => '',
WEB_CODE_PATH => '',
WEB_IMG_PATH => 'img/',
WEB_CSS_PATH => 'web/css/',
WEB_PLUGIN_PATH => 'plugin/',
WEB_ARCHIVE_PATH => 'archive/',
WEB_LIBRARY_PATH => 'inc/lib/',
WEB_AJAX_PATH => 'inc/ajax/'
);
$root_web = api_add_trailing_slash($root_web); /*// ADD : Take VChamilo into account
// Web server base and system server base. global $VCHAMILO;
$server_base_web = preg_replace('@'.$root_rel.'$@', '', $root_web); // No trailing slash. if (!empty($VCHAMILO) || !empty($configuration['virtual'])) {
$paths[$root_web][WEB_ARCHIVE_PATH] .= $web_host.'/';
$paths[$root_web][WEB_HOME_PATH] .= $web_host.'/';
}*/
// Redefine root webs // /ADD
$paths[WEB_PATH] = $root_web; $paths[$root_web][WEB_TEMPLATE_PATH] = $paths[$root_web][WEB_CODE_PATH].$paths[$root_web][WEB_TEMPLATE_PATH];
$paths[WEB_SERVER_ROOT_PATH] = $server_base_web.'/'; $paths[$root_web][INCLUDE_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][INCLUDE_PATH];
$paths[WEB_COURSE_PATH] = $root_web.$course_folder; $paths[$root_web][LIBRARY_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][REL_CODE_PATH].$paths[$root_web][LIBRARY_PATH];
$paths[WEB_CODE_PATH] = $root_web.$code_folder; $paths[$root_web][CONFIGURATION_PATH] = $paths[$root_web][SYS_PATH].$paths[$root_web][CONFIGURATION_PATH];
$paths[WEB_IMG_PATH] = $paths[WEB_CODE_PATH].$web_paths[WEB_IMG_PATH]; $paths[$root_web][WEB_HOME_PATH] = $paths[$root_web][WEB_PATH].$paths[$root_web][REL_HOME_PATH];
$paths[WEB_CSS_PATH] = $paths[WEB_PATH].$web_paths[WEB_CSS_PATH]; $isInitialized[$root_web] = true;
$paths[WEB_PLUGIN_PATH] = $paths[WEB_PATH].$web_paths[WEB_PLUGIN_PATH];
$paths[WEB_ARCHIVE_PATH] = $paths[WEB_PATH].$web_paths[WEB_ARCHIVE_PATH];
$paths[WEB_LIBRARY_PATH] = $paths[WEB_CODE_PATH].$web_paths[WEB_LIBRARY_PATH];
$paths[WEB_AJAX_PATH] = $paths[WEB_CODE_PATH].$web_paths[WEB_AJAX_PATH];
$paths[WEB_FONTS_PATH] = $paths[WEB_CODE_PATH].$paths[WEB_FONTS_PATH];
}
} }
// Shallow purification and validation of input parameters. // Shallow purification and validation of input parameters.
$path_type = trim($path_type); $path_type = trim($path_type);
$path = trim($path); $path = trim($path);
@ -900,20 +958,21 @@ function api_get_path($path_type, $path = null)
} }
// Retrieving a common-purpose path. // Retrieving a common-purpose path.
if (isset($paths[$path_type])) { if (isset($paths[$root_web][$path_type])) {
return $paths[$path_type]; if ($catcher) echo "common $path_type $root_web ";
return $paths[$root_web][$path_type];
} }
// Retrieving a specific resource path. // Retrieving a specific resource path.
if (isset($resource_paths[$path])) { if (isset($resourcePaths[$root_web][$path])) {
switch ($path_type) { switch ($path_type) {
case TO_WEB: case TO_WEB:
return $paths[WEB_CODE_PATH].$resource_paths[$path]; return $paths[$root_web][WEB_CODE_PATH].$resourcePaths[$root_web][$path];
case TO_SYS: case TO_SYS:
return $paths[SYS_CODE_PATH].$resource_paths[$path]; return $paths[$root_web][SYS_CODE_PATH].$resourcePaths[$root_web][$path];
case TO_REL: case TO_REL:
return $paths[REL_CODE_PATH].$resource_paths[$path]; return $paths[$root_web][REL_CODE_PATH].$resourcePaths[$root_web][$path];
default: default:
return null; return null;
} }
@ -921,8 +980,11 @@ function api_get_path($path_type, $path = null)
// Common-purpose paths as a second parameter - recognition. // Common-purpose paths as a second parameter - recognition.
if (isset($paths[$path])) { if (isset($paths[$root_web][$path])) {
$path = $paths[$path]; if ($catcher) {
echo "straight ";
}
$path = $paths[$root_web][$path];
} }
// Second purification. // Second purification.
@ -938,7 +1000,6 @@ function api_get_path($path_type, $path = null)
// Detection of the input path type. Conversion to semi-absolute type ( /chamilo/main/inc/.... ). // Detection of the input path type. Conversion to semi-absolute type ( /chamilo/main/inc/.... ).
if (preg_match(VALID_WEB_PATH, $path)) { if (preg_match(VALID_WEB_PATH, $path)) {
// A special case: When a URL points to the document download script directly, without // A special case: When a URL points to the document download script directly, without
// mod-rewrite translation, we have to translate it into an "ordinary" web path. // mod-rewrite translation, we have to translate it into an "ordinary" web path.
// For example: // For example:
@ -958,7 +1019,6 @@ function api_get_path($path_type, $path = null)
} }
// Replacement of the present web server base with a slash '/'. // Replacement of the present web server base with a slash '/'.
$path = preg_replace(VALID_WEB_SERVER_BASE, '/', $path); $path = preg_replace(VALID_WEB_SERVER_BASE, '/', $path);
} elseif (strpos($path, $server_base_sys) === 0) { } elseif (strpos($path, $server_base_sys) === 0) {
$path = preg_replace('@^'.$server_base_sys.'@', '', $path); $path = preg_replace('@^'.$server_base_sys.'@', '', $path);
} elseif (strpos($path, '/') === 0) { } elseif (strpos($path, '/') === 0) {
@ -985,6 +1045,7 @@ function api_get_path($path_type, $path = null)
return null; return null;
} }
/** /**
* Gets a modified version of the path for the CDN, if defined in * Gets a modified version of the path for the CDN, if defined in
* configuration.php * configuration.php
@ -6656,19 +6717,22 @@ function api_get_unique_id() {
*/ */
function api_get_home_path() function api_get_home_path()
{ {
$home = 'app/home/'; // FIX : Start the routing determination from central path definition
$home = api_get_path(TO_SYS, SYS_HOME_PATH);
if (api_get_multiple_access_url()) { if (api_get_multiple_access_url()) {
$access_url_id = api_get_current_access_url_id(); $access_url_id = api_get_current_access_url_id();
$url_info = api_get_access_url($access_url_id); $url_info = api_get_access_url($access_url_id);
$url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url'])); $url = api_remove_trailing_slash(preg_replace('/https?:\/\//i', '', $url_info['url']));
$clean_url = api_replace_dangerous_char($url); $clean_url = replace_dangerous_char($url);
$clean_url = str_replace('/', '-', $clean_url); $clean_url = str_replace('/', '-', $clean_url);
$clean_url .= '/'; $clean_url .= '/';
if ($clean_url != 'localhost/') {
$home = 'app/home/' . $clean_url; // means that the multiple URL was not well configured we don't rename the $home variable
return "{$home}{$clean_url}";
}
} }
return $home; return $home;
// /FIX
} }
/** /**

@ -1094,15 +1094,14 @@ class CourseHome
$course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST); $course_tools_table = Database :: get_course_table(TABLE_TOOL_LIST);
/* Link to the Course homepage */ /* Link to the Course homepage */
$navigation_items['home']['image'] = 'home.gif'; $navigation_items['home']['image'] = 'home.gif';
$navigation_items['home']['link'] = api_get_path(WEB_CODE_PATH).Security::remove_XSS($_SESSION['_course']['path']).'/index.php'; $navigation_items['home']['link'] = api_get_path(WEB_CODE_PATH).Security::remove_XSS($_SESSION['_course']['path']).'/index.php';
$navigation_items['home']['name'] = get_lang('CourseHomepageLink'); $navigation_items['home']['name'] = get_lang('CourseHomepageLink');
$sql_menu_query = "SELECT * FROM $course_tools_table $sql = "SELECT * FROM $course_tools_table
WHERE c_id = $course_id AND visibility='1' and admin='0' WHERE c_id = $course_id AND visibility='1' and admin='0'
ORDER BY id ASC"; ORDER BY id ASC";
$sql_result = Database::query($sql_menu_query); $sql_result = Database::query($sql);
while ($row = Database::fetch_array($sql_result)) { while ($row = Database::fetch_array($sql_result)) {
$navigation_items[$row['id']] = $row; $navigation_items[$row['id']] = $row;
if (stripos($row['link'], 'http://') === false && stripos($row['link'], 'https://') === false) { if (stripos($row['link'], 'http://') === false && stripos($row['link'], 'https://') === false) {
@ -1116,9 +1115,9 @@ class CourseHome
- Course rights (roles & rights overview) */ - Course rights (roles & rights overview) */
if ($include_admin_tools) { if ($include_admin_tools) {
$course_settings_sql = "SELECT name,image FROM $course_tools_table $sql = "SELECT name, image FROM $course_tools_table
WHERE c_id = $course_id AND link='course_info/infocours.php'"; WHERE c_id = $course_id AND link='course_info/infocours.php'";
$sql_result = Database::query($course_settings_sql); $sql_result = Database::query($sql);
$course_setting_info = Database::fetch_array($sql_result); $course_setting_info = Database::fetch_array($sql_result);
$course_setting_visual_name = CourseHome::translate_tool_name($course_setting_info); $course_setting_visual_name = CourseHome::translate_tool_name($course_setting_info);
if (api_get_session_id() == 0) { if (api_get_session_id() == 0) {

@ -37,6 +37,7 @@ class GlossaryManager
* Get glossary term by glossary id * Get glossary term by glossary id
* @author Isaac Flores <florespaz@bidsoftperu.com> * @author Isaac Flores <florespaz@bidsoftperu.com>
* @param int $glossary_id * @param int $glossary_id
*
* @return string The glossary description * @return string The glossary description
*/ */
public static function get_glossary_term_by_glossary_id ($glossary_id) public static function get_glossary_term_by_glossary_id ($glossary_id)
@ -45,7 +46,7 @@ class GlossaryManager
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$sql = "SELECT description FROM $glossary_table $sql = "SELECT description FROM $glossary_table
WHERE c_id = $course_id AND glossary_id =".intval($glossary_id); WHERE c_id = $course_id AND glossary_id =".intval($glossary_id);
$rs=Database::query($sql); $rs = Database::query($sql);
if (Database::num_rows($rs) > 0) { if (Database::num_rows($rs) > 0) {
$row = Database::fetch_array($rs); $row = Database::fetch_array($rs);

@ -10,6 +10,8 @@
* @package chamilo.whoisonline * @package chamilo.whoisonline
*/ */
use ChamiloSession as Session;
/** /**
* Insert a login reference for the current user into the track_e_online stats table. * Insert a login reference for the current user into the track_e_online stats table.
* This table keeps trace of the last login. Nothing else matters (we don't keep traces of anything older) * This table keeps trace of the last login. Nothing else matters (we don't keep traces of anything older)
@ -17,8 +19,6 @@
* @return void * @return void
*/ */
use ChamiloSession as Session;
function LoginCheck($uid) function LoginCheck($uid)
{ {
$_course = api_get_course_info(); $_course = api_get_course_info();
@ -154,7 +154,7 @@ function online_logout($user_id = null, $logout_redirect = false)
session_regenerate_id(); session_regenerate_id();
Session::destroy(); Session::destroy();
if ($logout_redirect) { if ($logout_redirect) {
header("Location: index.php"); header("Location: ".api_get_path(WEB_PATH)."index.php");
return; return;
} }
} }
@ -397,7 +397,7 @@ function who_is_online_in_this_course($from, $number_of_items, $uid, $time_limit
$time_limit = intval($time_limit); $time_limit = intval($time_limit);
} }
$online_time = time() - $time_limit*60; $online_time = time() - $time_limit * 60;
$current_date = api_get_utc_datetime($online_time); $current_date = api_get_utc_datetime($online_time);
$track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE); $track_online_table = Database::get_main_table(TABLE_STATISTIC_TRACK_E_ONLINE);
$course_code = Database::escape_string($course_code); $course_code = Database::escape_string($course_code);

@ -452,8 +452,7 @@ class PDF
if (strpos($old_src, 'http') === false) { if (strpos($old_src, 'http') === false) {
if (strpos($old_src, '/main/default_course_document') === false) { if (strpos($old_src, '/main/default_course_document') === false) {
if (strpos($old_src, '/main/inc/lib/') === false) { if (strpos($old_src, '/main/inc/lib/') === false) {
$old_src_fixed = str_replace(api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/', '', $old_src);
$old_src_fixed = str_replace('/courses/'.$course_data['path'].'/document/', '', $old_src);
$old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed); $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src_fixed);
$new_path = $document_path.$old_src_fixed; $new_path = $document_path.$old_src_fixed;
$document_html= str_replace($old_src, $new_path, $document_html); $document_html= str_replace($old_src, $new_path, $document_html);

@ -356,8 +356,11 @@ class SystemAnnouncementManager
$end = api_get_utc_datetime($date_end); $end = api_get_utc_datetime($date_end);
//Fixing urls that are sent by email //Fixing urls that are sent by email
$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content); //$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content);
$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content); //$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content);
$content = str_replace('src=\"'.api_get_path(REL_HOME_PATH), 'src=\"'.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content);
$content = str_replace('file='.api_get_path(REL_HOME_PATH), 'file='.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content);
$lang = is_null($lang) ? '' : $lang; $lang = is_null($lang) ? '' : $lang;
@ -541,8 +544,10 @@ class SystemAnnouncementManager
$end = api_get_utc_datetime($date_end); $end = api_get_utc_datetime($date_end);
//Fixing urls that are sent by email //Fixing urls that are sent by email
$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content); //$content = str_replace('src=\"/home/', 'src=\"'.api_get_path(WEB_PATH).'home/', $content);
$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content); //$content = str_replace('file=/home/', 'file='.api_get_path(WEB_PATH).'home/', $content);
$content = str_replace('src=\"'.api_get_path(REL_HOME_PATH), 'src=\"'.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content);
$content = str_replace('file='.api_get_path(REL_HOME_PATH), 'file='.api_get_path(WEB_PATH).api_get_path(REL_HOME_PATH), $content);
$id = intval($id); $id = intval($id);

@ -856,8 +856,7 @@ class Template
//If exist pick the current chamilo theme favicon //If exist pick the current chamilo theme favicon
if (is_file($favicoThemeUrl . 'favicon.ico')) { if (is_file($favicoThemeUrl . 'favicon.ico')) {
$favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH) $favico = '<link rel="shortcut icon" href="' . api_get_path(WEB_CSS_PATH). 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />';
. 'themes/' . $this->theme . '/images/favicon.ico" type="image/x-icon" />';
} }
if (api_is_multiple_url_enabled()) { if (api_is_multiple_url_enabled()) {

@ -333,8 +333,6 @@ class UserManager
/** @var User $user */ /** @var User $user */
$user = $userManager->createUser(); $user = $userManager->createUser();
$em = Database::getManager();
/** @var User $user */ /** @var User $user */
//$user = new User(); //$user = new User();
$user $user
@ -363,8 +361,6 @@ class UserManager
$userManager->updateUser($user); $userManager->updateUser($user);
$userId = $user->getId(); $userId = $user->getId();
error_log($userId);
if (!empty($userId)) { if (!empty($userId)) {
$return = $userId; $return = $userId;
$sql = "UPDATE $table_user SET user_id = $return WHERE id = $return"; $sql = "UPDATE $table_user SET user_id = $return WHERE id = $return";
@ -1445,6 +1441,7 @@ class UserManager
// In exceptional cases, on some portals, the intermediate base user // In exceptional cases, on some portals, the intermediate base user
// directory might not have been created. Make sure it is before // directory might not have been created. Make sure it is before
// going further. // going further.
$rootPath = api_get_path(SYS_UPLOAD_PATH) . 'users/' . substr((string) $id, 0, 1); $rootPath = api_get_path(SYS_UPLOAD_PATH) . 'users/' . substr((string) $id, 0, 1);
if (!is_dir($rootPath)) { if (!is_dir($rootPath)) {
$perm = api_get_permissions_for_new_directories(); $perm = api_get_permissions_for_new_directories();

@ -26,6 +26,21 @@ class IndexManager
$this->user_id = api_get_user_id(); $this->user_id = api_get_user_id();
$this->load_directories_preview = false; $this->load_directories_preview = false;
// Load footer plugins systematically
/*$config = api_get_settings_params(array('subkey = ? ' => 'customfooter', ' AND category = ? ' => 'Plugins'));
if (!empty($config)) {
foreach ($config as $fooid => $configrecord) {
$canonic = preg_replace('/^customfooter_/', '', $configrecord['variable']);
$footerconfig->$canonic = $configrecord['selected_value'];
}
if (!empty($footerconfig->footer_left)) {
$this->tpl->assign('plugin_footer_left', $footerconfig->footer_left);
}
if (!empty($footerconfig->footer_right)) {
$this->tpl->assign('plugin_footer_right', $footerconfig->footer_right);
}
}*/
if (api_get_setting('show_documents_preview') == 'true') { if (api_get_setting('show_documents_preview') == 'true') {
$this->load_directories_preview = true; $this->load_directories_preview = true;
} }

@ -363,7 +363,6 @@ function write_system_config_file($path)
foreach ($config as $key => $value) { foreach ($config as $key => $value) {
$content = str_replace($key, $value, $content); $content = str_replace($key, $value, $content);
} }
$fp = @ fopen($path, 'w'); $fp = @ fopen($path, 'w');
if (!$fp) { if (!$fp) {
@ -2281,7 +2280,6 @@ function fixIds(EntityManager $em)
$newId = $data['iid']; $newId = $data['iid'];
} }
$sql = "UPDATE c_item_property SET ref = $newId WHERE iid = $iid"; $sql = "UPDATE c_item_property SET ref = $newId WHERE iid = $iid";
error_log($sql);
$connection->executeQuery($sql); $connection->executeQuery($sql);
} }

@ -6229,7 +6229,7 @@ class learnpath
$file = $filepath . $row['path']; $file = $filepath . $row['path'];
if ($fp = @ fopen($file, 'w')) { if ($fp = @ fopen($file, 'w')) {
$content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'] . '/courses/', $content); $content = str_replace(api_get_path(WEB_COURSE_PATH), $_configuration['url_append'].api_get_path(REL_COURSE_PATH), $content);
// Change the path of mp3 to absolute. // Change the path of mp3 to absolute.
// The first regexp deals with :// urls. // The first regexp deals with :// urls.
@ -8327,7 +8327,7 @@ class learnpath
$audio_player .= '<script> $audio_player .= '<script>
var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF"); var s1 = new SWFObject("../inc/lib/mediaplayer/player.swf","ply","250","20","9","#FFFFFF");
s1.addParam("allowscriptaccess","always"); s1.addParam("allowscriptaccess","always");
s1.addParam("flashvars","file=../../courses/' . $_course['path'] . '/document/audio/' . $row['audio'] . '&autostart=true"); s1.addParam("flashvars","file=../..'.api_get_path(REL_COURSE_PATH).$_course['path'] . '/document/audio/' . $row['audio'] . '&autostart=true");
s1.write("container"); s1.write("container");
</script>'; </script>';
} }
@ -9798,8 +9798,8 @@ class learnpath
} }
$string = str_replace($old_new['orig'], $newDestination, $string); $string = str_replace($old_new['orig'], $newDestination, $string);
//Add files inside the HTMLs // Add files inside the HTMLs
$new_path = str_replace('/courses/', '', $old_new['orig']); $new_path = str_replace(api_get_path(REL_COURSE_PATH), '', $old_new['orig']);
$destinationFile = $archive_path.$temp_dir_short.'/'.$old_new['dest']; $destinationFile = $archive_path.$temp_dir_short.'/'.$old_new['dest'];
if (file_exists($sys_course_path.$new_path)) { if (file_exists($sys_course_path.$new_path)) {
copy($sys_course_path.$new_path, $destinationFile); copy($sys_course_path.$new_path, $destinationFile);

@ -57,7 +57,7 @@ $introductionSection = Display::return_introduction_section(
TOOL_LEARNPATH, TOOL_LEARNPATH,
array( array(
'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/', 'CreateDocumentWebDir' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/document/',
'CreateDocumentDir' => '../../courses/'.api_get_course_path().'/document/', 'CreateDocumentDir' => '../..'.api_get_path(REL_COURSE_PATH).api_get_course_path().'/document/',
'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/', 'BaseHref' => api_get_path(WEB_COURSE_PATH).api_get_course_path().'/',
) )
); );

@ -2057,7 +2057,7 @@ function attach_glossary_into_scorm(type) {
my_protocol = location.protocol; my_protocol = location.protocol;
my_pathname=location.pathname; my_pathname=location.pathname;
work_path = my_pathname.substr(0,my_pathname.indexOf('/courses/')); work_path = my_pathname.substr(0,my_pathname.indexOf('<?php echo api_get_path(REL_COURSE_PATH) ?>'));
var ajaxRequestUrl = '<?php echo api_get_path(WEB_CODE_PATH).'glossary/glossary_ajax_request.php'; ?>'; var ajaxRequestUrl = '<?php echo api_get_path(WEB_CODE_PATH).'glossary/glossary_ajax_request.php'; ?>';
if (type == 'automatic') { if (type == 'automatic') {

@ -1972,9 +1972,9 @@ class Wiki
$wikiContents = str_replace('{CONTENT}', $wikiContents, $template); $wikiContents = str_replace('{CONTENT}', $wikiContents, $template);
// replace relative path by absolute path for courses, so you can see items into this page wiki (images, mp3, etc..) exported in documents // replace relative path by absolute path for courses, so you can see items into this page wiki (images, mp3, etc..) exported in documents
if (api_strpos($wikiContents,'../../courses/') !== false) { if (api_strpos($wikiContents,'../..'.api_get_path(REL_COURSE_PATH)) !== false) {
$web_course_path = api_get_path(WEB_COURSE_PATH); $web_course_path = api_get_path(WEB_COURSE_PATH);
$wikiContents = str_replace('../../courses/',$web_course_path,$wikiContents); $wikiContents = str_replace('../..'.api_get_path(REL_COURSE_PATH), $web_course_path, $wikiContents);
} }
$i = 1; $i = 1;

@ -2102,7 +2102,9 @@ class User implements UserInterface //implements ParticipantInterface, ThemeUser
public function getPlainPassword() public function getPlainPassword()
{ {
//return $this->plainPassword; if (isset($this->plainPassword)) {
return $this->plainPassword;
}
} }
/** /**

Loading…
Cancel
Save