From b5b3f683cc3ca4392a0a6732faa4e09d514e676c Mon Sep 17 00:00:00 2001 From: jmontoya Date: Wed, 21 May 2014 09:53:08 +0200 Subject: [PATCH] Fixing PHP warnings. --- app/.htaccess | 1 + composer.json | 5 +++-- main/admin/change_user_session.php | 6 ++---- main/admin/class_list.php | 11 +++++------ main/admin/event_controller.php | 10 ++++------ main/admin/user_list.php | 2 +- main/auth/inscription.php | 10 ++++++++-- main/inc/lib/extra_field_value.lib.php | 2 -- .../CoreBundle/Block/CourseBlockService.php | 1 + .../CoreBundle/Controller/LegacyController.php | 1 - web/ChamiloLMS/css/themes/chamilo/default.css | 3 ++- web/app.php | 1 + 12 files changed, 28 insertions(+), 25 deletions(-) create mode 100644 app/.htaccess diff --git a/app/.htaccess b/app/.htaccess new file mode 100644 index 0000000000..3418e55a68 --- /dev/null +++ b/app/.htaccess @@ -0,0 +1 @@ +deny from all \ No newline at end of file diff --git a/composer.json b/composer.json index 74324ae3bc..02f95da2b9 100755 --- a/composer.json +++ b/composer.json @@ -62,7 +62,8 @@ "jbroadway/urlify": "1.0.0-stable", "chamilo/chash": "dev-master", "doctrine/migrations": "dev-master", - "composer/composer": "1.0.*@dev" + "composer/composer": "1.0.*@dev", + "sonata-project/media-bundle": "~2.2" }, "scripts": { "post-install-cmd": [ @@ -87,7 +88,7 @@ "symfony-app-dir": "app", "symfony-web-dir": "web", "incenteev-parameters": { - "file": "app/config/parameters.yml" + "file": "config/configuration.php" }, "branch-alias": { "dev-master": "2.4-dev" diff --git a/main/admin/change_user_session.php b/main/admin/change_user_session.php index 7db99fe246..72b5f1d6ed 100644 --- a/main/admin/change_user_session.php +++ b/main/admin/change_user_session.php @@ -77,7 +77,5 @@ $(document).ready(function() { '; -$tpl = $app['template']; -$tpl->assign('message', $message); -$tpl->assign('content', $content); -$tpl->display_one_col_template(); +echo $message; +echo $content; \ No newline at end of file diff --git a/main/admin/class_list.php b/main/admin/class_list.php index 5465045980..fee587bdd8 100644 --- a/main/admin/class_list.php +++ b/main/admin/class_list.php @@ -123,9 +123,8 @@ $actions .= Display::url(Display::return_icon('add.png', get_lang('Add'), array( $actions .= Display::url(Display::return_icon('import_csv.png', get_lang('AddUsersToAClass'), array(), ICON_SIZE_MEDIUM), 'class_user_import.php'); $actions .= Display::url(Display::return_icon('import_csv.png', get_lang('ImportClassListCSV'), array(), ICON_SIZE_MEDIUM), 'class_import.php'); -$app['title'] = $tool_name; -$tpl = $app['template']; -$tpl->assign('content', $content); -$tpl->assign('actions', $actions); -$tpl->assign('message', $message); -$tpl->display_one_col_template(); +//$app['title'] = $tool_name; + +echo $message; +echo $actions; +echo $content; diff --git a/main/admin/event_controller.php b/main/admin/event_controller.php index 57e0c11d8e..b9683e086b 100644 --- a/main/admin/event_controller.php +++ b/main/admin/event_controller.php @@ -94,9 +94,7 @@ $(function() { $interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin')); $interbreadcrumb[] = array('url' => '#', 'name' => get_lang('Events')); -$app['title'] = $tool_name; -$tpl = $app['template']; -$tpl->assign('actions', $actions); -$tpl->assign('message', $message); -$tpl->assign('content', $content); -$tpl->display_one_col_template(); +//$app['title'] = $tool_name; +echo $message; +echo $actions; +echo $content; diff --git a/main/admin/user_list.php b/main/admin/user_list.php index 7e8a59b006..656da521cf 100644 --- a/main/admin/user_list.php +++ b/main/admin/user_list.php @@ -350,7 +350,7 @@ function email_filter($email) { * @return string Some HTML-code with modify-buttons */ function modify_filter($user_id, $url_params, $row) { - global $_admins_list, $delete_user_available, $app; + global $_admins_list, $delete_user_available; $is_admin = false; $userId = api_get_user_id(); diff --git a/main/auth/inscription.php b/main/auth/inscription.php index c689cb9683..3a1a6c29d4 100644 --- a/main/auth/inscription.php +++ b/main/auth/inscription.php @@ -451,8 +451,14 @@ if ($form->validate()) { $user = Database::getManager()->getRepository('ChamiloLMSCoreBundle:User')->find($user_id); // Here, "secured" is the name of the firewall in your security.yml - $token = new UsernamePasswordToken($user, $user->getPassword(), 'secured', $user->getRoles()); - $app['security']->setToken($token); + $token = new UsernamePasswordToken( + $user, + $user->getPassword(), + 'secured', + $user->getRoles() + ); + + Security::getSecurity()->setToken($token); $request = $app['request']; // Fire the login event diff --git a/main/inc/lib/extra_field_value.lib.php b/main/inc/lib/extra_field_value.lib.php index 5b04b5ade4..e7bc89c5f1 100644 --- a/main/inc/lib/extra_field_value.lib.php +++ b/main/inc/lib/extra_field_value.lib.php @@ -261,7 +261,6 @@ class ExtraFieldValue extends Model // Insert if (empty($field_values)) { if ($extra_field_info['field_loggeable'] == 1) { - global $app; switch($this->type) { case 'question': $extraFieldValue = new QuestionFieldValues(); @@ -320,7 +319,6 @@ class ExtraFieldValue extends Model } else { // Update if ($extra_field_info['field_loggeable'] == 1) { - global $app; switch($this->type) { case 'question': $extraFieldValue = Database::getManager()->getRepository('ChamiloLMSCoreBundle:QuestionFieldValues')->find($field_values['id']); diff --git a/src/ChamiloLMS/CoreBundle/Block/CourseBlockService.php b/src/ChamiloLMS/CoreBundle/Block/CourseBlockService.php index 73ce0534db..299186a70d 100644 --- a/src/ChamiloLMS/CoreBundle/Block/CourseBlockService.php +++ b/src/ChamiloLMS/CoreBundle/Block/CourseBlockService.php @@ -1,4 +1,5 @@ register(true); require_once __DIR__.'/../app/AppKernel.php'; //require_once __DIR__.'/../app/AppCache.php'; +// Chamilo legacy code. require_once __DIR__.'/legacy.php'; $kernel = new AppKernel('prod', true);