Browse Source

retry merging

Eric Marguin 10 years ago
parent
commit
8a093876a8
100 changed files with 9075 additions and 2008 deletions
  1. 16 1
      .gitignore
  2. 0 0
      app/.htaccess
  3. 9 0
      app/AppCache.php
  4. 179 0
      app/AppKernel.php
  5. 27 0
      app/Resources/views/Common/topbar.html.twig
  6. 12 0
      app/Resources/views/Layouts/12.html.twig
  7. 387 0
      app/Resources/views/Layouts/3-9.html.twig
  8. 2 0
      app/Resources/views/Themes/page.html.twig
  9. 313 0
      app/Resources/views/base.html.twig
  10. 1 0
      app/Resources/views/layout.html.twig
  11. 39 0
      app/Resources/views/login.html.twig
  12. 687 0
      app/SymfonyRequirements.php
  13. 13 0
      app/autoload.php
  14. 3072 0
      app/bootstrap.php.cache
  15. 0 0
      app/cache/.gitkeep
  16. 62 0
      app/check.php
  17. 145 0
      app/config/assetic.yml
  18. 227 0
      app/config/config.yml
  19. 55 0
      app/config/config_dev.yml
  20. 25 0
      app/config/config_prod.yml
  21. 16 0
      app/config/config_test.yml
  22. 15 0
      app/config/fos/fos_message.yml
  23. 12 0
      app/config/fos/fos_rest.yml
  24. 26 0
      app/config/fos/fos_user.yml
  25. 23 0
      app/config/knp/knp_behat.yml
  26. 11 0
      app/config/knp/knp_paginator.yml
  27. 35 0
      app/config/parameters.yml.dist
  28. 55 0
      app/config/routing.yml
  29. 14 0
      app/config/routing_admin.yml
  30. 58 0
      app/config/routing_api.yml
  31. 14 0
      app/config/routing_dev.yml
  32. 83 0
      app/config/routing_front.yml
  33. 87 0
      app/config/security.yml
  34. 129 0
      app/config/sonata/sonata_admin.yml
  35. 85 0
      app/config/sonata/sonata_block.yml
  36. 33 0
      app/config/sonata/sonata_cache.yml
  37. 13 0
      app/config/sonata/sonata_classification.yml
  38. 6 0
      app/config/sonata/sonata_core.yml
  39. 70 0
      app/config/sonata/sonata_formatter.yml
  40. 12 0
      app/config/sonata/sonata_intl.yml
  41. 172 0
      app/config/sonata/sonata_media.yml
  42. 28 0
      app/config/sonata/sonata_news.yml
  43. 36 0
      app/config/sonata/sonata_notification.yml
  44. 142 0
      app/config/sonata/sonata_page.yml
  45. 45 0
      app/config/sonata/sonata_seo.yml
  46. 21 0
      app/config/sonata/sonata_timeline.yml
  47. 59 0
      app/config/sonata/sonata_user.yml
  48. 27 0
      app/console
  49. 0 0
      app/logs/.gitkeep
  50. 41 0
      app/phpunit.xml.dist
  51. 1 0
      bin/composer
  52. 1 0
      bin/doctrine
  53. 1 0
      bin/doctrine.php
  54. 1 0
      bin/jsonlint
  55. 1 0
      bin/lessc
  56. 1 0
      bin/validate-json
  57. 32 0
      cli-config.php
  58. 129 75
      composer.json
  59. 0 114
      config/auth.conf.dist.php
  60. 0 134
      config/configuration.dist.php
  61. 0 66
      config/events.conf.dist.php
  62. 0 16
      config/mail.conf.dist.php
  63. 0 19
      config/portfolio.conf.dist.php
  64. 0 42
      config/profile.conf.dist.php
  65. 0 39
      config/routing.yml
  66. 0 183
      console-config.php
  67. 0 93
      console.php
  68. 0 13
      custompages/README
  69. 0 106
      custompages/first_login.php
  70. BIN
      custompages/images/footer.png
  71. BIN
      custompages/images/header.png
  72. BIN
      custompages/images/login-form-submit-bg.jpg
  73. BIN
      custompages/images/page-background.png
  74. 0 16
      custompages/index-logged.php
  75. 0 109
      custompages/index-unlogged.php
  76. 0 80
      custompages/language.inc.php
  77. 0 56
      custompages/language.php
  78. 0 64
      custompages/loggedout.php
  79. 0 74
      custompages/lostpassword.php
  80. 0 41
      custompages/registration-feedback.php
  81. 0 119
      custompages/registration.php
  82. 0 218
      custompages/style-ie6.css
  83. 0 198
      custompages/style.css
  84. 0 5
      custompages/url-images/README
  85. 0 2
      global.inc.php
  86. 0 2
      inc/global.inc.php
  87. 0 7
      index.php
  88. 128 0
      main/admin/access_url_add_usergroup_to_url.php
  89. 2 6
      main/admin/access_url_edit.php
  90. 337 0
      main/admin/access_url_edit_course_category_to_url.php
  91. 346 0
      main/admin/access_url_edit_usergroup_to_url.php
  92. 1 6
      main/admin/access_urls.php
  93. 396 0
      main/admin/add_courses_to_session.php
  94. 189 0
      main/admin/add_students_to_session.php
  95. 193 0
      main/admin/add_teachers_to_session.php
  96. 674 0
      main/admin/add_users_to_session.php
  97. 1 1
      main/admin/add_users_to_usergroup.php
  98. 2 4
      main/admin/change_user_session.php
  99. 0 47
      main/admin/class_add.php
  100. 0 52
      main/admin/class_edit.php

+ 16 - 1
.gitignore

@@ -43,4 +43,19 @@ tests/doctrine_console/Proxies
 
 # OS stuff
 .DS_Store
-/.htaccess
+
+/.htaccess
+
+# Symfony
+
+behat.yml
+app/cache/*
+app/logs/*
+app/*.cache
+web/bundles
+web/uploads
+web/sitemap*.xml
+app/config/parameters*.yml
+vendor
+build
+composer.lock

+ 0 - 0
config/.htaccess → app/.htaccess


+ 9 - 0
app/AppCache.php

@@ -0,0 +1,9 @@
+<?php
+
+require_once __DIR__.'/AppKernel.php';
+
+use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
+
+class AppCache extends HttpCache
+{
+}

+ 179 - 0
app/AppKernel.php

@@ -0,0 +1,179 @@
+<?php
+
+use Symfony\Component\HttpKernel\Kernel;
+use Symfony\Component\Config\Loader\LoaderInterface;
+
+class AppKernel extends Kernel
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function registerBundles()
+    {
+        $bundles = array(
+            // Symfony standard edition
+            new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
+            new Symfony\Bundle\SecurityBundle\SecurityBundle(),
+            new Symfony\Bundle\TwigBundle\TwigBundle(),
+            new Symfony\Bundle\MonologBundle\MonologBundle(),
+            new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
+            new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
+            new JMS\AopBundle\JMSAopBundle(),
+            new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
+            new Symfony\Bundle\AsseticBundle\AsseticBundle(),
+
+            // Doctrine
+            new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
+            new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
+
+            // KNP bundles
+            new Knp\Bundle\MenuBundle\KnpMenuBundle(),
+            new Knp\Bundle\MarkdownBundle\KnpMarkdownBundle(),
+            new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
+
+            // User
+            new FOS\UserBundle\FOSUserBundle(),
+            new Sonata\UserBundle\SonataUserBundle('FOSUserBundle'),
+            new Application\Sonata\UserBundle\ApplicationSonataUserBundle(),
+
+            // Page
+            new Sonata\PageBundle\SonataPageBundle(),
+            new Application\Sonata\PageBundle\ApplicationSonataPageBundle(),
+
+            // NEWS
+            new Sonata\NewsBundle\SonataNewsBundle(),
+            new Application\Sonata\NewsBundle\ApplicationSonataNewsBundle(),
+
+            // MEDIA
+            new Sonata\MediaBundle\SonataMediaBundle(),
+            new Application\Sonata\MediaBundle\ApplicationSonataMediaBundle(),
+            // new Liip\ImagineBundle\LiipImagineBundle(),
+            //new Presta\CMSMediaBundle\PrestaCMSMediaBundle(),
+
+            new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
+
+            new Sonata\AdminBundle\SonataAdminBundle(),
+            new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
+
+            // Disable this if you don't want the audit on entities
+            new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(),
+
+            // API
+            new FOS\RestBundle\FOSRestBundle(),
+            new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
+
+            // E-COMMERCE
+            /*new Sonata\BasketBundle\SonataBasketBundle(),
+            new Application\Sonata\BasketBundle\ApplicationSonataBasketBundle(),
+            new Sonata\CustomerBundle\SonataCustomerBundle(),
+            new Application\Sonata\CustomerBundle\ApplicationSonataCustomerBundle(),
+            new Sonata\DeliveryBundle\SonataDeliveryBundle(),
+            new Application\Sonata\DeliveryBundle\ApplicationSonataDeliveryBundle(),
+            new Sonata\InvoiceBundle\SonataInvoiceBundle(),
+            new Application\Sonata\InvoiceBundle\ApplicationSonataInvoiceBundle(),
+            new Sonata\OrderBundle\SonataOrderBundle(),
+            new Application\Sonata\OrderBundle\ApplicationSonataOrderBundle(),
+            new Sonata\PaymentBundle\SonataPaymentBundle(),
+            new Application\Sonata\PaymentBundle\ApplicationSonataPaymentBundle(),
+            new Sonata\ProductBundle\SonataProductBundle(),
+            new Application\Sonata\ProductBundle\ApplicationSonataProductBundle(),
+            new Sonata\PriceBundle\SonataPriceBundle(),
+
+            */
+            new JMS\SerializerBundle\JMSSerializerBundle($this),
+            new FOS\CommentBundle\FOSCommentBundle(),
+            new Sonata\CommentBundle\SonataCommentBundle(),
+            new Application\Sonata\CommentBundle\ApplicationSonataCommentBundle(),
+
+            // SONATA CORE & HELPER BUNDLES
+            new Sonata\EasyExtendsBundle\SonataEasyExtendsBundle(),
+            new Sonata\CoreBundle\SonataCoreBundle(),
+            new Sonata\IntlBundle\SonataIntlBundle(),
+            new Sonata\FormatterBundle\SonataFormatterBundle(),
+            new Sonata\CacheBundle\SonataCacheBundle(),
+            new Sonata\BlockBundle\SonataBlockBundle(),
+            new Sonata\SeoBundle\SonataSeoBundle(),
+            new Sonata\ClassificationBundle\SonataClassificationBundle(),
+            new Application\Sonata\ClassificationBundle\ApplicationSonataClassificationBundle(),
+            new Sonata\NotificationBundle\SonataNotificationBundle(),
+            new Application\Sonata\NotificationBundle\ApplicationSonataNotificationBundle(),
+            new Application\Sonata\SeoBundle\ApplicationSonataSeoBundle(),
+            new Sonata\DatagridBundle\SonataDatagridBundle(),
+
+            // Search Integration
+            //new FOS\ElasticaBundle\FOSElasticaBundle(),
+
+            // CMF Integration
+            new Symfony\Cmf\Bundle\RoutingBundle\CmfRoutingBundle(),
+
+            // DEMO and QA - Can be deleted
+            //new Sonata\Bundle\DemoBundle\SonataDemoBundle(),
+            //new Sonata\Bundle\QABundle\SonataQABundle(),
+
+            // Disable this if you don't want the timeline in the admin
+            new Spy\TimelineBundle\SpyTimelineBundle(),
+            new Sonata\TimelineBundle\SonataTimelineBundle(),
+            new Application\Sonata\TimelineBundle\ApplicationSonataTimelineBundle(), // easy extends integration
+
+            new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
+            new Application\Sonata\AdminBundle\ApplicationSonataAdminBundle(),
+            new FOS\AdvancedEncoderBundle\FOSAdvancedEncoderBundle(),
+
+            //new HWI\Bundle\OAuthBundle\HWIOAuthBundle(),
+            new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),
+            new FOS\MessageBundle\FOSMessageBundle(),
+
+            // Chamilo
+            new ChamiloLMS\CoreBundle\ChamiloLMSCoreBundle(),
+            new ChamiloLMS\CourseBundle\ChamiloLMSCourseBundle(),
+            new ChamiloLMS\InstallerBundle\ChamiloLMSInstallerBundle(),
+            new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle()
+        );
+
+        if (in_array($this->getEnvironment(), array('dev', 'test'))) {
+            $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
+            $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
+            $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
+            $bundles[] = new Bazinga\Bundle\FakerBundle\BazingaFakerBundle();
+            $bundles[] = new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle();
+            $bundles[] = new Elao\WebProfilerExtraBundle\WebProfilerExtraBundle();
+        }
+
+        return $bundles;
+    }
+
+    public function registerContainerConfiguration(LoaderInterface $loader)
+    {
+        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
+    }
+
+    /*public function getLogDir()
+    {
+        return $this->rootDir.'/../logs/'.$this->environment.'/logs/';
+    }
+
+    public function getCacheDir()
+    {
+        return $this->rootDir.'/../data/temp/'.$this->environment.'/cache/';
+    }*/
+
+    // Custom paths
+
+    /**
+     * Returns the real root path
+     * @return string
+     */
+    public function getRealRootDir()
+    {
+        return realpath($this->rootDir.'/../').'/';
+    }
+
+    /**
+     * Returns the data path
+     * @return string
+     */
+    public function getDataDir()
+    {
+        return $this->getRealRootDir().'data/';
+    }
+}

+ 27 - 0
app/Resources/views/Common/topbar.html.twig

@@ -0,0 +1,27 @@
+{% block topbar %}
+    <nav class="navbar navbar-default navbar-fixed-top" role="navigation">
+        <!-- Brand and toggle get grouped for better mobile display -->
+        <div class="navbar-header">
+            <button type="button" class="navbar-toggle"
+                    data-toggle="collapse" data-target=".navbar-ex1-collapse">
+                <span class="sr-only">Toggle navigation</span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+                <span class="icon-bar"></span>
+            </button>
+            <a class="navbar-brand" href="#">Chamilo</a>
+        </div>
+
+        <!-- Collect the nav links, forms, and other content for toggling -->
+        <div class="collapse navbar-collapse navbar-ex1-collapse">
+            {{ knp_menu_render('ChamiloLMSCoreBundle:Builder:leftMenu', { 'style': 'navbar' }) }}
+            <form class="navbar-form navbar-left" role="search">
+                <div class="form-group">
+                    <input type="text" class="form-control" placeholder="Search">
+                </div>
+                <button type="submit" class="btn btn-default">Submit</button>
+            </form>
+            {{ knp_menu_render('ChamiloLMSCoreBundle:Builder:rightMenu', { 'style': 'navbar-right' }) }}
+        </div><!-- /.navbar-collapse -->
+    </nav>
+{% endblock %}

+ 12 - 0
app/Resources/views/Layouts/12.html.twig

@@ -0,0 +1,12 @@
+{% include '::Common/topbar.html.twig' %}
+<br />
+<br />
+<br />
+<div class="container-fluid">
+    <div class="row">
+        <div class="col-sm-12">
+            {% block content %}
+            {% endblock %}
+        </div>
+    </div>
+</div>

+ 387 - 0
app/Resources/views/Layouts/3-9.html.twig

@@ -0,0 +1,387 @@
+{% block header %}
+    <header class="header">
+    {% block logo %}
+        <a href="index.html" class="logo">
+            <!-- Add the class icon to your logo image or logo icon to add the margining -->
+            AdminLTE
+        </a>
+    {% endblock %}
+
+    {% block nav %}
+        <nav class="navbar navbar-static-top" role="navigation">
+        <!-- Sidebar toggle button-->
+        <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
+            <span class="sr-only">Toggle navigation</span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+            <span class="icon-bar"></span>
+        </a>
+
+        <div class="navbar-left">
+        {{ sonata_block_render_event('breadcrumb', { 'context': 'default', 'current_uri': app.request.requestUri }) }}
+        </div>
+
+        <div class="navbar-right">
+        <ul class="nav navbar-nav">
+        <!-- Messages: style can be found in dropdown.less-->
+        <li class="dropdown messages-menu">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+                <i class="fa fa-envelope"></i>
+                <span class="label label-success">4</span>
+            </a>
+            <ul class="dropdown-menu">
+                <li class="header">You have 4 messages</li>
+                <li>
+                    <!-- inner menu: contains the actual data -->
+                    <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
+                            <li><!-- start message -->
+                                <a href="#">
+                                    <div class="pull-left">
+                                        <img src="img/avatar3.png" class="img-circle" alt="User Image">
+                                    </div>
+                                    <h4>
+                                        Support Team
+                                        <small><i class="fa fa-clock-o"></i> 5 mins</small>
+                                    </h4>
+                                    <p>Why not buy a new awesome theme?</p>
+                                </a>
+                            </li><!-- end message -->
+                            <li>
+                                <a href="#">
+                                    <div class="pull-left">
+                                        <img src="img/avatar2.png" class="img-circle" alt="user image">
+                                    </div>
+                                    <h4>
+                                        AdminLTE Design Team
+                                        <small><i class="fa fa-clock-o"></i> 2 hours</small>
+                                    </h4>
+                                    <p>Why not buy a new awesome theme?</p>
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <div class="pull-left">
+                                        <img src="img/avatar.png" class="img-circle" alt="user image">
+                                    </div>
+                                    <h4>
+                                        Developers
+                                        <small><i class="fa fa-clock-o"></i> Today</small>
+                                    </h4>
+                                    <p>Why not buy a new awesome theme?</p>
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <div class="pull-left">
+                                        <img src="img/avatar2.png" class="img-circle" alt="user image">
+                                    </div>
+                                    <h4>
+                                        Sales Department
+                                        <small><i class="fa fa-clock-o"></i> Yesterday</small>
+                                    </h4>
+                                    <p>Why not buy a new awesome theme?</p>
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <div class="pull-left">
+                                        <img src="img/avatar.png" class="img-circle" alt="user image">
+                                    </div>
+                                    <h4>
+                                        Reviewers
+                                        <small><i class="fa fa-clock-o"></i> 2 days</small>
+                                    </h4>
+                                    <p>Why not buy a new awesome theme?</p>
+                                </a>
+                            </li>
+                        </ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div>
+                </li>
+                <li class="footer"><a href="#">See All Messages</a></li>
+            </ul>
+        </li>
+        <!-- Notifications: style can be found in dropdown.less -->
+        <li class="dropdown notifications-menu">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+                <i class="fa fa-warning"></i>
+                <span class="label label-warning">10</span>
+            </a>
+            <ul class="dropdown-menu">
+                <li class="header">You have 10 notifications</li>
+                <li>
+                    <!-- inner menu: contains the actual data -->
+                    <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
+                            <li>
+                                <a href="#">
+                                    <i class="ion ion-ios7-people info"></i> 5 new members joined today
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <i class="fa fa-warning danger"></i> Very long description here that may not fit into the page and may cause design problems
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <i class="fa fa-users warning"></i> 5 new members joined
+                                </a>
+                            </li>
+
+                            <li>
+                                <a href="#">
+                                    <i class="ion ion-ios7-cart success"></i> 25 sales made
+                                </a>
+                            </li>
+                            <li>
+                                <a href="#">
+                                    <i class="ion ion-ios7-person danger"></i> You changed your username
+                                </a>
+                            </li>
+                        </ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div>
+                </li>
+                <li class="footer"><a href="#">View all</a></li>
+            </ul>
+        </li>
+        <!-- Tasks: style can be found in dropdown.less -->
+        <li class="dropdown tasks-menu">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+                <i class="fa fa-tasks"></i>
+                <span class="label label-danger">9</span>
+            </a>
+            <ul class="dropdown-menu">
+                <li class="header">You have 9 tasks</li>
+                <li>
+                    <!-- inner menu: contains the actual data -->
+                    <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;"><ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
+                            <li><!-- Task item -->
+                                <a href="#">
+                                    <h3>
+                                        Design some buttons
+                                        <small class="pull-right">20%</small>
+                                    </h3>
+                                    <div class="progress xs">
+                                        <div class="progress-bar progress-bar-aqua" style="width: 20%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
+                                            <span class="sr-only">20% Complete</span>
+                                        </div>
+                                    </div>
+                                </a>
+                            </li><!-- end task item -->
+                            <li><!-- Task item -->
+                                <a href="#">
+                                    <h3>
+                                        Create a nice theme
+                                        <small class="pull-right">40%</small>
+                                    </h3>
+                                    <div class="progress xs">
+                                        <div class="progress-bar progress-bar-green" style="width: 40%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
+                                            <span class="sr-only">40% Complete</span>
+                                        </div>
+                                    </div>
+                                </a>
+                            </li><!-- end task item -->
+                            <li><!-- Task item -->
+                                <a href="#">
+                                    <h3>
+                                        Some task I need to do
+                                        <small class="pull-right">60%</small>
+                                    </h3>
+                                    <div class="progress xs">
+                                        <div class="progress-bar progress-bar-red" style="width: 60%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
+                                            <span class="sr-only">60% Complete</span>
+                                        </div>
+                                    </div>
+                                </a>
+                            </li><!-- end task item -->
+                            <li><!-- Task item -->
+                                <a href="#">
+                                    <h3>
+                                        Make beautiful transitions
+                                        <small class="pull-right">80%</small>
+                                    </h3>
+                                    <div class="progress xs">
+                                        <div class="progress-bar progress-bar-yellow" style="width: 80%" role="progressbar" aria-valuenow="20" aria-valuemin="0" aria-valuemax="100">
+                                            <span class="sr-only">80% Complete</span>
+                                        </div>
+                                    </div>
+                                </a>
+                            </li><!-- end task item -->
+                        </ul><div class="slimScrollBar" style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: block; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; z-index: 99; right: 1px; background: rgb(0, 0, 0);"></div><div class="slimScrollRail" style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-top-left-radius: 0px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; border-bottom-left-radius: 0px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div></div>
+                </li>
+                <li class="footer">
+                    <a href="#">View all tasks</a>
+                </li>
+            </ul>
+        </li>
+        <!-- User Account: style can be found in dropdown.less -->
+        <li class="dropdown user user-menu">
+            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
+                <i class="glyphicon glyphicon-user"></i>
+                <span>Jane Doe <i class="caret"></i></span>
+            </a>
+            <ul class="dropdown-menu">
+                <!-- User image -->
+                <li class="user-header bg-light-blue">
+                    <img src="img/avatar3.png" class="img-circle" alt="User Image">
+                    <p>
+                        Jane Doe - Web Developer
+                        <small>Member since Nov. 2012</small>
+                    </p>
+                </li>
+                <!-- Menu Body -->
+                <li class="user-body">
+                    <div class="col-xs-4 text-center">
+                        <a href="#">Followers</a>
+                    </div>
+                    <div class="col-xs-4 text-center">
+                        <a href="#">Sales</a>
+                    </div>
+                    <div class="col-xs-4 text-center">
+                        <a href="#">Friends</a>
+                    </div>
+                </li>
+                <!-- Menu Footer-->
+                <li class="user-footer">
+                    <div class="pull-left">
+                        <a href="#" class="btn btn-default btn-flat">Profile</a>
+                    </div>
+                    <div class="pull-right">
+                        <a href="#" class="btn btn-default btn-flat">Sign out</a>
+                    </div>
+                </li>
+            </ul>
+        </li>
+        </ul>
+        </div>
+        </nav>
+    {% endblock %}
+    </header>
+{% endblock %}
+    {% block sonata_wrapper %}
+        <div class="wrapper row-offcanvas row-offcanvas-left">
+            {% block sonata_left_side %}
+                <aside class="left-side sidebar-offcanvas">
+                    <section class="sidebar">
+
+                        {{ sonata_block_render({'type': 'chamilolms.corebundle.block.main_menu', 'settings': {
+                            'current_uri': app.request.requestUri,
+                            'ttl': 60
+                        }}) }}
+
+                        {% block sonata_side_nav %}
+                            {% block sonata_sidebar_search %}
+                                {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+                                    <form action="{{ url('sonata_admin_search') }}" method="GET" class="sidebar-form" role="search">
+                                        <div class="input-group custom-search-form">
+                                            <input type="text" name="q" value="{{ app.request.get('q') }}" class="form-control" placeholder="{{ 'search_placeholder'|trans({}, 'SonataAdminBundle') }}">
+                                                    <span class="input-group-btn">
+                                                        <button class="btn btn-flat" type="submit">
+                                                            <i class="fa fa-search"></i>
+                                                        </button>
+                                                    </span>
+                                        </div>
+                                    </form>
+                                {% endif %}
+                            {% endblock sonata_sidebar_search %}
+
+                            {% block side_bar_before_nav %} {% endblock %}
+                            {% block side_bar_nav %}
+                                {% if app.security.token and is_granted('ROLE_SONATA_ADMIN') %}
+
+                                {% endif %}
+                            {% endblock side_bar_nav %}
+                        {% endblock sonata_side_nav %}
+                    </section>
+                </aside>
+            {% endblock sonata_left_side %}
+
+            <aside class="right-side">
+                {% block sonata_page_content %}
+                    <section class="content-header">
+                        {% block sonata_page_content_header %}
+                            {% block sonata_page_content_nav %}
+                                {% if _tab_menu is not empty or _actions is not empty %}
+                                    <nav class="navbar navbar-default" role="navigation">
+                                        {% if _navbar_title is not empty %}
+                                            <div class="navbar-header">
+                                                <span class="navbar-brand">{{ _navbar_title|raw }}</span>
+                                            </div>
+                                        {% endif %}
+                                        <div class="container-fluid">
+                                            <div class="navbar-left">
+                                                {% if _tab_menu is not empty %}
+                                                    {{ _tab_menu|raw }}
+                                                {% endif %}
+                                            </div>
+
+                                            {% if _actions is not empty %}
+                                                <ul class="nav navbar-nav navbar-right">
+                                                    <li class="dropdown sonata-actions">
+                                                        <a href="#" class="dropdown-toggle" data-toggle="dropdown">Actions <b class="caret"></b></a>
+                                                        <ul class="dropdown-menu" role="menu">
+                                                            {{ _actions|raw }}
+                                                        </ul>
+                                                    </li>
+                                                </ul>
+                                            {% endif %}
+                                        </div>
+                                    </nav>
+                                {% endif %}
+                            {% endblock sonata_page_content_nav %}
+
+                        {% endblock sonata_page_content_header %}
+                    </section>
+
+                    <section class="content">
+
+                    <div class="row">
+                    <div class="col-md-3 col-sm-4">
+                        {% block sidebar %}
+
+                            {#{{ sonata_block_render({ 'type': 'sonata.block.service.menu' }, {#}
+                                {#'menu_name': 'ChamiloLMSCoreBundle:MainMenuBuilder:profileMenu',#}
+                            {#}) }}#}
+
+                            {% include "@template_style/layout/sidebar.tpl" %}
+
+                            {# course navigation links/shortcuts need to be activated by the admin #}
+                            {% include "@template_style/layout/course_navigation.tpl" %}
+                        {% endblock %}
+                    </div>
+                    <div class="col-md-9 col-sm-8">
+                    {% block main_content %}
+                        {% if plugin_content_top %}
+                            <div id="plugin_content_top" class="col-lg-10 col-sm-11">
+                                {{ plugin_content_top}}
+                            </div>
+                        {% endif %}
+
+                        {% include "@template_style/layout/page_body.tpl" %}
+                        {% block content %}
+                            {% autoescape false %}
+                            {% if content is not null %}
+                                {{ content }}
+                            {% endif %}
+                            {% endautoescape %}
+                        {% endblock %}
+
+                        {#  Plugin bottom  #}
+                        {% if plugin_content_bottom %}
+                            <div id="plugin_content_bottom" class="col-md-12">
+                                {{ plugin_content_bottom }}
+                            </div>
+                        {% endif %}
+                        </section>
+
+                        {# Footer #}
+                        {% include "@template_style/layout/footer.tpl" %}
+                    {% endblock %}
+                    </div>
+                    </div>
+
+
+                    </section>
+                {% endblock sonata_page_content %}
+            </aside>
+
+        </div>
+    {% endblock sonata_wrapper %}
+

+ 2 - 0
app/Resources/views/Themes/page.html.twig

@@ -0,0 +1,2 @@
+{% extends '::base.html.twig' %}
+{% block theme 'page' %}

+ 313 - 0
app/Resources/views/base.html.twig

@@ -0,0 +1,313 @@
+{% set _preview      = block('preview') %}
+{% set _form         = block('form') %}
+{% set _show         = block('show') %}
+{% set _list_table   = block('list_table') %}
+{% set _list_filters = block('list_filters') %}
+{% set _tab_menu     = block('tab_menu') %}
+{% set _content      = block('content') %}
+{% set _title        = block('title') %}
+{% set _breadcrumb   = block('breadcrumb') %}
+{% set _actions      = block('actions') %}
+{% set _navbar_title = block('navbar_title') %}
+<!DOCTYPE html>
+<!--[if lt IE 7]> <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>    <html lang="{{ app.request.locale }}" class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>    <html lang="{{ app.request.locale }}" class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--><html lang="{{ app.request.locale }}" class="no-js"> <!--<![endif]-->
+<head>
+{% block head %}
+    <noscript>{{ "NoJavascript"|trans }}</noscript>
+    <meta charset="UTF-8" />
+    <link href="http://www.chamilo.org/documentation.php" rel="help" />
+    <link href="http://www.chamilo.org/team.php" rel="author" />
+    <link href="http://www.chamilo.org" rel="copyright" />
+    <link rel="shortcut icon" href="{{ asset('favicon.ico') }}" />
+    <link rel="shortcut icon" href="{{ asset('apple-touch-icon.png') }}" />
+    <meta name="apple-mobile-web-app-capable" content="yes" />
+    <meta name="Generator" content="{{ software_name }} {{ version }}" />
+    {#  Use the latest engine in ie8/ie9 or use google chrome engine if available  #}
+    {#  Improve usability in portal devices #}
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1.0">
+    <title>{% block title %}{% endblock %}</title>
+
+    {% block stylesheets %}
+        <link href="{{ asset('assetic/sonata_formatter_css.css') }}" rel="stylesheet" media="screen">
+        <link href="{{ asset('assetic/sonata_admin_css.css') }}" rel="stylesheet" media="screen">
+        <link href="{{ asset('assetic/sonata_jqueryui_css.css') }}" rel="stylesheet" media="screen">
+
+        <link href="{{ asset('ChamiloLMS/css/base.css') }}" rel="stylesheet" media="screen">
+        <link href="{{ asset('ChamiloLMS/css/themes/chamilo/default.css') }}" rel="stylesheet" media="screen">
+    {% endblock %}
+
+    {% block javascripts %}
+        <script src="{{ asset('assetic/sonata_admin_js.js') }}" type="text/javascript"></script>
+        <script src="{{ asset('assetic/sonata_formatter_js.js') }}" type="text/javascript"></script>
+        <script src="{{ asset('assetic/sonata_jqueryui_js.js') }}" type="text/javascript"></script>
+    {% endblock %}
+
+    {% block header_end %}{% endblock header_end %}
+    <script>
+    function setCheckbox(value, table_id) {
+        checkboxes = $("#"+table_id+" input:checkbox");
+        $.each(checkboxes, function(index, checkbox) {
+            checkbox.checked = value;
+            if (value) {
+                $(checkbox).parentsUntil("tr").parent().addClass("row_selected");
+            } else {
+                $(checkbox).parentsUntil("tr").parent().removeClass("row_selected");
+            }
+        });
+        return false;
+    }
+
+    function action_click(element, table_id) {
+        d = $("#"+table_id);
+        if (!confirm('{{ "ConfirmYourChoice"|trans }}')) {
+            return false;
+        } else {
+            var action =$(element).attr("data-action");
+            $('#'+table_id+' input[name="action"] ').attr("value", action);
+            d.submit();
+            return false;
+        }
+    }
+
+    /* Global chat variables */
+    {#
+    var ajax_url        = '{{ _p.web_ajax }}chat.ajax.php';
+    var online_button   = '{{ online_button |e('js') }}';
+    var offline_button  = '{{ offline_button |e('js') }}';
+        #}
+    var connect_lang    = '{{ "ChatConnected"|trans |e('js') }}';
+    var disconnect_lang = '{{ "ChatDisconnected"|trans |e('js') }}';
+
+    function get_url_params(q, attribute) {
+        var vars;
+        var hash;
+        if (q != undefined) {
+            q = q.split('&');
+            for(var i = 0; i < q.length; i++){
+                hash = q[i].split('=');
+                if (hash[0] == attribute) {
+                    return hash[1];
+                }
+            }
+        }
+    }
+
+    function check_brand() {
+        if ($('.subnav').length) {
+            if ($(window).width() >= 969) {
+                $('.subnav .brand').hide();
+            } else {
+                $('.subnav .brand').show();
+            }
+        }
+    }
+
+    $(window).resize(function() {
+        //check_brand();
+    });
+
+    $(document).scroll(function() {
+
+        // Top bar scroll effect
+        if ($('body').width() > 959) {
+            if ($('.subnav').length) {
+                if (!$('.subnav').attr('data-top')) {
+                    // If already fixed, then do nothing
+                    if ($('.subnav').hasClass('subnav-fixed')) return;
+                    // Remember top position
+                    var offset = $('.subnav').offset();
+                    $('.subnav').attr('data-top', offset.top);
+                }
+
+                if ($('.subnav').attr('data-top') - $('.subnav').outerHeight() <= $(this).scrollTop()) {
+                    $('.subnav').addClass('subnav-fixed');
+                } else {
+                    $('.subnav').removeClass('subnav-fixed');
+                }
+                //$('.subnav .brand').show();
+            }
+        } else {
+            //$('.subnav .brand').hide();
+        }
+
+        //Exercise warning fixed at the top
+        var fixed =  $("#exercise_clock_warning");
+        if (fixed.length) {
+            if (!fixed.attr('data-top')) {
+                // If already fixed, then do nothing
+                if (fixed.hasClass('subnav-fixed')) return;
+                // Remember top position
+                var offset = fixed.offset();
+                fixed.attr('data-top', offset.top);
+                fixed.css('width', '100%');
+            }
+
+            if (fixed.attr('data-top') - fixed.outerHeight() <= $(this).scrollTop()) {
+                fixed.addClass('subnav-fixed');
+                fixed.css('width', '100%');
+            } else {
+                fixed.removeClass('subnav-fixed');
+                fixed.css('width', '200px');
+            }
+        }
+
+        // Admin -> Settings toolbar.
+        if ($('body').width() > 959) {/*
+         if ($('.new_actions').length) {
+         if (!$('.new_actions').attr('data-top')) {
+         // If already fixed, then do nothing
+         if ($('.new_actions').hasClass('new_actions-fixed')) return;
+         // Remember top position
+         var offset = $('.new_actions').offset();
+
+         var more_top = 0;
+         if ($('.subnav').hasClass('new_actions-fixed')) {
+         more_top = 50;
+         }
+         $('.new_actions').attr('data-top', offset.top + more_top);
+         }
+
+         if ($('.new_actions').attr('data-top') - $('.new_actions').outerHeight() <= $(this).scrollTop()) {
+         $('.new_actions').addClass('new_actions-fixed');
+         } else {
+         $('.new_actions').removeClass('new_actions-fixed');
+         }
+         }*/
+        }
+
+        // Bottom actions.
+        if ($('.bottom_actions').length) {
+            if (!$('.bottom_actions').attr('data-top')) {
+                // If already fixed, then do nothing
+                if ($('.bottom_actions').hasClass('bottom_actions_fixed')) return;
+
+                // Remember top position
+                var offset = $('.bottom_actions').offset();
+                $('.bottom_actions').attr('data-top', offset.top);
+            }
+
+            if ($('.bottom_actions').attr('data-top') > $('body').outerHeight()) {
+                if ( ($('.bottom_actions').attr('data-top') - $('body').outerHeight() - $('.bottom_actions').outerHeight()) >= $(this).scrollTop()) {
+                    $('.bottom_actions').addClass('bottom_actions_fixed');
+                    $('.bottom_actions').css("width", "100%");
+                } else {
+                    $('.bottom_actions').css("width", "");
+                    $('.bottom_actions').removeClass('bottom_actions_fixed');
+                }
+            } else {
+                if ( ($('.bottom_actions').attr('data-top') -  $('.bottom_actions').outerHeight()) <= $(this).scrollTop()) {
+                    $('.bottom_actions').addClass('bottom_actions_fixed');
+                    $('.bottom_actions').css("width", "100%");
+                } else {
+                    $('.bottom_actions').removeClass('bottom_actions_fixed');
+                    $('.bottom_actions').css("width", "");
+                }
+            }
+        }
+    });
+
+    $(function() {
+        check_brand();
+        //Removes the yellow input in Chrome
+        if (navigator.userAgent.toLowerCase().indexOf("chrome") >= 0) {
+            $(window).load(function(){
+                $('input:-webkit-autofill').each(function(){
+                    var text = $(this).val();
+                    var name = $(this).attr('name');
+                    $(this).after(this.outerHTML).remove();
+                    //var has_string = $(name).find(":contains('[')");
+                    $('input[name=' + name + ']').val(text);
+                });
+            });
+        }
+
+        // Fixes buttons to the new btn class.
+        if (!$('#button').hasClass('btn')) {
+            $("button").addClass('btn');
+        }
+
+        // Dropdown effect.
+        $('.dropdown-toggle').dropdown();
+
+        // Responsive effect.
+        //$(".collapse").collapse();
+
+        /*$(".accordion_jquery").accordion({
+            autoHeight: false,
+            active: false, // all items closed by default
+            collapsible: true,
+            header: ".accordion-heading"
+        });*/
+
+        // Global popup
+        $('.ajax').on('click', function() {
+            var url     = this.href;
+            var dialog  = $("#dialog");
+            if ($("#dialog").length == 0) {
+                dialog  = $('<div id="dialog" style="display:none"></div>').appendTo('body');
+            }
+
+            width_value = 580;
+            height_value = 450;
+            resizable_value = true;
+
+            new_param = get_url_params(url, 'width');
+            if (new_param) {
+                width_value = new_param;
+            }
+
+            new_param = get_url_params(url, 'height')
+            if (new_param) {
+                height_value = new_param;
+            }
+
+            new_param = get_url_params(url, 'resizable');
+            if (new_param) {
+                resizable_value = new_param;
+            }
+
+            // load remote content
+            dialog.load(url,{}, function(responseText, textStatus, XMLHttpRequest) {
+                dialog.dialog({
+                    modal       : true,
+                    width       : width_value,
+                    height      : height_value,
+                    resizable   : resizable_value
+                });
+            });
+            //prevent the browser to follow the link
+            return false;
+        });
+
+        //old jquery.menu.js
+        $('#navigation a').stop().animate({
+            'marginLeft':'50px'
+        }, 1000);
+
+        $('#navigation > li').hover(
+                function () {
+                    $('a',$(this)).stop().animate({
+                        'marginLeft':'1px'
+                    },200);
+                },
+                function () {
+                    $('a',$(this)).stop().animate({
+                        'marginLeft':'50px'
+                    },200);
+                }
+        );
+    });
+    </script>
+    {% block extraHead %}
+    {% endblock %}
+{% endblock %}
+</head>
+
+<body class="{% block theme %}default{% endblock %} sonata-bc skin-black fixed">
+{% block layout %}{% endblock %}
+</body>
+</html>

+ 1 - 0
app/Resources/views/layout.html.twig

@@ -0,0 +1 @@
+123

+ 39 - 0
app/Resources/views/login.html.twig

@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html class="bg-black">
+<head>
+    <meta charset="UTF-8">
+    <title>{% block title %} Log in {% endblock %}</title>
+    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
+    {% stylesheets '@admin_lte_css' %}
+    <link href="{{ asset_url }}" rel="stylesheet" type="text/css" />
+    {% endstylesheets %}
+
+    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
+    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
+    <!--[if lt IE 9]>
+
+    <![endif]-->
+</head>
+<body class="bg-black">
+
+<div class="form-box" id="login-box">
+    {% block fos_user_content %}
+    {% endblock fos_user_content %}
+    {#
+    <div class="margin text-center">
+        <span>Sign in using social networks</span>
+        <br/>
+        <button class="btn bg-light-blue btn-circle"><i class="fa fa-facebook"></i></button>
+        <button class="btn bg-aqua btn-circle"><i class="fa fa-twitter"></i></button>
+        <button class="btn bg-red btn-circle"><i class="fa fa-google-plus"></i></button>
+    </div>
+    #}
+</div>
+
+<!-- jQuery 2.0.2 -->
+<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
+<!-- Bootstrap -->
+<script src="../../js/bootstrap.min.js" type="text/javascript"></script>
+
+</body>
+</html>

+ 687 - 0
app/SymfonyRequirements.php

@@ -0,0 +1,687 @@
+<?php
+
+/*
+ * This file is part of the Symfony package.
+ *
+ * (c) Fabien Potencier <fabien@symfony.com>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+/*
+ * Users of PHP 5.2 should be able to run the requirements checks.
+ * This is why the file and all classes must be compatible with PHP 5.2+
+ * (e.g. not using namespaces and closures).
+ *
+ * ************** CAUTION **************
+ *
+ * DO NOT EDIT THIS FILE as it will be overridden by Composer as part of
+ * the installation/update process. The original file resides in the
+ * SensioDistributionBundle.
+ *
+ * ************** CAUTION **************
+ */
+
+/**
+ * Represents a single PHP requirement, e.g. an installed extension.
+ * It can be a mandatory requirement or an optional recommendation.
+ * There is a special subclass, named PhpIniRequirement, to check a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class Requirement
+{
+    private $fulfilled;
+    private $testMessage;
+    private $helpText;
+    private $helpHtml;
+    private $optional;
+
+    /**
+     * Constructor that initializes the requirement.
+     *
+     * @param Boolean     $fulfilled   Whether the requirement is fulfilled
+     * @param string      $testMessage The message for testing the requirement
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     * @param Boolean     $optional    Whether this is only an optional recommendation not a mandatory requirement
+     */
+    public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
+    {
+        $this->fulfilled = (Boolean) $fulfilled;
+        $this->testMessage = (string) $testMessage;
+        $this->helpHtml = (string) $helpHtml;
+        $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText;
+        $this->optional = (Boolean) $optional;
+    }
+
+    /**
+     * Returns whether the requirement is fulfilled.
+     *
+     * @return Boolean true if fulfilled, otherwise false
+     */
+    public function isFulfilled()
+    {
+        return $this->fulfilled;
+    }
+
+    /**
+     * Returns the message for testing the requirement.
+     *
+     * @return string The test message
+     */
+    public function getTestMessage()
+    {
+        return $this->testMessage;
+    }
+
+    /**
+     * Returns the help text for resolving the problem
+     *
+     * @return string The help text
+     */
+    public function getHelpText()
+    {
+        return $this->helpText;
+    }
+
+    /**
+     * Returns the help text formatted in HTML.
+     *
+     * @return string The HTML help
+     */
+    public function getHelpHtml()
+    {
+        return $this->helpHtml;
+    }
+
+    /**
+     * Returns whether this is only an optional recommendation and not a mandatory requirement.
+     *
+     * @return Boolean true if optional, false if mandatory
+     */
+    public function isOptional()
+    {
+        return $this->optional;
+    }
+}
+
+/**
+ * Represents a PHP requirement in form of a php.ini configuration.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class PhpIniRequirement extends Requirement
+{
+    /**
+     * Constructor that initializes the requirement.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string|null $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     * @param Boolean     $optional    Whether this is only an optional recommendation not a mandatory requirement
+     */
+    public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
+    {
+        $cfgValue = ini_get($cfgName);
+
+        if (is_callable($evaluation)) {
+            if (null === $testMessage || null === $helpHtml) {
+                throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
+            }
+
+            $fulfilled = call_user_func($evaluation, $cfgValue);
+        } else {
+            if (null === $testMessage) {
+                $testMessage = sprintf('%s %s be %s in php.ini',
+                    $cfgName,
+                    $optional ? 'should' : 'must',
+                    $evaluation ? 'enabled' : 'disabled'
+                );
+            }
+
+            if (null === $helpHtml) {
+                $helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
+                    $cfgName,
+                    $evaluation ? 'on' : 'off'
+                );
+            }
+
+            $fulfilled = $evaluation == $cfgValue;
+        }
+
+        parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
+    }
+}
+
+/**
+ * A RequirementCollection represents a set of Requirement instances.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ */
+class RequirementCollection implements IteratorAggregate
+{
+    private $requirements = array();
+
+    /**
+     * Gets the current RequirementCollection as an Iterator.
+     *
+     * @return Traversable A Traversable interface
+     */
+    public function getIterator()
+    {
+        return new ArrayIterator($this->requirements);
+    }
+
+    /**
+     * Adds a Requirement.
+     *
+     * @param Requirement $requirement A Requirement instance
+     */
+    public function add(Requirement $requirement)
+    {
+        $this->requirements[] = $requirement;
+    }
+
+    /**
+     * Adds a mandatory requirement.
+     *
+     * @param Boolean     $fulfilled   Whether the requirement is fulfilled
+     * @param string      $testMessage The message for testing the requirement
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
+    {
+        $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
+    }
+
+    /**
+     * Adds an optional recommendation.
+     *
+     * @param Boolean     $fulfilled   Whether the recommendation is fulfilled
+     * @param string      $testMessage The message for testing the recommendation
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
+    {
+        $this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
+    }
+
+    /**
+     * Adds a mandatory requirement in form of a php.ini configuration.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+    {
+        $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
+    }
+
+    /**
+     * Adds an optional recommendation in form of a php.ini configuration.
+     *
+     * @param string           $cfgName    The configuration name used for ini_get()
+     * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
+                                                    or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
+     * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
+                                                    This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
+                                                    Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
+     * @param string      $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
+     * @param string      $helpHtml    The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
+     * @param string|null $helpText    The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
+     */
+    public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
+    {
+        $this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
+    }
+
+    /**
+     * Adds a requirement collection to the current set of requirements.
+     *
+     * @param RequirementCollection $collection A RequirementCollection instance
+     */
+    public function addCollection(RequirementCollection $collection)
+    {
+        $this->requirements = array_merge($this->requirements, $collection->all());
+    }
+
+    /**
+     * Returns both requirements and recommendations.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function all()
+    {
+        return $this->requirements;
+    }
+
+    /**
+     * Returns all mandatory requirements.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getRequirements()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns the mandatory requirements that were not met.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getFailedRequirements()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && !$req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns all optional recommendations.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getRecommendations()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if ($req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns the recommendations that were not met.
+     *
+     * @return array Array of Requirement instances
+     */
+    public function getFailedRecommendations()
+    {
+        $array = array();
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && $req->isOptional()) {
+                $array[] = $req;
+            }
+        }
+
+        return $array;
+    }
+
+    /**
+     * Returns whether a php.ini configuration is not correct.
+     *
+     * @return Boolean php.ini configuration problem?
+     */
+    public function hasPhpIniConfigIssue()
+    {
+        foreach ($this->requirements as $req) {
+            if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
+                return true;
+            }
+        }
+
+        return false;
+    }
+
+    /**
+     * Returns the PHP configuration file (php.ini) path.
+     *
+     * @return string|false php.ini file path
+     */
+    public function getPhpIniConfigPath()
+    {
+        return get_cfg_var('cfg_file_path');
+    }
+}
+
+/**
+ * This class specifies all requirements and optional recommendations that
+ * are necessary to run the Symfony Standard Edition.
+ *
+ * @author Tobias Schultze <http://tobion.de>
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
+class SymfonyRequirements extends RequirementCollection
+{
+    const REQUIRED_PHP_VERSION = '5.3.3';
+
+    /**
+     * Constructor that initializes the requirements.
+     */
+    public function __construct()
+    {
+        /* mandatory requirements follow */
+
+        $installedPhpVersion = phpversion();
+
+        $this->addRequirement(
+            version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>='),
+            sprintf('PHP version must be at least %s (%s installed)', self::REQUIRED_PHP_VERSION, $installedPhpVersion),
+            sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
+                Before using Symfony, upgrade your PHP installation, preferably to the latest version.',
+                $installedPhpVersion, self::REQUIRED_PHP_VERSION),
+            sprintf('Install PHP %s or newer (installed version is %s)', self::REQUIRED_PHP_VERSION, $installedPhpVersion)
+        );
+
+        $this->addRequirement(
+            version_compare($installedPhpVersion, '5.3.16', '!='),
+            'PHP version must not be 5.3.16 as Symfony won\'t work properly with it',
+            'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)'
+        );
+
+        $this->addRequirement(
+            is_dir(__DIR__.'/../vendor/composer'),
+            'Vendor libraries must be installed',
+            'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' .
+                'Then run "<strong>php composer.phar install</strong>" to install them.'
+        );
+
+        $baseDir = basename(__DIR__);
+
+        $this->addRequirement(
+            is_writable(__DIR__.'/cache'),
+            "$baseDir/cache/ directory must be writable",
+            "Change the permissions of the \"<strong>$baseDir/cache/</strong>\" directory so that the web server can write into it."
+        );
+
+        $this->addRequirement(
+            is_writable(__DIR__.'/logs'),
+            "$baseDir/logs/ directory must be writable",
+            "Change the permissions of the \"<strong>$baseDir/logs/</strong>\" directory so that the web server can write into it."
+        );
+
+        $this->addPhpIniRequirement(
+            'date.timezone', true, false,
+            'date.timezone setting must be set',
+            'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
+        );
+
+        if (version_compare($installedPhpVersion, self::REQUIRED_PHP_VERSION, '>=')) {
+            $timezones = array();
+            foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
+                foreach ($abbreviations as $abbreviation) {
+                    $timezones[$abbreviation['timezone_id']] = true;
+                }
+            }
+
+            $this->addRequirement(
+                isset($timezones[date_default_timezone_get()]),
+                sprintf('Configured default timezone "%s" must be supported by your installation of PHP', date_default_timezone_get()),
+                'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
+            );
+        }
+
+        $this->addRequirement(
+            function_exists('json_encode'),
+            'json_encode() must be available',
+            'Install and enable the <strong>JSON</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('session_start'),
+            'session_start() must be available',
+            'Install and enable the <strong>session</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('ctype_alpha'),
+            'ctype_alpha() must be available',
+            'Install and enable the <strong>ctype</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('token_get_all'),
+            'token_get_all() must be available',
+            'Install and enable the <strong>Tokenizer</strong> extension.'
+        );
+
+        $this->addRequirement(
+            function_exists('simplexml_import_dom'),
+            'simplexml_import_dom() must be available',
+            'Install and enable the <strong>SimpleXML</strong> extension.'
+        );
+
+        if (function_exists('apc_store') && ini_get('apc.enabled')) {
+            if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
+                $this->addRequirement(
+                    version_compare(phpversion('apc'), '3.1.13', '>='),
+                    'APC version must be at least 3.1.13 when using PHP 5.4',
+                    'Upgrade your <strong>APC</strong> extension (3.1.13+).'
+                );
+            } else {
+                $this->addRequirement(
+                    version_compare(phpversion('apc'), '3.0.17', '>='),
+                    'APC version must be at least 3.0.17',
+                    'Upgrade your <strong>APC</strong> extension (3.0.17+).'
+                );
+            }
+        }
+
+        $this->addPhpIniRequirement('detect_unicode', false);
+
+        if (extension_loaded('suhosin')) {
+            $this->addPhpIniRequirement(
+                'suhosin.executor.include.whitelist',
+                create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'),
+                false,
+                'suhosin.executor.include.whitelist must be configured correctly in php.ini',
+                'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
+            );
+        }
+
+        if (extension_loaded('xdebug')) {
+            $this->addPhpIniRequirement(
+                'xdebug.show_exception_trace', false, true
+            );
+
+            $this->addPhpIniRequirement(
+                'xdebug.scream', false, true
+            );
+
+            $this->addPhpIniRecommendation(
+                'xdebug.max_nesting_level',
+                create_function('$cfgValue', 'return $cfgValue > 100;'),
+                true,
+                'xdebug.max_nesting_level should be above 100 in php.ini',
+                'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
+            );
+        }
+
+        $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;
+
+        $this->addRequirement(
+            null !== $pcreVersion,
+            'PCRE extension must be available',
+            'Install the <strong>PCRE</strong> extension (version 8.0+).'
+        );
+
+        /* optional recommendations follow */
+
+        $this->addRecommendation(
+            file_get_contents(__FILE__) === file_get_contents(__DIR__.'/../vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/skeleton/app/SymfonyRequirements.php'),
+            'Requirements file should be up-to-date',
+            'Your requirements file is outdated. Run composer install and re-check your configuration.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.3.4', '>='),
+            'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions',
+            'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.3.8', '>='),
+            'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156',
+            'Install PHP 5.3.8 or newer if your project uses annotations.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.4.0', '!='),
+            'You should not use PHP 5.4.0 due to the PHP bug #61453',
+            'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
+        );
+
+        $this->addRecommendation(
+            version_compare($installedPhpVersion, '5.4.11', '>='),
+            'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
+            'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.'
+        );
+
+        $this->addRecommendation(
+            (version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
+            ||
+            version_compare($installedPhpVersion, '5.4.8', '>='),
+            'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
+            'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
+        );
+
+        if (null !== $pcreVersion) {
+            $this->addRecommendation(
+                $pcreVersion >= 8.0,
+                sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion),
+                '<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
+            );
+        }
+
+        $this->addRecommendation(
+            class_exists('DomDocument'),
+            'PHP-XML module should be installed',
+            'Install and enable the <strong>PHP-XML</strong> module.'
+        );
+
+        $this->addRecommendation(
+            function_exists('mb_strlen'),
+            'mb_strlen() should be available',
+            'Install and enable the <strong>mbstring</strong> extension.'
+        );
+
+        $this->addRecommendation(
+            function_exists('iconv'),
+            'iconv() should be available',
+            'Install and enable the <strong>iconv</strong> extension.'
+        );
+
+        $this->addRecommendation(
+            function_exists('utf8_decode'),
+            'utf8_decode() should be available',
+            'Install and enable the <strong>XML</strong> extension.'
+        );
+
+        if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
+            $this->addRecommendation(
+                function_exists('posix_isatty'),
+                'posix_isatty() should be available',
+                'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).'
+            );
+        }
+
+        $this->addRecommendation(
+            class_exists('Locale'),
+            'intl extension should be available',
+            'Install and enable the <strong>intl</strong> extension (used for validators).'
+        );
+
+        if (class_exists('Collator')) {
+            $this->addRecommendation(
+                null !== new Collator('fr_FR'),
+                'intl extension should be correctly configured',
+                'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
+            );
+        }
+
+        if (class_exists('Locale')) {
+            if (defined('INTL_ICU_VERSION')) {
+                $version = INTL_ICU_VERSION;
+            } else {
+                $reflector = new ReflectionExtension('intl');
+
+                ob_start();
+                $reflector->info();
+                $output = strip_tags(ob_get_clean());
+
+                preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
+                $version = $matches[1];
+            }
+
+            $this->addRecommendation(
+                version_compare($version, '4.0', '>='),
+                'intl ICU version should be at least 4+',
+                'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
+            );
+        }
+
+        $accelerator =
+            (extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'))
+            ||
+            (extension_loaded('apc') && ini_get('apc.enabled'))
+            ||
+            (extension_loaded('Zend OPcache') && ini_get('opcache.enable'))
+            ||
+            (extension_loaded('xcache') && ini_get('xcache.cacher'))
+            ||
+            (extension_loaded('wincache') && ini_get('wincache.ocenabled'))
+        ;
+
+        $this->addRecommendation(
+            $accelerator,
+            'a PHP accelerator should be installed',
+            'Install and enable a <strong>PHP accelerator</strong> like APC (highly recommended).'
+        );
+
+        $this->addPhpIniRecommendation('short_open_tag', false);
+
+        $this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
+
+        $this->addPhpIniRecommendation('register_globals', false, true);
+
+        $this->addPhpIniRecommendation('session.auto_start', false);
+
+        $this->addRecommendation(
+            class_exists('PDO'),
+            'PDO should be installed',
+            'Install <strong>PDO</strong> (mandatory for Doctrine).'
+        );
+
+        if (class_exists('PDO')) {
+            $drivers = PDO::getAvailableDrivers();
+            $this->addRecommendation(
+                count($drivers),
+                sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
+                'Install <strong>PDO drivers</strong> (mandatory for Doctrine).'
+            );
+        }
+    }
+}

+ 13 - 0
app/autoload.php

@@ -0,0 +1,13 @@
+<?php
+
+use Doctrine\Common\Annotations\AnnotationRegistry;
+use Composer\Autoload\ClassLoader;
+
+/**
+ * @var ClassLoader $loader
+ */
+$loader = require __DIR__.'/../vendor/autoload.php';
+
+AnnotationRegistry::registerLoader(array($loader, 'loadClass'));
+
+return $loader;

+ 3072 - 0
app/bootstrap.php.cache

@@ -0,0 +1,3072 @@
+<?php
+
+namespace { $loader = require_once __DIR__.'/autoload.php'; }
+
+ 
+namespace Symfony\Component\HttpFoundation
+{
+class ParameterBag implements \IteratorAggregate, \Countable
+{
+protected $parameters;
+public function __construct(array $parameters = array())
+{
+$this->parameters = $parameters;
+}
+public function all()
+{
+return $this->parameters;
+}
+public function keys()
+{
+return array_keys($this->parameters);
+}
+public function replace(array $parameters = array())
+{
+$this->parameters = $parameters;
+}
+public function add(array $parameters = array())
+{
+$this->parameters = array_replace($this->parameters, $parameters);
+}
+public function get($path, $default = null, $deep = false)
+{
+if (!$deep || false === $pos = strpos($path,'[')) {
+return array_key_exists($path, $this->parameters) ? $this->parameters[$path] : $default;
+}
+$root = substr($path, 0, $pos);
+if (!array_key_exists($root, $this->parameters)) {
+return $default;
+}
+$value = $this->parameters[$root];
+$currentKey = null;
+for ($i = $pos, $c = strlen($path); $i < $c; $i++) {
+$char = $path[$i];
+if ('['=== $char) {
+if (null !== $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "[" at position %d.', $i));
+}
+$currentKey ='';
+} elseif (']'=== $char) {
+if (null === $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "]" at position %d.', $i));
+}
+if (!is_array($value) || !array_key_exists($currentKey, $value)) {
+return $default;
+}
+$value = $value[$currentKey];
+$currentKey = null;
+} else {
+if (null === $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Unexpected "%s" at position %d.', $char, $i));
+}
+$currentKey .= $char;
+}
+}
+if (null !== $currentKey) {
+throw new \InvalidArgumentException(sprintf('Malformed path. Path must end with "]".'));
+}
+return $value;
+}
+public function set($key, $value)
+{
+$this->parameters[$key] = $value;
+}
+public function has($key)
+{
+return array_key_exists($key, $this->parameters);
+}
+public function remove($key)
+{
+unset($this->parameters[$key]);
+}
+public function getAlpha($key, $default ='', $deep = false)
+{
+return preg_replace('/[^[:alpha:]]/','', $this->get($key, $default, $deep));
+}
+public function getAlnum($key, $default ='', $deep = false)
+{
+return preg_replace('/[^[:alnum:]]/','', $this->get($key, $default, $deep));
+}
+public function getDigits($key, $default ='', $deep = false)
+{
+return str_replace(array('-','+'),'', $this->filter($key, $default, $deep, FILTER_SANITIZE_NUMBER_INT));
+}
+public function getInt($key, $default = 0, $deep = false)
+{
+return (int) $this->get($key, $default, $deep);
+}
+public function filter($key, $default = null, $deep = false, $filter = FILTER_DEFAULT, $options = array())
+{
+$value = $this->get($key, $default, $deep);
+if (!is_array($options) && $options) {
+$options = array('flags'=> $options);
+}
+if (is_array($value) && !isset($options['flags'])) {
+$options['flags'] = FILTER_REQUIRE_ARRAY;
+}
+return filter_var($value, $filter, $options);
+}
+public function getIterator()
+{
+return new \ArrayIterator($this->parameters);
+}
+public function count()
+{
+return count($this->parameters);
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class HeaderBag implements \IteratorAggregate, \Countable
+{
+protected $headers = array();
+protected $cacheControl = array();
+public function __construct(array $headers = array())
+{
+foreach ($headers as $key => $values) {
+$this->set($key, $values);
+}
+}
+public function __toString()
+{
+if (!$this->headers) {
+return'';
+}
+$max = max(array_map('strlen', array_keys($this->headers))) + 1;
+$content ='';
+ksort($this->headers);
+foreach ($this->headers as $name => $values) {
+$name = implode('-', array_map('ucfirst', explode('-', $name)));
+foreach ($values as $value) {
+$content .= sprintf("%-{$max}s %s\r\n", $name.':', $value);
+}
+}
+return $content;
+}
+public function all()
+{
+return $this->headers;
+}
+public function keys()
+{
+return array_keys($this->headers);
+}
+public function replace(array $headers = array())
+{
+$this->headers = array();
+$this->add($headers);
+}
+public function add(array $headers)
+{
+foreach ($headers as $key => $values) {
+$this->set($key, $values);
+}
+}
+public function get($key, $default = null, $first = true)
+{
+$key = strtr(strtolower($key),'_','-');
+if (!array_key_exists($key, $this->headers)) {
+if (null === $default) {
+return $first ? null : array();
+}
+return $first ? $default : array($default);
+}
+if ($first) {
+return count($this->headers[$key]) ? $this->headers[$key][0] : $default;
+}
+return $this->headers[$key];
+}
+public function set($key, $values, $replace = true)
+{
+$key = strtr(strtolower($key),'_','-');
+$values = array_values((array) $values);
+if (true === $replace || !isset($this->headers[$key])) {
+$this->headers[$key] = $values;
+} else {
+$this->headers[$key] = array_merge($this->headers[$key], $values);
+}
+if ('cache-control'=== $key) {
+$this->cacheControl = $this->parseCacheControl($values[0]);
+}
+}
+public function has($key)
+{
+return array_key_exists(strtr(strtolower($key),'_','-'), $this->headers);
+}
+public function contains($key, $value)
+{
+return in_array($value, $this->get($key, null, false));
+}
+public function remove($key)
+{
+$key = strtr(strtolower($key),'_','-');
+unset($this->headers[$key]);
+if ('cache-control'=== $key) {
+$this->cacheControl = array();
+}
+}
+public function getDate($key, \DateTime $default = null)
+{
+if (null === $value = $this->get($key)) {
+return $default;
+}
+if (false === $date = \DateTime::createFromFormat(DATE_RFC2822, $value)) {
+throw new \RuntimeException(sprintf('The %s HTTP header is not parseable (%s).', $key, $value));
+}
+return $date;
+}
+public function addCacheControlDirective($key, $value = true)
+{
+$this->cacheControl[$key] = $value;
+$this->set('Cache-Control', $this->getCacheControlHeader());
+}
+public function hasCacheControlDirective($key)
+{
+return array_key_exists($key, $this->cacheControl);
+}
+public function getCacheControlDirective($key)
+{
+return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null;
+}
+public function removeCacheControlDirective($key)
+{
+unset($this->cacheControl[$key]);
+$this->set('Cache-Control', $this->getCacheControlHeader());
+}
+public function getIterator()
+{
+return new \ArrayIterator($this->headers);
+}
+public function count()
+{
+return count($this->headers);
+}
+protected function getCacheControlHeader()
+{
+$parts = array();
+ksort($this->cacheControl);
+foreach ($this->cacheControl as $key => $value) {
+if (true === $value) {
+$parts[] = $key;
+} else {
+if (preg_match('#[^a-zA-Z0-9._-]#', $value)) {
+$value ='"'.$value.'"';
+}
+$parts[] = "$key=$value";
+}
+}
+return implode(', ', $parts);
+}
+protected function parseCacheControl($header)
+{
+$cacheControl = array();
+preg_match_all('#([a-zA-Z][a-zA-Z_-]*)\s*(?:=(?:"([^"]*)"|([^ \t",;]*)))?#', $header, $matches, PREG_SET_ORDER);
+foreach ($matches as $match) {
+$cacheControl[strtolower($match[1])] = isset($match[3]) ? $match[3] : (isset($match[2]) ? $match[2] : true);
+}
+return $cacheControl;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+use Symfony\Component\HttpFoundation\File\UploadedFile;
+class FileBag extends ParameterBag
+{
+private static $fileKeys = array('error','name','size','tmp_name','type');
+public function __construct(array $parameters = array())
+{
+$this->replace($parameters);
+}
+public function replace(array $files = array())
+{
+$this->parameters = array();
+$this->add($files);
+}
+public function set($key, $value)
+{
+if (!is_array($value) && !$value instanceof UploadedFile) {
+throw new \InvalidArgumentException('An uploaded file must be an array or an instance of UploadedFile.');
+}
+parent::set($key, $this->convertFileInformation($value));
+}
+public function add(array $files = array())
+{
+foreach ($files as $key => $file) {
+$this->set($key, $file);
+}
+}
+protected function convertFileInformation($file)
+{
+if ($file instanceof UploadedFile) {
+return $file;
+}
+$file = $this->fixPhpFilesArray($file);
+if (is_array($file)) {
+$keys = array_keys($file);
+sort($keys);
+if ($keys == self::$fileKeys) {
+if (UPLOAD_ERR_NO_FILE == $file['error']) {
+$file = null;
+} else {
+$file = new UploadedFile($file['tmp_name'], $file['name'], $file['type'], $file['size'], $file['error']);
+}
+} else {
+$file = array_map(array($this,'convertFileInformation'), $file);
+}
+}
+return $file;
+}
+protected function fixPhpFilesArray($data)
+{
+if (!is_array($data)) {
+return $data;
+}
+$keys = array_keys($data);
+sort($keys);
+if (self::$fileKeys != $keys || !isset($data['name']) || !is_array($data['name'])) {
+return $data;
+}
+$files = $data;
+foreach (self::$fileKeys as $k) {
+unset($files[$k]);
+}
+foreach (array_keys($data['name']) as $key) {
+$files[$key] = $this->fixPhpFilesArray(array('error'=> $data['error'][$key],'name'=> $data['name'][$key],'type'=> $data['type'][$key],'tmp_name'=> $data['tmp_name'][$key],'size'=> $data['size'][$key]
+));
+}
+return $files;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class ServerBag extends ParameterBag
+{
+public function getHeaders()
+{
+$headers = array();
+$contentHeaders = array('CONTENT_LENGTH'=> true,'CONTENT_MD5'=> true,'CONTENT_TYPE'=> true);
+foreach ($this->parameters as $key => $value) {
+if (0 === strpos($key,'HTTP_')) {
+$headers[substr($key, 5)] = $value;
+}
+elseif (isset($contentHeaders[$key])) {
+$headers[$key] = $value;
+}
+}
+if (isset($this->parameters['PHP_AUTH_USER'])) {
+$headers['PHP_AUTH_USER'] = $this->parameters['PHP_AUTH_USER'];
+$headers['PHP_AUTH_PW'] = isset($this->parameters['PHP_AUTH_PW']) ? $this->parameters['PHP_AUTH_PW'] :'';
+} else {
+$authorizationHeader = null;
+if (isset($this->parameters['HTTP_AUTHORIZATION'])) {
+$authorizationHeader = $this->parameters['HTTP_AUTHORIZATION'];
+} elseif (isset($this->parameters['REDIRECT_HTTP_AUTHORIZATION'])) {
+$authorizationHeader = $this->parameters['REDIRECT_HTTP_AUTHORIZATION'];
+}
+if (null !== $authorizationHeader) {
+if (0 === stripos($authorizationHeader,'basic')) {
+$exploded = explode(':', base64_decode(substr($authorizationHeader, 6)));
+if (count($exploded) == 2) {
+list($headers['PHP_AUTH_USER'], $headers['PHP_AUTH_PW']) = $exploded;
+}
+} elseif (empty($this->parameters['PHP_AUTH_DIGEST']) && (0 === stripos($authorizationHeader,'digest'))) {
+$headers['PHP_AUTH_DIGEST'] = $authorizationHeader;
+$this->parameters['PHP_AUTH_DIGEST'] = $authorizationHeader;
+}
+}
+}
+if (isset($headers['PHP_AUTH_USER'])) {
+$headers['AUTHORIZATION'] ='Basic '.base64_encode($headers['PHP_AUTH_USER'].':'.$headers['PHP_AUTH_PW']);
+} elseif (isset($headers['PHP_AUTH_DIGEST'])) {
+$headers['AUTHORIZATION'] = $headers['PHP_AUTH_DIGEST'];
+}
+return $headers;
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+use Symfony\Component\HttpFoundation\Session\SessionInterface;
+class Request
+{
+const HEADER_CLIENT_IP ='client_ip';
+const HEADER_CLIENT_HOST ='client_host';
+const HEADER_CLIENT_PROTO ='client_proto';
+const HEADER_CLIENT_PORT ='client_port';
+protected static $trustedProxies = array();
+protected static $trustedHostPatterns = array();
+protected static $trustedHosts = array();
+protected static $trustedHeaders = array(
+self::HEADER_CLIENT_IP =>'X_FORWARDED_FOR',
+self::HEADER_CLIENT_HOST =>'X_FORWARDED_HOST',
+self::HEADER_CLIENT_PROTO =>'X_FORWARDED_PROTO',
+self::HEADER_CLIENT_PORT =>'X_FORWARDED_PORT',
+);
+protected static $httpMethodParameterOverride = false;
+public $attributes;
+public $request;
+public $query;
+public $server;
+public $files;
+public $cookies;
+public $headers;
+protected $content;
+protected $languages;
+protected $charsets;
+protected $encodings;
+protected $acceptableContentTypes;
+protected $pathInfo;
+protected $requestUri;
+protected $baseUrl;
+protected $basePath;
+protected $method;
+protected $format;
+protected $session;
+protected $locale;
+protected $defaultLocale ='en';
+protected static $formats;
+protected static $requestFactory;
+public function __construct(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+$this->initialize($query, $request, $attributes, $cookies, $files, $server, $content);
+}
+public function initialize(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+$this->request = new ParameterBag($request);
+$this->query = new ParameterBag($query);
+$this->attributes = new ParameterBag($attributes);
+$this->cookies = new ParameterBag($cookies);
+$this->files = new FileBag($files);
+$this->server = new ServerBag($server);
+$this->headers = new HeaderBag($this->server->getHeaders());
+$this->content = $content;
+$this->languages = null;
+$this->charsets = null;
+$this->encodings = null;
+$this->acceptableContentTypes = null;
+$this->pathInfo = null;
+$this->requestUri = null;
+$this->baseUrl = null;
+$this->basePath = null;
+$this->method = null;
+$this->format = null;
+}
+public static function createFromGlobals()
+{
+$request = self::createRequestFromFactory($_GET, $_POST, array(), $_COOKIE, $_FILES, $_SERVER);
+if (0 === strpos($request->headers->get('CONTENT_TYPE'),'application/x-www-form-urlencoded')
+&& in_array(strtoupper($request->server->get('REQUEST_METHOD','GET')), array('PUT','DELETE','PATCH'))
+) {
+parse_str($request->getContent(), $data);
+$request->request = new ParameterBag($data);
+}
+return $request;
+}
+public static function create($uri, $method ='GET', $parameters = array(), $cookies = array(), $files = array(), $server = array(), $content = null)
+{
+$server = array_replace(array('SERVER_NAME'=>'localhost','SERVER_PORT'=> 80,'HTTP_HOST'=>'localhost','HTTP_USER_AGENT'=>'Symfony/2.X','HTTP_ACCEPT'=>'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8','HTTP_ACCEPT_LANGUAGE'=>'en-us,en;q=0.5','HTTP_ACCEPT_CHARSET'=>'ISO-8859-1,utf-8;q=0.7,*;q=0.7','REMOTE_ADDR'=>'127.0.0.1','SCRIPT_NAME'=>'','SCRIPT_FILENAME'=>'','SERVER_PROTOCOL'=>'HTTP/1.1','REQUEST_TIME'=> time(),
+), $server);
+$server['PATH_INFO'] ='';
+$server['REQUEST_METHOD'] = strtoupper($method);
+$components = parse_url($uri);
+if (isset($components['host'])) {
+$server['SERVER_NAME'] = $components['host'];
+$server['HTTP_HOST'] = $components['host'];
+}
+if (isset($components['scheme'])) {
+if ('https'=== $components['scheme']) {
+$server['HTTPS'] ='on';
+$server['SERVER_PORT'] = 443;
+} else {
+unset($server['HTTPS']);
+$server['SERVER_PORT'] = 80;
+}
+}
+if (isset($components['port'])) {
+$server['SERVER_PORT'] = $components['port'];
+$server['HTTP_HOST'] = $server['HTTP_HOST'].':'.$components['port'];
+}
+if (isset($components['user'])) {
+$server['PHP_AUTH_USER'] = $components['user'];
+}
+if (isset($components['pass'])) {
+$server['PHP_AUTH_PW'] = $components['pass'];
+}
+if (!isset($components['path'])) {
+$components['path'] ='/';
+}
+switch (strtoupper($method)) {
+case'POST':
+case'PUT':
+case'DELETE':
+if (!isset($server['CONTENT_TYPE'])) {
+$server['CONTENT_TYPE'] ='application/x-www-form-urlencoded';
+}
+case'PATCH':
+$request = $parameters;
+$query = array();
+break;
+default:
+$request = array();
+$query = $parameters;
+break;
+}
+$queryString ='';
+if (isset($components['query'])) {
+parse_str(html_entity_decode($components['query']), $qs);
+if ($query) {
+$query = array_replace($qs, $query);
+$queryString = http_build_query($query,'','&');
+} else {
+$query = $qs;
+$queryString = $components['query'];
+}
+} elseif ($query) {
+$queryString = http_build_query($query,'','&');
+}
+$server['REQUEST_URI'] = $components['path'].(''!== $queryString ?'?'.$queryString :'');
+$server['QUERY_STRING'] = $queryString;
+return self::createRequestFromFactory($query, $request, array(), $cookies, $files, $server, $content);
+}
+public static function setFactory($callable)
+{
+self::$requestFactory = $callable;
+}
+public function duplicate(array $query = null, array $request = null, array $attributes = null, array $cookies = null, array $files = null, array $server = null)
+{
+$dup = clone $this;
+if ($query !== null) {
+$dup->query = new ParameterBag($query);
+}
+if ($request !== null) {
+$dup->request = new ParameterBag($request);
+}
+if ($attributes !== null) {
+$dup->attributes = new ParameterBag($attributes);
+}
+if ($cookies !== null) {
+$dup->cookies = new ParameterBag($cookies);
+}
+if ($files !== null) {
+$dup->files = new FileBag($files);
+}
+if ($server !== null) {
+$dup->server = new ServerBag($server);
+$dup->headers = new HeaderBag($dup->server->getHeaders());
+}
+$dup->languages = null;
+$dup->charsets = null;
+$dup->encodings = null;
+$dup->acceptableContentTypes = null;
+$dup->pathInfo = null;
+$dup->requestUri = null;
+$dup->baseUrl = null;
+$dup->basePath = null;
+$dup->method = null;
+$dup->format = null;
+if (!$dup->get('_format') && $this->get('_format')) {
+$dup->attributes->set('_format', $this->get('_format'));
+}
+if (!$dup->getRequestFormat(null)) {
+$dup->setRequestFormat($format = $this->getRequestFormat(null));
+}
+return $dup;
+}
+public function __clone()
+{
+$this->query = clone $this->query;
+$this->request = clone $this->request;
+$this->attributes = clone $this->attributes;
+$this->cookies = clone $this->cookies;
+$this->files = clone $this->files;
+$this->server = clone $this->server;
+$this->headers = clone $this->headers;
+}
+public function __toString()
+{
+return
+sprintf('%s %s %s', $this->getMethod(), $this->getRequestUri(), $this->server->get('SERVER_PROTOCOL'))."\r\n".
+$this->headers."\r\n".
+$this->getContent();
+}
+public function overrideGlobals()
+{
+$_GET = $this->query->all();
+$_POST = $this->request->all();
+$_SERVER = $this->server->all();
+$_COOKIE = $this->cookies->all();
+foreach ($this->headers->all() as $key => $value) {
+$key = strtoupper(str_replace('-','_', $key));
+if (in_array($key, array('CONTENT_TYPE','CONTENT_LENGTH'))) {
+$_SERVER[$key] = implode(', ', $value);
+} else {
+$_SERVER['HTTP_'.$key] = implode(', ', $value);
+}
+}
+$request = array('g'=> $_GET,'p'=> $_POST,'c'=> $_COOKIE);
+$requestOrder = ini_get('request_order') ?: ini_get('variables_order');
+$requestOrder = preg_replace('#[^cgp]#','', strtolower($requestOrder)) ?:'gp';
+$_REQUEST = array();
+foreach (str_split($requestOrder) as $order) {
+$_REQUEST = array_merge($_REQUEST, $request[$order]);
+}
+}
+public static function setTrustedProxies(array $proxies)
+{
+self::$trustedProxies = $proxies;
+}
+public static function getTrustedProxies()
+{
+return self::$trustedProxies;
+}
+public static function setTrustedHosts(array $hostPatterns)
+{
+self::$trustedHostPatterns = array_map(function ($hostPattern) {
+return sprintf('{%s}i', str_replace('}','\\}', $hostPattern));
+}, $hostPatterns);
+self::$trustedHosts = array();
+}
+public static function getTrustedHosts()
+{
+return self::$trustedHostPatterns;
+}
+public static function setTrustedHeaderName($key, $value)
+{
+if (!array_key_exists($key, self::$trustedHeaders)) {
+throw new \InvalidArgumentException(sprintf('Unable to set the trusted header name for key "%s".', $key));
+}
+self::$trustedHeaders[$key] = $value;
+}
+public static function getTrustedHeaderName($key)
+{
+if (!array_key_exists($key, self::$trustedHeaders)) {
+throw new \InvalidArgumentException(sprintf('Unable to get the trusted header name for key "%s".', $key));
+}
+return self::$trustedHeaders[$key];
+}
+public static function normalizeQueryString($qs)
+{
+if (''== $qs) {
+return'';
+}
+$parts = array();
+$order = array();
+foreach (explode('&', $qs) as $param) {
+if (''=== $param ||'='=== $param[0]) {
+continue;
+}
+$keyValuePair = explode('=', $param, 2);
+$parts[] = isset($keyValuePair[1]) ?
+rawurlencode(urldecode($keyValuePair[0])).'='.rawurlencode(urldecode($keyValuePair[1])) :
+rawurlencode(urldecode($keyValuePair[0]));
+$order[] = urldecode($keyValuePair[0]);
+}
+array_multisort($order, SORT_ASC, $parts);
+return implode('&', $parts);
+}
+public static function enableHttpMethodParameterOverride()
+{
+self::$httpMethodParameterOverride = true;
+}
+public static function getHttpMethodParameterOverride()
+{
+return self::$httpMethodParameterOverride;
+}
+public function get($key, $default = null, $deep = false)
+{
+return $this->query->get($key, $this->attributes->get($key, $this->request->get($key, $default, $deep), $deep), $deep);
+}
+public function getSession()
+{
+return $this->session;
+}
+public function hasPreviousSession()
+{
+return $this->hasSession() && $this->cookies->has($this->session->getName());
+}
+public function hasSession()
+{
+return null !== $this->session;
+}
+public function setSession(SessionInterface $session)
+{
+$this->session = $session;
+}
+public function getClientIps()
+{
+$ip = $this->server->get('REMOTE_ADDR');
+if (!self::$trustedProxies) {
+return array($ip);
+}
+if (!self::$trustedHeaders[self::HEADER_CLIENT_IP] || !$this->headers->has(self::$trustedHeaders[self::HEADER_CLIENT_IP])) {
+return array($ip);
+}
+$clientIps = array_map('trim', explode(',', $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_IP])));
+$clientIps[] = $ip;
+$ip = $clientIps[0];
+foreach ($clientIps as $key => $clientIp) {
+if (IpUtils::checkIp($clientIp, self::$trustedProxies)) {
+unset($clientIps[$key]);
+}
+}
+return $clientIps ? array_reverse($clientIps) : array($ip);
+}
+public function getClientIp()
+{
+$ipAddresses = $this->getClientIps();
+return $ipAddresses[0];
+}
+public function getScriptName()
+{
+return $this->server->get('SCRIPT_NAME', $this->server->get('ORIG_SCRIPT_NAME',''));
+}
+public function getPathInfo()
+{
+if (null === $this->pathInfo) {
+$this->pathInfo = $this->preparePathInfo();
+}
+return $this->pathInfo;
+}
+public function getBasePath()
+{
+if (null === $this->basePath) {
+$this->basePath = $this->prepareBasePath();
+}
+return $this->basePath;
+}
+public function getBaseUrl()
+{
+if (null === $this->baseUrl) {
+$this->baseUrl = $this->prepareBaseUrl();
+}
+return $this->baseUrl;
+}
+public function getScheme()
+{
+return $this->isSecure() ?'https':'http';
+}
+public function getPort()
+{
+if (self::$trustedProxies) {
+if (self::$trustedHeaders[self::HEADER_CLIENT_PORT] && $port = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PORT])) {
+return $port;
+}
+if (self::$trustedHeaders[self::HEADER_CLIENT_PROTO] &&'https'=== $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO],'http')) {
+return 443;
+}
+}
+if ($host = $this->headers->get('HOST')) {
+if (false !== $pos = strrpos($host,':')) {
+return intval(substr($host, $pos + 1));
+}
+return'https'=== $this->getScheme() ? 443 : 80;
+}
+return $this->server->get('SERVER_PORT');
+}
+public function getUser()
+{
+return $this->server->get('PHP_AUTH_USER');
+}
+public function getPassword()
+{
+return $this->server->get('PHP_AUTH_PW');
+}
+public function getUserInfo()
+{
+$userinfo = $this->getUser();
+$pass = $this->getPassword();
+if (''!= $pass) {
+$userinfo .= ":$pass";
+}
+return $userinfo;
+}
+public function getHttpHost()
+{
+$scheme = $this->getScheme();
+$port = $this->getPort();
+if (('http'== $scheme && $port == 80) || ('https'== $scheme && $port == 443)) {
+return $this->getHost();
+}
+return $this->getHost().':'.$port;
+}
+public function getRequestUri()
+{
+if (null === $this->requestUri) {
+$this->requestUri = $this->prepareRequestUri();
+}
+return $this->requestUri;
+}
+public function getSchemeAndHttpHost()
+{
+return $this->getScheme().'://'.$this->getHttpHost();
+}
+public function getUri()
+{
+if (null !== $qs = $this->getQueryString()) {
+$qs ='?'.$qs;
+}
+return $this->getSchemeAndHttpHost().$this->getBaseUrl().$this->getPathInfo().$qs;
+}
+public function getUriForPath($path)
+{
+return $this->getSchemeAndHttpHost().$this->getBaseUrl().$path;
+}
+public function getQueryString()
+{
+$qs = static::normalizeQueryString($this->server->get('QUERY_STRING'));
+return''=== $qs ? null : $qs;
+}
+public function isSecure()
+{
+if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_PROTO] && $proto = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_PROTO])) {
+return in_array(strtolower(current(explode(',', $proto))), array('https','on','ssl','1'));
+}
+return'on'== strtolower($this->server->get('HTTPS')) || 1 == $this->server->get('HTTPS');
+}
+public function getHost()
+{
+if (self::$trustedProxies && self::$trustedHeaders[self::HEADER_CLIENT_HOST] && $host = $this->headers->get(self::$trustedHeaders[self::HEADER_CLIENT_HOST])) {
+$elements = explode(',', $host);
+$host = $elements[count($elements) - 1];
+} elseif (!$host = $this->headers->get('HOST')) {
+if (!$host = $this->server->get('SERVER_NAME')) {
+$host = $this->server->get('SERVER_ADDR','');
+}
+}
+$host = strtolower(preg_replace('/:\d+$/','', trim($host)));
+if ($host && !preg_match('/^\[?(?:[a-zA-Z0-9-:\]_]+\.?)+$/', $host)) {
+throw new \UnexpectedValueException(sprintf('Invalid Host "%s"', $host));
+}
+if (count(self::$trustedHostPatterns) > 0) {
+if (in_array($host, self::$trustedHosts)) {
+return $host;
+}
+foreach (self::$trustedHostPatterns as $pattern) {
+if (preg_match($pattern, $host)) {
+self::$trustedHosts[] = $host;
+return $host;
+}
+}
+throw new \UnexpectedValueException(sprintf('Untrusted Host "%s"', $host));
+}
+return $host;
+}
+public function setMethod($method)
+{
+$this->method = null;
+$this->server->set('REQUEST_METHOD', $method);
+}
+public function getMethod()
+{
+if (null === $this->method) {
+$this->method = strtoupper($this->server->get('REQUEST_METHOD','GET'));
+if ('POST'=== $this->method) {
+if ($method = $this->headers->get('X-HTTP-METHOD-OVERRIDE')) {
+$this->method = strtoupper($method);
+} elseif (self::$httpMethodParameterOverride) {
+$this->method = strtoupper($this->request->get('_method', $this->query->get('_method','POST')));
+}
+}
+}
+return $this->method;
+}
+public function getRealMethod()
+{
+return strtoupper($this->server->get('REQUEST_METHOD','GET'));
+}
+public function getMimeType($format)
+{
+if (null === static::$formats) {
+static::initializeFormats();
+}
+return isset(static::$formats[$format]) ? static::$formats[$format][0] : null;
+}
+public function getFormat($mimeType)
+{
+if (false !== $pos = strpos($mimeType,';')) {
+$mimeType = substr($mimeType, 0, $pos);
+}
+if (null === static::$formats) {
+static::initializeFormats();
+}
+foreach (static::$formats as $format => $mimeTypes) {
+if (in_array($mimeType, (array) $mimeTypes)) {
+return $format;
+}
+}
+}
+public function setFormat($format, $mimeTypes)
+{
+if (null === static::$formats) {
+static::initializeFormats();
+}
+static::$formats[$format] = is_array($mimeTypes) ? $mimeTypes : array($mimeTypes);
+}
+public function getRequestFormat($default ='html')
+{
+if (null === $this->format) {
+$this->format = $this->get('_format', $default);
+}
+return $this->format;
+}
+public function setRequestFormat($format)
+{
+$this->format = $format;
+}
+public function getContentType()
+{
+return $this->getFormat($this->headers->get('CONTENT_TYPE'));
+}
+public function setDefaultLocale($locale)
+{
+$this->defaultLocale = $locale;
+if (null === $this->locale) {
+$this->setPhpDefaultLocale($locale);
+}
+}
+public function setLocale($locale)
+{
+$this->setPhpDefaultLocale($this->locale = $locale);
+}
+public function getLocale()
+{
+return null === $this->locale ? $this->defaultLocale : $this->locale;
+}
+public function isMethod($method)
+{
+return $this->getMethod() === strtoupper($method);
+}
+public function isMethodSafe()
+{
+return in_array($this->getMethod(), array('GET','HEAD'));
+}
+public function getContent($asResource = false)
+{
+if (false === $this->content || (true === $asResource && null !== $this->content)) {
+throw new \LogicException('getContent() can only be called once when using the resource return type.');
+}
+if (true === $asResource) {
+$this->content = false;
+return fopen('php://input','rb');
+}
+if (null === $this->content) {
+$this->content = file_get_contents('php://input');
+}
+return $this->content;
+}
+public function getETags()
+{
+return preg_split('/\s*,\s*/', $this->headers->get('if_none_match'), null, PREG_SPLIT_NO_EMPTY);
+}
+public function isNoCache()
+{
+return $this->headers->hasCacheControlDirective('no-cache') ||'no-cache'== $this->headers->get('Pragma');
+}
+public function getPreferredLanguage(array $locales = null)
+{
+$preferredLanguages = $this->getLanguages();
+if (empty($locales)) {
+return isset($preferredLanguages[0]) ? $preferredLanguages[0] : null;
+}
+if (!$preferredLanguages) {
+return $locales[0];
+}
+$extendedPreferredLanguages = array();
+foreach ($preferredLanguages as $language) {
+$extendedPreferredLanguages[] = $language;
+if (false !== $position = strpos($language,'_')) {
+$superLanguage = substr($language, 0, $position);
+if (!in_array($superLanguage, $preferredLanguages)) {
+$extendedPreferredLanguages[] = $superLanguage;
+}
+}
+}
+$preferredLanguages = array_values(array_intersect($extendedPreferredLanguages, $locales));
+return isset($preferredLanguages[0]) ? $preferredLanguages[0] : $locales[0];
+}
+public function getLanguages()
+{
+if (null !== $this->languages) {
+return $this->languages;
+}
+$languages = AcceptHeader::fromString($this->headers->get('Accept-Language'))->all();
+$this->languages = array();
+foreach (array_keys($languages) as $lang) {
+if (strstr($lang,'-')) {
+$codes = explode('-', $lang);
+if ($codes[0] =='i') {
+if (count($codes) > 1) {
+$lang = $codes[1];
+}
+} else {
+for ($i = 0, $max = count($codes); $i < $max; $i++) {
+if ($i == 0) {
+$lang = strtolower($codes[0]);
+} else {
+$lang .='_'.strtoupper($codes[$i]);
+}
+}
+}
+}
+$this->languages[] = $lang;
+}
+return $this->languages;
+}
+public function getCharsets()
+{
+if (null !== $this->charsets) {
+return $this->charsets;
+}
+return $this->charsets = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Charset'))->all());
+}
+public function getEncodings()
+{
+if (null !== $this->encodings) {
+return $this->encodings;
+}
+return $this->encodings = array_keys(AcceptHeader::fromString($this->headers->get('Accept-Encoding'))->all());
+}
+public function getAcceptableContentTypes()
+{
+if (null !== $this->acceptableContentTypes) {
+return $this->acceptableContentTypes;
+}
+return $this->acceptableContentTypes = array_keys(AcceptHeader::fromString($this->headers->get('Accept'))->all());
+}
+public function isXmlHttpRequest()
+{
+return'XMLHttpRequest'== $this->headers->get('X-Requested-With');
+}
+protected function prepareRequestUri()
+{
+$requestUri ='';
+if ($this->headers->has('X_ORIGINAL_URL')) {
+$requestUri = $this->headers->get('X_ORIGINAL_URL');
+$this->headers->remove('X_ORIGINAL_URL');
+$this->server->remove('HTTP_X_ORIGINAL_URL');
+$this->server->remove('UNENCODED_URL');
+$this->server->remove('IIS_WasUrlRewritten');
+} elseif ($this->headers->has('X_REWRITE_URL')) {
+$requestUri = $this->headers->get('X_REWRITE_URL');
+$this->headers->remove('X_REWRITE_URL');
+} elseif ($this->server->get('IIS_WasUrlRewritten') =='1'&& $this->server->get('UNENCODED_URL') !='') {
+$requestUri = $this->server->get('UNENCODED_URL');
+$this->server->remove('UNENCODED_URL');
+$this->server->remove('IIS_WasUrlRewritten');
+} elseif ($this->server->has('REQUEST_URI')) {
+$requestUri = $this->server->get('REQUEST_URI');
+$schemeAndHttpHost = $this->getSchemeAndHttpHost();
+if (strpos($requestUri, $schemeAndHttpHost) === 0) {
+$requestUri = substr($requestUri, strlen($schemeAndHttpHost));
+}
+} elseif ($this->server->has('ORIG_PATH_INFO')) {
+$requestUri = $this->server->get('ORIG_PATH_INFO');
+if (''!= $this->server->get('QUERY_STRING')) {
+$requestUri .='?'.$this->server->get('QUERY_STRING');
+}
+$this->server->remove('ORIG_PATH_INFO');
+}
+$this->server->set('REQUEST_URI', $requestUri);
+return $requestUri;
+}
+protected function prepareBaseUrl()
+{
+$filename = basename($this->server->get('SCRIPT_FILENAME'));
+if (basename($this->server->get('SCRIPT_NAME')) === $filename) {
+$baseUrl = $this->server->get('SCRIPT_NAME');
+} elseif (basename($this->server->get('PHP_SELF')) === $filename) {
+$baseUrl = $this->server->get('PHP_SELF');
+} elseif (basename($this->server->get('ORIG_SCRIPT_NAME')) === $filename) {
+$baseUrl = $this->server->get('ORIG_SCRIPT_NAME'); } else {
+$path = $this->server->get('PHP_SELF','');
+$file = $this->server->get('SCRIPT_FILENAME','');
+$segs = explode('/', trim($file,'/'));
+$segs = array_reverse($segs);
+$index = 0;
+$last = count($segs);
+$baseUrl ='';
+do {
+$seg = $segs[$index];
+$baseUrl ='/'.$seg.$baseUrl;
+++$index;
+} while ($last > $index && (false !== $pos = strpos($path, $baseUrl)) && 0 != $pos);
+}
+$requestUri = $this->getRequestUri();
+if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, $baseUrl)) {
+return $prefix;
+}
+if ($baseUrl && false !== $prefix = $this->getUrlencodedPrefix($requestUri, dirname($baseUrl))) {
+return rtrim($prefix,'/');
+}
+$truncatedRequestUri = $requestUri;
+if (false !== $pos = strpos($requestUri,'?')) {
+$truncatedRequestUri = substr($requestUri, 0, $pos);
+}
+$basename = basename($baseUrl);
+if (empty($basename) || !strpos(rawurldecode($truncatedRequestUri), $basename)) {
+return'';
+}
+if (strlen($requestUri) >= strlen($baseUrl) && (false !== $pos = strpos($requestUri, $baseUrl)) && $pos !== 0) {
+$baseUrl = substr($requestUri, 0, $pos + strlen($baseUrl));
+}
+return rtrim($baseUrl,'/');
+}
+protected function prepareBasePath()
+{
+$filename = basename($this->server->get('SCRIPT_FILENAME'));
+$baseUrl = $this->getBaseUrl();
+if (empty($baseUrl)) {
+return'';
+}
+if (basename($baseUrl) === $filename) {
+$basePath = dirname($baseUrl);
+} else {
+$basePath = $baseUrl;
+}
+if ('\\'=== DIRECTORY_SEPARATOR) {
+$basePath = str_replace('\\','/', $basePath);
+}
+return rtrim($basePath,'/');
+}
+protected function preparePathInfo()
+{
+$baseUrl = $this->getBaseUrl();
+if (null === ($requestUri = $this->getRequestUri())) {
+return'/';
+}
+$pathInfo ='/';
+if ($pos = strpos($requestUri,'?')) {
+$requestUri = substr($requestUri, 0, $pos);
+}
+if (null !== $baseUrl && false === $pathInfo = substr($requestUri, strlen($baseUrl))) {
+return'/';
+} elseif (null === $baseUrl) {
+return $requestUri;
+}
+return (string) $pathInfo;
+}
+protected static function initializeFormats()
+{
+static::$formats = array('html'=> array('text/html','application/xhtml+xml'),'txt'=> array('text/plain'),'js'=> array('application/javascript','application/x-javascript','text/javascript'),'css'=> array('text/css'),'json'=> array('application/json','application/x-json'),'xml'=> array('text/xml','application/xml','application/x-xml'),'rdf'=> array('application/rdf+xml'),'atom'=> array('application/atom+xml'),'rss'=> array('application/rss+xml'),
+);
+}
+private function setPhpDefaultLocale($locale)
+{
+try {
+if (class_exists('Locale', false)) {
+\Locale::setDefault($locale);
+}
+} catch (\Exception $e) {
+}
+}
+private function getUrlencodedPrefix($string, $prefix)
+{
+if (0 !== strpos(rawurldecode($string), $prefix)) {
+return false;
+}
+$len = strlen($prefix);
+if (preg_match("#^(%[[:xdigit:]]{2}|.){{$len}}#", $string, $match)) {
+return $match[0];
+}
+return false;
+}
+private static function createRequestFromFactory(array $query = array(), array $request = array(), array $attributes = array(), array $cookies = array(), array $files = array(), array $server = array(), $content = null)
+{
+if (self::$requestFactory) {
+$request = call_user_func(self::$requestFactory, $query, $request, $attributes, $cookies, $files, $server, $content);
+if (!$request instanceof Request) {
+throw new \LogicException('The Request factory must return an instance of Symfony\Component\HttpFoundation\Request.');
+}
+return $request;
+}
+return new static($query, $request, $attributes, $cookies, $files, $server, $content);
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class Response
+{
+const HTTP_CONTINUE = 100;
+const HTTP_SWITCHING_PROTOCOLS = 101;
+const HTTP_PROCESSING = 102; const HTTP_OK = 200;
+const HTTP_CREATED = 201;
+const HTTP_ACCEPTED = 202;
+const HTTP_NON_AUTHORITATIVE_INFORMATION = 203;
+const HTTP_NO_CONTENT = 204;
+const HTTP_RESET_CONTENT = 205;
+const HTTP_PARTIAL_CONTENT = 206;
+const HTTP_MULTI_STATUS = 207; const HTTP_ALREADY_REPORTED = 208; const HTTP_IM_USED = 226; const HTTP_MULTIPLE_CHOICES = 300;
+const HTTP_MOVED_PERMANENTLY = 301;
+const HTTP_FOUND = 302;
+const HTTP_SEE_OTHER = 303;
+const HTTP_NOT_MODIFIED = 304;
+const HTTP_USE_PROXY = 305;
+const HTTP_RESERVED = 306;
+const HTTP_TEMPORARY_REDIRECT = 307;
+const HTTP_PERMANENTLY_REDIRECT = 308; const HTTP_BAD_REQUEST = 400;
+const HTTP_UNAUTHORIZED = 401;
+const HTTP_PAYMENT_REQUIRED = 402;
+const HTTP_FORBIDDEN = 403;
+const HTTP_NOT_FOUND = 404;
+const HTTP_METHOD_NOT_ALLOWED = 405;
+const HTTP_NOT_ACCEPTABLE = 406;
+const HTTP_PROXY_AUTHENTICATION_REQUIRED = 407;
+const HTTP_REQUEST_TIMEOUT = 408;
+const HTTP_CONFLICT = 409;
+const HTTP_GONE = 410;
+const HTTP_LENGTH_REQUIRED = 411;
+const HTTP_PRECONDITION_FAILED = 412;
+const HTTP_REQUEST_ENTITY_TOO_LARGE = 413;
+const HTTP_REQUEST_URI_TOO_LONG = 414;
+const HTTP_UNSUPPORTED_MEDIA_TYPE = 415;
+const HTTP_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
+const HTTP_EXPECTATION_FAILED = 417;
+const HTTP_I_AM_A_TEAPOT = 418; const HTTP_UNPROCESSABLE_ENTITY = 422; const HTTP_LOCKED = 423; const HTTP_FAILED_DEPENDENCY = 424; const HTTP_RESERVED_FOR_WEBDAV_ADVANCED_COLLECTIONS_EXPIRED_PROPOSAL = 425; const HTTP_UPGRADE_REQUIRED = 426; const HTTP_PRECONDITION_REQUIRED = 428; const HTTP_TOO_MANY_REQUESTS = 429; const HTTP_REQUEST_HEADER_FIELDS_TOO_LARGE = 431; const HTTP_INTERNAL_SERVER_ERROR = 500;
+const HTTP_NOT_IMPLEMENTED = 501;
+const HTTP_BAD_GATEWAY = 502;
+const HTTP_SERVICE_UNAVAILABLE = 503;
+const HTTP_GATEWAY_TIMEOUT = 504;
+const HTTP_VERSION_NOT_SUPPORTED = 505;
+const HTTP_VARIANT_ALSO_NEGOTIATES_EXPERIMENTAL = 506; const HTTP_INSUFFICIENT_STORAGE = 507; const HTTP_LOOP_DETECTED = 508; const HTTP_NOT_EXTENDED = 510; const HTTP_NETWORK_AUTHENTICATION_REQUIRED = 511;
+public $headers;
+protected $content;
+protected $version;
+protected $statusCode;
+protected $statusText;
+protected $charset;
+public static $statusTexts = array(
+100 =>'Continue',
+101 =>'Switching Protocols',
+102 =>'Processing', 200 =>'OK',
+201 =>'Created',
+202 =>'Accepted',
+203 =>'Non-Authoritative Information',
+204 =>'No Content',
+205 =>'Reset Content',
+206 =>'Partial Content',
+207 =>'Multi-Status', 208 =>'Already Reported', 226 =>'IM Used', 300 =>'Multiple Choices',
+301 =>'Moved Permanently',
+302 =>'Found',
+303 =>'See Other',
+304 =>'Not Modified',
+305 =>'Use Proxy',
+306 =>'Reserved',
+307 =>'Temporary Redirect',
+308 =>'Permanent Redirect', 400 =>'Bad Request',
+401 =>'Unauthorized',
+402 =>'Payment Required',
+403 =>'Forbidden',
+404 =>'Not Found',
+405 =>'Method Not Allowed',
+406 =>'Not Acceptable',
+407 =>'Proxy Authentication Required',
+408 =>'Request Timeout',
+409 =>'Conflict',
+410 =>'Gone',
+411 =>'Length Required',
+412 =>'Precondition Failed',
+413 =>'Request Entity Too Large',
+414 =>'Request-URI Too Long',
+415 =>'Unsupported Media Type',
+416 =>'Requested Range Not Satisfiable',
+417 =>'Expectation Failed',
+418 =>'I\'m a teapot', 422 =>'Unprocessable Entity', 423 =>'Locked', 424 =>'Failed Dependency', 425 =>'Reserved for WebDAV advanced collections expired proposal', 426 =>'Upgrade Required', 428 =>'Precondition Required', 429 =>'Too Many Requests', 431 =>'Request Header Fields Too Large', 500 =>'Internal Server Error',
+501 =>'Not Implemented',
+502 =>'Bad Gateway',
+503 =>'Service Unavailable',
+504 =>'Gateway Timeout',
+505 =>'HTTP Version Not Supported',
+506 =>'Variant Also Negotiates (Experimental)', 507 =>'Insufficient Storage', 508 =>'Loop Detected', 510 =>'Not Extended', 511 =>'Network Authentication Required', );
+public function __construct($content ='', $status = 200, $headers = array())
+{
+$this->headers = new ResponseHeaderBag($headers);
+$this->setContent($content);
+$this->setStatusCode($status);
+$this->setProtocolVersion('1.0');
+if (!$this->headers->has('Date')) {
+$this->setDate(new \DateTime(null, new \DateTimeZone('UTC')));
+}
+}
+public static function create($content ='', $status = 200, $headers = array())
+{
+return new static($content, $status, $headers);
+}
+public function __toString()
+{
+return
+sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText)."\r\n".
+$this->headers."\r\n".
+$this->getContent();
+}
+public function __clone()
+{
+$this->headers = clone $this->headers;
+}
+public function prepare(Request $request)
+{
+$headers = $this->headers;
+if ($this->isInformational() || in_array($this->statusCode, array(204, 304))) {
+$this->setContent(null);
+}
+if (!$headers->has('Content-Type')) {
+$format = $request->getRequestFormat();
+if (null !== $format && $mimeType = $request->getMimeType($format)) {
+$headers->set('Content-Type', $mimeType);
+}
+}
+$charset = $this->charset ?:'UTF-8';
+if (!$headers->has('Content-Type')) {
+$headers->set('Content-Type','text/html; charset='.$charset);
+} elseif (0 === stripos($headers->get('Content-Type'),'text/') && false === stripos($headers->get('Content-Type'),'charset')) {
+$headers->set('Content-Type', $headers->get('Content-Type').'; charset='.$charset);
+}
+if ($headers->has('Transfer-Encoding')) {
+$headers->remove('Content-Length');
+}
+if ($request->isMethod('HEAD')) {
+$length = $headers->get('Content-Length');
+$this->setContent(null);
+if ($length) {
+$headers->set('Content-Length', $length);
+}
+}
+if ('HTTP/1.0'!= $request->server->get('SERVER_PROTOCOL')) {
+$this->setProtocolVersion('1.1');
+}
+if ('1.0'== $this->getProtocolVersion() &&'no-cache'== $this->headers->get('Cache-Control')) {
+$this->headers->set('pragma','no-cache');
+$this->headers->set('expires', -1);
+}
+$this->ensureIEOverSSLCompatibility($request);
+return $this;
+}
+public function sendHeaders()
+{
+if (headers_sent()) {
+return $this;
+}
+header(sprintf('HTTP/%s %s %s', $this->version, $this->statusCode, $this->statusText), true, $this->statusCode);
+foreach ($this->headers->allPreserveCase() as $name => $values) {
+foreach ($values as $value) {
+header($name.': '.$value, false, $this->statusCode);
+}
+}
+foreach ($this->headers->getCookies() as $cookie) {
+setcookie($cookie->getName(), $cookie->getValue(), $cookie->getExpiresTime(), $cookie->getPath(), $cookie->getDomain(), $cookie->isSecure(), $cookie->isHttpOnly());
+}
+return $this;
+}
+public function sendContent()
+{
+echo $this->content;
+return $this;
+}
+public function send()
+{
+$this->sendHeaders();
+$this->sendContent();
+if (function_exists('fastcgi_finish_request')) {
+fastcgi_finish_request();
+} elseif ('cli'!== PHP_SAPI) {
+static::closeOutputBuffers(0, true);
+flush();
+}
+return $this;
+}
+public function setContent($content)
+{
+if (null !== $content && !is_string($content) && !is_numeric($content) && !is_callable(array($content,'__toString'))) {
+throw new \UnexpectedValueException(sprintf('The Response content must be a string or object implementing __toString(), "%s" given.', gettype($content)));
+}
+$this->content = (string) $content;
+return $this;
+}
+public function getContent()
+{
+return $this->content;
+}
+public function setProtocolVersion($version)
+{
+$this->version = $version;
+return $this;
+}
+public function getProtocolVersion()
+{
+return $this->version;
+}
+public function setStatusCode($code, $text = null)
+{
+$this->statusCode = $code = (int) $code;
+if ($this->isInvalid()) {
+throw new \InvalidArgumentException(sprintf('The HTTP status code "%s" is not valid.', $code));
+}
+if (null === $text) {
+$this->statusText = isset(self::$statusTexts[$code]) ? self::$statusTexts[$code] :'';
+return $this;
+}
+if (false === $text) {
+$this->statusText ='';
+return $this;
+}
+$this->statusText = $text;
+return $this;
+}
+public function getStatusCode()
+{
+return $this->statusCode;
+}
+public function setCharset($charset)
+{
+$this->charset = $charset;
+return $this;
+}
+public function getCharset()
+{
+return $this->charset;
+}
+public function isCacheable()
+{
+if (!in_array($this->statusCode, array(200, 203, 300, 301, 302, 404, 410))) {
+return false;
+}
+if ($this->headers->hasCacheControlDirective('no-store') || $this->headers->getCacheControlDirective('private')) {
+return false;
+}
+return $this->isValidateable() || $this->isFresh();
+}
+public function isFresh()
+{
+return $this->getTtl() > 0;
+}
+public function isValidateable()
+{
+return $this->headers->has('Last-Modified') || $this->headers->has('ETag');
+}
+public function setPrivate()
+{
+$this->headers->removeCacheControlDirective('public');
+$this->headers->addCacheControlDirective('private');
+return $this;
+}
+public function setPublic()
+{
+$this->headers->addCacheControlDirective('public');
+$this->headers->removeCacheControlDirective('private');
+return $this;
+}
+public function mustRevalidate()
+{
+return $this->headers->hasCacheControlDirective('must-revalidate') || $this->headers->has('proxy-revalidate');
+}
+public function getDate()
+{
+return $this->headers->getDate('Date', new \DateTime());
+}
+public function setDate(\DateTime $date)
+{
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Date', $date->format('D, d M Y H:i:s').' GMT');
+return $this;
+}
+public function getAge()
+{
+if (null !== $age = $this->headers->get('Age')) {
+return (int) $age;
+}
+return max(time() - $this->getDate()->format('U'), 0);
+}
+public function expire()
+{
+if ($this->isFresh()) {
+$this->headers->set('Age', $this->getMaxAge());
+}
+return $this;
+}
+public function getExpires()
+{
+try {
+return $this->headers->getDate('Expires');
+} catch (\RuntimeException $e) {
+return \DateTime::createFromFormat(DATE_RFC2822,'Sat, 01 Jan 00 00:00:00 +0000');
+}
+}
+public function setExpires(\DateTime $date = null)
+{
+if (null === $date) {
+$this->headers->remove('Expires');
+} else {
+$date = clone $date;
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Expires', $date->format('D, d M Y H:i:s').' GMT');
+}
+return $this;
+}
+public function getMaxAge()
+{
+if ($this->headers->hasCacheControlDirective('s-maxage')) {
+return (int) $this->headers->getCacheControlDirective('s-maxage');
+}
+if ($this->headers->hasCacheControlDirective('max-age')) {
+return (int) $this->headers->getCacheControlDirective('max-age');
+}
+if (null !== $this->getExpires()) {
+return $this->getExpires()->format('U') - $this->getDate()->format('U');
+}
+}
+public function setMaxAge($value)
+{
+$this->headers->addCacheControlDirective('max-age', $value);
+return $this;
+}
+public function setSharedMaxAge($value)
+{
+$this->setPublic();
+$this->headers->addCacheControlDirective('s-maxage', $value);
+return $this;
+}
+public function getTtl()
+{
+if (null !== $maxAge = $this->getMaxAge()) {
+return $maxAge - $this->getAge();
+}
+}
+public function setTtl($seconds)
+{
+$this->setSharedMaxAge($this->getAge() + $seconds);
+return $this;
+}
+public function setClientTtl($seconds)
+{
+$this->setMaxAge($this->getAge() + $seconds);
+return $this;
+}
+public function getLastModified()
+{
+return $this->headers->getDate('Last-Modified');
+}
+public function setLastModified(\DateTime $date = null)
+{
+if (null === $date) {
+$this->headers->remove('Last-Modified');
+} else {
+$date = clone $date;
+$date->setTimezone(new \DateTimeZone('UTC'));
+$this->headers->set('Last-Modified', $date->format('D, d M Y H:i:s').' GMT');
+}
+return $this;
+}
+public function getEtag()
+{
+return $this->headers->get('ETag');
+}
+public function setEtag($etag = null, $weak = false)
+{
+if (null === $etag) {
+$this->headers->remove('Etag');
+} else {
+if (0 !== strpos($etag,'"')) {
+$etag ='"'.$etag.'"';
+}
+$this->headers->set('ETag', (true === $weak ?'W/':'').$etag);
+}
+return $this;
+}
+public function setCache(array $options)
+{
+if ($diff = array_diff(array_keys($options), array('etag','last_modified','max_age','s_maxage','private','public'))) {
+throw new \InvalidArgumentException(sprintf('Response does not support the following options: "%s".', implode('", "', array_values($diff))));
+}
+if (isset($options['etag'])) {
+$this->setEtag($options['etag']);
+}
+if (isset($options['last_modified'])) {
+$this->setLastModified($options['last_modified']);
+}
+if (isset($options['max_age'])) {
+$this->setMaxAge($options['max_age']);
+}
+if (isset($options['s_maxage'])) {
+$this->setSharedMaxAge($options['s_maxage']);
+}
+if (isset($options['public'])) {
+if ($options['public']) {
+$this->setPublic();
+} else {
+$this->setPrivate();
+}
+}
+if (isset($options['private'])) {
+if ($options['private']) {
+$this->setPrivate();
+} else {
+$this->setPublic();
+}
+}
+return $this;
+}
+public function setNotModified()
+{
+$this->setStatusCode(304);
+$this->setContent(null);
+foreach (array('Allow','Content-Encoding','Content-Language','Content-Length','Content-MD5','Content-Type','Last-Modified') as $header) {
+$this->headers->remove($header);
+}
+return $this;
+}
+public function hasVary()
+{
+return null !== $this->headers->get('Vary');
+}
+public function getVary()
+{
+if (!$vary = $this->headers->get('Vary', null, false)) {
+return array();
+}
+$ret = array();
+foreach ($vary as $item) {
+$ret = array_merge($ret, preg_split('/[\s,]+/', $item));
+}
+return $ret;
+}
+public function setVary($headers, $replace = true)
+{
+$this->headers->set('Vary', $headers, $replace);
+return $this;
+}
+public function isNotModified(Request $request)
+{
+if (!$request->isMethodSafe()) {
+return false;
+}
+$lastModified = $request->headers->get('If-Modified-Since');
+$notModified = false;
+if ($etags = $request->getEtags()) {
+$notModified = (in_array($this->getEtag(), $etags) || in_array('*', $etags)) && (!$lastModified || $this->headers->get('Last-Modified') == $lastModified);
+} elseif ($lastModified) {
+$notModified = $lastModified == $this->headers->get('Last-Modified');
+}
+if ($notModified) {
+$this->setNotModified();
+}
+return $notModified;
+}
+public function isInvalid()
+{
+return $this->statusCode < 100 || $this->statusCode >= 600;
+}
+public function isInformational()
+{
+return $this->statusCode >= 100 && $this->statusCode < 200;
+}
+public function isSuccessful()
+{
+return $this->statusCode >= 200 && $this->statusCode < 300;
+}
+public function isRedirection()
+{
+return $this->statusCode >= 300 && $this->statusCode < 400;
+}
+public function isClientError()
+{
+return $this->statusCode >= 400 && $this->statusCode < 500;
+}
+public function isServerError()
+{
+return $this->statusCode >= 500 && $this->statusCode < 600;
+}
+public function isOk()
+{
+return 200 === $this->statusCode;
+}
+public function isForbidden()
+{
+return 403 === $this->statusCode;
+}
+public function isNotFound()
+{
+return 404 === $this->statusCode;
+}
+public function isRedirect($location = null)
+{
+return in_array($this->statusCode, array(201, 301, 302, 303, 307, 308)) && (null === $location ?: $location == $this->headers->get('Location'));
+}
+public function isEmpty()
+{
+return in_array($this->statusCode, array(204, 304));
+}
+public static function closeOutputBuffers($targetLevel, $flush)
+{
+$status = ob_get_status(true);
+$level = count($status);
+while ($level-- > $targetLevel
+&& (!empty($status[$level]['del'])
+|| (isset($status[$level]['flags'])
+&& ($status[$level]['flags'] & PHP_OUTPUT_HANDLER_REMOVABLE)
+&& ($status[$level]['flags'] & ($flush ? PHP_OUTPUT_HANDLER_FLUSHABLE : PHP_OUTPUT_HANDLER_CLEANABLE))
+)
+)
+) {
+if ($flush) {
+ob_end_flush();
+} else {
+ob_end_clean();
+}
+}
+}
+protected function ensureIEOverSSLCompatibility(Request $request)
+{
+if (false !== stripos($this->headers->get('Content-Disposition'),'attachment') && preg_match('/MSIE (.*?);/i', $request->server->get('HTTP_USER_AGENT'), $match) == 1 && true === $request->isSecure()) {
+if (intval(preg_replace("/(MSIE )(.*?);/","$2", $match[0])) < 9) {
+$this->headers->remove('Cache-Control');
+}
+}
+}
+}
+}
+namespace Symfony\Component\HttpFoundation
+{
+class ResponseHeaderBag extends HeaderBag
+{
+const COOKIES_FLAT ='flat';
+const COOKIES_ARRAY ='array';
+const DISPOSITION_ATTACHMENT ='attachment';
+const DISPOSITION_INLINE ='inline';
+protected $computedCacheControl = array();
+protected $cookies = array();
+protected $headerNames = array();
+public function __construct(array $headers = array())
+{
+parent::__construct($headers);
+if (!isset($this->headers['cache-control'])) {
+$this->set('Cache-Control','');
+}
+}
+public function __toString()
+{
+$cookies ='';
+foreach ($this->getCookies() as $cookie) {
+$cookies .='Set-Cookie: '.$cookie."\r\n";
+}
+ksort($this->headerNames);
+return parent::__toString().$cookies;
+}
+public function allPreserveCase()
+{
+return array_combine($this->headerNames, $this->headers);
+}
+public function replace(array $headers = array())
+{
+$this->headerNames = array();
+parent::replace($headers);
+if (!isset($this->headers['cache-control'])) {
+$this->set('Cache-Control','');
+}
+}
+public function set($key, $values, $replace = true)
+{
+parent::set($key, $values, $replace);
+$uniqueKey = strtr(strtolower($key),'_','-');
+$this->headerNames[$uniqueKey] = $key;
+if (in_array($uniqueKey, array('cache-control','etag','last-modified','expires'))) {
+$computed = $this->computeCacheControlValue();
+$this->headers['cache-control'] = array($computed);
+$this->headerNames['cache-control'] ='Cache-Control';
+$this->computedCacheControl = $this->parseCacheControl($computed);
+}
+}
+public function remove($key)
+{
+parent::remove($key);
+$uniqueKey = strtr(strtolower($key),'_','-');
+unset($this->headerNames[$uniqueKey]);
+if ('cache-control'=== $uniqueKey) {
+$this->computedCacheControl = array();
+}
+}
+public function hasCacheControlDirective($key)
+{
+return array_key_exists($key, $this->computedCacheControl);
+}
+public function getCacheControlDirective($key)
+{
+return array_key_exists($key, $this->computedCacheControl) ? $this->computedCacheControl[$key] : null;
+}
+public function setCookie(Cookie $cookie)
+{
+$this->cookies[$cookie->getDomain()][$cookie->getPath()][$cookie->getName()] = $cookie;
+}
+public function removeCookie($name, $path ='/', $domain = null)
+{
+if (null === $path) {
+$path ='/';
+}
+unset($this->cookies[$domain][$path][$name]);
+if (empty($this->cookies[$domain][$path])) {
+unset($this->cookies[$domain][$path]);
+if (empty($this->cookies[$domain])) {
+unset($this->cookies[$domain]);
+}
+}
+}
+public function getCookies($format = self::COOKIES_FLAT)
+{
+if (!in_array($format, array(self::COOKIES_FLAT, self::COOKIES_ARRAY))) {
+throw new \InvalidArgumentException(sprintf('Format "%s" invalid (%s).', $format, implode(', ', array(self::COOKIES_FLAT, self::COOKIES_ARRAY))));
+}
+if (self::COOKIES_ARRAY === $format) {
+return $this->cookies;
+}
+$flattenedCookies = array();
+foreach ($this->cookies as $path) {
+foreach ($path as $cookies) {
+foreach ($cookies as $cookie) {
+$flattenedCookies[] = $cookie;
+}
+}
+}
+return $flattenedCookies;
+}
+public function clearCookie($name, $path ='/', $domain = null)
+{
+$this->setCookie(new Cookie($name, null, 1, $path, $domain));
+}
+public function makeDisposition($disposition, $filename, $filenameFallback ='')
+{
+if (!in_array($disposition, array(self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE))) {
+throw new \InvalidArgumentException(sprintf('The disposition must be either "%s" or "%s".', self::DISPOSITION_ATTACHMENT, self::DISPOSITION_INLINE));
+}
+if (''== $filenameFallback) {
+$filenameFallback = $filename;
+}
+if (!preg_match('/^[\x20-\x7e]*$/', $filenameFallback)) {
+throw new \InvalidArgumentException('The filename fallback must only contain ASCII characters.');
+}
+if (false !== strpos($filenameFallback,'%')) {
+throw new \InvalidArgumentException('The filename fallback cannot contain the "%" character.');
+}
+if (false !== strpos($filename,'/') || false !== strpos($filename,'\\') || false !== strpos($filenameFallback,'/') || false !== strpos($filenameFallback,'\\')) {
+throw new \InvalidArgumentException('The filename and the fallback cannot contain the "/" and "\\" characters.');
+}
+$output = sprintf('%s; filename="%s"', $disposition, str_replace('"','\\"', $filenameFallback));
+if ($filename !== $filenameFallback) {
+$output .= sprintf("; filename*=utf-8''%s", rawurlencode($filename));
+}
+return $output;
+}
+protected function computeCacheControlValue()
+{
+if (!$this->cacheControl && !$this->has('ETag') && !$this->has('Last-Modified') && !$this->has('Expires')) {
+return'no-cache';
+}
+if (!$this->cacheControl) {
+return'private, must-revalidate';
+}
+$header = $this->getCacheControlHeader();
+if (isset($this->cacheControl['public']) || isset($this->cacheControl['private'])) {
+return $header;
+}
+if (!isset($this->cacheControl['s-maxage'])) {
+return $header.', private';
+}
+return $header;
+}
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+interface ContainerAwareInterface
+{
+public function setContainer(ContainerInterface $container = null);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+interface ContainerInterface
+{
+const EXCEPTION_ON_INVALID_REFERENCE = 1;
+const NULL_ON_INVALID_REFERENCE = 2;
+const IGNORE_ON_INVALID_REFERENCE = 3;
+const SCOPE_CONTAINER ='container';
+const SCOPE_PROTOTYPE ='prototype';
+public function set($id, $service, $scope = self::SCOPE_CONTAINER);
+public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE);
+public function has($id);
+public function getParameter($name);
+public function hasParameter($name);
+public function setParameter($name, $value);
+public function enterScope($name);
+public function leaveScope($name);
+public function addScope(ScopeInterface $scope);
+public function hasScope($name);
+public function isScopeActive($name);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+interface IntrospectableContainerInterface extends ContainerInterface
+{
+public function initialized($id);
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+use Symfony\Component\DependencyInjection\Exception\InactiveScopeException;
+use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
+use Symfony\Component\DependencyInjection\Exception\RuntimeException;
+use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
+use Symfony\Component\DependencyInjection\Exception\ServiceCircularReferenceException;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBagInterface;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\ParameterBag\FrozenParameterBag;
+class Container implements IntrospectableContainerInterface
+{
+protected $parameterBag;
+protected $services = array();
+protected $methodMap = array();
+protected $aliases = array();
+protected $scopes = array();
+protected $scopeChildren = array();
+protected $scopedServices = array();
+protected $scopeStacks = array();
+protected $loading = array();
+public function __construct(ParameterBagInterface $parameterBag = null)
+{
+$this->parameterBag = $parameterBag ?: new ParameterBag();
+$this->set('service_container', $this);
+}
+public function compile()
+{
+$this->parameterBag->resolve();
+$this->parameterBag = new FrozenParameterBag($this->parameterBag->all());
+}
+public function isFrozen()
+{
+return $this->parameterBag instanceof FrozenParameterBag;
+}
+public function getParameterBag()
+{
+return $this->parameterBag;
+}
+public function getParameter($name)
+{
+return $this->parameterBag->get($name);
+}
+public function hasParameter($name)
+{
+return $this->parameterBag->has($name);
+}
+public function setParameter($name, $value)
+{
+$this->parameterBag->set($name, $value);
+}
+public function set($id, $service, $scope = self::SCOPE_CONTAINER)
+{
+if (self::SCOPE_PROTOTYPE === $scope) {
+throw new InvalidArgumentException(sprintf('You cannot set service "%s" of scope "prototype".', $id));
+}
+$id = strtolower($id);
+if (self::SCOPE_CONTAINER !== $scope) {
+if (!isset($this->scopedServices[$scope])) {
+throw new RuntimeException(sprintf('You cannot set service "%s" of inactive scope.', $id));
+}
+$this->scopedServices[$scope][$id] = $service;
+}
+$this->services[$id] = $service;
+if (method_exists($this, $method ='synchronize'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) {
+$this->$method();
+}
+if (self::SCOPE_CONTAINER !== $scope && null === $service) {
+unset($this->scopedServices[$scope][$id]);
+}
+if (null === $service) {
+unset($this->services[$id]);
+}
+}
+public function has($id)
+{
+$id = strtolower($id);
+return isset($this->services[$id])
+|| array_key_exists($id, $this->services)
+|| isset($this->aliases[$id])
+|| method_exists($this,'get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')
+;
+}
+public function get($id, $invalidBehavior = self::EXCEPTION_ON_INVALID_REFERENCE)
+{
+foreach (array(false, true) as $strtolower) {
+if ($strtolower) {
+$id = strtolower($id);
+}
+if (isset($this->aliases[$id])) {
+$id = $this->aliases[$id];
+}
+if (isset($this->services[$id]) || array_key_exists($id, $this->services)) {
+return $this->services[$id];
+}
+}
+if (isset($this->loading[$id])) {
+throw new ServiceCircularReferenceException($id, array_keys($this->loading));
+}
+if (isset($this->methodMap[$id])) {
+$method = $this->methodMap[$id];
+} elseif (method_exists($this, $method ='get'.strtr($id, array('_'=>'','.'=>'_','\\'=>'_')).'Service')) {
+} else {
+if (self::EXCEPTION_ON_INVALID_REFERENCE === $invalidBehavior) {
+if (!$id) {
+throw new ServiceNotFoundException($id);
+}
+$alternatives = array();
+foreach (array_keys($this->services) as $key) {
+$lev = levenshtein($id, $key);
+if ($lev <= strlen($id) / 3 || false !== strpos($key, $id)) {
+$alternatives[] = $key;
+}
+}
+throw new ServiceNotFoundException($id, null, null, $alternatives);
+}
+return;
+}
+$this->loading[$id] = true;
+try {
+$service = $this->$method();
+} catch (\Exception $e) {
+unset($this->loading[$id]);
+if (array_key_exists($id, $this->services)) {
+unset($this->services[$id]);
+}
+if ($e instanceof InactiveScopeException && self::EXCEPTION_ON_INVALID_REFERENCE !== $invalidBehavior) {
+return;
+}
+throw $e;
+}
+unset($this->loading[$id]);
+return $service;
+}
+public function initialized($id)
+{
+$id = strtolower($id);
+return isset($this->services[$id]) || array_key_exists($id, $this->services);
+}
+public function getServiceIds()
+{
+$ids = array();
+$r = new \ReflectionClass($this);
+foreach ($r->getMethods() as $method) {
+if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
+$ids[] = self::underscore($match[1]);
+}
+}
+return array_unique(array_merge($ids, array_keys($this->services)));
+}
+public function enterScope($name)
+{
+if (!isset($this->scopes[$name])) {
+throw new InvalidArgumentException(sprintf('The scope "%s" does not exist.', $name));
+}
+if (self::SCOPE_CONTAINER !== $this->scopes[$name] && !isset($this->scopedServices[$this->scopes[$name]])) {
+throw new RuntimeException(sprintf('The parent scope "%s" must be active when entering this scope.', $this->scopes[$name]));
+}
+if (isset($this->scopedServices[$name])) {
+$services = array($this->services, $name => $this->scopedServices[$name]);
+unset($this->scopedServices[$name]);
+foreach ($this->scopeChildren[$name] as $child) {
+if (isset($this->scopedServices[$child])) {
+$services[$child] = $this->scopedServices[$child];
+unset($this->scopedServices[$child]);
+}
+}
+$this->services = call_user_func_array('array_diff_key', $services);
+array_shift($services);
+if (!isset($this->scopeStacks[$name])) {
+$this->scopeStacks[$name] = new \SplStack();
+}
+$this->scopeStacks[$name]->push($services);
+}
+$this->scopedServices[$name] = array();
+}
+public function leaveScope($name)
+{
+if (!isset($this->scopedServices[$name])) {
+throw new InvalidArgumentException(sprintf('The scope "%s" is not active.', $name));
+}
+$services = array($this->services, $this->scopedServices[$name]);
+unset($this->scopedServices[$name]);
+foreach ($this->scopeChildren[$name] as $child) {
+if (!isset($this->scopedServices[$child])) {
+continue;
+}
+$services[] = $this->scopedServices[$child];
+unset($this->scopedServices[$child]);
+}
+$this->services = call_user_func_array('array_diff_key', $services);
+if (isset($this->scopeStacks[$name]) && count($this->scopeStacks[$name]) > 0) {
+$services = $this->scopeStacks[$name]->pop();
+$this->scopedServices += $services;
+foreach ($services as $array) {
+foreach ($array as $id => $service) {
+$this->set($id, $service, $name);
+}
+}
+}
+}
+public function addScope(ScopeInterface $scope)
+{
+$name = $scope->getName();
+$parentScope = $scope->getParentName();
+if (self::SCOPE_CONTAINER === $name || self::SCOPE_PROTOTYPE === $name) {
+throw new InvalidArgumentException(sprintf('The scope "%s" is reserved.', $name));
+}
+if (isset($this->scopes[$name])) {
+throw new InvalidArgumentException(sprintf('A scope with name "%s" already exists.', $name));
+}
+if (self::SCOPE_CONTAINER !== $parentScope && !isset($this->scopes[$parentScope])) {
+throw new InvalidArgumentException(sprintf('The parent scope "%s" does not exist, or is invalid.', $parentScope));
+}
+$this->scopes[$name] = $parentScope;
+$this->scopeChildren[$name] = array();
+while ($parentScope !== self::SCOPE_CONTAINER) {
+$this->scopeChildren[$parentScope][] = $name;
+$parentScope = $this->scopes[$parentScope];
+}
+}
+public function hasScope($name)
+{
+return isset($this->scopes[$name]);
+}
+public function isScopeActive($name)
+{
+return isset($this->scopedServices[$name]);
+}
+public static function camelize($id)
+{
+return strtr(ucwords(strtr($id, array('_'=>' ','.'=>'_ ','\\'=>'_ '))), array(' '=>''));
+}
+public static function underscore($id)
+{
+return strtolower(preg_replace(array('/([A-Z]+)([A-Z][a-z])/','/([a-z\d])([A-Z])/'), array('\\1_\\2','\\1_\\2'), strtr($id,'_','.')));
+}
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+interface HttpKernelInterface
+{
+const MASTER_REQUEST = 1;
+const SUB_REQUEST = 2;
+public function handle(Request $request, $type = self::MASTER_REQUEST, $catch = true);
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\Config\Loader\LoaderInterface;
+interface KernelInterface extends HttpKernelInterface, \Serializable
+{
+public function registerBundles();
+public function registerContainerConfiguration(LoaderInterface $loader);
+public function boot();
+public function shutdown();
+public function getBundles();
+public function isClassInActiveBundle($class);
+public function getBundle($name, $first = true);
+public function locateResource($name, $dir = null, $first = true);
+public function getName();
+public function getEnvironment();
+public function isDebug();
+public function getRootDir();
+public function getContainer();
+public function getStartTime();
+public function getCacheDir();
+public function getLogDir();
+public function getCharset();
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+interface TerminableInterface
+{
+public function terminate(Request $request, Response $response);
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator;
+use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Dumper\PhpDumper;
+use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
+use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
+use Symfony\Component\DependencyInjection\Loader\IniFileLoader;
+use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
+use Symfony\Component\DependencyInjection\Loader\ClosureLoader;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\HttpKernel\Bundle\BundleInterface;
+use Symfony\Component\HttpKernel\Config\FileLocator;
+use Symfony\Component\HttpKernel\DependencyInjection\MergeExtensionConfigurationPass;
+use Symfony\Component\HttpKernel\DependencyInjection\AddClassesToCachePass;
+use Symfony\Component\Config\Loader\LoaderResolver;
+use Symfony\Component\Config\Loader\DelegatingLoader;
+use Symfony\Component\Config\ConfigCache;
+use Symfony\Component\ClassLoader\ClassCollectionLoader;
+abstract class Kernel implements KernelInterface, TerminableInterface
+{
+protected $bundles = array();
+protected $bundleMap;
+protected $container;
+protected $rootDir;
+protected $environment;
+protected $debug;
+protected $booted = false;
+protected $name;
+protected $startTime;
+protected $loadClassCache;
+const VERSION ='2.5.0';
+const VERSION_ID ='20500';
+const MAJOR_VERSION ='2';
+const MINOR_VERSION ='5';
+const RELEASE_VERSION ='0';
+const EXTRA_VERSION ='';
+public function __construct($environment, $debug)
+{
+$this->environment = $environment;
+$this->debug = (bool) $debug;
+$this->rootDir = $this->getRootDir();
+$this->name = $this->getName();
+if ($this->debug) {
+$this->startTime = microtime(true);
+}
+$this->init();
+}
+public function init()
+{
+}
+public function __clone()
+{
+if ($this->debug) {
+$this->startTime = microtime(true);
+}
+$this->booted = false;
+$this->container = null;
+}
+public function boot()
+{
+if (true === $this->booted) {
+return;
+}
+if ($this->loadClassCache) {
+$this->doLoadClassCache($this->loadClassCache[0], $this->loadClassCache[1]);
+}
+$this->initializeBundles();
+$this->initializeContainer();
+foreach ($this->getBundles() as $bundle) {
+$bundle->setContainer($this->container);
+$bundle->boot();
+}
+$this->booted = true;
+}
+public function terminate(Request $request, Response $response)
+{
+if (false === $this->booted) {
+return;
+}
+if ($this->getHttpKernel() instanceof TerminableInterface) {
+$this->getHttpKernel()->terminate($request, $response);
+}
+}
+public function shutdown()
+{
+if (false === $this->booted) {
+return;
+}
+$this->booted = false;
+foreach ($this->getBundles() as $bundle) {
+$bundle->shutdown();
+$bundle->setContainer(null);
+}
+$this->container = null;
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+if (false === $this->booted) {
+$this->boot();
+}
+return $this->getHttpKernel()->handle($request, $type, $catch);
+}
+protected function getHttpKernel()
+{
+return $this->container->get('http_kernel');
+}
+public function getBundles()
+{
+return $this->bundles;
+}
+public function isClassInActiveBundle($class)
+{
+foreach ($this->getBundles() as $bundle) {
+if (0 === strpos($class, $bundle->getNamespace())) {
+return true;
+}
+}
+return false;
+}
+public function getBundle($name, $first = true)
+{
+if (!isset($this->bundleMap[$name])) {
+throw new \InvalidArgumentException(sprintf('Bundle "%s" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your %s.php file?', $name, get_class($this)));
+}
+if (true === $first) {
+return $this->bundleMap[$name][0];
+}
+return $this->bundleMap[$name];
+}
+public function locateResource($name, $dir = null, $first = true)
+{
+if ('@'!== $name[0]) {
+throw new \InvalidArgumentException(sprintf('A resource name must start with @ ("%s" given).', $name));
+}
+if (false !== strpos($name,'..')) {
+throw new \RuntimeException(sprintf('File name "%s" contains invalid characters (..).', $name));
+}
+$bundleName = substr($name, 1);
+$path ='';
+if (false !== strpos($bundleName,'/')) {
+list($bundleName, $path) = explode('/', $bundleName, 2);
+}
+$isResource = 0 === strpos($path,'Resources') && null !== $dir;
+$overridePath = substr($path, 9);
+$resourceBundle = null;
+$bundles = $this->getBundle($bundleName, false);
+$files = array();
+foreach ($bundles as $bundle) {
+if ($isResource && file_exists($file = $dir.'/'.$bundle->getName().$overridePath)) {
+if (null !== $resourceBundle) {
+throw new \RuntimeException(sprintf('"%s" resource is hidden by a resource from the "%s" derived bundle. Create a "%s" file to override the bundle resource.',
+$file,
+$resourceBundle,
+$dir.'/'.$bundles[0]->getName().$overridePath
+));
+}
+if ($first) {
+return $file;
+}
+$files[] = $file;
+}
+if (file_exists($file = $bundle->getPath().'/'.$path)) {
+if ($first && !$isResource) {
+return $file;
+}
+$files[] = $file;
+$resourceBundle = $bundle->getName();
+}
+}
+if (count($files) > 0) {
+return $first && $isResource ? $files[0] : $files;
+}
+throw new \InvalidArgumentException(sprintf('Unable to find file "%s".', $name));
+}
+public function getName()
+{
+if (null === $this->name) {
+$this->name = preg_replace('/[^a-zA-Z0-9_]+/','', basename($this->rootDir));
+}
+return $this->name;
+}
+public function getEnvironment()
+{
+return $this->environment;
+}
+public function isDebug()
+{
+return $this->debug;
+}
+public function getRootDir()
+{
+if (null === $this->rootDir) {
+$r = new \ReflectionObject($this);
+$this->rootDir = str_replace('\\','/', dirname($r->getFileName()));
+}
+return $this->rootDir;
+}
+public function getContainer()
+{
+return $this->container;
+}
+public function loadClassCache($name ='classes', $extension ='.php')
+{
+$this->loadClassCache = array($name, $extension);
+}
+public function setClassCache(array $classes)
+{
+file_put_contents($this->getCacheDir().'/classes.map', sprintf('<?php return %s;', var_export($classes, true)));
+}
+public function getStartTime()
+{
+return $this->debug ? $this->startTime : -INF;
+}
+public function getCacheDir()
+{
+return $this->rootDir.'/cache/'.$this->environment;
+}
+public function getLogDir()
+{
+return $this->rootDir.'/logs';
+}
+public function getCharset()
+{
+return'UTF-8';
+}
+protected function doLoadClassCache($name, $extension)
+{
+if (!$this->booted && is_file($this->getCacheDir().'/classes.map')) {
+ClassCollectionLoader::load(include($this->getCacheDir().'/classes.map'), $this->getCacheDir(), $name, $this->debug, false, $extension);
+}
+}
+protected function initializeBundles()
+{
+$this->bundles = array();
+$topMostBundles = array();
+$directChildren = array();
+foreach ($this->registerBundles() as $bundle) {
+$name = $bundle->getName();
+if (isset($this->bundles[$name])) {
+throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
+}
+$this->bundles[$name] = $bundle;
+if ($parentName = $bundle->getParent()) {
+if (isset($directChildren[$parentName])) {
+throw new \LogicException(sprintf('Bundle "%s" is directly extended by two bundles "%s" and "%s".', $parentName, $name, $directChildren[$parentName]));
+}
+if ($parentName == $name) {
+throw new \LogicException(sprintf('Bundle "%s" can not extend itself.', $name));
+}
+$directChildren[$parentName] = $name;
+} else {
+$topMostBundles[$name] = $bundle;
+}
+}
+if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) {
+$diff = array_keys($diff);
+throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
+}
+$this->bundleMap = array();
+foreach ($topMostBundles as $name => $bundle) {
+$bundleMap = array($bundle);
+$hierarchy = array($name);
+while (isset($directChildren[$name])) {
+$name = $directChildren[$name];
+array_unshift($bundleMap, $this->bundles[$name]);
+$hierarchy[] = $name;
+}
+foreach ($hierarchy as $bundle) {
+$this->bundleMap[$bundle] = $bundleMap;
+array_pop($bundleMap);
+}
+}
+}
+protected function getContainerClass()
+{
+return $this->name.ucfirst($this->environment).($this->debug ?'Debug':'').'ProjectContainer';
+}
+protected function getContainerBaseClass()
+{
+return'Container';
+}
+protected function initializeContainer()
+{
+$class = $this->getContainerClass();
+$cache = new ConfigCache($this->getCacheDir().'/'.$class.'.php', $this->debug);
+$fresh = true;
+if (!$cache->isFresh()) {
+$container = $this->buildContainer();
+$container->compile();
+$this->dumpContainer($cache, $container, $class, $this->getContainerBaseClass());
+$fresh = false;
+}
+require_once $cache;
+$this->container = new $class();
+$this->container->set('kernel', $this);
+if (!$fresh && $this->container->has('cache_warmer')) {
+$this->container->get('cache_warmer')->warmUp($this->container->getParameter('kernel.cache_dir'));
+}
+}
+protected function getKernelParameters()
+{
+$bundles = array();
+foreach ($this->bundles as $name => $bundle) {
+$bundles[$name] = get_class($bundle);
+}
+return array_merge(
+array('kernel.root_dir'=> $this->rootDir,'kernel.environment'=> $this->environment,'kernel.debug'=> $this->debug,'kernel.name'=> $this->name,'kernel.cache_dir'=> $this->getCacheDir(),'kernel.logs_dir'=> $this->getLogDir(),'kernel.bundles'=> $bundles,'kernel.charset'=> $this->getCharset(),'kernel.container_class'=> $this->getContainerClass(),
+),
+$this->getEnvParameters()
+);
+}
+protected function getEnvParameters()
+{
+$parameters = array();
+foreach ($_SERVER as $key => $value) {
+if (0 === strpos($key,'SYMFONY__')) {
+$parameters[strtolower(str_replace('__','.', substr($key, 9)))] = $value;
+}
+}
+return $parameters;
+}
+protected function buildContainer()
+{
+foreach (array('cache'=> $this->getCacheDir(),'logs'=> $this->getLogDir()) as $name => $dir) {
+if (!is_dir($dir)) {
+if (false === @mkdir($dir, 0777, true)) {
+throw new \RuntimeException(sprintf("Unable to create the %s directory (%s)\n", $name, $dir));
+}
+} elseif (!is_writable($dir)) {
+throw new \RuntimeException(sprintf("Unable to write in the %s directory (%s)\n", $name, $dir));
+}
+}
+$container = $this->getContainerBuilder();
+$container->addObjectResource($this);
+$this->prepareContainer($container);
+if (null !== $cont = $this->registerContainerConfiguration($this->getContainerLoader($container))) {
+$container->merge($cont);
+}
+$container->addCompilerPass(new AddClassesToCachePass($this));
+return $container;
+}
+protected function prepareContainer(ContainerBuilder $container)
+{
+$extensions = array();
+foreach ($this->bundles as $bundle) {
+if ($extension = $bundle->getContainerExtension()) {
+$container->registerExtension($extension);
+$extensions[] = $extension->getAlias();
+}
+if ($this->debug) {
+$container->addObjectResource($bundle);
+}
+}
+foreach ($this->bundles as $bundle) {
+$bundle->build($container);
+}
+$container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass($extensions));
+}
+protected function getContainerBuilder()
+{
+$container = new ContainerBuilder(new ParameterBag($this->getKernelParameters()));
+if (class_exists('ProxyManager\Configuration')) {
+$container->setProxyInstantiator(new RuntimeInstantiator());
+}
+return $container;
+}
+protected function dumpContainer(ConfigCache $cache, ContainerBuilder $container, $class, $baseClass)
+{
+$dumper = new PhpDumper($container);
+if (class_exists('ProxyManager\Configuration')) {
+$dumper->setProxyDumper(new ProxyDumper());
+}
+$content = $dumper->dump(array('class'=> $class,'base_class'=> $baseClass));
+if (!$this->debug) {
+$content = static::stripComments($content);
+}
+$cache->write($content, $container->getResources());
+}
+protected function getContainerLoader(ContainerInterface $container)
+{
+$locator = new FileLocator($this);
+$resolver = new LoaderResolver(array(
+new XmlFileLoader($container, $locator),
+new YamlFileLoader($container, $locator),
+new IniFileLoader($container, $locator),
+new PhpFileLoader($container, $locator),
+new ClosureLoader($container),
+));
+return new DelegatingLoader($resolver);
+}
+public static function stripComments($source)
+{
+if (!function_exists('token_get_all')) {
+return $source;
+}
+$rawChunk ='';
+$output ='';
+$tokens = token_get_all($source);
+$ignoreSpace = false;
+for (reset($tokens); false !== $token = current($tokens); next($tokens)) {
+if (is_string($token)) {
+$rawChunk .= $token;
+} elseif (T_START_HEREDOC === $token[0]) {
+$output .= $rawChunk.$token[1];
+do {
+$token = next($tokens);
+$output .= $token[1];
+} while ($token[0] !== T_END_HEREDOC);
+$rawChunk ='';
+} elseif (T_WHITESPACE === $token[0]) {
+if ($ignoreSpace) {
+$ignoreSpace = false;
+continue;
+}
+$rawChunk .= preg_replace(array('/\n{2,}/S'),"\n", $token[1]);
+} elseif (in_array($token[0], array(T_COMMENT, T_DOC_COMMENT))) {
+$ignoreSpace = true;
+} else {
+$rawChunk .= $token[1];
+if (T_OPEN_TAG === $token[0]) {
+$ignoreSpace = true;
+}
+}
+}
+$output .= $rawChunk;
+return $output;
+}
+public function serialize()
+{
+return serialize(array($this->environment, $this->debug));
+}
+public function unserialize($data)
+{
+list($environment, $debug) = unserialize($data);
+$this->__construct($environment, $debug);
+}
+}
+}
+namespace Symfony\Component\ClassLoader
+{
+class ApcClassLoader
+{
+private $prefix;
+protected $decorated;
+public function __construct($prefix, $decorated)
+{
+if (!extension_loaded('apc')) {
+throw new \RuntimeException('Unable to use ApcClassLoader as APC is not enabled.');
+}
+if (!method_exists($decorated,'findFile')) {
+throw new \InvalidArgumentException('The class finder must implement a "findFile" method.');
+}
+$this->prefix = $prefix;
+$this->decorated = $decorated;
+}
+public function register($prepend = false)
+{
+spl_autoload_register(array($this,'loadClass'), true, $prepend);
+}
+public function unregister()
+{
+spl_autoload_unregister(array($this,'loadClass'));
+}
+public function loadClass($class)
+{
+if ($file = $this->findFile($class)) {
+require $file;
+return true;
+}
+}
+public function findFile($class)
+{
+if (false === $file = apc_fetch($this->prefix.$class)) {
+apc_store($this->prefix.$class, $file = $this->decorated->findFile($class));
+}
+return $file;
+}
+public function __call($method, $args)
+{
+return call_user_func_array(array($this->decorated, $method), $args);
+}
+}
+}
+namespace Symfony\Component\HttpKernel\Bundle
+{
+use Symfony\Component\DependencyInjection\ContainerAwareInterface;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
+interface BundleInterface extends ContainerAwareInterface
+{
+public function boot();
+public function shutdown();
+public function build(ContainerBuilder $container);
+public function getContainerExtension();
+public function getParent();
+public function getName();
+public function getNamespace();
+public function getPath();
+}
+}
+namespace Symfony\Component\DependencyInjection
+{
+abstract class ContainerAware implements ContainerAwareInterface
+{
+protected $container;
+public function setContainer(ContainerInterface $container = null)
+{
+$this->container = $container;
+}
+}
+}
+namespace Symfony\Component\HttpKernel\Bundle
+{
+use Symfony\Component\DependencyInjection\ContainerAware;
+use Symfony\Component\DependencyInjection\ContainerBuilder;
+use Symfony\Component\DependencyInjection\Container;
+use Symfony\Component\Console\Application;
+use Symfony\Component\Finder\Finder;
+use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
+abstract class Bundle extends ContainerAware implements BundleInterface
+{
+protected $name;
+protected $extension;
+protected $path;
+public function boot()
+{
+}
+public function shutdown()
+{
+}
+public function build(ContainerBuilder $container)
+{
+}
+public function getContainerExtension()
+{
+if (null === $this->extension) {
+$basename = preg_replace('/Bundle$/','', $this->getName());
+$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
+if (class_exists($class)) {
+$extension = new $class();
+$expectedAlias = Container::underscore($basename);
+if ($expectedAlias != $extension->getAlias()) {
+throw new \LogicException(sprintf('The extension alias for the default extension of a '.'bundle must be the underscored version of the '.'bundle name ("%s" instead of "%s")',
+$expectedAlias, $extension->getAlias()
+));
+}
+$this->extension = $extension;
+} else {
+$this->extension = false;
+}
+}
+if ($this->extension) {
+return $this->extension;
+}
+}
+public function getNamespace()
+{
+$class = get_class($this);
+return substr($class, 0, strrpos($class,'\\'));
+}
+public function getPath()
+{
+if (null === $this->path) {
+$reflected = new \ReflectionObject($this);
+$this->path = dirname($reflected->getFileName());
+}
+return $this->path;
+}
+public function getParent()
+{
+}
+final public function getName()
+{
+if (null !== $this->name) {
+return $this->name;
+}
+$name = get_class($this);
+$pos = strrpos($name,'\\');
+return $this->name = false === $pos ? $name : substr($name, $pos + 1);
+}
+public function registerCommands(Application $application)
+{
+if (!is_dir($dir = $this->getPath().'/Command')) {
+return;
+}
+$finder = new Finder();
+$finder->files()->name('*Command.php')->in($dir);
+$prefix = $this->getNamespace().'\\Command';
+foreach ($finder as $file) {
+$ns = $prefix;
+if ($relativePath = $file->getRelativePath()) {
+$ns .='\\'.strtr($relativePath,'/','\\');
+}
+$class = $ns.'\\'.$file->getBasename('.php');
+if ($this->container) {
+$alias ='console.command.'.strtolower(str_replace('\\','_', $class));
+if ($this->container->has($alias)) {
+continue;
+}
+}
+$r = new \ReflectionClass($class);
+if ($r->isSubclassOf('Symfony\\Component\\Console\\Command\\Command') && !$r->isAbstract() && !$r->getConstructor()->getNumberOfRequiredParameters()) {
+$application->add($r->newInstance());
+}
+}
+}
+}
+}
+namespace Symfony\Component\Config
+{
+use Symfony\Component\Config\Resource\ResourceInterface;
+use Symfony\Component\Filesystem\Exception\IOException;
+use Symfony\Component\Filesystem\Filesystem;
+class ConfigCache
+{
+private $debug;
+private $file;
+public function __construct($file, $debug)
+{
+$this->file = $file;
+$this->debug = (bool) $debug;
+}
+public function __toString()
+{
+return $this->file;
+}
+public function isFresh()
+{
+if (!is_file($this->file)) {
+return false;
+}
+if (!$this->debug) {
+return true;
+}
+$metadata = $this->getMetaFile();
+if (!is_file($metadata)) {
+return false;
+}
+$time = filemtime($this->file);
+$meta = unserialize(file_get_contents($metadata));
+foreach ($meta as $resource) {
+if (!$resource->isFresh($time)) {
+return false;
+}
+}
+return true;
+}
+public function write($content, array $metadata = null)
+{
+$mode = 0666;
+$umask = umask();
+$filesystem = new Filesystem();
+$filesystem->dumpFile($this->file, $content, null);
+try {
+$filesystem->chmod($this->file, $mode, $umask);
+} catch (IOException $e) {
+}
+if (null !== $metadata && true === $this->debug) {
+$filesystem->dumpFile($this->getMetaFile(), serialize($metadata), null);
+try {
+$filesystem->chmod($this->getMetaFile(), $mode, $umask);
+} catch (IOException $e) {
+}
+}
+}
+private function getMetaFile()
+{
+return $this->file.'.meta';
+}
+}
+}
+namespace Symfony\Component\HttpKernel
+{
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
+use Symfony\Component\HttpKernel\Event\FilterControllerEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
+use Symfony\Component\HttpKernel\Event\FinishRequestEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForControllerResultEvent;
+use Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent;
+use Symfony\Component\HttpKernel\Event\PostResponseEvent;
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpFoundation\Response;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+class HttpKernel implements HttpKernelInterface, TerminableInterface
+{
+protected $dispatcher;
+protected $resolver;
+protected $requestStack;
+public function __construct(EventDispatcherInterface $dispatcher, ControllerResolverInterface $resolver, RequestStack $requestStack = null)
+{
+$this->dispatcher = $dispatcher;
+$this->resolver = $resolver;
+$this->requestStack = $requestStack ?: new RequestStack();
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+try {
+return $this->handleRaw($request, $type);
+} catch (\Exception $e) {
+if (false === $catch) {
+$this->finishRequest($request, $type);
+throw $e;
+}
+return $this->handleException($e, $request, $type);
+}
+}
+public function terminate(Request $request, Response $response)
+{
+$this->dispatcher->dispatch(KernelEvents::TERMINATE, new PostResponseEvent($this, $request, $response));
+}
+public function terminateWithException(\Exception $exception)
+{
+if (!$request = $this->requestStack->getMasterRequest()) {
+throw new \LogicException('Request stack is empty', 0, $exception);
+}
+$response = $this->handleException($exception, $request, self::MASTER_REQUEST);
+$response->sendHeaders();
+$response->sendContent();
+$this->terminate($request, $response);
+}
+private function handleRaw(Request $request, $type = self::MASTER_REQUEST)
+{
+$this->requestStack->push($request);
+$event = new GetResponseEvent($this, $request, $type);
+$this->dispatcher->dispatch(KernelEvents::REQUEST, $event);
+if ($event->hasResponse()) {
+return $this->filterResponse($event->getResponse(), $request, $type);
+}
+if (false === $controller = $this->resolver->getController($request)) {
+throw new NotFoundHttpException(sprintf('Unable to find the controller for path "%s". Maybe you forgot to add the matching route in your routing configuration?', $request->getPathInfo()));
+}
+$event = new FilterControllerEvent($this, $controller, $request, $type);
+$this->dispatcher->dispatch(KernelEvents::CONTROLLER, $event);
+$controller = $event->getController();
+$arguments = $this->resolver->getArguments($request, $controller);
+$response = call_user_func_array($controller, $arguments);
+if (!$response instanceof Response) {
+$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
+$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
+if ($event->hasResponse()) {
+$response = $event->getResponse();
+}
+if (!$response instanceof Response) {
+$msg = sprintf('The controller must return a response (%s given).', $this->varToString($response));
+if (null === $response) {
+$msg .=' Did you forget to add a return statement somewhere in your controller?';
+}
+throw new \LogicException($msg);
+}
+}
+return $this->filterResponse($response, $request, $type);
+}
+private function filterResponse(Response $response, Request $request, $type)
+{
+$event = new FilterResponseEvent($this, $request, $type, $response);
+$this->dispatcher->dispatch(KernelEvents::RESPONSE, $event);
+$this->finishRequest($request, $type);
+return $event->getResponse();
+}
+private function finishRequest(Request $request, $type)
+{
+$this->dispatcher->dispatch(KernelEvents::FINISH_REQUEST, new FinishRequestEvent($this, $request, $type));
+$this->requestStack->pop();
+}
+private function handleException(\Exception $e, $request, $type)
+{
+$event = new GetResponseForExceptionEvent($this, $request, $type, $e);
+$this->dispatcher->dispatch(KernelEvents::EXCEPTION, $event);
+$e = $event->getException();
+if (!$event->hasResponse()) {
+$this->finishRequest($request, $type);
+throw $e;
+}
+$response = $event->getResponse();
+if ($response->headers->has('X-Status-Code')) {
+$response->setStatusCode($response->headers->get('X-Status-Code'));
+$response->headers->remove('X-Status-Code');
+} elseif (!$response->isClientError() && !$response->isServerError() && !$response->isRedirect()) {
+if ($e instanceof HttpExceptionInterface) {
+$response->setStatusCode($e->getStatusCode());
+$response->headers->add($e->getHeaders());
+} else {
+$response->setStatusCode(500);
+}
+}
+try {
+return $this->filterResponse($response, $request, $type);
+} catch (\Exception $e) {
+return $response;
+}
+}
+private function varToString($var)
+{
+if (is_object($var)) {
+return sprintf('Object(%s)', get_class($var));
+}
+if (is_array($var)) {
+$a = array();
+foreach ($var as $k => $v) {
+$a[] = sprintf('%s => %s', $k, $this->varToString($v));
+}
+return sprintf("Array(%s)", implode(', ', $a));
+}
+if (is_resource($var)) {
+return sprintf('Resource(%s)', get_resource_type($var));
+}
+if (null === $var) {
+return'null';
+}
+if (false === $var) {
+return'false';
+}
+if (true === $var) {
+return'true';
+}
+return (string) $var;
+}
+}
+}
+namespace Symfony\Component\HttpKernel\DependencyInjection
+{
+use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\RequestStack;
+use Symfony\Component\HttpKernel\HttpKernelInterface;
+use Symfony\Component\HttpKernel\HttpKernel;
+use Symfony\Component\HttpKernel\Controller\ControllerResolverInterface;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
+use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\DependencyInjection\Scope;
+class ContainerAwareHttpKernel extends HttpKernel
+{
+protected $container;
+public function __construct(EventDispatcherInterface $dispatcher, ContainerInterface $container, ControllerResolverInterface $controllerResolver, RequestStack $requestStack = null)
+{
+parent::__construct($dispatcher, $controllerResolver, $requestStack);
+$this->container = $container;
+if (!$container->hasScope('request')) {
+$container->addScope(new Scope('request'));
+}
+}
+public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
+{
+$request->headers->set('X-Php-Ob-Level', ob_get_level());
+$this->container->enterScope('request');
+$this->container->set('request', $request,'request');
+try {
+$response = parent::handle($request, $type, $catch);
+} catch (\Exception $e) {
+$this->container->set('request', null,'request');
+$this->container->leaveScope('request');
+throw $e;
+}
+$this->container->set('request', null,'request');
+$this->container->leaveScope('request');
+return $response;
+}
+}
+}
+
+namespace { return $loader; }
+            

+ 0 - 0
vendor/braincrafted/bootstrap-bundle/Braincrafted/Bundle/BootstrapBundle/Tests/Command/fixtures/app/.gitkeep → app/cache/.gitkeep


+ 62 - 0
app/check.php

@@ -0,0 +1,62 @@
+<?php
+
+require_once dirname(__FILE__).'/SymfonyRequirements.php';
+
+$symfonyRequirements = new SymfonyRequirements();
+
+$iniPath = $symfonyRequirements->getPhpIniConfigPath();
+
+echo "********************************\n";
+echo "*                              *\n";
+echo "*  Symfony requirements check  *\n";
+echo "*                              *\n";
+echo "********************************\n\n";
+
+echo $iniPath ? sprintf("* Configuration file used by PHP: %s\n\n", $iniPath) : "* WARNING: No configuration file (php.ini) used by PHP!\n\n";
+
+echo "** ATTENTION **\n";
+echo "*  The PHP CLI can use a different php.ini file\n";
+echo "*  than the one used with your web server.\n";
+if ('\\' == DIRECTORY_SEPARATOR) {
+    echo "*  (especially on the Windows platform)\n";
+}
+echo "*  To be on the safe side, please also launch the requirements check\n";
+echo "*  from your web server using the web/config.php script.\n";
+
+echo_title('Mandatory requirements');
+
+$checkPassed = true;
+foreach ($symfonyRequirements->getRequirements() as $req) {
+    /** @var $req Requirement */
+    echo_requirement($req);
+    if (!$req->isFulfilled()) {
+        $checkPassed = false;
+    }
+}
+
+echo_title('Optional recommendations');
+
+foreach ($symfonyRequirements->getRecommendations() as $req) {
+    echo_requirement($req);
+}
+
+exit($checkPassed ? 0 : 1);
+
+/**
+ * Prints a Requirement instance
+ */
+function echo_requirement(Requirement $requirement)
+{
+    $result = $requirement->isFulfilled() ? 'OK' : ($requirement->isOptional() ? 'WARNING' : 'ERROR');
+    echo ' ' . str_pad($result, 9);
+    echo $requirement->getTestMessage() . "\n";
+
+    if (!$requirement->isFulfilled()) {
+        echo sprintf("          %s\n\n", $requirement->getHelpText());
+    }
+}
+
+function echo_title($title)
+{
+    echo "\n** $title **\n\n";
+}

+ 145 - 0
app/config/assetic.yml

@@ -0,0 +1,145 @@
+assetic:
+    debug:          false # %kernel.debug%
+    use_controller: false
+    read_from:      %kernel.root_dir%/../web
+    write_to:       %kernel.root_dir%/../web
+    bundles:        [] # disable bundles parsing
+
+    filters:
+        cssrewrite: ~
+        yui_js:  { jar: "%kernel.root_dir%/../bin/yuicompressor.jar" }
+        yui_css: { jar: "%kernel.root_dir%/../bin/yuicompressor.jar" }
+
+    assets:
+        # see http://sonata-project.org/blog/2012/5/15/assetic-package-configuration
+        #
+        sonata_jqueryui_js:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.core.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.widget.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.mouse.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.draggable.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.droppable.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.resizable.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.selectable.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.sortable.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.accordion.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.autocomplete.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.button.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.datepicker.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.dialog.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-blind.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-bounce.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-clip.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-drop.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-explode.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fade.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-fold.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-highlight.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-pulsate.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-scale.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-shake.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-slide.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.effect-transfer.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.menu.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.position.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.progressbar.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.slider.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.spinner.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.tabs.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/jquery.ui.tooltip.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/ui/i18n/jquery-ui-i18n.js
+
+            filters:
+                - yui_js
+
+        sonata_jqueryui_css:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/themes/base/jquery-ui.css
+
+            filters:
+                - cssrewrite
+                - yui_css
+
+        sonata_formatter_js:
+            inputs:
+                # do not uncomment this, ckeditor behave badly when compacted...
+                #- %kernel.root_dir%/../web/bundles/sonataformatter/vendor/ckeditor/ckeditor.js
+                - %kernel.root_dir%/../web/bundles/sonataformatter/vendor/markitup-markitup/markitup/jquery.markitup.js
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/markdown/set.js
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/html/set.js
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/textile/set.js
+
+            filters:
+                - yui_js
+
+        sonata_formatter_css:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/skins/sonata/style.css
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/markdown/style.css
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/html/style.css
+                - %kernel.root_dir%/../web/bundles/sonataformatter/markitup/sets/textile/style.css
+
+            filters:
+                - cssrewrite
+                - yui_css
+
+        sonata_admin_js:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jquery/dist/jquery.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jquery.scrollTo/jquery.scrollTo.js
+#                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js
+                - %kernel.root_dir%/../web/bundles/sonatacore/vendor/moment/min/moment.min.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/bootstrap/dist/js/bootstrap.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/js/bootstrap-editable.js
+                - %kernel.root_dir%/../web/bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/select2/select2.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/jquery/jquery.form.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/jquery/jquery.confirmExit.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/App.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/Admin.js
+
+            filters:
+                - yui_js
+
+        sonata_admin_css:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/AdminLTE/css/ionicons.min.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/AdminLTE/css/AdminLTE.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jqueryui/themes/flick/jquery-ui.min.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/select2/select2.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/select2/select2-bootstrap.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css
+                - %kernel.root_dir%/../web/bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/css/styles.css
+                - %kernel.root_dir%/../web/bundles/sonataadmin/css/layout.css
+
+            filters:
+                - cssrewrite
+                - yui_css
+
+        sonata_front_js:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/jquery/dist/jquery.js
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/bootstrap/dist/js/bootstrap.js
+                - %kernel.root_dir%/../web/bundles/sonataproduct/js/product.js
+                - %kernel.root_dir%/../web/bundles/sonatacore/js/base.js
+                - %kernel.root_dir%/../web/bundles/sonatacore/select2/select2.min.js
+                - %kernel.root_dir%/../web/bundles/sonatademo/js/demo.js
+
+            filters:
+                - yui_js
+
+        sonata_front_css:
+            inputs:
+                - %kernel.root_dir%/../web/bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css
+                - %kernel.root_dir%/../web/bundles/sonatacore/select2/select2.css
+                - %kernel.root_dir%/../web/bundles/mopabootstrap/css/datepicker.css
+                - %kernel.root_dir%/../web/bundles/sonatademo/css/demo.css
+
+            filters:
+                - cssrewrite
+                - yui_css

+ 227 - 0
app/config/config.yml

@@ -0,0 +1,227 @@
+imports:
+    - { resource: parameters.yml }
+    - { resource: security.yml }
+    - { resource: assetic.yml }
+
+    - { resource: @ChamiloLMSCoreBundle/Resources/config/admin.yml }
+
+    # Mopa Bootstrap
+    - { resource: mopa/mopa_bootstrap.yml }
+
+    # Knp Paginator
+    - { resource: knp/knp_paginator.yml }
+
+    # FriendOfSymfony Bundles
+    #- { resource: fos/fos_comment.yml }
+    - { resource: fos/fos_rest.yml }
+    - { resource: fos/fos_user.yml }
+    #- { resource: fos/fos_elastica.yml }
+    - { resource: fos/fos_message.yml }
+
+    # Sonata Core Bundles
+    - { resource: sonata/sonata_block.yml }
+    - { resource: sonata/sonata_formatter.yml }
+    - { resource: sonata/sonata_cache.yml }
+    #- { resource: sonata/sonata_seo.yml }
+    - { resource: sonata/sonata_timeline.yml }
+    - { resource: sonata/sonata_intl.yml }
+    - { resource: sonata/sonata_core.yml }
+
+    # Sonata Feature Bundles
+    - { resource: sonata/sonata_admin.yml }
+    - { resource: sonata/sonata_page.yml }
+    - { resource: sonata/sonata_media.yml }
+    - { resource: sonata/sonata_news.yml }
+    - { resource: sonata/sonata_user.yml }
+    - { resource: sonata/sonata_notification.yml }
+    - { resource: sonata/sonata_classification.yml }
+
+framework:
+    #esi:             ~
+    translator:      { fallback: "%locale%" }
+    secret:          "%secret%"
+    router:
+        resource: "%kernel.root_dir%/config/routing.yml"
+        strict_requirements: ~
+    form:            ~
+    csrf_protection: ~
+    validation:      { enable_annotations: true }
+    templating:
+        engines: ['twig']
+        #assets_version: SomeVersionScheme
+    default_locale:  "%locale%"
+    trusted_hosts:   ~
+    trusted_proxies: ~
+    session:
+        # handler_id set to null will use default session handler from php.ini
+        handler_id:  ~
+    fragments:       ~
+    http_method_override: true
+    session:
+        cookie_lifetime: 1440
+    http_method_override: true
+
+# Twig Configuration
+twig:
+    debug:            "%kernel.debug%"
+    strict_variables: "%kernel.debug%"
+
+    base_template_class: Sonata\CacheBundle\Twig\TwigTemplate14
+
+    form:
+        resources:
+            - 'SonataFormatterBundle:Form:formatter.html.twig'
+            - 'SonataMediaBundle:Form:media_widgets.html.twig'
+            - 'SonataCoreBundle:Form:datepicker.html.twig'
+    exception_controller: 'FOS\RestBundle\Controller\ExceptionController::showAction'
+
+    paths:
+      "%kernel.root_dir%/../src/ChamiloLMS/CoreBundle/Resources/views/default": template_style
+
+    globals:
+
+      show_toolbar: true
+      show_footer: true
+      software_name:
+      version:
+
+      session_teachers: 1
+      teachers: 1
+      news_counter:
+      news_list:
+      messages_count:
+      message_link:
+      is_profile_editable:
+      administrator_name:
+      plugin_footer_left:
+      plugin_footer_center:
+      plugin_content_bottom:
+      plugin_header_left:
+      plugin_header_center:
+      plugin_header_right:
+      plugin_header_main:
+      plugin_menu_bottom:
+      plugin_menu_top:
+      plugin_content_top:
+      plugin_footer_right:
+      footer_extra_content:
+      course_session_block:
+      show_course_shortcut:
+      show_course_navigation_menu:
+      actions:
+      header:
+      message:
+      welcome_to_course_block:
+
+# Assetic Configuration
+assetic:
+    debug:          "%kernel.debug%"
+    use_controller: false
+    bundles:        [ ]
+    #java: /usr/bin/java
+    filters:
+        cssrewrite: ~
+        #closure:
+        #    jar: "%kernel.root_dir%/Resources/java/compiler.jar"
+        #yui_css:
+        #    jar: "%kernel.root_dir%/Resources/java/yuicompressor-2.4.7.jar"
+
+        lessphp:
+          file: %kernel.root_dir%/../vendor/oyejorge/less.php/lessc.inc.php
+          apply_to: "\.less$"
+        cssrewrite: ~
+
+#braincrafted_bootstrap:
+  #less_filter: lessphp
+
+# Doctrine Configuration
+doctrine:
+    dbal:
+        default_connection: default
+        connections:
+            default:
+                driver:   "%database_driver%"
+                host:     "%database_host%"
+                port:     "%database_port%"
+                dbname:   "%database_name%"
+                user:     "%database_user%"
+                password: "%database_password%"
+                charset:  UTF8
+        types:
+            json: Sonata\Doctrine\Types\JsonType
+            #currency: Sonata\Component\Currency\CurrencyDoctrineType
+    orm:
+
+        auto_generate_proxy_classes: "%kernel.debug%"
+        default_entity_manager: default
+        # auto_mapping: true
+        entity_managers:
+            default:
+                auto_mapping: true
+                mappings: ~
+
+        #metadata_cache_driver: apc  # default "array" "apc", "memcache", "memcached", "xcache"
+        #query_cache_driver: apc
+
+# Swiftmailer Configuration
+swiftmailer:
+    transport: "%mailer_transport%"
+    host:      "%mailer_host%"
+    username:  "%mailer_user%"
+    password:  "%mailer_password%"
+    spool:     { type: memory }
+
+jms_security_extra:
+    secure_all_services: false
+
+jms_serializer:
+    metadata:
+        directories:
+            - { path: %kernel.root_dir%/../vendor/sonata-project/user-bundle/Resources/config/serializer/FOSUserBundle, namespace_prefix: 'FOS\UserBundle' }
+            #- { path: %kernel.root_dir%/../vendor/sonata-project/ecommerce/src/BasketBundle/Resources/config/serializer/Component, namespace_prefix: 'Sonata\Component\Basket' }
+            - { path: %kernel.root_dir%/../vendor/sonata-project/datagrid-bundle/Resources/config/serializer, namespace_prefix: 'Sonata\DatagridBundle' }
+
+knp_menu:
+    twig:  # use "twig: false" to disable the Twig extension and the TwigRenderer
+        template: knp_menu.html.twig
+    templating: false # if true, enables the helper for PHP templates
+    default_renderer: twig # The renderer to use, list is also available by default
+
+# %kernel.root_dir%/DoctrineMigrations
+doctrine_migrations:
+    dir_name: %kernel.root_dir%/../vendor/chamilo/chash/src/Chash/Migrations
+    namespace: Chash\Migrations
+    table_name: chamilo_migration_versions
+    name: Chamilo Migrations
+
+fos_advanced_encoder:
+    encoders:
+        FOS\UserBundle\Model\UserInterface: sha512
+        legacy_encoder:
+            id: chamilolms.userbundle.encoder
+
+sonata_admin:
+    title:      ChamiloLMS
+    title_logo: apple-touch-icon.png
+
+nelmio_api_doc: ~
+
+sensio_framework_extra:
+    view:    { annotations: false }
+    router:  { annotations: true }
+    request:
+        converters: true
+
+# Doctrine extensions configuration
+stof_doctrine_extensions:
+    default_locale: "%locale%"
+    translation_fallback: true
+    orm:
+        default:
+            tree: true
+            timestampable: true
+            sluggable: true
+
+avanzu_admin_theme:
+    bower_bin: /usr/bin/bower # that's the default value
+

+ 55 - 0
app/config/config_dev.yml

@@ -0,0 +1,55 @@
+imports:
+    - { resource: config.yml }
+
+framework:
+    router:   { resource: "%kernel.root_dir%/config/routing_dev.yml" }
+    profiler: { only_exceptions: false }
+
+web_profiler:
+    toolbar: true
+    intercept_redirects: false
+
+monolog:
+    handlers:
+        main:
+            type:   stream
+            path:   "%kernel.logs_dir%/%kernel.environment%.log"
+            level:  debug
+#        console:
+#            type:   console
+#            bubble: false
+        # uncomment to get logging in your browser
+        # you may have to allow bigger header sizes in your Web server configuration
+        #firephp:
+        #    type:   firephp
+        #    level:  info
+        #chromephp:
+        #    type:   chromephp
+        #    level:  info
+
+assetic:
+    use_controller: true
+
+#swiftmailer:
+#    delivery_address: me@example.com
+
+
+web_profiler_extra:
+    routing:
+        enabled:        true
+        display_in_wdt: true
+    container:
+        enabled:        true
+        display_in_wdt: true
+    assetic:
+        enabled:        true
+        display_in_wdt: true
+    twig:
+        enabled:        true
+        display_in_wdt: true
+
+services:
+    twig.extension.debug:
+        class: Twig_Extensions_Extension_Debug
+        tags:
+            - { name: twig.extension }

+ 25 - 0
app/config/config_prod.yml

@@ -0,0 +1,25 @@
+imports:
+    - { resource: config.yml }
+
+#framework:
+#    validation:
+#        cache: apc
+
+#doctrine:
+#    orm:
+#        metadata_cache_driver: apc
+#        result_cache_driver: apc
+#        query_cache_driver: apc
+
+monolog:
+    handlers:
+        main:
+            type:         fingers_crossed
+            action_level: error
+            handler:      nested
+        nested:
+            type:  stream
+            path:  "%kernel.logs_dir%/%kernel.environment%.log"
+            level: debug
+#        console:
+#            type:  console

+ 16 - 0
app/config/config_test.yml

@@ -0,0 +1,16 @@
+imports:
+    - { resource: config_dev.yml }
+
+framework:
+    test: ~
+    session:
+        storage_id: session.storage.mock_file
+    profiler:
+        collect: false
+
+web_profiler:
+    toolbar: false
+    intercept_redirects: false
+
+swiftmailer:
+    disable_delivery: true

+ 15 - 0
app/config/fos/fos_message.yml

@@ -0,0 +1,15 @@
+fos_message:
+    db_driver: orm
+
+    thread_class: ChamiloLMS\CoreBundle\Entity\Thread
+    message_class: ChamiloLMS\CoreBundle\Entity\Message
+
+fos_comment:
+    db_driver: orm
+    class:
+        model:
+            comment: ChamiloLMS\CoreBundle\Entity\Comment
+            thread: ChamiloLMS\CoreBundle\Entity\Thread
+
+assetic:
+    bundles: [ "FOSCommentBundle" ]

+ 12 - 0
app/config/fos/fos_rest.yml

@@ -0,0 +1,12 @@
+fos_rest:
+    param_fetcher_listener: true
+    body_listener:          true
+    format_listener:        true
+    view:
+        view_response_listener: force
+    body_converter:
+        enabled: false
+        validate: true
+    exception:
+        messages:
+            'Symfony\Component\HttpKernel\Exception\NotFoundHttpException': true

+ 26 - 0
app/config/fos/fos_user.yml

@@ -0,0 +1,26 @@
+fos_user:
+    db_driver:      orm # can be orm or odm
+    firewall_name:  main
+
+    # if you change the class configuration, please also alter the sonata_user.yml file
+    user_class:     Application\Sonata\UserBundle\Entity\User
+
+    group:
+        group_class:   Application\Sonata\UserBundle\Entity\Group
+        group_manager: sonata.user.orm.group_manager
+
+    service:
+        user_manager: sonata.user.orm.user_manager
+
+    registration:
+        form:
+            type:               fos_user_profile
+            handler:            fos_user.profile.form.handler.default
+            name:               fos_user_profile_form
+            validation_groups: [ProfileCustom]
+    profile:
+        form:
+            type:               fos_user_profile
+            handler:            fos_user.profile.form.handler.default
+            name:               fos_user_profile_form
+            validation_groups: [ProfileCustom]

+ 23 - 0
app/config/knp/knp_behat.yml

@@ -0,0 +1,23 @@
+#
+#  References :
+#      Behat - BDD framework            : http://docs.behat.org/bundle/index.html
+#      Mink - Web acceptance testing    : http://mink.behat.org/
+#
+
+mink:
+    base_url:   http://localhost/app_dev.php
+    show_cmd:   mate %%s
+
+
+#    default_session: sahi              # use Javascript engine
+    default_session: goutte            # use for real HTTP test (remote server)
+#    default_session: symfony           # use symfony http client, test local symfony project
+
+    goutte:
+        server_parameters:
+            host: http://localhost
+    sahi:
+        host:     x.local
+
+
+behat: ~

+ 11 - 0
app/config/knp/knp_paginator.yml

@@ -0,0 +1,11 @@
+knp_paginator:
+    page_range: 5                      # default page range used in pagination control
+    default_options:
+        page_name: page                # page query parameter name
+        sort_field_name: sort          # sort field query parameter name
+        sort_direction_name: direction # sort direction query parameter name
+        distinct: true                 # ensure distinct results, useful when ORM queries are using GROUP BY statements
+    template:
+        pagination: MopaBootstrapBundle:Pagination:sliding.html.twig     # sliding pagination controls template
+#        sortable: MopaBootstrapBundle:Pagination:sortable_link.html.twig # sort link template
+#        pagination: KnpPaginatorBundle:Pagination:twitter_bootstrap_v3_pagination.html.twig

+ 35 - 0
app/config/parameters.yml.dist

@@ -0,0 +1,35 @@
+parameters:
+    database_driver: pdo_mysql
+    database_host: 127.0.0.1
+    database_port: null
+    database_name: chamilo
+    database_user: root
+    database_password: root
+    mailer_transport: smtp
+    mailer_host: 127.0.0.1
+    mailer_user: null
+    mailer_password: null
+    locale: en
+    secret: ThisTokenIsNotSoSecretChangeIt
+    path.data: null
+    path.temp: null
+    path.courses: null
+    path.logs: null
+    security_key: null
+    password_encryption: sha1
+    deny_delete_users: false
+    login_as_forbidden_globally: false
+    name_order_conventions: null
+    sonata_admin.title: 'Chamilo LMS'
+    sonata_admin.logo_title: /bundles/sonataadmin/logo_title.png
+    sonata_news.blog_title: 'Campus blog'
+    sonata_news.blog_link: 'http://awesome-blog.ltd'
+    sonata_news.blog_description: 'My Awesome blog description'
+    sonata_news.salt: ThisTokenIsNotSoSecretChangeIt
+    sonata_news.comment.emails:
+        - mail@example.org
+    sonata_news.comment.email_from: no-reply@example.org
+    sonata_media.cdn.host: /uploads/media
+    sonata_user.google_authenticator.server: demo.sonata-project.org
+    sonata_page.varnish.command: 'if [ ! -r "/etc/varnish/secret" ]; then echo "VALID ERROR :/"; else varnishadm -S /etc/varnish/secret -T 127.0.0.1:6082 {{ COMMAND }} "{{ EXPRESSION }}"; fi;'
+

+ 55 - 0
app/config/routing.yml

@@ -0,0 +1,55 @@
+chamilo_lms_course:
+    resource: "@ChamiloLMSCourseBundle/Resources/config/routing.yml"
+    prefix:   /
+
+_front:
+    resource: routing_front.yml
+
+_admin:
+    resource: routing_admin.yml
+    prefix:   /admin
+
+_api:
+    resource: routing_api.yml
+    prefix:   /api
+
+fos_message:
+    resource: "@FOSMessageBundle/Resources/config/routing.xml"
+    prefix: /messages
+
+fos_comment_api:
+    type: rest
+    resource: "@FOSCommentBundle/Resources/config/routing.yml"
+    prefix: /api
+    defaults: { _format: html }
+
+avanzu_admin_profile:
+    path: /profile
+
+avanzu_admin_all_messages:
+    path: /messages/
+avanzu_admin_show_message:
+    path: /messages/{messageid}/
+avanzu_admin_all_notifications:
+    path: /notifications/
+avanzu_admin_show_notification:
+    path: /notifications/{notifyid}/
+avanzu_admin_all_tasks:
+    path: /tasks/
+avanzu_admin_show_task:
+    path: /tasks/{taskid}/
+avanzu_admin_logout:
+    path: /logout
+
+home:
+    path: /
+
+logout:
+    path: /logout
+
+login_check:
+    path: /login_check
+
+# Always at the end
+core_bundle:
+    resource: "@ChamiloLMSCoreBundle/Resources/config/routing.yml"

+ 14 - 0
app/config/routing_admin.yml

@@ -0,0 +1,14 @@
+# cross links between kernels
+admin:
+    resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
+
+_sonata_admin:
+    resource: .
+    type:     sonata_admin
+
+soanata_user_admin:
+    resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml'
+
+sonata_media_pixlr:
+    resource: '@SonataMediaBundle/Resources/config/routing/pixlr.xml'
+    prefix:   /admin/media

+ 58 - 0
app/config/routing_api.yml

@@ -0,0 +1,58 @@
+NelmioApiDocBundle:
+    resource:     "@NelmioApiDocBundle/Resources/config/routing.yml"
+    prefix:       /doc
+
+sonata_api_classification:
+    type:         rest
+    prefix:       /classification
+    resource:     "@SonataClassificationBundle/Resources/config/routing/api.xml"
+
+sonata_api_news:
+    type:         rest
+    prefix:       /news
+    resource:     "@SonataNewsBundle/Resources/config/routing/api.xml"
+
+sonata_api_media:
+    type:         rest
+    prefix:       /media
+    resource:     "@SonataMediaBundle/Resources/config/routing/api.xml"
+
+sonata_api_notification:
+    type:         rest
+    prefix:       /notification
+    resource:     "@SonataNotificationBundle/Resources/config/routing/api.xml"
+
+#sonata_api_ecommerce_product:
+#    type:         rest
+#    prefix:       /ecommerce
+#    resource:     "@SonataProductBundle/Resources/config/routing/api.xml"
+#
+#sonata_api_ecommerce_order:
+#    type:         rest
+#    prefix:       /ecommerce
+#    resource:     "@SonataOrderBundle/Resources/config/routing/api.xml"
+#
+#sonata_api_ecommerce_invoice:
+#    type:         rest
+#    prefix:       /ecommerce
+#    resource:     "@SonataInvoiceBundle/Resources/config/routing/api.xml"
+#
+#sonata_api_ecommerce_customer:
+#    type:         rest
+#    prefix:       /ecommerce
+#    resource:     "@SonataCustomerBundle/Resources/config/routing/api.xml"
+#
+#sonata_api_ecommerce_basket:
+#    type:         rest
+#    prefix:       /ecommerce
+#    resource:     "@SonataBasketBundle/Resources/config/routing/api.xml"
+
+sonata_api_page:
+    type:         rest
+    prefix:       /page
+    resource:     "@SonataPageBundle/Resources/config/routing/api.xml"
+
+sonata_api_user:
+    type:         rest
+    prefix:       /user
+    resource:     "@SonataUserBundle/Resources/config/routing/api.xml"

+ 14 - 0
app/config/routing_dev.yml

@@ -0,0 +1,14 @@
+_main:
+    resource: routing.yml
+
+#_assetic:
+#    resource: .
+#    type:     assetic
+
+_wdt:
+    resource: "@WebProfilerBundle/Resources/config/routing/wdt.xml"
+    prefix:   /_wdt
+
+_profiler:
+    resource: "@WebProfilerBundle/Resources/config/routing/profiler.xml"
+    prefix:   /_profiler

+ 83 - 0
app/config/routing_front.yml

@@ -0,0 +1,83 @@
+# these 2 references : sonata_demo and sonata_qa can be safely removed
+#sonata_demo:
+#    resource: "@SonataDemoBundle/Resources/config/routing/demo.xml"
+#
+#sonata_qa:
+#    resource: "@SonataQABundle/Resources/config/routing/qa.xml"
+
+sonata_user_security:
+    resource: "@SonataUserBundle/Resources/config/routing/sonata_security_1.xml"
+
+sonata_user_resetting:
+    resource: "@SonataUserBundle/Resources/config/routing/sonata_resetting_1.xml"
+    prefix: /resetting
+
+sonata_user_profile:
+    resource: "@SonataUserBundle/Resources/config/routing/sonata_profile_1.xml"
+    prefix: /profile
+
+sonata_user_register:
+    resource: "@SonataUserBundle/Resources/config/routing/sonata_registration_1.xml"
+    prefix: /register
+
+sonata_user_change_password:
+    resource: "@SonataUserBundle/Resources/config/routing/sonata_change_password_1.xml"
+    prefix: /profile
+
+sonata_cache_cache:
+    resource: '@SonataCacheBundle/Resources/config/routing/cache.xml'
+    prefix: /
+
+sonata_page_cache:
+    resource: '@SonataPageBundle/Resources/config/routing/cache.xml'
+    prefix: /
+
+sonata_page_exceptions:
+    resource: '@SonataPageBundle/Resources/config/routing/exceptions.xml'
+    prefix: /page
+
+sonata_media_gallery:
+    resource: '@SonataMediaBundle/Resources/config/routing/gallery.xml'
+    prefix: /media/gallery
+
+sonata_media_media:
+    resource: '@SonataMediaBundle/Resources/config/routing/media.xml'
+    prefix: /media
+#
+#sonata_customer:
+#    resource: @SonataCustomerBundle/Resources/config/routing/customer.xml
+#    prefix: /shop/user
+#
+#sonata_basket:
+#    resource: @SonataBasketBundle/Resources/config/routing/basket.xml
+#    prefix: /shop/basket
+#
+#sonata_order:
+#    resource: @SonataOrderBundle/Resources/config/routing/order.xml
+#    prefix: /shop/user/order
+#
+#sonata_product_catalog:
+#    resource: @SonataProductBundle/Resources/config/routing/catalog.xml
+#    prefix: /shop/catalog
+#
+#sonata_product:
+#    resource: @SonataProductBundle/Resources/config/routing/product.xml
+#    prefix: /shop/product
+#
+#sonata_payment:
+#    resource: @SonataPaymentBundle/Resources/config/routing/payment.xml
+#    prefix: /shop/payment
+#
+#sonata_invoice:
+#    resource: @SonataInvoiceBundle/Resources/config/routing/invoice.xml
+#    prefix: /shop/user/invoice
+
+blog:
+    resource: '@SonataNewsBundle/Resources/config/routing/news.xml'
+    prefix: /blog
+
+#fos_comment:
+#    type: rest
+#    resource: "@FOSCommentBundle/Resources/config/routing.yml"
+#    prefix: /comments
+#    defaults: { _format: html }

+ 87 - 0
app/config/security.yml

@@ -0,0 +1,87 @@
+security:
+    encoders:
+       FOS\UserBundle\Model\UserInterface:
+           id: chamilolms.userbundle.encoder
+
+    role_hierarchy:
+        ROLE_SONATA_ADMIN: ROLE_USER
+        ROLE_ADMIN:
+            - ROLE_SONATA_ADMIN
+            - ROLE_QUESTION_MANAGER
+            - ROLE_SESSION_MANAGER
+            - ROLE_TEACHER
+            - ROLE_DIRECTOR
+            - ROLE_JURY_PRESIDENT
+        ROLE_SUPER_ADMIN: [ROLE_SONATA_ADMIN, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
+
+        ROLE_GLOBAL_ADMIN: [ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
+
+        ROLE_RRHH: [ROLE_TEACHER]
+        ROLE_TEACHER: [ROLE_STUDENT]
+        ROLE_QUESTION_MANAGER: [ROLE_STUDENT, ROLE_QUESTION_MANAGER]
+        ROLE_SESSION_MANAGER: [ROLE_STUDENT, ROLE_SESSION_MANAGER, ROLE_ALLOWED_TO_SWITCH]
+        ROLE_STUDENT: [ROLE_STUDENT]
+        ROLE_ANONYMOUS: [ROLE_ANONYMOUS]
+
+    access_decision_manager:
+        strategy: unanimous
+
+    providers:
+        fos_userbundle:
+            id: fos_user.user_manager
+    firewalls:
+        dev:
+          pattern:  ^/(_(profiler|wdt)|css|images|js|admin/_(wdt|profiler)|api/_(wdt|profiler))/
+          security: false
+
+        admin:
+            pattern:            /admin(.*)
+            context:            user
+            form_login:
+                provider:       fos_userbundle
+                login_path:     /admin/login
+                use_forward:    false
+                check_path:     /admin/login_check
+                failure_path:   null
+            logout:
+                path:           /admin/logout
+            anonymous:          true
+
+        main:
+            pattern: .*
+            context: user
+            form_login:
+                provider: fos_userbundle
+                login_path:     /login
+                use_forward:    false
+                check_path:     /login_check
+                failure_path:   null
+                success_handler: listener.login_success_handler
+            logout:
+                path:   /logout
+                target: /
+                success_handler: listener.logout_success_handler
+                invalidate_session: false
+                handlers: ['sonata.page.cms_manager_selector']
+            anonymous:    true
+
+    access_control:
+        # URL of FOSUserBundle which need to be available to anonymous users
+        - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
+        - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
+        - { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
+
+        # Admin login page needs to be access without credential
+        - { path: ^/admin/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
+        - { path: ^/admin/logout$, role: IS_AUTHENTICATED_ANONYMOUSLY }
+        - { path: ^/admin/login_check$, role: IS_AUTHENTICATED_ANONYMOUSLY }
+
+        # Secured part of the site
+        # This config requires being logged for the whole site and having the admin role for the admin part.
+        # Change these rules to adapt them to your needs
+        - { path: ^/admin/, role: [ROLE_ADMIN, ROLE_SONATA_ADMIN] }
+        - { path: ^/profile/, role: IS_AUTHENTICATED_FULLY }
+        - { path: ^/.*, role: IS_AUTHENTICATED_ANONYMOUSLY }
+
+    acl:
+        connection: default

+ 129 - 0
app/config/sonata/sonata_admin.yml

@@ -0,0 +1,129 @@
+# more information can be found here http://sonata-project.org/bundles/admin
+
+sonata_admin:
+    # default value, change it to sonata.admin.security.handler.acl to use ACL
+    security:
+        handler: sonata.admin.security.handler.role
+
+    title:      %sonata_admin.title%
+    title_logo: %sonata_admin.logo_title%
+    options:
+        html5_validate: false # does not use html5 validation
+        pager_links: 5 # pager max links to display
+
+    templates:
+        # default global templates
+        # the layout template include javascript/stylesheet to the formatter bundle,
+        # if you don't need it use the default one: SonataAdminBundle::standard_layout.html.twig
+        #layout:  ApplicationSonataAdminBundle::layout.html.twig
+        layout:  SonataAdminBundle::standard_layout.html.twig
+        ajax:    SonataAdminBundle::ajax_layout.html.twig
+
+        # default value if done set, actions templates, should extends a global templates
+        list:    SonataAdminBundle:CRUD:list.html.twig
+        show:    SonataAdminBundle:CRUD:show.html.twig
+        edit:    SonataAdminBundle:CRUD:edit.html.twig
+
+    dashboard:
+        blocks:
+            - { position: left, type: sonata.admin.block.admin_list }
+#            - { position: right, type: sonata.admin_doctrine_orm.block.audit}
+            - { position: center, type: sonata.block.service.text, settings: { content: "<h2>Welcome!</h2> You can customize this dashboard by editing the sonata_admin.yml file. The current dashboard presents the recent items from the NewsBundle and a timeline with the latest action"} }
+            - { position: center, type: sonata.timeline.block.timeline, settings: { context: SONATA_ADMIN, max_per_page: 25 }}
+            #- { position: center, type: sonata.news.block.recent_posts, settings: { title: Recent Posts, number: 7, mode: admin }}
+            - { position: left, type: sonata.block.service.text, settings: { content: "<div class='panel panel-default'><div class='panel-heading'><h3 class='panel-title'>Welcome!</h3></div><div class='panel-body'>You can customize this dashboard by editing the <code>sonata_admin.yml</code> file. The current dashboard presents the recent items from the NewsBundle and a non-statistical e-commerce information.</div></div>"} }
+            - { position: center, type: sonata.news.block.recent_comments, settings: { title: Recent Comments, number: 7, mode: admin }}
+            #- { position: right, type: sonata.order.block.recent_orders, settings: { title: Recent Orders, number: 5, mode: admin }}
+            #- { position: right, type: sonata.customer.block.recent_customers, settings: { title: Recent Customers, number: 5, mode: admin }}
+            #- { position: right, type: sonata.block.service.rss, settings: { title: Sonata Project's Feeds, url: http://sonata-project.org/blog/archive.rss }}
+
+        groups:
+#            sonata_page:
+#                items:
+#                    - sonata.page.admin.page
+            sonata.admin.group.content:
+                label:           sonata_content
+                label_catalogue: SonataDemoBundle
+                icon:            '<i class="fa fa-th"></i>'
+                items:
+                    #- sonata.page.admin.page
+                    - sonata.news.admin.comment
+                    - sonata.news.admin.post
+                    - sonata.media.admin.media
+                    - sonata.media.admin.gallery
+                    - sonata.comment.admin.thread
+            #sonata.admin.group.ecommerce:
+             #   label:           sonata_ecommerce
+              #  label_catalogue: SonataAdminBundle
+               # items:
+                #    - sonata.customer.admin.customer
+                 #   - sonata.invoice.admin.invoice
+                 #   - sonata.order.admin.order
+                  #  - sonata.product.admin.product
+            sonata.admin.group.classification:
+                label:           sonata_classification
+                label_catalogue: SonataClassificationBundle
+                icon:            '<i class="fa fa-sitemap"></i>'
+                items:
+                    - sonata.classification.admin.category
+                    - sonata.classification.admin.tag
+                    - sonata.classification.admin.collection
+            sonata.admin.group.site_builder:
+                label:           Site Builder
+                label_catalogue: SonataDemoBundle
+                icon:            '<i class="fa fa-puzzle-piece"></i>'
+                items:
+                    - sonata.page.admin.page
+                    - sonata.page.admin.site
+            sonata.admin.group.administration:
+                label:           sonata_administration
+                label_catalogue: SonataAdminBundle
+                icon:            '<i class="fa fa-cogs"></i>'
+                items:
+                    - sonata.user.admin.user
+                    - sonata.user.admin.group
+                    #- sonata.page.admin.site
+                    - sonata.page.admin.site
+                    - sonata.notification.admin.message
+            sonata.admin.group.lms:
+                label: LMS
+                icon:  '<i class="fa fa-play-circle"></i>'
+                label_catalogue: SonataAdminBundle
+                items:
+                    - sonata.admin.course
+                    - sonata.admin.session
+                    - sonata.admin.access_url
+
+    assets:
+        stylesheets:
+            # The sandbox includes default pre-optimized version of some css and js
+            # So you can either use them, and add your custom assets here
+            #   ~ or ~
+            # tweak the assetic.yml and the following lines
+            - assetic/sonata_admin_css.css
+            - assetic/sonata_formatter_css.css
+            - assetic/sonata_jqueryui_css.css
+            - bundles/sonatademo/css/demo.css
+
+            - bundles/sonataformatter/markitup/skins/sonata/style.css
+            - bundles/sonataformatter/markitup/sets/markdown/style.css
+            - bundles/sonataformatter/markitup/sets/html/style.css
+            - bundles/sonataformatter/markitup/sets/textile/style.css
+#            - bundles/sonataadmin/vendor/bootstrap/dist/css/bootstrap.min.css
+#            - bundles/sonataadmin/vendor/AdminLTE/css/font-awesome.min.css
+#            - bundles/sonataadmin/vendor/AdminLTE/css/ionicons.min.css
+#            - bundles/sonataadmin/vendor/AdminLTE/css/AdminLTE.css
+#            - bundles/sonataadmin/vendor/jqueryui/themes/flick/jquery-ui.min.css
+#            - bundles/sonataadmin/vendor/select2/select2.css
+#            - bundles/sonataadmin/vendor/select2/select2-bootstrap.css
+#            - bundles/sonataadmin/vendor/x-editable/dist/bootstrap3-editable/css/bootstrap-editable.css
+#            - bundles/sonataadmin/css/styles.css
+#            - bundles/sonataadmin/css/layout.css
+
+        javascripts:
+            - assetic/sonata_admin_js.js
+            - assetic/sonata_jqueryui_js.js
+            - assetic/sonata_formatter_js.js
+            - bundles/sonataformatter/vendor/ckeditor/ckeditor.js
+                    #- sonata.demo.admin.car
+                    #- sonata.demo.admin.engine

+ 85 - 0
app/config/sonata/sonata_block.yml

@@ -0,0 +1,85 @@
+sonata_block:
+    context_manager: sonata.page.block.context_manager
+    default_contexts: [sonata_page_bundle]
+
+    http_cache:
+            listener: true
+    menus:
+        "ChamiloLMSCoreBundle:MainMenuBuilder:mainMenu": "Main Menu"
+
+    blocks:
+        sonata.admin.block.admin_list:
+            contexts:   [admin]
+        sonata.timeline.block.timeline:
+            contexts:   [admin]
+        sonata.admin.block.search_result:
+            contexts:   [admin]
+
+        #sonata.admin_doctrine_orm.block.audit:
+        #    contexts:   [admin]
+
+        # Chamilo blocks
+        chamilolms.corebundle.block.course:
+        chamilolms.corebundle.block.breadcrumb:
+        chamilolms.corebundle.block.main_menu:
+
+        # Builtin Block
+        sonata.block.service.text:
+        sonata.block.service.container:
+        sonata.block.service.rss:
+        sonata.block.service.menu:
+        sonata.block.service.template:
+
+        # PageBundle's Blocks
+        sonata.page.block.container:
+            # cache: sonata.cache.memcached
+            # cache: sonata.cache.predis
+            # cache: sonata.page.cache.esi # if you are using the PageBundle
+            # cache: sonata.block.cache.esi # if you are using the BlockBundle without the PageBundle
+        sonata.page.block.children_pages:
+        sonata.page.block.breadcrumb:
+
+        # MediaBundle's Blocks
+        sonata.media.block.media:
+        sonata.media.block.gallery:
+        sonata.media.block.feature_media:
+
+        # NewsBundle's Blocks
+        sonata.news.block.recent_comments:
+        sonata.news.block.recent_posts:
+
+        # TimelineBundle's Blocks
+
+        sonata.timeline.block.timeline:
+        sonata.timeline.block.timeline:
+            contexts:   [admin]
+
+        # UserBundle's Blocks
+        sonata.user.block.account:
+            cache: sonata.page.cache.js_async
+            #cache: sonata.page.cache.esi
+            contexts: [user]
+        sonata.user.block.menu:
+            contexts: [user]
+
+        # SeoBundle's Blocks
+        sonata.seo.block.social.container:
+        sonata.seo.block.email.share_button:
+        sonata.seo.block.facebook.like_box:
+        sonata.seo.block.facebook.like_button:
+        sonata.seo.block.facebook.send_button:
+        sonata.seo.block.facebook.share_button:
+        sonata.seo.block.pinterest.pin_button:
+        sonata.seo.block.twitter.share_button:
+        sonata.seo.block.twitter.follow_button:
+        sonata.seo.block.twitter.hashtag_button:
+        sonata.seo.block.twitter.mention_button:
+        sonata.seo.block.twitter.embed:
+
+        sonata.demo.block.newsletter:
+
+
+        # Formatter
+        sonata.formatter.block.formatter:
+
+        sonata.seo.block.breadcrumb.homepage:

+ 33 - 0
app/config/sonata/sonata_cache.yml

@@ -0,0 +1,33 @@
+#
+# more information can be found here http://sonata-project.org/bundles/cache
+#
+#sonata_cache:
+#    caches:
+#        esi:
+#            servers:
+#                - varnishadm -T 127.0.0.1:2000 {{ COMMAND }} "{{ EXPRESSION }}"
+#
+#        ssi:
+#            token: TheToken
+#
+#        mongo:
+#            database:   cache
+#            collection: cache
+#            servers:
+#                - {host: 127.0.0.1, port: 27017, user: username, password: pASS'}
+#                - {host: 127.0.0.2}
+#
+#        memcached:
+#            prefix: test     # prefix to ensure there is no clash between instances
+#            servers:
+#                - {host: 127.0.0.1, port: 11211, weight: 0}
+#
+#        predis:
+#            servers:
+#                - {host: 127.0.0.1, port: 11211, database: 6379}
+#
+#        apc:
+#            token:  s3cur3   # token used to clear the related cache
+#            prefix: test     # prefix to ensure there is no clash between instances
+#            servers:
+#                - { domain: kooqit.local, ip: 127.0.0.1, port: 80}

+ 13 - 0
app/config/sonata/sonata_classification.yml

@@ -0,0 +1,13 @@
+sonata_classification:
+    # ...
+
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                #metadata_cache_driver: apc
+                #query_cache_driver: apc
+                #result_cache_driver: apc
+                mappings:
+                    ApplicationSonataClassificationBundle: ~
+                    SonataClassificationBundle: ~

+ 6 - 0
app/config/sonata/sonata_core.yml

@@ -0,0 +1,6 @@
+sonata_core:
+    flashmessage:
+        error:
+            css_class: danger
+        success:
+

+ 70 - 0
app/config/sonata/sonata_formatter.yml

@@ -0,0 +1,70 @@
+#
+# more information can be found here http://sonata-project.org/bundles/formatter
+#
+sonata_formatter:
+    formatters:
+        markdown:
+            service: sonata.formatter.text.markdown
+            extensions:
+                - sonata.formatter.twig.control_flow
+                - sonata.formatter.twig.gist
+                - sonata.media.formatter.twig
+
+        text:
+            service: sonata.formatter.text.text
+            extensions:
+                - sonata.formatter.twig.control_flow
+                - sonata.formatter.twig.gist
+                - sonata.media.formatter.twig
+        rawhtml:
+            service: sonata.formatter.text.raw
+            extensions:
+                - sonata.formatter.twig.control_flow
+                - sonata.formatter.twig.gist
+                - sonata.media.formatter.twig
+        richhtml:
+            service: sonata.formatter.text.raw
+            extensions:
+                - sonata.formatter.twig.control_flow
+                - sonata.formatter.twig.gist
+                - sonata.media.formatter.twig
+    ckeditor:
+        templates:
+            browser: 'SonataFormatterBundle:Ckeditor:browser.html.twig'
+            upload: 'SonataFormatterBundle:Ckeditor:upload.html.twig'
+
+# This section can be used to include the SonataMediaBundle with CKEDITOR
+#  => http://sonata-project.org/bundles/media/master/doc/reference/extra.html#ckeditor-integration
+#  there is also a configuration in the sonata_formatter section (see sonata_formatter.yml)
+ivory_ck_editor:
+    default_config: default
+    configs:
+        default:
+            filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser
+            filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser
+            # Display images by default when clicking the image dialog browse button
+            filebrowserImageBrowseRouteParameters:
+                provider: sonata.media.provider.image
+            filebrowserUploadRoute: admin_sonata_media_media_ckeditor_upload
+            filebrowserUploadRouteParameters:
+                provider: sonata.media.provider.file
+            # Upload file as image when sending a file from the image dialog
+            filebrowserImageUploadRoute: admin_sonata_media_media_ckeditor_upload
+            filebrowserImageUploadRouteParameters:
+                provider: sonata.media.provider.image
+                context: default # Optional, to upload in a custom context
+
+        news:
+            filebrowserBrowseRoute: admin_sonata_media_media_ckeditor_browser
+            filebrowserImageBrowseRoute: admin_sonata_media_media_ckeditor_browser
+            # Display images by default when clicking the image dialog browse button
+            filebrowserImageBrowseRouteParameters:
+                provider: sonata.media.provider.image
+            filebrowserUploadRoute: admin_sonata_media_media_ckeditor_upload
+            filebrowserUploadRouteParameters:
+                provider: sonata.media.provider.file
+            # Upload file as image when sending a file from the image dialog
+            filebrowserImageUploadRoute: admin_sonata_media_media_ckeditor_upload
+            filebrowserImageUploadRouteParameters:
+                provider: sonata.media.provider.image
+                context: news # Optional, to upload in a custom context

+ 12 - 0
app/config/sonata/sonata_intl.yml

@@ -0,0 +1,12 @@
+#
+# more information can be found here http://sonata-project.org/bundles/intl
+#
+sonata_intl:
+    locale: ~
+    timezone:
+        # if service is left blank, the chain detector will be used with detectors
+        # defined in the dedicated section
+        service:    ~
+        detectors:
+            - sonata.intl.timezone_detector.user    # default value if SonataUserBundle is available
+            - sonata.intl.timezone_detector.locale  # default value

+ 172 - 0
app/config/sonata/sonata_media.yml

@@ -0,0 +1,172 @@
+#
+# more information can be found here http://sonata-project.org/bundles/media
+#
+sonata_media:
+    db_driver:       doctrine_orm # | doctrine_mongodb
+    default_context: default
+    contexts:
+        default:  # the default context is mandatory
+            download:
+                mode: http # X-Sendfile | http
+            providers:
+                - sonata.media.provider.dailymotion
+                - sonata.media.provider.youtube
+                - sonata.media.provider.image
+                - sonata.media.provider.file
+                - sonata.media.provider.vimeo
+
+            formats:
+                small: { width: 100, quality: 100}
+                big:   { width: 970 , quality: 100}
+
+        news:
+            providers:
+                - sonata.media.provider.dailymotion
+                - sonata.media.provider.youtube
+                - sonata.media.provider.image
+
+            formats:
+                abstract: { width: 100, quality: 100}
+                wide:     { width: 820, quality: 100}
+
+        sonata_collection:
+            providers:
+              - sonata.media.provider.image
+
+            formats:
+                preview: { width: 100, quality: 100}
+                wide:    { width: 820, quality: 100}
+
+        sonata_category:
+            providers:
+              - sonata.media.provider.image
+
+            formats:
+                preview: { width: 100, quality: 100}
+                wide:    { width: 820, quality: 100}
+
+    cdn:
+        # define the public base url for the uploaded media
+        server:
+            path:      %sonata_media.cdn.host%
+
+    filesystem:
+        # define where the uploaded file will be stored
+        local:
+            directory:  %kernel.root_dir%/../web/uploads/media
+            create:     true
+
+    providers:
+        # ...
+        file:
+            # the resizer must be set to false, otherwhise this can delete icon files from the fs
+            resizer:    false
+        image:
+           thumbnail: sonata.media.thumbnail.format          # default value
+#           thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task
+#            thumbnail: sonata.media.thumbnail.liip_imagine    # use the LiipImagineBundle to resize the image
+        vimeo:
+            thumbnail: sonata.media.thumbnail.format          # default value
+#           thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task
+#           thumbnail: sonata.media.thumbnail.liip_imagine    # use the LiipImagineBundle to resize the image
+        youtube:
+            thumbnail: sonata.media.thumbnail.format          # default value
+#           thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task
+#           thumbnail: sonata.media.thumbnail.liip_imagine    # use the LiipImagineBundle to resize the image
+        dailymotion:
+            thumbnail: sonata.media.thumbnail.format          # default value
+#           thumbnail: sonata.media.thumbnail.consumer.format # can be used to dispatch the resize action to async task
+#           thumbnail: sonata.media.thumbnail.liip_imagine    # use the LiipImagineBundle to resize the image
+
+    pixlr:
+        enabled:  true
+        referrer: Demo - Sonata Project
+
+    resizer:
+        simple:
+#            mode:  outbound
+            mode:  inset
+
+#
+# The LiipImagineBundle can be used if you want to convert on demand an image
+# to a specific format. (ie a controller render the file)
+#    more information can be found here : https://github.com/liip/LiipImagineBundle
+#
+#liip_imagine:
+#    filter_sets:
+#
+#        # this configuration match the sonata_media configuration format definition
+#        sonata_product_preview:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [100, 100], mode: outbound }
+#
+#        sonata_product_small:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [200, 100], mode: outbound }
+#
+#        sonata_product_large:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [600, 100], mode: outbound }
+#
+#        news_abstract:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [100, 100], mode: outbound }
+#
+#        news_wide:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [820, 100], mode: outbound }
+#
+#        sonata_collection_preview:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [100, 100], mode: outbound }
+#
+#        sonata_collection_wide:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [820, 100], mode: outbound }
+#
+#        sonata_category_preview:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [100, 100], mode: outbound }
+#
+#        sonata_category_wide:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [820, 100], mode: outbound }
+#
+#        default_small:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [100, 100], mode: outbound }
+#
+#        default_big:
+#            quality: 75
+#            controller_action: 'SonataMediaBundle:Media:liipImagineFilter'
+#            filters:
+#                thumbnail: { size: [820, 70], mode: outbound }
+
+# Enable Doctrine to map the provided entities
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    ApplicationSonataMediaBundle: ~
+                    SonataMediaBundle: ~

+ 28 - 0
app/config/sonata/sonata_news.yml

@@ -0,0 +1,28 @@
+#
+# more information can be found here http://sonata-project.org/bundles/news
+#
+sonata_news:
+    title:        %sonata_news.blog_title%
+    link:         %sonata_news.blog_link%
+    description:  %sonata_news.blog_description%
+    salt:         %sonata_news.salt%
+
+    # permalink_generator: sonata.news.permalink.category # /party/new-year
+    permalink_generator: sonata.news.permalink.date # /2011/12/31/new-year
+
+    # comment options
+    comment:
+        notification:
+            emails:   %sonata_news.comment.emails%
+            from:     %sonata_news.comment.email_from%
+            template: 'SonataNewsBundle:Mail:comment_notification.txt.twig'
+
+
+# Enable Doctrine to map the provided entities
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    ApplicationSonataNewsBundle: ~
+                    SonataNewsBundle: ~

+ 36 - 0
app/config/sonata/sonata_notification.yml

@@ -0,0 +1,36 @@
+sonata_notification:
+    backend: sonata.notification.backend.postpone
+#    backend: sonata.notification.backend.doctrine
+#    backend: sonata.notification.backend.rabbitmq
+
+#    queues:
+#        default:
+#            queue: message
+#            routing_key: ''
+
+#    backends:
+#        doctrine:
+#            max_age:      86400     # max age in second
+#            pause:        500000    # delay in microseconds
+#            states:                 # raising errors level
+#                in_progress: 10
+#                error:       20
+#                open:        100
+#                done:        10000
+
+#        rabbitmq:
+#            exchange:     router
+#            connection:
+#                host:     localhost
+#                user:     guest
+#                pass:     guest
+#                port:     5672
+#                vhost:    /
+
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    SonataNotificationBundle: ~
+                    ApplicationSonataNotificationBundle: ~

+ 142 - 0
app/config/sonata/sonata_page.yml

@@ -0,0 +1,142 @@
+# more information can be found here http://sonata-project.org/bundles/page
+
+cmf_routing:
+    chain:
+        routers_by_id:
+            # enable the DynamicRouter with high priority to allow overwriting configured routes with content
+            #symfony_cmf_routing_extra.dynamic_router: 200
+            # enable the symfony default router with a lower priority
+            sonata.page.router: 150
+            router.default: 100
+
+sonata_page:
+    multisite: host_with_path_by_locale # host
+    use_streamed_response: false # set the value to false in debug mode or if the reverse proxy does not handle streamed response
+
+    ignore_uri_patterns:
+        - ^/admin(.*)
+        - ^/api/(.*)
+
+    ignore_route_patterns:
+        - (.*)admin(.*)     # ignore admin route, ie route containing 'admin'
+        - ^_(.*)            # ignore symfony routes
+        - login
+        - home
+        - homepage
+        - (.*)fos_user_(.*)
+
+    ignore_routes:
+        - sonata_page_cache_esi
+        - sonata_page_cache_ssi
+        - sonata_page_js_sync_cache
+        - sonata_page_js_async_cache
+        - sonata_cache_es
+        - sonata_cache_ssi
+        - sonata_cache_js_async
+        - sonata_cache_js_sync
+        - sonata_cache_apc
+
+    cache_invalidation:
+        service:  sonata.page.cache.invalidation.simple
+        recorder: sonata.page.cache.recorder
+        classes:
+            "Application\Sonata\PageBundle\Entity\Block": getId
+
+    # generate page css styles
+    assets:
+        stylesheets:
+            #- assetic/sonata_front_css.css
+
+        javascripts:
+            #- assetic/sonata_front_js.js
+
+    default_template: default
+    templates:
+        default:
+            #path: 'ApplicationSonataPageBundle::default_layout.html.twig'
+            path: 'ChamiloLMSCoreBundle::main_layout.html.twig'
+            name: 'default'
+            containers:
+                 header:
+                     name: Header
+                 content_top:
+                     name: Top content
+                 content:
+                     name: Main content
+                 content_bottom:
+                     name: Bottom content
+                 footer:
+                     name: Footer
+            matrix:
+                 layout: |
+                     HHHHHHHH
+                     TTTTTTTT
+                     CCCCCCCC
+                     BBBBBBBB
+                     FFFFFFFF
+
+                 mapping:
+                     H: header
+                     T: content_top
+                     C: content
+                     B: content_bottom
+                     F: footer
+
+        2columns:
+            #path: 'ApplicationSonataPageBundle::default_2columns_layout.html.twig'
+            path: 'ChamiloLMSCoreBundle::main_layout.html.twig'
+            name: '2 columns layout'
+            containers:
+                 header:
+                     name: Header
+                 content_top:
+                     name: Top content
+                 left_col:
+                     name: Left content
+                 rigth_col:
+                     name: Right content
+                 content_bottom:
+                     name: Bottom content
+                 footer:
+                     name: Footer
+            matrix:
+                 layout: |
+                     HHHHHHHH
+                     TTTTTTTT
+                     LLLLRRRR
+                     BBBBBBBB
+                     FFFFFFFF
+
+                 mapping:
+                     H: header
+                     T: content_top
+                     L: left_col
+                     R: rigth_col
+                     B: content_bottom
+                     F: footer
+
+    page_defaults:
+        homepage: { decorate: false, enabled: true }
+
+    caches:
+        esi:
+            token:    add an unique token here # default is a random value
+            version:  3                        # version 3 is the default on debian wheezy ...
+            servers:
+                - %sonata_page.varnish.command% # you need to adapt this line to work with your configuration
+
+        ssi:
+            token:    add an unique token here # default is a random value
+
+    catch_exceptions:
+        not_found: [404]    # render 404 page with "not_found" key (name generated: _page_internal_error_{key})
+        fatal:     [500]    # so you can use the same page for different http errors or specify specific page for each error
+
+# Enable Doctrine to map the provided entities
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    ApplicationSonataPageBundle: ~
+                    SonataPageBundle: ~

+ 45 - 0
app/config/sonata/sonata_seo.yml

@@ -0,0 +1,45 @@
+#
+# more information can be found here http://sonata-project.org/bundles/page
+#
+sonata_seo:
+    encoding:             UTF-8
+    page:
+        default:          sonata.seo.page.default
+        title:            Sonata Project
+        metas:
+            name:
+                keywords:             foo bar
+                description:          The description
+                robots:               index, follow
+
+            property:
+                # Facebook application settings
+                #'fb:app_id':          XXXXXX
+                #'fb:admins':          admin1, admin2
+
+                # Open Graph information
+                # see http://developers.facebook.com/docs/opengraphprotocol/#types or http://ogp.me/
+                'og:site_name':       Sonata Project Sandbox
+                'og:description':     A demo of the some rich bundles for your Symfony2 projects
+
+            http-equiv:
+                'Content-Type':         text/html; charset=utf-8
+                #'X-Ua-Compatible':      IE=EmulateIE7
+
+        head:
+            'xmlns':              http://www.w3.org/1999/xhtml
+
+    sitemap:
+        services:
+            - sonata.product.seo_iterator
+        doctrine_orm:
+            # media
+            - { connection: doctrine.dbal.default_connection, route: sonata_media_view, parameters: {id: null}, query: "SELECT id, updated_at as lastmod, 'weekly' as changefreq, '0.5' as prioriy FROM media__media WHERE enabled = true" }
+            # blog post
+            - { connection: doctrine.dbal.default_connection, route: sonata_news_view, parameters: {permalink: null}, query: "SELECT CONCAT_WS('/', YEAR(created_at), MONTH(created_at), DAY(created_at), slug) as permalink , updated_at as lastmod, 'weekly' as changefreq, '0.5' as prioriy FROM news__post WHERE enabled = 1 AND (publication_date_start IS NULL OR publication_date_start <= NOW())" }
+            # page - works only for one site, please adapt the code if required
+            - { connection: doctrine.dbal.default_connection, route: page_slug, parameters: {path: null}, query: "SELECT url as path, updated_at as lastmod, 'weekly' as changefreq, '0.5' as prioriy FROM page__snapshot WHERE route_name = 'page_slug' AND enabled = 1 AND (publication_date_start IS NULL OR publication_date_start <= NOW())" }
+            # product categories
+            - { connection: doctrine.dbal.default_connection, route: sonata_catalog_category, parameters: {category_id: null, category_slug: null}, query: "SELECT id as category_id, slug as category_slug, updated_at as lastmod, 'weekly' as changefreq, '0.5' as prioriy FROM classification__category WHERE enabled = true" }
+            # products
+            - { connection: doctrine.dbal.default_connection, route: sonata_product_view, parameters: {productId: null, slug: null}, query: "SELECT id as productId, slug, updated_at as lastmod, 'weekly' as changefreq, '0.5' as prioriy FROM product__product WHERE enabled = true" }

+ 21 - 0
app/config/sonata/sonata_timeline.yml

@@ -0,0 +1,21 @@
+spy_timeline:
+    drivers:
+        orm:
+            object_manager: doctrine.orm.entity_manager
+            classes:
+                query_builder: ~ # Spy\TimelineBundle\Driver\ORM\QueryBuilder\QueryBuilder
+                timeline:         Application\Sonata\TimelineBundle\Entity\Timeline
+                action:           Application\Sonata\TimelineBundle\Entity\Action
+                component:        Application\Sonata\TimelineBundle\Entity\Component
+                action_component: Application\Sonata\TimelineBundle\Entity\ActionComponent
+
+    filters:
+        data_hydrator:
+            priority:             20
+            service:              spy_timeline.filter.data_hydrator
+            filter_unresolved:    false
+            locators:
+                - spy_timeline.filter.data_hydrator.locator.doctrine_orm
+
+sonata_timeline:
+    manager_type: orm

+ 59 - 0
app/config/sonata/sonata_user.yml

@@ -0,0 +1,59 @@
+# if you change the class configuration, please also alter the fos_user.yml file
+doctrine:
+    orm:
+        entity_managers:
+            default:
+                mappings:
+                    FOSUserBundle: ~
+                    ApplicationSonataUserBundle: ~
+                    SonataUserBundle: ~
+sonata_user:
+    #admin:
+      #user:
+        #class:      Application\Sonata\UserBundle\Admin\UserAdmin
+
+    class:                  # Entity Classes
+        user:               Application\Sonata\UserBundle\Entity\User
+        group:              Application\Sonata\UserBundle\Entity\Group
+
+    security_acl:             false
+    table:
+        user_group:           fos_user_user_group
+
+    impersonating:
+        route:                page_slug
+        parameters:           { path: / }
+
+    google_authenticator:
+        server:               %sonata_user.google_authenticator.server%
+        enabled:              true
+
+    manager_type:             orm
+
+    profile:
+        dashboard:
+            blocks:
+                - { position: left, type: sonata.block.service.text, settings: { content: "<h2>Welcome!</h2> <p>This is a sample user profile dashboard, feel free to override it in the configuration! Want to make this text dynamic? For instance display the user's name? Create a dedicated block and edit the configuration!</p>"} }
+                #- { position: left, type: sonata.order.block.recent_orders, settings: { title: Recent Orders, number: 5, mode: public }}
+                - { position: right, type: sonata.timeline.block.timeline, settings: { max_per_page: 15 }}
+                - { position: right, type: sonata.news.block.recent_posts, settings: { title: Recent Posts, number: 5, mode: public }}
+                - { position: right, type: sonata.news.block.recent_comments, settings: { title: Recent Comments, number: 5, mode: public }}
+        menu:
+            - { route: 'sonata_user_profile_show', label: 'sonata_profile_title', domain: 'SonataUserBundle'}
+            - { route: 'sonata_user_profile_edit', label: 'link_edit_profile', domain: 'SonataUserBundle'}
+            #- { route: 'sonata_customer_addresses', label: 'link_list_addresses', domain: 'SonataCustomerBundle'}
+            #- { route: 'sonata_order_index', label: 'order_list', domain: 'SonataOrderBundle'}
+        form:
+            type:                 sonata_user_profile
+            handler:              sonata.user.profile.form.handler.default
+            name:                 sonata_user_profile_form
+            validation_groups:
+                - ProfileCustom
+
+        register:
+            form:
+                type:                 sonata_user_registration
+                handler:              sonata.user.registration.form.handler.default
+                name:                 sonata_user_registration_form
+                validation_groups:
+                  - ProfileCustom

+ 27 - 0
app/console

@@ -0,0 +1,27 @@
+#!/usr/bin/env php
+<?php
+
+// if you don't want to setup permissions the proper way, just uncomment the following PHP line
+// read http://symfony.com/doc/current/book/installation.html#configuration-and-setup for more information
+//umask(0000);
+
+set_time_limit(0);
+
+require_once __DIR__.'/bootstrap.php.cache';
+require_once __DIR__.'/AppKernel.php';
+
+use Symfony\Bundle\FrameworkBundle\Console\Application;
+use Symfony\Component\Console\Input\ArgvInput;
+use Symfony\Component\Debug\Debug;
+
+$input = new ArgvInput();
+$env = $input->getParameterOption(array('--env', '-e'), getenv('SYMFONY_ENV') ?: 'dev');
+$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(array('--no-debug', '')) && $env !== 'prod';
+
+if ($debug) {
+    Debug::enable();
+}
+
+$kernel = new AppKernel($env, $debug);
+$application = new Application($kernel);
+$application->run($input);

+ 0 - 0
vendor/braincrafted/bootstrap-bundle/Braincrafted/Bundle/BootstrapBundle/Tests/Command/fixtures/web/fonts/.gitkeep → app/logs/.gitkeep


+ 41 - 0
app/phpunit.xml.dist

@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- http://phpunit.de/manual/current/en/appendixes.configuration.html -->
+<phpunit
+    backupGlobals               = "false"
+    backupStaticAttributes      = "false"
+    colors                      = "true"
+    convertErrorsToExceptions   = "true"
+    convertNoticesToExceptions  = "true"
+    convertWarningsToExceptions = "true"
+    processIsolation            = "false"
+    stopOnFailure               = "false"
+    syntaxCheck                 = "false"
+    bootstrap                   = "bootstrap.php.cache" >
+
+    <testsuites>
+        <testsuite name="Project Test Suite">
+            <directory>../src/*/*Bundle/Tests</directory>
+            <directory>../src/*/Bundle/*Bundle/Tests</directory>
+        </testsuite>
+    </testsuites>
+
+    <!--
+    <php>
+        <server name="KERNEL_DIR" value="/path/to/your/app/" />
+    </php>
+    -->
+
+    <filter>
+        <whitelist>
+            <directory>../src</directory>
+            <exclude>
+                <directory>../src/*/*Bundle/Resources</directory>
+                <directory>../src/*/*Bundle/Tests</directory>
+                <directory>../src/*/Bundle/*Bundle/Resources</directory>
+                <directory>../src/*/Bundle/*Bundle/Tests</directory>
+            </exclude>
+        </whitelist>
+    </filter>
+
+</phpunit>

+ 1 - 0
bin/composer

@@ -0,0 +1 @@
+../vendor/composer/composer/bin/composer

+ 1 - 0
bin/doctrine

@@ -0,0 +1 @@
+../vendor/doctrine/orm/bin/doctrine

+ 1 - 0
bin/doctrine.php

@@ -0,0 +1 @@
+../vendor/doctrine/orm/bin/doctrine.php

+ 1 - 0
bin/jsonlint

@@ -0,0 +1 @@
+../vendor/seld/jsonlint/bin/jsonlint

+ 1 - 0
bin/lessc

@@ -0,0 +1 @@
+../vendor/oyejorge/less.php/bin/lessc

+ 1 - 0
bin/validate-json

@@ -0,0 +1 @@
+../vendor/justinrainbow/json-schema/bin/validate-json

+ 32 - 0
cli-config.php

@@ -0,0 +1,32 @@
+<?php
+
+$config = new \Doctrine\ORM\Configuration();
+$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
+
+use Doctrine\Common\Annotations\AnnotationReader;
+use Doctrine\Common\Annotations\AnnotationRegistry;
+
+$sysPath = __DIR__."/";
+
+AnnotationRegistry::registerFile($sysPath."vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
+$reader = new AnnotationReader();
+
+$driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($sysPath."tests/doctrine_console/mapping"));
+
+$config->setMetadataDriverImpl($driverImpl);
+$config->setProxyDir(__DIR__ . '/Proxies');
+$config->setProxyNamespace('Proxies');
+
+$defaultConnection = array(
+    'driver'    => 'pdo_mysql',
+    'dbname'    => 'chamilo',
+    'user'      => 'root',
+    'password'  => 'root',
+    'host'      => 'localhost',
+);
+
+
+$em = \Doctrine\ORM\EntityManager::create($defaultConnection, $config);
+
+use Doctrine\ORM\Tools\Console\ConsoleRunner;
+return ConsoleRunner::createHelperSet($em);

+ 129 - 75
composer.json

@@ -7,11 +7,10 @@
         "forum": "http://www.chamilo.org/forum",
         "irc": "irc://irc.freenode.org/chamilo"
     },
+
     "autoload": {
         "psr-0": {
-            "Entity" : "main/inc/",
-            "Gedmo": "vendor/gedmo/doctrine-extensions/lib",
-            "ChamiloLMS" : "src/"
+            "": "src/"
         },
         "classmap": [
             "main/auth",
@@ -27,90 +26,145 @@
             "main/survey"
         ]
     },
+
+    "minimum-stability": "stable",
     "repositories": [
         {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/phpqrcode"
-        },
-        {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/silex-pagerfanta-provider"
-        },
-        {
-            "type": "vcs",
-            "url": "https://github.com/jmontoyaa/XHProfServiceProvider"
+            "type": "package",
+            "package": {
+                "name": "jquery/jquery",
+                "version": "1.10.2",
+                "dist": {
+                    "url": "http://code.jquery.com/jquery-1.10.2.js",
+                    "type": "file"
+                }
+            }
         }
     ],
+
     "require": {
         "php": ">=5.3.3",
-        "silex/silex": "~1.1",
-        "symfony/console"  : "~2.3",
-        "symfony/twig-bridge": "~2.3",
-        "symfony/doctrine-bridge": "~2.3",
-        "symfony/security": "~2.3",
-        "symfony/form": "~2.3",
-        "symfony/property-access": "~2.3",
-        "symfony/validator": "~2.3",
-        "symfony/translation": "~2.3",
-        "symfony/dependency-injection": "~2.3",
-        "symfony/filesystem": "~2.3",
-        "symfony/finder": "~2.3",
-        "monolog/monolog" : ">=1.0.0",
-        "symfony/config": "~2.3",
-        "symfony/yaml": "~2.3",
-        "symfony/locale": "~2.3",
-        "symfony/monolog-bridge": "~2.3",
-        "twig/twig": ">=1.8,<2.0-dev",
-        "braincrafted/bootstrap-bundle": "dev-master",
-        "dflydev/doctrine-orm-service-provider": "1.0.*@dev",
+
+        "twig/twig": "~1.12",
+        "twig/extensions": "~1.0",
+
+        "symfony/symfony": "~2.5",
+
+        "symfony/assetic-bundle": "~2.3",
+        "symfony/swiftmailer-bundle": "~2.3",
+        "symfony/monolog-bundle": "~2.3",
+
+        "sensio/distribution-bundle": "~2.3",
+        "sensio/framework-extra-bundle": "~3.0.0",
+        "sensio/generator-bundle": "~2.3",
+
+        "jms/security-extra-bundle": "~1.5",
+        "jms/di-extra-bundle": "~1.4",
+        "jms/serializer-bundle": "~0.11",
+
+        "doctrine/orm": "2.4.2",
+        "doctrine/doctrine-bundle": "~1.3@dev",
+        "doctrine/doctrine-migrations-bundle": "dev-master",
         "doctrine/migrations": "dev-master",
+        "doctrine/doctrine-fixtures-bundle": "~2.2",
+        "doctrine/data-fixtures": "1.0.*@dev",
+
+        "symfony-cmf/routing-bundle": "~1.1",
+
+        "knplabs/gaufrette": "0.1.4",
+        "knplabs/knp-menu-bundle": "1.1.x-dev",
+
+        "sonata-project/easy-extends-bundle": "~2.1@dev",
+        "sonata-project/seo-bundle": "~1@dev",
+        "sonata-project/doctrine-extensions": "~1@dev",
+        "sonata-project/intl-bundle": "~2.2@dev",
+        "sonata-project/admin-bundle": "~2.3@dev",
+        "sonata-project/doctrine-orm-admin-bundle": "~2.3@dev",
+        "sonata-project/notification-bundle": "~2.2@dev",
+        "sonata-project/block-bundle": "~2.2@dev",
+        "sonata-project/media-bundle": "~2.3@dev",
+        "sonata-project/user-bundle": "~2.2@dev",
+        "sonata-project/cache-bundle": "~2.1@dev",
+        "sonata-project/cache": "~1.0@dev",
+        "sonata-project/page-bundle": "dev-master",
+        "sonata-project/core-bundle": "~2.2@dev",
+        "sonata-project/formatter-bundle": "~2.3@dev",
+        "sonata-project/news-bundle": "~2.3@dev",
+        "sonata-project/datagrid-bundle": "~2.2@dev",
+        "sonata-project/exporter": "~1.3@dev",
+        "sonata-project/timeline-bundle": "~2.2@dev",
+        "sonata-project/classification-bundle": "~2.2@dev",
+        "sonata-project/ecommerce": "dev-develop",
+        "sonata-project/comment-bundle": "~2.2@dev",
+
+        "friendsofsymfony/comment-bundle": "dev-master",
+
+        "dflydev/markdown": "~1.0",
+        "simplethings/entity-audit-bundle": "~0.5",
+        "willdurand/faker-bundle": "~1.0",
+
+        "mopa/bootstrap-bundle": "v3.0.0-beta3",
+        "twbs/bootstrap": "v3.0.0",
+
+        "stof/doctrine-extensions-bundle": "~1.1",
+        "stephpy/TimelineBundle": "~2.0@dev",
+        "stephpy/timeline": "~1.0@dev",
+
+        "incenteev/composer-parameter-handler": "~2.0",
+
         "gedmo/doctrine-extensions": "~2.3",
-        "swiftmailer/swiftmailer": ">=4.1.2,<4.2-dev",
-        "pagerfanta/pagerfanta": "dev-master",
-        "franmomu/silex-pagerfanta-provider": "1.0.*@dev",
-        "igorw/config-service-provider": "1.2.*@dev",
-        "mpdf/mpdf": "v5.6.1",
-        "ezyang/htmlpurifier": "v4.6.0",
-        "realityking/pchart": "dev-master",
-        "imagine/imagine": "0.6.*@dev",
-        "grom/silex-service-provider": "dev-master",
-        "knplabs/knp-menu": "2.0.*@dev",
-        "knplabs/knp-snappy": "dev-master",
-        "knplabs/console-service-provider": "dev-master",
-        "jmontoyaa/phpqrcode": "dev-master",
-        "neutron/silex-filesystem-provider": "dev-master",
+        "jquery/jquery":  "1.10.*",
+        "oyejorge/less.php": "~1.5",
+        "white-october/pagerfanta-bundle": "dev-master",
         "jbroadway/urlify": "1.0.0-stable",
-        "sensio/framework-extra-bundle": "~2.3",
-        "chamilo/chash": "dev-master",
-        "composer/composer": "1.0.0-alpha7",
-        "flint/flint": "1.6.0",
-        "icehero/silex-opauth": "dev-master",
-        "opauth/openid": "0.1.0",
-        "opauth/facebook": "0.2.1",
-        "opauth/google": "0.2.2",
-        "media-alchemyst/media-alchemyst": "0.4.4",
-        "php-ffmpeg/php-ffmpeg": "0.4.4",
-        "sunra/php-simple-html-dom-parser": "1.5.0",
-        "zendframework/zend-config": "~2.3",
-        "zendframework/zend-feed": "~2.3",
-        "zendframework/zend-http": "~2.3",
-        "zendframework/zend-servicemanager": "~2.3",
-        "sabre/vobject" : "~3.1",
-        "patchwork/utf8": "1.1.*"
+
+        "composer/composer": "1.0.*@dev",
+        "friendsofsymfony/advanced-encoder-bundle": "~1.0",
+        "hwi/oauth-bundle": "0.4.*@dev",
+        "friendsofsymfony/message-bundle": "~1.2",
+        "stof/doctrine-extensions-bundle": "~1.1@dev",
+        "avanzu/admin-theme-bundle": "dev-master",
+
+        "sylius/flow-bundle": "0.10.*@dev",
+        "liip/theme-bundle": "1.0.*@dev",
+        "chamilo/chash" : "dev-master"
     },
     "require-dev": {
-        "league/flysystem": "0.3.3",
-        "symfony/browser-kit": "~2.3",
-        "symfony/web-profiler-bundle": "~2.3",
-        "silex/web-profiler": "~1.0",
-        "natxet/CssMin": "dev-master",
-        "leafo/lessphp": "dev-master",
-        "mheap/silex-assetic": "1.0.*@dev",
-        "filp/whoops": "dev-master",
-        "jmontoyaa/xhprof-service-provider": "dev-master"
+        "elao/web-profiler-extra-bundle" : "~2.3@dev",
+        "lexik/maintenance-bundle": "dev-master"
     },
+
     "scripts": {
-        "post-install-cmd": "ChamiloLMS\\Composer\\Tasks::postInstall",
-        "post-update-cmd": "ChamiloLMS\\Composer\\Tasks::postUpdate"
+        "post-install-cmd": [
+            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
+        ],
+        "post-update-cmd": [
+            "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
+            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
+            "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
+        ]
+    },
+
+    "config": {
+        "bin-dir": "bin"
+    },
+
+    "extra": {
+        "symfony-app-dir": "app",
+        "symfony-web-dir": "web",
+        "incenteev-parameters": {
+            "file": "app/config/parameters.yml"
+        },
+        "branch-alias": {
+            "dev-master": "2.4-dev"
+        }
     }
 }

+ 0 - 114
config/auth.conf.dist.php

@@ -1,114 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-
-/**
- * Configuration file for all authentication methods. Uncomment and configure only the section(s) you need.
- * @package chamilo.conf.auth
- */
-
-/**
- * Facebook
- */
-
-/*
- * Decomment those lines and put your facebook app parameters here
- * Find them here : https://developers.facebook.com/apps/
- 
-$facebook_config = array(   'appId'         => 'APPID',
-                            'secret'        => 'secret app',
-                            'return_url'    => api_get_path(WEB_PATH).'?action=fbconnect'
-);
-*/
- 
-
-/**
- * Shibboleth
- */
-
-// $shibb_login = ...;
-
-/**
- * LDAP
- */
-
-
-
-/** 
- * Array of connection parameters
- **/
-$extldap_config = array(
-  //base dommain string
-  'base_dn' => 'DC=cblue,DC=be',
-  //admin distinguished name
-  'admin_dn' => 'CN=admin,dc=cblue,dc=be',
-  //admin password
-  'admin_password' => 'pass',
-  //ldap host
-  'host' => array('1.2.3.4', '2.3.4.5', '3.4.5.6'),
-  // filter
-//  'filter' => '', // no () arround the string
-  //'port' => , default on 389
-  //protocl version (2 or 3)
-  'protocol_version' => 3,
-  // set this to 0 to connect to AD server
-  'referrals' => 0,
-  //String used to search the user in ldap. %username will ber replaced by the username.
-  //See extldap_get_user_search_string() function below
-//  'user_search' => 'sAMAccountName=%username%',  // no () arround the string
-  'user_search' => 'uid=%username%',  // no () arround the string
-  //encoding used in ldap (most common are UTF-8 and ISO-8859-1
-  'encoding' => 'UTF-8',
-  //Set to true if user info have to be update at each login
-  'update_userinfo' => true
-);
-
-
-
-/**
- * Correspondance array between chamilo user info and ldap user info
- * This array is of this form : 
- *  '<chamilo_field> => <ldap_field>
- *
- * If <ldap_field> is "func", then the value of <chamilo_field> will be the return value of the function
- * extldap_get_<chamilo_field>($ldap_array)
- * In this cas you will have to declare the extldap_get_<chamilo_field> function
- *
- * If <ldap_field> is a string beginning with "!", then the value will be this string without "!"
- * 
- * If <ldap_field> is any other string then the value of <chamilo_field> will be 
- * $ldap_array[<ldap_field>][0]
- *
- * If <ldap_field> is an array then its value will be an array of values with the same rules as above
- * 
- **/
-$extldap_user_correspondance = array(
-    'firstname' => 'givenName',
-    'lastname' => 'sn',
-    'status' => 'func',
-    'admin' => 'func',
-    'email' => 'mail',
-    'auth_source' => '!extldap',
-    //'username' => ,
-    'language' => '!english',
-    'password' => '!PLACEHOLDER',
-    'extra' => array(
-    'title' => 'title',
-    'globalid' => 'employeeID',
-    'department' => 'department',
-    'country' => 'co',
-    'bu' => 'Company')
-);
-
-/**
- * OpenID
- */
-
-$langMainInfo = 'You may login to this site using an OpenID. You may add your OpenId URLs below, and also see a list of any OpenIDs which have already been added.';
-$langMainInfoDetail = '<p>OpenID is a secure way to use one user ID and password to log in to many web sites without special software, giving the same password to each site, or losing control over which information is shared with each site that you visit.</p>';
-$langMainInfoDetail .= '<p>Users can create accounts using their OpenID, assign one or more OpenIDs to an existing account, and log in using an OpenID. This lowers the barrier to registration, which is good for the site, and offers convenience and security to the users. Logging in via OpenID is far more secure than cross-site logins using drupal.module.</p>';
-$langMainInfoDetail .= '<p>More information on OpenID is available at <a href="http://openid.net">OpenID.net</a></p>';
-
-/**
- * CAS
- */
-//$cas = ...;

+ 0 - 134
config/configuration.dist.php

@@ -1,134 +0,0 @@
-<?php
-// Chamilo version {NEW_VERSION}
-// File generated by /install/index.php script - {DATE_GENERATED}
-/* For licensing terms, see /license.txt */
-/**
- *		Chamilo configuration
- *
- * This file contains a list of variables that can be modified by the campus
- * site's server administrator. Pay attention when changing these variables,
- * some changes may cause Chamilo to stop working.
- * If you changed some settings and want to restore them, please have a look at
- * configuration.dist.php. That file is an exact copy of the config file at
- * install time.
- */
-
-/**
- * $_configuration define only the bare essential variables
- * for configuring the platform (paths, database connections, ...).
- * Changing a $_configuration variable CAN generally break the installation.
- * Besides the $_configuration, a $_settings array also exists, that
- * contains variables that can be changed and will not break the platform.
- * These optional settings are defined in the database, now (table settings_current).
- */
-
-/**
- * Database settings
- */
-$_configuration = array();
-
-// Host.
-$_configuration['db_host']     = '{DATABASE_HOST}';
-// Port.
-$_configuration['db_port']     = '{DATABASE_PORT}';
-// Username.
-$_configuration['db_user']     = '{DATABASE_USER}';
-// Password.
-$_configuration['db_password'] = '{DATABASE_PASSWORD}';
-// Driver.
-$_configuration['db_driver']   = '{DATABASE_DRIVER}';
-// Database name.
-$_configuration['main_database'] = '{DATABASE_MAIN}';
-
-/** Directory settings */
-
-/** Chamilo will automatically manage the following paths */
-
-// Path to the data folder, example /var/www/chamilo/data
-//$_configuration['path.data'] = null;
-
-// Path to the temp folder, example /var/www/chamilo/data/temp
-//$_configuration['path.temp'] = null;
-
-// Path to the logs folder, example /var/www/chamilo/data/courses
-//$_configuration['path.courses'] = null;
-
-// Path to the logs folder, example /var/www/chamilo/logs
-//$_configuration['path.logs'] = null;
-
-/**
- *
- * Hosting settings - Allows you to set limits to the Chamilo portal when
- * hosting it for a third party. These settings can be overwritten by an
- * optionally-loaded extension file with only the settings (no comments).
- * The settings use an index at the first level to represent the ID of the
- * URL in case you use multi-url (otherwise it will always use 1, which is
- * the ID of the only URL inside the access_url table).
- */
-// Set a maximum number of users. Default (0) = no limit
-$_configuration[1]['hosting_limit_users'] = 0;
-// Set a maximum number of teachers. Default (0) = no limit
-$_configuration[1]['hosting_limit_teachers'] = 0;
-// Set a maximum number of courses. Default (0) = no limit
-$_configuration[1]['hosting_limit_courses'] = 0;
-// Set a maximum number of sessions. Default (0) = no limit
-$_configuration[1]['hosting_limit_sessions'] = 0;
-// Set a maximum disk space used, in MB (set to 1024 for 1GB, 5120 for 5GB).
-// Default (0) = no limit
-$_configuration[1]['hosting_limit_disk_space'] = 0;
-
-/**
- * Content Delivery Network (CDN) settings. Only use if you need a separate
- * server to serve your static data. If you don't know what a CDN is, you
- * don't need it. These settings are for simple Origin Pull CDNs and are
- * experimental. Enable only if you really know what you're doing.
- * This might conflict with multiple-access urls.
- */
-// Set the following setting to true to start using the CDN
-$_configuration['cdn_enable'] = false;
-// The following setting will be ignored if the previous one is set to false
-$_configuration['cdn'] = array(
-    //You can define several CDNs and split them by extensions
-    //Replace the following by your full CDN URL, which should point to
-    // your Chamilo's root directory. DO NOT INCLUDE a final slash! (won't work)
-    'http://cdn.chamilo.org' => array('.css','.js','.jpg','.jpeg','.png','.gif','.avi','.flv'),
-    // copy the line above and modify following your needs
-);
-
-/**
- * Session settings
- */
-// You may have to restart your web server if you change this.
-$_configuration['session_stored_in_db'] = false;
-// Session lifetime
-$_configuration['session_lifetime'] = SESSION_LIFETIME;
-
-/** Security */
-// Security word for password recovery.
-$_configuration['security_key'] = '{SECURITY_KEY}';
-// Hash function method.
-$_configuration['password_encryption'] = '{ENCRYPT_PASSWORD}';
-//Deny the elimination of users.
-$_configuration['deny_delete_users'] = false;
-//Prevent all admins from using the "login_as" feature.
-$_configuration['login_as_forbidden_globally'] = false;
-
-/** Multiple URL */
-// Activation for multi-url access.
-//$_configuration['multiple_access_urls'] = true;
-
-/** Chamilo version settings */
-$_configuration['system_version']    = '{NEW_VERSION}';
-$_configuration['system_stable']     = NEW_VERSION_STABLE;
-$_configuration['software_name']     = 'Chamilo';
-$_configuration['software_url']	     = 'http://www.chamilo.org/';
-
-/** Chamilo dev settings */
-// Generate twig templates in every request, prompts SQL errors.
-$_configuration['debug']             = false;
-$_configuration['platform_charset']  = 'utf-8';
-// Show a useful toolbar with memory used, loaded time, request, session, logs information.
-$_configuration['show_profiler']     = false;
-$_configuration['name_order_conventions'] = array();
-
-return $_configuration;

+ 0 - 66
config/events.conf.dist.php

@@ -1,66 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-
-/**
- * Events' configuration
- * Used to configure each event and to link them to functions the event'll fire.
- * The flow is like the following :
- * 1. somewhere in the application an event is fired
- * 2. that event is intercepted by the switch EventsDispatcher
- * 3. that switch will go all over the "actions" in the event_config initialized beneath us according to the event
- * 4. that switch will see if the function actually exists (if not, we get dont do anything)
- * 5. then it will see if a filter for that function exists (if it does, the filter is executed)
- * 6. if the filter says it's ok, the function linked to the event is executed
- * 7. and that function will actually call the truly interesting function with the good require_once
- */
-global $event_config;
-
-$event_config = array(
-    'portal_homepage_edited' => array( // key for "user registration" event
-        'actions' => array( // we link this event to a bunch of functions that will be triggered when the event is fired
-            'event_send_mail' // don't forget to actually write this function in the events.lib.php file
-        ),
-        'self_sent' => false, // this key states that we can't add user to this event through the admin panel
-        'name_lang_var' => 'PortalHomepageEdited',
-        'desc_lang_var' => 'PortalHomepageEdited',
-        'available_keyvars' => array (// keys used for the mail template
-            'url'           => 'portal',
-            'sitename'      => 'sitename',
-            'firstname'     => 'firstname',
-            'lastname'      => 'lastname',
-            'username'      => 'username',
-            'usermail'      => 'usermail',
-            'password'      => 'password',
-            'user_lang'     => 'language',
-            'admin_name'    => 'administrator_name',
-            'admin_surname' => 'administrator_surname',
-            'admin_phone'   => 'administrator_phone',
-            'admin_email'   => 'administrator_email',
-        )
-    ),
-    'user_registration' => array( // key for "user registration" event
-        'actions' => array( // we link this event to a bunch of functions that will be triggered when the event is fired
-            'event_send_mail' // don't forget to actually write this function in the events.lib.php file
-        ),
-        'self_sent' => true, // this key states that we can't add user to this event through the admin panel
-        'name_lang_var' => 'UserRegistrationTitle',
-        'desc_lang_var' => 'UserRegistrationComment',
-        'available_keyvars' => array (// keys used for the mail template
-            'url'           => 'portal',
-            'sitename'      => 'sitename',
-            'firstname'     => 'firstname',
-            'lastname'      => 'lastname',
-            'username'      => 'username',
-            'usermail'      => 'usermail',
-            'password'      => 'password',
-            'user_lang'     => 'language',
-            'admin_name'    => 'administrator_name',
-            'admin_surname' => 'administrator_surname',
-            'admin_phone'   => 'administrator_phone',
-            'admin_email'   => 'administrator_email',
-        )
-    ),
-);
-
-
-//@include 'events.conf.local.php';

+ 0 - 16
config/mail.conf.dist.php

@@ -1,16 +0,0 @@
-<?php
-
-/**
- *	This file holds the email configuration settings
- *	@package chamilo.configuration
- */
-
-$platform_email['SMTP_FROM_EMAIL']   = (isset($administrator['email'])?$administrator['email']:'admin@example.com');
-$platform_email['SMTP_FROM_NAME']    = (isset($administrator['name'])?$administrator['name']:'Admin');
-$platform_email['SMTP_HOST']         = 'localhost';
-$platform_email['SMTP_PORT']         = 25;
-$platform_email['SMTP_MAILER']       = 'mail'; // mail, sendmail or smtp
-$platform_email['SMTP_AUTH']         = 0;
-$platform_email['SMTP_USER']         = '';
-$platform_email['SMTP_PASS']         = '';
-$platform_email['SMTP_CHARSET']      = 'UTF-8';

+ 0 - 19
config/portfolio.conf.dist.php

@@ -1,19 +0,0 @@
-<?php
-
-/*
- * This file contains the portfolios configuration.
- * 
- * Portfolios are external applicatoins used to display and share files. The
- * portfolio configuration set up where files can be sent.
- * 
- * @see \Portfolio
- */
-
-$portfolios = array();
-
-//$_mahara_portfolio = new Portfolio\Mahara('http(s)://...');
-//$portfolios[] = $_mahara_portfolio;
-
-//$download_portfolio = new Portfolio\Download();
-//$download_portfolio->set_title(get_lang('Download'));
-//$portfolios[] = $download_portfolio;

+ 0 - 42
config/profile.conf.dist.php

@@ -1,42 +0,0 @@
-<?php
-
-/**
- *	This file holds the configuration constants and variables
- *	for the user profile tool.
- *
- *	@package chamilo.configuration
- */
-
-// Autentication, password
-define('CHECK_PASS_EASY_TO_FIND', false);
-
-$profileIsEditable = true;
-$profileIsReadable = true;
-
-// User photos
-define('PREFIX_IMAGE_FILENAME_WITH_UID', true); // If true, filename of images on server begin with uid of the user.
-define('RESIZE_IMAGE_TO_THIS_HEIGTH', 180);
-define('IMAGE_THUMBNAIL_WIDTH', 100);
-
-// Replacing user photos
-define('KEEP_THE_NAME_WHEN_CHANGE_IMAGE', true);
-	// true  -> the new image have the name of previous.
-	// false -> a new name is build for each upladed image.
-define('KEEP_THE_OLD_IMAGE_AFTER_CHANGE', true);
-	// true  -> if KEEP_THE_NAME_WHEN_CHANGE_IMAGE is true, the  previous image is rename before.
-	// false -> only the last image still on server.
-
-// Official code
-// Don't forget to change name of offical code in your organization
-// See $langOfficialCode within the language file 'registration'
-define('CONFVAL_ASK_FOR_OFFICIAL_CODE', true); // not used but name fixed
-define('CONFVAL_CHECK_OFFICIAL_CODE', false);
-/* if CONFVAL_CHECK_OFFICIAL_CODE is true, build here the
-function personal_check_official_code($code, $valueToReturnIfOk, $valueToReturnIfBad) {
-	return $stateOfficialCode = true;
-}
-*/
-
-// For stats
-define('NB_LINE_OF_EVENTS', 15);
-

+ 0 - 39
config/routing.yml

@@ -1,39 +0,0 @@
-secured_login_check:
-    pattern:   /secured/login_check
-
-secured_logout:
-    pattern:   /secured/logout
-
-logout:
-    pattern:   /secured/logout
-
-home:
-    path:      /
-    defaults:  { _controller: index.controller:indexAction, culture: en }
-
-index:
-    path:      /
-    defaults:  { _controller: index.controller:indexAction, culture: en }
-
-root:
-    path:      /
-    defaults:  { _controller: index.controller:indexAction, culture: en }
-
-homepage:
-    path:      /
-    defaults:  { _controller: index.controller:indexAction, culture: en }
-
-userportal:
-    path:      /
-    defaults:  { _controller: index.controller:userportalAction, culture: en }
-
-example:
-    resource: "src/ChamiloLMS/Resources/config/route_example.yml"
-    prefix:   /example-route
-
-javascript:
-    path:      /ChamiloLMS/js
-
-css:
-    path:      /ChamiloLMS/css
-

+ 0 - 183
console-config.php

@@ -1,183 +0,0 @@
-<?php
-
-/* For licensing terms, see /license.txt */
-
-$config = new \Doctrine\ORM\Configuration();
-$config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache);
-
-use Doctrine\Common\Annotations\AnnotationReader;
-use Doctrine\Common\Annotations\AnnotationRegistry;
-
-$sysPath = __DIR__."/";
-
-AnnotationRegistry::registerFile($sysPath."vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php");
-$reader = new AnnotationReader();
-
-$driverImpl = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver($reader, array($sysPath."tests/doctrine_console/mapping"));
-
-$config->setMetadataDriverImpl($driverImpl);
-$config->setProxyDir(__DIR__ . '/Proxies');
-$config->setProxyNamespace('Proxies');
-
-$courseList = CourseManager::get_real_course_list();
-
-$app['chamilo.log'] = $app['sys_log_path'].'chamilo-cli.log';
-
-// Loading db connections
-
-$connectionOptions = array();
-
-if (!empty($courseList)) {
-
-    $dbPrefix = isset($_configuration['db_prefix']) && !empty($_configuration['db_prefix']) ? $_configuration['db_prefix'].Database::get_database_glue() : null;
-    foreach ($courseList as $course) {
-        $connectionOptions['_chamilo_course_'.$course['db_name']] = array(
-            'driver'    => 'pdo_mysql',
-            'dbname'    => $dbPrefix.$course['db_name'],
-            'user'      => $_configuration['db_user'],
-            'password'  => $_configuration['db_password'],
-            'host'      => $_configuration['db_host'],
-        );
-    }
-}
-
-if (isset($_configuration['main_database'])) {
-    $connectionOptions['main_database'] = array(
-        'driver'    => 'pdo_mysql',
-        'dbname'    => $_configuration['main_database'],
-        'user'      => $_configuration['db_user'],
-        'password'  => $_configuration['db_password'],
-        'host'      => $_configuration['db_host'],
-    );
-}
-
-if (isset($_configuration['statistics_database'])) {
-    $connectionOptions['statistics_database'] = array(
-        'driver'    => 'pdo_mysql',
-        'dbname'    => $_configuration['statistics_database'],
-        'user'      => $_configuration['db_user'],
-        'password'  => $_configuration['db_password'],
-        'host'      => $_configuration['db_host'],
-    );
-} else {
-    if (isset($_configuration['main_database'])) {
-        $connectionOptions['statistics_database'] = $connectionOptions['main_database'];
-    }
-}
-
-if (isset($_configuration['user_personal_database'])) {
-    $connectionOptions['user_personal_database'] = array(
-        'driver'    => 'pdo_mysql',
-        'dbname'    => $_configuration['user_personal_database'],
-        'user'      => $_configuration['db_user'],
-        'password'  => $_configuration['db_password'],
-        'host'      => $_configuration['db_host'],
-    );
-} else {
-    if (isset($_configuration['main_database'])) {
-        $connectionOptions['user_personal_database'] = $connectionOptions['main_database'];
-    }
-}
-
-$defaultConnection = array(
-    'driver' => 'pdo_mysql'
-);
-
-if (isset($_configuration['main_database'])) {
-    $defaultConnection = array(
-        'driver'    => 'pdo_mysql',
-        'dbname'    => $_configuration['main_database'],
-        'user'      => $_configuration['db_user'],
-        'password'  => $_configuration['db_password'],
-        'host'      => $_configuration['db_host'],
-    );
-}
-
-$em = \Doctrine\ORM\EntityManager::create($defaultConnection, $config);
-
-//Fixes some errors
-$platform = $em->getConnection()->getDatabasePlatform();
-$platform->registerDoctrineTypeMapping('enum', 'string');
-$platform->registerDoctrineTypeMapping('set', 'string');
-
-$helpers = array(
-    'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
-    'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em),
-    'configuration' => new \Chash\Helpers\ConfigurationHelper()
-);
-
-use Doctrine\DBAL\DriverManager;
-$multipleEM = array();
-foreach ($connectionOptions as $name => $connection) {
-    $em = \Doctrine\ORM\EntityManager::create($connection, $config);
-    //$helpers[$name] = new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em);
-    $helpers[$name] = new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection());
-}
-
-/*
-To generate doctrine2 entities you must:
-
-cd /var/www/chamilo11/tests/doctrine_console
-
-Delete old mappings/entities
-
-sudo rm -R mapping generated repository
-
-Creating the mapping from the DB
-
-sudo mkdir mapping generated repository
-
-You can add a Namespace if you want to with: --namespace "Entity"
-sudo php5 doctrine.php orm:convert-mapping --force --from-database --namespace "Entity" annotation mapping
-
-
-1. Generate entities
-
-sudo php5 doctrine.php orm:generate-entities   --generate-annotations="true"   generated
-
-Validate schema
-sudo php5 doctrine.php orm:validate-schema -v
-
-Move generated files in a chamilo folder:
-
-sudo rm -R main/inc/Entity/*
-mkdir main/inc/Entity
-
-cp -R tests/doctrine_console/generated/* main/inc/Entity
-
-fixes \ORM bug see http://redgreenrefactor.blogsite.org/php/code-first-approaching-php-with-doctrine-2-2-1-and-composer/
-cd main/inc/Entity
-
-sed -i 's/@ORM\\/@/g' *.php
-
-For tests
-php5 tests/doctrine_console/doctrine.php orm:generate-entities   --generate-annotations="true"   main/inc/Entity
-
-Then autoload classes with composer
-sudo php5 composer.phar update or sudo composer.phar update
-
-2. Migrations
-
-a. Generate empty migration file
-cd /var/www/chamilo11/tests/doctrine_console
-
-php5 doctrine.php migrations:generate
-
-b. Check status
-
-php5 doctrine.php migrations:status
-
-c. Check sql
-php5 doctrine.php migrations:migrate --dry-run
-
-d. execute migration
-php5 doctrine.php migrations:migrate
-
-e. Revert migrations
-php5 doctrine.php  migrations:migrate 0
-
-
-http://docs.doctrine-project.org/projects/doctrine-migrations/en/latest/reference/managing_migrations.html
-
-*/
-

+ 0 - 93
console.php

@@ -1,93 +0,0 @@
-#!/usr/bin/env php
-<?php
-/* For licensing terms, see /license.txt */
-
-set_time_limit(0);
-
-if (PHP_SAPI != 'cli') {
-    die("Cannot be called by any other method than the command line.");
-}
-require_once __DIR__.'/vendor/autoload.php';
-
-$app = require_once dirname(__FILE__).'/src/ChamiloLMS/app.php';
-
-use Knp\Provider\ConsoleServiceProvider;
-
-$app->register(
-    new ConsoleServiceProvider(),
-    array(
-        'console.name'              => 'Chamilo CLI',
-        'console.version'           => '1.0.0',
-        'console.project_directory' => __DIR__.'/..'
-    )
-);
-
-
-// Variable $helperSet is defined inside cli-config.php
-//require __DIR__.'/console-config.php';
-//$cli = new \Symfony\Component\Console\Application('Chamilo CLI');
-
-// Adding commands.
-/** @var Knp\Console\Application $cli */
-$cli = $app['console'];
-
-$cli->setCatchExceptions(true);
-
-$helpers = array(
-    'configuration' => new Chash\Helpers\ConfigurationHelper()
-);
-$helperSet = $cli->getHelperSet();
-foreach ($helpers as $name => $helper) {
-    $helperSet->set($helper, $name);
-}
-
-$cli->addCommands(
-    array(
-        // DBAL Commands.
-        new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
-        new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
-
-        // ORM Commands.
-        new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
-        new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
-
-        // Migrations Commands.
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
-        new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(),
-
-        // Chamilo commands.
-
-        new ChamiloLMS\Command\Template\AsseticDumpCommand(),
-        new ChamiloLMS\Command\Translation\ExportLanguagesCommand(),
-
-        // Chash commands.
-        new Chash\Command\Database\RunSQLCommand(),
-        //new Chash\Command\Database\DumpCommand(),
-        //new Chash\Command\Database\RestoreCommand(),
-        new Chash\Command\Database\SQLCountCommand(),
-        new Chash\Command\Database\FullBackupCommand(),
-        //new Chash\Command\Database\DropDatabaseCommand(),
-
-        new Chash\Command\Files\CleanTempFolderCommand(),
-
-        new Chash\Command\Translation\ExportLanguageCommand(),
-        new Chash\Command\Translation\ImportLanguageCommand()
-    )
-);
-$cli->run();

+ 0 - 13
custompages/README

@@ -1,13 +0,0 @@
-CustomPages looks for alternatives in this directory, and displays them if present. The user-provided custom pages must exactly be named as such :
-
-- index-logged.php for the general landing page before login
-- index-unlogged.php for the general landing page when already logged-in
-- registration.php for the registration form
-- registration-feedback.php for the registration success feedback
-- lostpassword.php for the password recovery form
-- lostpassword-feedback.php for the password recovery feedback page
-
-Important note :
-Enable the use_custom_pages setting
-
-If you pull this feature from a repo, not through an upgrade or install process, you have to exectute the following SQL statements in the main database or this option won't appear in the admin interface :

+ 0 - 106
custompages/first_login.php

@@ -1,106 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * Quick page to react to first login cases
- * @package chamilo.custompages
- */
-/**
- * Initialization
- */
-require_once 'language.php';
-require_once dirname(__FILE__).'/../main/inc/global.inc.php';
-
-/**
- * Security checks
- */
-if (! isset($_SESSION['conditional_login']['uid']))
-  die("Not Authorised");
-
-if (isset($_POST['password'])) {
-  $u = UserManager::get_user_info_by_id($_SESSION['conditional_login']['uid']);
-  if ($_POST['password'] != $_POST['password2']) {
-    header('Location: '. api_get_self().'?invalid=2');
-    exit();
-  }
-  if (empty($_POST['password'])){ //|| !api_check_password($password)) { //Pass must be at least 5 char long with 2 digits and 3 letters
-    header('Location: '. api_get_self().'?invalid=1');
-    exit();
-  }
-  $password = $_POST['password'];
-  $updated = UserManager::update_user($u['user_id'], $u['firstname'], $u['lastname'], $u['username'], $password, $u['auth_source'], $u['email'], $u['status'], $u['official_code'], $u['phone'], $u['picture_uri'], $u['expiration_date'], $u['active'], $u['creator_id'], $u['hr_dept_id'], null, $u['language'],'');
-
-  if ($updated) {
-    UserManager::update_extra_field_value($u['user_id'], 'already_logged_in', 'true');
-    ConditionalLogin::login();
-  }
-}
-if ($_GET['invalid'] == 1) {
-  $error_message = get_lang('CurrentPasswordEmptyOrIncorrect');
-}
-if ($_GET['invalid'] == 2) {
-  $error_message = get_lang('PassTwo');
-}
-/**
- * HTML output
- */
-?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-	<title>Custompage - login</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<!--[if !IE 6]><!-->
-	<link rel="stylesheet" type="text/css" href="/custompages/style.css" />
-	<!--<![endif]-->
-	<!--[if IE 6]>
-	<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
-	<![endif]-->
-
-	<script type="text/javascript" src="/main/inc/lib/javascript/jquery.min.js"></script>
-	<script type="text/javascript">
-		$(document).ready(function() {
-			if (top.location != location)
-				top.location.href = document.location.href ;
-
-			// Handler pour la touche retour
-			$('input').keyup(function(e) {
-				if (e.keyCode == 13) {
-					$('#changepassword-form').submit();
-				}
-			});
-		});
-	</script>
-</head>
-<body>
-	<div id="backgroundimage">
-		<img src="/custompages/images/page-background.png" class="backgroundimage" />
-	</div>
-	<div id="wrapper">
-		<div id="header">
-			<img src="/custompages/images/header.png" alt="Logo" />
-		</div> <!-- #header -->
-    <h2> <?php echo custompages_get_lang('FirstLogin');?> </h2>
-
-		<div id="changepassword-form-box" class="form-box">
-      <div class="info"> <?php echo custompages_get_lang('FirstLoginChangePassword');?> </div>
-		<?php if (isset($error_message)) {
-			echo '<div id="changepassword-form-error" class="form-error">'.$error_message.'</div>';
-		}?>
-			<form id="changepassword-form" class="form" method="post">
-				<div>
-          <label for="password">*<?php echo custompages_get_lang('langPass');?></label>
-					<input name="password" type="password" /><br />
-          <label for="password2">*<?php echo custompages_get_lang('langPass');?></label>
-					<input name="password2" type="password" /><br />
-				</div>
-			</form>
-			<div id="changepassword-form-submit" class="form-submit" onclick="document.forms['changepassword-form'].submit();">
-      <span><?php echo custompages_get_lang('LoginEnter');?></span>
-			</div> <!-- #form-submit -->
-		</div> <!-- #form -->
-		<div id="footer">
-			<img src="/custompages/images/footer.png" />
-		</div> <!-- #footer -->
-	</div> <!-- #wrapper -->
-</body>
-</html>

BIN
custompages/images/footer.png


BIN
custompages/images/header.png


BIN
custompages/images/login-form-submit-bg.jpg


BIN
custompages/images/page-background.png


+ 0 - 16
custompages/index-logged.php

@@ -1,16 +0,0 @@
-<?php 
-/* For licensing terms, see /license.txt */
-/**
- * Redirect to normal Chamilo
- * @package chamilo.custompages
- */
-/**
- * Initialization
- */
-require_once(dirname(__FILE__).'/../main/inc/global.inc.php');
-
-$www = api_get_path('WEB_PATH');
-/**
- * Redirect
- */
-header("Location: $www/user_portal.php");

+ 0 - 109
custompages/index-unlogged.php

@@ -1,109 +0,0 @@
-<?php 
-/* For licensing terms, see /license.txt */
-/**
- * Redirect script
- * @package chamilo.custompages
- */
-/**
- * Initialization
- */
-//require_once('main/inc/global.inc.php'); 
-require_once('language.php');
-/**
- * Homemade micro-controller
- */
-if (isset($_GET['loginFailed'])){
-  if (isset($_GET['error'])) {
-    switch ($_GET['error']) {
-    case 'account_expired':
-      $error_message = custompages_get_lang('AccountExpired');
-      break;
-    case 'account_inactive':
-      $error_message = custompages_get_lang('AccountInactive');
-      break;
-    case 'user_password_incorrect':
-      $error_message = custompages_get_lang('InvalidId');
-      break;
-    case 'access_url_inactive':
-      $error_message = custompages_get_lang('AccountURLInactive');
-      break;
-    default : 
-      $error_message = custompages_get_lang('InvalidId');
-    }
-  } else { 
-    $error_message = get_lang('InvalidId');
-  }
-}
-
-    $rootWeb = api_get_path('WEB_PATH');
-/**
- * HTML output
- */
-?>
-<html>
-<head>
-	<title>Custompage - login</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<!--[if !IE 6]><!-->
-	<link rel="stylesheet" type="text/css" href="<?php echo $rootWeb ?>custompages/style.css" />
-	<!--<![endif]-->
-	<!--[if IE 6]>
-	<link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
-	<![endif]-->
-
-	<script type="text/javascript" src="<?php echo $rootWeb ?>main/inc/lib/javascript/jquery.min.js"></script>
-        
-	<script type="text/javascript">
-		$(document).ready(function() {
-			if (top.location != location) 
-				top.location.href = document.location.href ;
-
-			// Handler pour la touche retour
-			$('input').keyup(function(e) { 
-				if (e.keyCode == 13) {
-					$('#login-form').submit();
-				}
-			});
-		});
-	</script>
-</head>
-<body>
-	<div id="backgroundimage">
-		<img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/page-background.png" class="backgroundimage" />
-	</div>
-	<div id="wrapper">
-		<div id="header">
-			<img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/header.png" alt="Logo" />
-		</div> <!-- #header -->
-		<div id="login-form-box" class="form-box">
-      <div id="login-form-info" class="form-info">
-        <?php if (isset($content['info']) && !empty($content['info'] )) {
-          echo $content['info'];
-        }?>
-      </div>
-		<?php if (isset($error_message)) {
-			echo '<div id="login-form-info" class="form-error">'.$error_message.'</div>';
-		}?> 
-			<form id="login-form" class="form" action="<?php echo api_get_path(WEB_PATH)?>index.php" method="post">
-				<div>
-        <label for="login">*<?php echo custompages_get_lang('User');?></label>
-					<input name="login" type="text" /><br />
-          <label for="password">*<?php echo custompages_get_lang('langPass');?></label>
-					<input name="password" type="password" /><br />
-				</div>
-			</form>
-			<div id="login-form-submit" class="form-submit" onclick="document.forms['login-form'].submit();">
-      <span><?php echo custompages_get_lang('LoginEnter');?></span>
-			</div> <!-- #form-submit -->
-			<div id="links">
-      <a href="<?php echo api_get_path(WEB_PATH)?>main/auth/inscription.php"><?php echo custompages_get_lang('langReg')?></a><br />
-      <a href="<?php echo api_get_path(WEB_PATH)?>main/auth/lostPassword.php"><?php echo custompages_get_lang('langLostPassword')?></a>
-			</div>
-		</div> <!-- #form -->
-		<div id="footer">
-			<img src="<?php echo api_get_path(WEB_PATH)?>/custompages/images/footer.png" />
-		</div> <!-- #footer -->
-	</div> <!-- #wrapper -->
-        
-</body>
-</html>

+ 0 - 80
custompages/language.inc.php

@@ -1,80 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * CustomPages : Browser language detection
- * Include this file in your custom page if you want to set the language variable of the Chamilo session to the best pick according to the visitor's browser's options.
- * 2011, Jean-Karim Bockstael, CBlue <jeankarim@cblue.be>
- * This requires the Chamilo system to be initialized
- * (note that it's easier to do the following include in the parent page)
- * @package chamilo.custompages
- */
-/**
- * Returns the best match between available languages and visitor preferences
- * @return string the best match as 2-chars code, null when none match
-*/
-function get_preferred_language($available_langs) {
-    // Parsing the Accept-languages HTTP header
-    $langs = array();
-    foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) {
-        $rawlang = explode(';q=', $httplang);
-        if (strpos($rawlang[0], '-') !== FALSE) {
-            // We ignore the locale part, as in en-GB vs en-US
-            $rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-'));
-        }
-        if (count($rawlang) == 1) {
-            $rawlang[1] = 1.0; // The absence of weighting means a weight of 1 (max)
-        }
-        $langs[$rawlang[1]][] = $rawlang[0];
-    }
-    krsort($langs, SORT_NUMERIC);
-    // Choosing the best match
-    foreach($langs as $weight => $codes) {
-		foreach ($codes as $code) {
-        	if (in_array($code, $available_langs)) {
-            	return $code;
-        	}
-		}
-    }
-    // No match
-    return null;
-}
-
-/**
- * Wrapper function for the get_lang function
- * use this if you want to avoid translation caching issues
- */
-function cp_get_lang($variable) {
-	return get_lang($variable, null, $_SESSION['user_language_choice']);
-}
-/**
- * Code
- */
-// Note that Chamilo languages are expressed as full english names, not 2-characters codes
-// e.g. 'english' instead of 'en', 'french' instead of 'fr', ...
-// We need a matching array. Note the value for the null key, which is the default language.
-// Also note that this is an example matchin array, not all languages are present.
-$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'es' => 'spanish');
-
-// Which of these can we actually pick from ?
-$available_langs = array('en','fr');
-
-// Which language files will we need ?
-$language_file = array('courses', 'index', 'registration', 'admin','userInfo');
-
-// Let's find out which language to serve to this particular browser
-$lang_match = $chamilo_langs[get_preferred_language($available_langs)];
-
-// Chamilo overrides this parameters at some places, e.g. in the logout link
-if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) {
-	$lang_match = $_REQUEST['language'];
-}
-
-// Maybe a language had already been selected, we should honor this
-if (isset($_SESSION['user_language_choice']) && in_array($_SESSION['user_language_choice'], $chamilo_langs)) {
-	$lang_match = $_SESSION['user_language_choice'];
-}
-
-// We need to set the relevant session variables to the best match, to use Chamilo's i18n lib.
-$_user['language'] = $lang_match;
-$_SESSION['user_language_choice'] = $lang_match;
-?>

+ 0 - 56
custompages/language.php

@@ -1,56 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * Definition of language-related functions for cases where th user isn't 
- * logged in yet
- * @package chamilo.custompages
- */
-/**
- * Get the preferred language base on the browser headers
- */
-function get_preferred_language($available_langs) {
-	$langs = array();
-	foreach (explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']) as $httplang) {
-		$rawlang = explode(';q=', $httplang);
-		if (strpos($rawlang[0], '-') !== FALSE) {
-			$rawlang[0] = substr($rawlang[0], 0, strpos($rawlang[0], '-'));
-		}
-		if (count($rawlang) == 1) {
-			$rawlang[1] = 1.0;
-		}
-		$langs[$rawlang[1]] = $rawlang[0];
-	}
-	krsort($langs, SORT_NUMERIC);
-	foreach($langs as $weight => $code) {
-		if (in_array($code, $available_langs)) {
-			return $code;
-		}
-	}
-	return null;
-}
-/**
- * Get a language variable in a specific language
- */
-function custompages_get_lang($variable) {
-	return get_lang($variable, null, $_SESSION['user_language_choice']);
-}
-
-$language_file = array('courses', 'index', 'registration', 'admin','userInfo');
-$available_langs = array('en','fr');
-$chamilo_langs = array(null => 'english', 'en' => 'english', 'fr' => 'french', 'nl' => 'dutch', 'de' => 'german', 'es' => 'spanish');
-$lang_match = $chamilo_langs[get_preferred_language($available_langs)];
-// recover previous value ... 
-if (isset($_SESSION['user_language_choice']))
-	$lang_match = $_SESSION['user_language_choice'];
-
-// Chamilo parameter, on logout
-if (isset($_REQUEST['language']) && !empty($_REQUEST['language']) && in_array($_REQUEST['language'], $chamilo_langs)) {
-	$lang_match = $_REQUEST['language'];
-}
-// Incoming link parameter
-if (isset($_REQUEST['lang']) && !empty($_REQUEST['lang']) && in_array($_REQUEST['lang'], $available_langs)) {
-	$lang_match = $chamilo_langs[$_REQUEST['lang']];
-}
-$_user['language'] = $lang_match;
-$_SESSION['user_language_choice'] = $lang_match;
-?>

+ 0 - 64
custompages/loggedout.php

@@ -1,64 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * Displayed after the user has been logged out.
- * @package chamilo.custompages
- */
-/**
- * Init
- */
-$called_direcly = !function_exists('api_get_path');
-if ($called_direcly)
-{
-    return '';
-}
-
-require_once('language.php');
-$www = api_get_path('WEB_PATH');
-
-/**
- * HTML output
- */
-?>
-<!DOCTYPE html>
-<html>
-    <head>
-        <title>Custompage - logged out</title>
-        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-        <!--[if !IE 6]><!-->
-        <link rel="stylesheet" type="text/css" href="<?php echo $www ?>custompages/style.css" />
-        <!--<![endif]-->
-        <!--[if IE 6]>
-        <link rel="stylesheet" type="text/css" href="/custompages/style-ie6.css" />
-        <![endif]-->
-
-        <script type="text/javascript" src="<?php echo $www ?>main/inc/lib/javascript/jquery.min.js"></script>
-
-        <script type="text/javascript">
-            $(document).ready(function() {
-                if (top.location != location) 
-                    top.location.href = document.location.href ;
-            });
-        </script>
-    </head>
-    <body>
-        <div id="backgroundimage">
-            <img src="<?php echo $www ?>/custompages/images/page-background.png" class="backgroundimage" alt="background"/>
-        </div>
-        <div id="wrapper">
-            <div id="header">
-                <img src="<?php echo $www ?>/custompages/images/header.png" alt="Logo" />
-            </div>
-
-            <div id="login-form-box" class="form-box">
-                <div id="login-form-info" class="form-info">
-                    You have been logged out.
-                </div>
-            </div>
-            <a href="<?php echo $www . 'user_portal.php'; ?>">Go to your portal</a>
-            <div id="footer">
-                <img src="<?php echo $www ?>/custompages/images/footer.png" alt="footer"/>
-            </div> 
-        </div> 
-    </body>
-</html>

+ 0 - 74
custompages/lostpassword.php

@@ -1,74 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * Quick form to ask for password reminder.
- * @package chamilo.custompages
- */ 
-/**
- * Initialization
- */
-require_once('../../main/inc/global.inc.php'); 
-require_once('language.php');
-/**
- * HTML
- */
-?>
-<html>
-<head>
-	<title>Password recovery</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<!--[if !IE 6]><!-->
-	<link rel="stylesheet" type="text/css" href="../../custompages/style.css" />
-	<!--<![endif]-->
-	<!--[if IE 6]>
-	<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" />
-	<![endif]-->
-	<script type="text/javascript" src="../../main/inc/lib/javascript/jquery.min.js"></script>
-	<script type="text/javascript">
-		$(document).ready(function() {
-			// Handler pour la touche retour
-			$('input').keyup(function(e) { 
-				if (e.keyCode == 13) {
-					$('#lostpassword-form').submit();
-				}
-			});
-		});
-	</script>
-</head>
-<body>
-	<div id="backgroundimage">
-		<img src="/custompages/images/page-background.png" class="backgroundimage" />
-	</div>
-	<div id="wrapper">
-		<div id="header">
-			<img src="../../custompages/images/header.png" alt="Ambassador logo" />
-		</div> <!-- #header -->
-      <div id="registration-form-info" class="form-info">
-        <?php if(isset($content['error']) && !empty($content['error'])){
-          echo $content['info'];
-        } else {
-          echo custompages_get_lang('lang_enter_email_and_well_send_you_password');
-        }?>
-      </div>
-		<div id="lostpassword-form-box" class="form-box">
-		<?php if (isset($content['error']) && !empty($content['error'])) {
-			echo '<div id="registration-form-error" class="form-error"><ul>'.$content['error'].'</ul></div>';
-		}?>
-			<form id="lostpassword-form" class="form" action="lostPassword.php" method="post">
-				<div>
-        <label for="user">*<?php echo custompages_get_lang('UserName');?></label>
-					<input name="user" type="text" /><br />
-          <label for="email">*<?php echo custompages_get_lang('Email');?></label>
-					<input name="email" type="text" /><br />
-				</div>
-			</form>
-			<div id="lostpassword-form-submit" class="form-submit" onclick="document.forms['lostpassword-form'].submit();">
-      <span><?php echo custompages_get_lang('langSend'); ?> </span>
-			</div> <!-- #form-submit -->
-		</div> <!-- #form -->
-		<div id="footer">
-			<img src="../../custompages/images/footer.png" />
-		</div> <!-- #footer -->
-	</div> <!-- #wrapper -->
-</body>
-</html>

+ 0 - 41
custompages/registration-feedback.php

@@ -1,41 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * Quick display for user registration
- * @package chamilo.custompages
- */ 
-/**
- * HTML output
- */
-?>
-<html>
-<head>
-	<title>Registration</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<!--[if !IE 6]><!-->
-	<link rel="stylesheet" type="text/css" href="../../custompages/style.css" />
-	<!--<![endif]-->
-	<!--[if IE 6]>
-	<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" />
-	<![endif]-->
-	<script type="text/javascript" src="../../main/inc/lib/javascript/jquery.min.js"></script>
-</head>
-<body>
-	<div id="backgroundimage">
-		<img src="/custompages/images/page-background.png" class="backgroundimage" />
-	</div>
-	<div id="wrapper">
-		<div id="header">
-			<img src="../../custompages/images/header.png" alt="Ambassador logo" />
-		</div> <!-- #header -->
-		<div id="registration-feedback-box">
-      <?php
-      echo $content['info'];
-      ?>
-		</div> <!-- #feedback -->
-		<div id="footer">
-			<img src="../../custompages/images/footer.png" />
-		</div> <!-- #footer -->
-	</div> <!-- #wrapper -->
-</body>
-</html>

+ 0 - 119
custompages/registration.php

@@ -1,119 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
- * This script allows for specific registration rules (see CustomPages feature of Chamilo)
- * Please contact CBlue regarding any licences issues.
- * Author: noel@cblue.be
- * Copyright: CBlue SPRL, 20XX (GNU/GPLv3)
- * @package chamilo.custompages
- **/
-/**
- * Initialization
- */
-require_once('language.php');
-require_once('../inc/global.inc.php');
-
-/**
- * Removes some unwanted elementend of the form object
- */
-$content['form']->removeElement('extra_mail_notify_invitation');
-$content['form']->removeElement('extra_mail_notify_message');
-$content['form']->removeElement('extra_mail_notify_group_message');
-$content['form']->removeElement('official_code');
-$content['form']->removeElement('phone');
-$content['form']->removeElement('submit');
-$content['form']->removeElement('status');
-$content['form']->removeElement('status');
-/**
- * Code to change the way QuickForm render html
- */
-/*
-$renderer = & $content['form']->defaultRenderer();
-$form_template = <<<EOT
-
-<form {attributes}>
-{content}
-  <div class="clear">
-    &nbsp;
-  </div>
-  <p><a href="#" class="btn" onclick="$('#registration-form').submit()"><span>S'inscrire</span></a></p>
-</form>
-
-EOT;
-$renderer->setFormTemplate($form_template);
-
-$element_template = <<<EOT
-  <div class="field decalle">
-    <label>
-      <!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
-    </label>
-    <div class="formw">
-      <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
-    </div>
-  </div>
-
-EOT;
-$element_template_wimage = <<<EOT
-  <div class="field decalle display">
-    <label>
-      <!-- BEGIN required --><span class="form_required">*</span> <!-- END required -->{label}
-    </label>
-    <div class="formw">
-      <!-- BEGIN error --><span class="form_error">{error}</span><br /><!-- END error --> {element}
-      <img src="/custompages/images/perso.jpg" alt="" />
-    </div>
-  </div>
-
-EOT;
-$renderer->setElementTemplate($element_template_wimage,'pass1');
-$renderer->setElementTemplate($element_template);
-
-$header_template = <<<EOT
-  <div class="row">
-    <div class="form_header">{header}</div>
-  </div>
-
-EOT;
-
- */
-?>
-<html>
-<head>
-	<title>Registration</title>
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
-	<!--[if !IE 6]><!-->
-	<link rel="stylesheet" type="text/css" href="../../custompages/style.css" />
-	<!--<![endif]-->
-	<!--[if IE 6]>
-	<link rel="stylesheet" type="text/css" href="../../custompages/style-ie6.css" />
-	<![endif]-->
-	<script type="text/javascript" src="../../main/inc/lib/javascript/jquery.min.js"></script>
-</head>
-<body>
-	<div id="backgroundimage">
-		<img src="/custompages/images/page-background.png" class="backgroundimage" />
-	</div>
-	<div id="wrapper">
-		<div id="header">
-			<img src="../../custompages/images/header.png" alt="Ambassador logo" />
-		</div> <!-- #header -->
-		<div id="registration-form-box" class="form-box">
-		<?php if (isset($form_error) && !empty($form_error)) {
-			echo '<div id="registration-form-error" class="form-error"><ul>'.$form_error.'</ul></div>';
-		}?>
-      <?php
-      $content['form']->display();
-      ?>
-			<div id="registration-form-submit" class="form-submit" onclick="document.forms['registration'].submit();">
-				<span><?php echo custompages_get_lang('Subscribe');?></span>
-			</div> <!-- #form-submit -->
-			<div id="links">
-      <!--<a href="mailto: support@cblue.be"><?php echo custompages_get_lang('NeedContactAdmin')?></a><br />-->
-			</div>
-		</div> <!-- #form -->
-		<div id="footer">
-			<img src="../../custompages/images/footer.png" />
-		</div> <!-- #footer -->
-	</div> <!-- #wrapper -->
-</body>
-</html>

+ 0 - 218
custompages/style-ie6.css

@@ -1,218 +0,0 @@
-/* Color easy change */
-body, .form, #links a, .form-info {
-  color: #DF002A;
-}
-.form-submit, input, select {
-  background-color: #DF002A;
-}
-.form-error {
-	color: red;
-	font-size: 9pt;
-}
-.form-submit {
-	margin: 0;
-	padding: 0;
-	width: 310px;
-	height: 27px;
-	background-color: #DF002A;
-	/*background-image: url(/custompages/images/login-form-submit-bg.jpg);*/
-	color: white;
-	cursor: pointer;
-	cursor: hand;
-}
-/* end easy change */
-/* Registration form */
-#registration-form-box {
-	width: 400px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 50px;
-	border: solid 1px #CCCCCC;
-	text-align: left;
-	background-color: white;
-}
-#registration-form-box .form-submit{
-  width: 400px;
-}
-div.row {
-  clear: both;
-  padding-top: 5px;
-}
-div.row div.form_header {
-  white-space: nowrap;
-  padding: 2px;
-  background-color: #f0f0f0;
-  border: 1px solid #bbb;
-}
-div.row div.label {
-  float: left;
-  width: 53%;
-  text-align: right;
-  padding-right:1%
-}
-div.row div.formw {
-  width: 46%;
-  float:left;
-}
-[dir=ltr] div.row div.label, [dir=rtl] div.row div.formw {
-  float: left;
-  text-align: right;
-}
-[dir=rtl] div.row div.label, [dir=ltr] div.row div.formw {
-  float: right;
-  text-align: left;
-}
-span.form_required {
-  color: #f00;
-}
-span.form_error {
-  color: #f00;
-  font-size: x-small;
-  margin: 2px;
-}
-html, body {
-	margin: 0;
-	padding: 0;
-}
-
-body {
-	font-family: "Arial Black",sans-serif;
-	font-size: 10pt;
-	width: 100%;
-	text-align: center;
-	color: #1F3660;
-	/*background-image: url(images/page-background.png);
-	background-repeat: no-repeat;
-	background-size: 100%;
-	*/
-}
-
-#backgroundimage {
-	background-attachment:fixed;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0;
-	top: 30px;
-	z-index:-1;
-}
-
-.backgroundimage {
-	width: 100%;
-	height: auto;
-}
-
-#wrapper {
-	position: absolute;
-	top: 0;
-	left: 0;
-	width: 100%;
-	z-index: 1;
-}
-
-#header {
-	width: 520px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 30px;
-}
-
-#footer {
-	position: relative;
-	/*margin-top: 50px;*/
-	text-align: center;
-}
-
-.form-box {
-	width: 310px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 50px;
-	border: solid 1px #CCCCCC;
-	text-align: left;
-	/*background-color: white;*/
-}
-
-.form {
-	margin-left: 15px;
-	margin-right: 15px;
-	margin-top: 30px;
-	/*color: #1F3660;*/
-	/*position: relative;*/
-	text-align: left;
-}
-
-
-label {
-	width: 100px;
-	float: left;
-	margin-right: 1em;
-	display: block;
-	text-align: right;
-	line-height: 2ex;
-}
-
-input {
-	text-align: left;
-	vertical-align: baseline;
-	margin-bottom: 2em;
-	width: 150px;
-	color: white;
-	/*background-color: #1F3660;*/
-	border: none;
-}
-.radiobutton {
-  width: 20px;
-  background-color: white;
-  margin: 0;  
-} 
-.radiogroup { 
-   margin-bottom: 2em;
- } 
-
-select {
-	width: 150px;
-	color: white;
-	/*background-color: #1F3660;*/
-	border: none;
-	margin-bottom: 2em;
-  width: 150px;
-}
-label {
-  clear: both;
-}
-input, select, .radiogroup {
-  float: right;
-  clear: both;
-}
-.radiogroup input, .radiogroup label {
-   float: none;
- }
-
-#links {
-	margin-left: 15px;
-	margin-right: 15px;
-	margin-top: 10px;
-	margin-bottom: 50px;
-	/*color: #1F3660;*/
-}
-
-
-#links a {
-	text-decoration: none;
-}
-
-#links a:hover {
-	text-decoration: underline;
-}
-
-span {
-	margin-right: 30px;
-	margin-top: 3px;
-	float: right;
-}
-
-.form-info {
-	/*color: #1F3660;*/
-	font-size: 9pt;
-}

+ 0 - 198
custompages/style.css

@@ -1,198 +0,0 @@
-/* Color easy change */
-body, .form, #links a, .form-info {
-  color: #DF002A;
-}
-.form-submit, input, select {
-  background-color: #DF002A;
-}
-.form-error {
-	color: red;
-	font-size: 9pt;
-}
-.form-submit {
-	margin: 0;
-	padding: 0;
-	width: 310px;
-	height: 27px;
-	background-color: #DF002A;
-	/*background-image: url(/custompages/images/login-form-submit-bg.jpg);*/
-	color: white;
-	cursor: pointer;
-	cursor: hand;
-}
-/* end easy change */
-/* Registration form */
-#registration-form-box {
-	width: 400px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 50px;
-	border: solid 1px #CCCCCC;
-	text-align: left;
-	background-color: white;
-}
-#registration-form-box .form-submit{
-  width: 400px;
-}
-div.row {
-  clear: both;
-  padding-top: 5px;
-}
-div.row div.form_header {
-  white-space: nowrap;
-  padding: 2px;
-  background-color: #f0f0f0;
-  border: 1px solid #bbb;
-}
-div.row div.label {
-  float: left;
-  width: 53%;
-  text-align: right;
-  padding-right:1%
-}
-div.row div.formw {
-  width: 46%;
-  float:left;
-}
-[dir=ltr] div.row div.label, [dir=rtl] div.row div.formw {
-  float: left;
-  text-align: right;
-}
-[dir=rtl] div.row div.label, [dir=ltr] div.row div.formw {
-  float: right;
-  text-align: left;
-}
-span.form_required {
-  color: #f00;
-}
-span.form_error {
-  color: #f00;
-  font-size: x-small;
-  margin: 2px;
-}
-html, body {
-	margin: 0;
-	padding: 0;
-}
-
-body {
-	font-family: "Arial Black",sans-serif;
-	font-size: 10pt;
-	width: 100%;
-	text-align: center;
-	/*color: #1F3660;*/
-	/*background-image: url(images/page-background.png);
-	background-repeat: no-repeat;
-	background-size: 100%;
-	*/
-}
-
-#backgroundimage {        
-	background-attachment:fixed;
-	width: 100%;
-	height: 100%;
-	position: absolute;
-	left: 0;
-	top: 30px;
-	z-index:-1;
-}
-
-.backgroundimage {
-	width: 100%;
-	height: auto;
-}
-
-#wrapper {
-	position: absolute;
-	top: 0;
-	left: 0;
-	width: 100%;
-	z-index: 1;
-}
-
-#header {
-	width: 520px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 30px;
-}
-
-#footer {
-	position: relative;
-	margin-top: 50px;
-	text-align: center;
-}
-
-.form-box {
-	width: 310px;
-	margin-left: auto;
-	margin-right: auto;
-	margin-top: 50px;
-	border: solid 1px #CCCCCC;
-	text-align: left;
-	background-color: white;
-}
-
-.form {
-	margin-left: 15px;
-	margin-right: 15px;
-	margin-top: 30px;
-	/*color: #1F3660;*/
-	position: relative;
-	text-align: left;
-}
-
-
-label {
-	width: 100px;
-	float: left;
-	margin-right: 1em;
-	display: block;
-	text-align: right;
-	line-height: 2ex;
-}
-
-input {
-	text-align: left;
-	vertical-align: baseline;
-	margin-bottom: 2em;
-	width: 150px;
-	color: white;
-	/*background-color: #1F3660;*/
-	border: none;
-}
-
-select {
-	width: 150px;
-	color: white;
-	/*background-color: #1F3660;*/
-	border: none;
-	margin-bottom: 2em;
-}
-#links {
-	margin-left: 15px;
-	margin-right: 15px;
-	margin-top: 10px;
-	margin-bottom: 50px;
-	/*color: #1F3660;*/
-}
-
-
-#links a {
-	text-decoration: none;
-}
-
-#links a:hover {
-	text-decoration: underline;
-}
-
-span {
-	margin-right: 30px;
-	margin-top: 3px;
-	float: right;
-}
-
-.form-info {
-	/*color: #1F3660;*/
-	font-size: 9pt;
-}

+ 0 - 5
custompages/url-images/README

@@ -1,5 +0,0 @@
-Custom Pages : URL Images
-
-This features allows each access URL to have a number of images (currently three) specific to this URL. This allows easier customization of landing pages by access URL.
-
-You can access a URL's images by calling the static function CustomPages::getURLImages() in your custom page.

+ 0 - 2
global.inc.php

@@ -1,2 +0,0 @@
-<?php
-/*  File needed because all files include the "require_once '../inc/global.inc.php'" */

+ 0 - 2
inc/global.inc.php

@@ -1,2 +0,0 @@
-<?php
-/*  File needed because all files include the "require_once '../inc/global.inc.php'" */

+ 0 - 7
index.php

@@ -1,7 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-// Redirect calls to web/index
-// Please make sure you read the installation manual in the documentation/
-// folder if your installation doesn't work. Hint: you need to allow overrides
-header('Location: web/index');
-exit;

+ 128 - 0
main/admin/access_url_add_usergroup_to_url.php

@@ -0,0 +1,128 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*	This script allows platform admins to add users to urls.
+*	It displays a list of users and a list of courses;
+*	you can select multiple users and courses and then click on
+*	@package chamilo.admin
+*	@author Julio Montoya <gugli100@gmail.com>
+*/
+
+// name of the language file that needs to be included
+$language_file = 'admin';
+$cidReset = true;
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
+require_once api_get_path(LIBRARY_PATH).'usergroup.lib.php';
+$this_section = SECTION_PLATFORM_ADMIN;
+
+api_protect_global_admin_script();
+if (!api_get_multiple_access_url()) {
+    header('Location: index.php');
+    exit;
+}
+
+$userGroup = new UserGroup();
+
+$form_sent = 0;
+$firstLetterUserGroup = null;
+$courses = array();
+$url_list = array();
+
+$tbl_access_url_rel_course 	= Database :: get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+$tbl_access_url 			= Database :: get_main_table(TABLE_MAIN_ACCESS_URL);
+$tbl_user 					= Database :: get_main_table(TABLE_MAIN_USER);
+$tbl_course					= Database :: get_main_table(TABLE_MAIN_COURSE);
+
+$tool_name = get_lang('AddUserGroupToURL');
+$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
+
+Display::display_header($tool_name);
+
+echo '<div class="actions">';
+echo Display::url(
+    Display::return_icon('edit.png', get_lang('EditUserGroupToURL'), ''),
+    api_get_path(WEB_CODE_PATH).'admin/access_url_edit_usergroup_to_url.php'
+);
+echo '</div>';
+
+api_display_tool_title($tool_name);
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent = $_POST['form_sent'];
+    $userGroups = is_array($_POST['user_group_list']) ? $_POST['user_group_list'] : array() ;
+    $urlList = is_array($_POST['url_list']) ? $_POST['url_list'] : array() ;
+    $firstLetterUserGroup = $_POST['first_letter_user_group'];
+
+    if ($form_sent == 1) {
+        if (count($userGroups) == 0 || count($urlList) == 0) {
+            Display :: display_error_message(get_lang('AtLeastOneUserGroupAndOneURL'));
+        } else {
+            UrlManager::addUserGroupListToUrl($userGroups, $urlList);
+            Display::display_confirmation_message(get_lang('UserGroupBelongURL'));
+        }
+    }
+}
+
+$firstLetterUser = null;
+if ($userGroup->getTotalCount() > 1000) {
+    //if there are too much num_courses to gracefully handle with the HTML select list,
+    // assign a default filter on users names
+    $firstLetterUser = 'A';
+}
+
+$dbUserGroups = $userGroup->filterByFirstLetter($firstLetterUserGroup);
+
+$sql = "SELECT id, url FROM $tbl_access_url  WHERE active = 1 ORDER BY url";
+$result = Database::query($sql);
+$db_urls = Database::store_result($result);
+?>
+
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;">
+    <input type="hidden" name="form_sent" value="1"/>
+    <table border="0" cellpadding="5" cellspacing="0" width="100%">
+    <tr>
+        <td width="40%" align="center">
+            <b><?php echo get_lang('UserGroupList'); ?></b>
+            <br/><br/>
+             <?php echo get_lang('FirstLetter'); ?> :
+             <select name="first_letter_user_group" onchange="javascript:document.formulaire.form_sent.value='2'; document.formulaire.submit();">
+                <option value="">--</option>
+                  <?php
+                    echo Display::get_alphabet_options($firstLetterUserGroup);
+                    echo Display::get_numeric_options(0, 9, $firstLetterUserGroup);
+                  ?>
+            </select>
+        </td>
+        <td width="20%">&nbsp;</td>
+        <td width="40%" align="center">
+            <b><?php echo get_lang('URLList'); ?> :</b>
+        </td>
+   </tr>
+   <tr>
+        <td width="40%" align="center">
+        <select name="user_group_list[]" multiple="multiple" size="20" style="width:400px;">
+		<?php foreach ($dbUserGroups as $item) { ?>
+			<option value="<?php echo $item['id']; ?>" <?php if (in_array($item['id'], $courses)) echo 'selected="selected"'; ?>><?php echo $item['name']; ?>
+            </option>
+        <?php } ?>
+    </select>
+   </td>
+   <td width="20%" valign="middle" align="center">
+    <button type="submit" class="add"> <?php echo get_lang('AddUserGroupToThatURL'); ?> </button>
+   </td>
+   <td width="40%" align="center">
+    <select name="url_list[]" multiple="multiple" size="20" style="width:300px;">
+		<?php foreach ($db_urls as $url_obj) { ?>
+        <option value="<?php echo $url_obj['id']; ?>" <?php if (in_array($url_obj['id'], $url_list)) echo 'selected="selected"'; ?>><?php echo $url_obj['url']; ?>
+        </option>
+		<?php } ?>
+    </select>
+   </td>
+  </tr>
+ </table>
+</form>
+<?php
+
+Display :: display_footer();

+ 2 - 6
main/admin/access_url_edit.php

@@ -6,9 +6,7 @@
  * @author Julio Montoya <gugli100@gmail.com>
  * @author Yannick Warnier <yannick.warnier@beeznest.com>
  */
-/**
- * Initialization
- */
+
 $language_file = 'admin';
 $cidReset = true;
 require_once '../inc/global.inc.php';
@@ -149,9 +147,7 @@ if (!api_is_multiple_url_enabled()) {
 $tool_name = get_lang('AddUrl');
 $interbreadcrumb[] = array ("url" => 'index.php', "name" => get_lang('PlatformAdmin'));
 $interbreadcrumb[] = array ("url" => 'access_urls.php', "name" => get_lang('MultipleAccessURLs'));
-/**
- * View
- */
+
 Display :: display_header($tool_name);
 
 if (isset ($_GET['action'])) {

+ 337 - 0
main/admin/access_url_edit_course_category_to_url.php

@@ -0,0 +1,337 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*	@package chamilo.admin
+*	@author Julio Montoya <gugli100@gmail.com>
+*/
+
+// name of the language file that needs to be included
+$language_file = 'admin';
+
+// resetting the course id
+$cidReset = true;
+
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
+require_once api_get_path(LIBRARY_PATH).'course_category.lib.php';
+require_once api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php';
+
+$xajax = new xajax();
+$xajax->registerFunction(array('searchCourseCategoryAjax', 'UrlManager', 'searchCourseCategoryAjax'));
+
+// Setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// Access restrictions
+api_protect_global_admin_script();
+if (!api_get_multiple_access_url()) {
+    header('Location: index.php');
+    exit;
+}
+
+// Setting breadcrumbs
+$tool_name = get_lang('EditUserGroupToURL');
+$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
+
+$add_type = 'multiple';
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+
+$access_url_id = 1;
+if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
+    $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
+}
+
+$xajax->processRequests();
+$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
+$htmlHeadXtra[] = '
+<script>
+function add_user_to_url(code, content) {
+
+	document.getElementById("course_to_add").value = "";
+	document.getElementById("ajax_list_courses").innerHTML = "";
+
+	destination = document.getElementById("destination_users");
+	destination.options[destination.length] = new Option(content,code);
+
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function send() {
+
+	if (document.formulaire.access_url_id.value!=0) {
+		document.formulaire.form_sent.value=0;
+		document.formulaire.add_type.value=\''.$add_type.'\';
+		document.formulaire.submit();
+	}
+}
+
+function remove_item(origin) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+}
+</script>';
+
+$form_sent=0;
+$errorMsg='';
+$UserList=$SessionList = array();
+$users=$sessions = array();
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent = $_POST['form_sent'];
+    $list = $_POST['course_list'];
+
+    if (!is_array($list)) {
+        $list = array();
+    }
+
+    if ($form_sent == 1) {
+        if ($access_url_id == 0) {
+            header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
+        } elseif (is_array($list)) {
+            UrlManager::updateUrlRelCourseCategory($list, $access_url_id);
+            header('Location: access_urls.php?action=show_message&message='.get_lang('Updated'));
+        }
+        exit;
+    }
+}
+
+Display::display_header($tool_name);
+
+api_display_tool_title($tool_name);
+
+if ($_GET['action'] == 'show_message') {
+    Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
+}
+
+$noUserGroupList = $userGroupList = array();
+$ajax_search = $add_type == 'unique' ? true : false;
+
+if ($ajax_search) {
+    $userGroups = UrlManager::getUrlRelCourseCategory($access_url_id);
+    foreach ($userGroups as $item) {
+        $userGroupList[$item['id']] = $item;
+    }
+} else {
+    $userGroups = UrlManager::getUrlRelCourseCategory();
+
+    foreach ($userGroups as $item) {
+        if ($item['access_url_id'] == $access_url_id) {
+            $userGroupList[$item['id']] = $item ;
+        }
+    }
+    $noUserGroupList = getCourseCategoryNotInList(array_keys($userGroupList));
+}
+
+if ($add_type == 'multiple') {
+	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
+	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
+} else {
+	$link_add_type_unique = get_lang('SessionAddTypeUnique');
+	$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
+}
+
+$url_list = UrlManager::get_url_data();
+?>
+<div style="text-align: left;">
+	<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+</div>
+<br /><br />
+<form
+    name="formulaire"
+    method="post"
+    action="<?php echo api_get_self(); ?>"
+    style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"'; } ?>
+>
+<?php echo get_lang('SelectUrl').' : '; ?>
+<select name="access_url_id" onchange="javascript:send();">
+<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
+	<?php
+    $url_selected = '';
+    foreach ($url_list as $url_obj) {
+        $checked = '';
+        if (!empty($access_url_id)) {
+            if ($url_obj[0] == $access_url_id) {
+                $checked = 'selected=true';
+                $url_selected=$url_obj[1];
+            }
+        }
+        if ($url_obj['active']==1) { ?>
+            <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
+            </option>
+        <?php
+        }
+    }
+?>
+</select>
+<br /><br />
+<input type="hidden" name="form_sent" value="1" />
+<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
+
+<?php
+if (!empty($errorMsg)) {
+    Display::display_normal_message($errorMsg); //main API
+}
+?>
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%">
+<!-- Users -->
+<tr>
+  <td align="center"><b><?php echo get_lang('CourseCategoryInPlatform') ?> :</b>
+  </td>
+  <td></td>
+  <td align="center"><b><?php echo get_lang('CourseCategoryListIn').' '.$url_selected; ?></b></td>
+</tr>
+
+<tr>
+  <td align="center">
+  <div id="content_source">
+    <?php if ($ajax_search) { ?>
+		<input type="text" id="course_to_add" onkeyup="xajax_searchCourseCategoryAjax(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
+		<div id="ajax_list_courses"></div>
+    <?php } else { ?>
+	  <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
+		<?php
+		foreach ($noUserGroupList as $noItem) {
+		?>
+			<option value="<?php echo $noItem['id']; ?>">
+                <?php echo $noItem['name']; ?>
+            </option>
+		<?php
+		}
+		?>
+	  </select>
+	<?php
+  	  }
+  	 ?>
+  </div>
+  </td>
+  <td width="10%" valign="middle" align="center">
+  <?php
+  if ($ajax_search) {
+	?>
+	<button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination_users'))" ></button>
+  	<?php
+  } else {
+  	?>
+	<button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" ></button>
+	<br /><br />
+	<button class="arrowl" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" ></button>
+	<?php
+  }
+  ?>
+	<br /><br /><br /><br /><br /><br />
+  </td>
+  <td align="center">
+  <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
+<?php
+foreach($userGroupList as $item) {
+?>
+	<option value="<?php echo $item['id']; ?>">
+        <?php echo $item['name']; ?>
+    </option>
+<?php
+}
+?>
+  </select>
+  </td>
+</tr>
+<tr>
+	<td colspan="3" align="center">
+		<br />
+		<?php
+		if(isset($_GET['add']))
+			echo '<button class="save" onclick="valide()" >'.get_lang('Add').'</button>';
+		else
+			echo '<button class="save" onclick="valide()" >'.get_lang('Edit').'</button>';
+		?>
+	</td>
+</tr>
+</table>
+</form>
+<script>
+
+function moveItem(origin , destination) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function sortOptions(options) {
+	newOptions = new Array();
+	for (i = 0 ; i<options.length ; i++)
+		newOptions[i] = options[i];
+
+	newOptions = newOptions.sort(mysort);
+	options.length = 0;
+	for(i = 0 ; i < newOptions.length ; i++)
+		options[i] = newOptions[i];
+
+}
+
+function mysort(a, b) {
+	if(a.text.toLowerCase() > b.text.toLowerCase()){
+		return 1;
+	}
+	if(a.text.toLowerCase() < b.text.toLowerCase()){
+		return -1;
+	}
+	return 0;
+}
+
+function valide(){
+	var options = document.getElementById('destination_users').options;
+	for (i = 0 ; i<options.length ; i++)
+		options[i].selected = true;
+	document.forms.formulaire.submit();
+}
+
+function loadUsersInSelect(select){
+
+	var xhr_object = null;
+
+	if(window.XMLHttpRequest) // Firefox
+		xhr_object = new XMLHttpRequest();
+	else if(window.ActiveXObject) // Internet Explorer
+		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+	else  // XMLHttpRequest non supporté par le navigateur
+	alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+	xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+	xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+	nosessionUsers = makepost(document.getElementById('origin_users'));
+	sessionUsers = makepost(document.getElementById('destination_users'));
+	nosessionClasses = makepost(document.getElementById('origin_classes'));
+	sessionClasses = makepost(document.getElementById('destination_classes'));
+	xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+	xhr_object.onreadystatechange = function() {
+		if(xhr_object.readyState == 4) {
+			document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+		}
+	}
+}
+
+function makepost(select){
+	var options = select.options;
+	var ret = "";
+	for (i = 0 ; i<options.length ; i++)
+		ret = ret + options[i].value +'::'+options[i].text+";;";
+	return ret;
+}
+</script>
+<?php
+Display::display_footer();

+ 346 - 0
main/admin/access_url_edit_usergroup_to_url.php

@@ -0,0 +1,346 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*	@package chamilo.admin
+*	@author Julio Montoya <gugli100@gmail.com>
+*/
+
+// name of the language file that needs to be included
+$language_file = 'admin';
+
+// resetting the course id
+$cidReset = true;
+
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'urlmanager.lib.php';
+require_once api_get_path(LIBRARY_PATH).'usergroup.lib.php';
+require_once api_get_path(LIBRARY_PATH).'xajax/xajax.inc.php';
+
+$xajax = new xajax();
+$xajax->registerFunction(array('searchUserGroupAjax', 'UserGroup', 'searchUserGroupAjax'));
+$userGroup = new UserGroup();
+
+// Setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// Access restrictions
+api_protect_global_admin_script();
+if (!api_get_multiple_access_url()) {
+    header('Location: index.php');
+    exit;
+}
+
+// setting breadcrumbs
+$tool_name = get_lang('EditUserGroupToURL');
+$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array ('url' => 'access_urls.php', 'name' => get_lang('MultipleAccessURLs'));
+
+$add_type = 'multiple';
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type'] != '') {
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+
+$access_url_id = 1;
+if (isset($_REQUEST['access_url_id']) && $_REQUEST['access_url_id'] != '') {
+    $access_url_id = Security::remove_XSS($_REQUEST['access_url_id']);
+}
+
+$xajax->processRequests();
+$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
+$htmlHeadXtra[] = '
+<script>
+function add_user_to_url(code, content) {
+
+	document.getElementById("course_to_add").value = "";
+	document.getElementById("ajax_list_courses").innerHTML = "";
+
+	destination = document.getElementById("destination_users");
+	destination.options[destination.length] = new Option(content,code);
+
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function send() {
+
+	if (document.formulaire.access_url_id.value!=0) {
+		document.formulaire.form_sent.value=0;
+		document.formulaire.add_type.value=\''.$add_type.'\';
+		document.formulaire.submit();
+	}
+}
+
+function remove_item(origin) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+}
+</script>';
+
+$form_sent=0;
+$errorMsg='';
+$UserList=$SessionList=array();
+$users=$sessions=array();
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent = $_POST['form_sent'];
+    $course_list = $_POST['course_list'];
+
+    if (!is_array($course_list)) {
+        $course_list = array();
+    }
+
+    if ($form_sent == 1) {
+        if ($access_url_id == 0) {
+            header('Location: access_url_edit_users_to_url.php?action=show_message&message='.get_lang('SelectURL'));
+        } elseif (is_array($course_list)) {
+            UrlManager::update_urls_rel_usergroup($course_list, $access_url_id);
+            header('Location: access_urls.php?action=show_message&message='.get_lang('Updated'));
+        }
+        exit;
+    }
+}
+
+Display::display_header($tool_name);
+
+echo '<div class="actions">';
+echo Display::url(
+    Display::return_icon('view_more_stats.gif', get_lang('AddUserGroupToURL'), ''),
+    api_get_path(WEB_CODE_PATH).'admin/access_url_add_usergroup_to_url.php'
+);
+echo '</div>';
+
+api_display_tool_title($tool_name);
+
+if ($_GET['action'] == 'show_message') {
+    Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));
+}
+
+$noUserGroupList = $userGroupList = array();
+$ajax_search = $add_type == 'unique' ? true : false;
+
+if ($ajax_search) {
+    $userGroups = UrlManager::get_url_rel_usergroup_data($access_url_id);
+    foreach ($userGroups as $item) {
+        $userGroupList[$item['id']] = $item;
+    }
+} else {
+	$userGroups = UrlManager::get_url_rel_usergroup_data();
+
+    foreach ($userGroups as $item) {
+        if ($item['access_url_id'] == $access_url_id) {
+            $userGroupList[$item['id']] = $item ;
+        }
+    }
+    $noUserGroupList = $userGroup->getUserGroupNotInList(array_keys($userGroupList));
+}
+
+if ($add_type == 'multiple') {
+	$link_add_type_unique = '<a href="'.api_get_self().'?add_type=unique&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeUnique').'</a>';
+	$link_add_type_multiple = get_lang('SessionAddTypeMultiple');
+} else {
+	$link_add_type_unique = get_lang('SessionAddTypeUnique');
+	$link_add_type_multiple = '<a href="'.api_get_self().'?add_type=multiple&access_url_id='.$access_url_id.'">'.get_lang('SessionAddTypeMultiple').'</a>';
+}
+
+$url_list = UrlManager::get_url_data();
+?>
+<div style="text-align: left;">
+	<?php echo $link_add_type_unique ?>&nbsp;|&nbsp;<?php echo $link_add_type_multiple ?>
+</div>
+<br /><br />
+<form
+    name="formulaire"
+    method="post"
+    action="<?php echo api_get_self(); ?>"
+    style="margin:0px;" <?php if ($ajax_search){ echo ' onsubmit="valide();"'; } ?>
+>
+<?php echo get_lang('SelectUrl').' : '; ?>
+<select name="access_url_id" onchange="javascript:send();">
+<option value="0">-- <?php echo get_lang('SelectUrl')?> -- </option>
+	<?php
+    $url_selected = '';
+    foreach ($url_list as $url_obj) {
+        $checked = '';
+        if (!empty($access_url_id)) {
+            if ($url_obj[0] == $access_url_id) {
+                $checked = 'selected=true';
+                $url_selected=$url_obj[1];
+            }
+        }
+        if ($url_obj['active']==1) { ?>
+            <option <?php echo $checked;?> value="<?php echo $url_obj[0]; ?>"> <?php echo $url_obj[1]; ?>
+            </option>
+        <?php
+        }
+    }
+?>
+</select>
+<br /><br />
+<input type="hidden" name="form_sent" value="1" />
+<input type="hidden" name="add_type" value = "<?php echo $add_type ?>" />
+
+<?php
+if (!empty($errorMsg)) {
+    Display::display_normal_message($errorMsg); //main API
+}
+?>
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%">
+<!-- Users -->
+<tr>
+  <td align="center"><b><?php echo get_lang('UserGroupListInPlatform') ?> :</b>
+  </td>
+  <td></td>
+  <td align="center"><b><?php printf(get_lang('UserGroupListInX'),$url_selected); ?></b></td>
+</tr>
+
+<tr>
+  <td align="center">
+  <div id="content_source">
+    <?php if ($ajax_search) { ?>
+		<input type="text" id="course_to_add" onkeyup="xajax_searchUserGroupAjax(this.value,document.formulaire.access_url_id.options[document.formulaire.access_url_id.selectedIndex].value)" />
+		<div id="ajax_list_courses"></div>
+    <?php } else { ?>
+	  <select id="origin_users" name="no_course_list[]" multiple="multiple" size="15" style="width:380px;">
+		<?php
+		foreach ($noUserGroupList as $noItem) {
+		?>
+			<option value="<?php echo $noItem['id']; ?>">
+                <?php echo $noItem['name']; ?>
+            </option>
+		<?php
+		}
+		?>
+	  </select>
+	<?php
+  	  }
+  	 ?>
+  </div>
+  </td>
+  <td width="10%" valign="middle" align="center">
+  <?php
+  if ($ajax_search) {
+	?>
+	<button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination_users'))" ></button>
+  	<?php
+  } else {
+  	?>
+	<button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" ></button>
+	<br /><br />
+	<button class="arrowl" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" ></button>
+	<?php
+  }
+  ?>
+	<br /><br /><br /><br /><br /><br />
+  </td>
+  <td align="center">
+  <select id="destination_users" name="course_list[]" multiple="multiple" size="15" style="width:380px;">
+<?php
+foreach($userGroupList as $item) {
+?>
+	<option value="<?php echo $item['id']; ?>">
+        <?php echo $item['name']; ?>
+    </option>
+<?php
+}
+?>
+  </select>
+  </td>
+</tr>
+<tr>
+	<td colspan="3" align="center">
+		<br />
+		<?php
+		if(isset($_GET['add']))
+			echo '<button class="save" onclick="valide()" >'.get_lang('AddUserGroupToURL').'</button>';
+		else
+			echo '<button class="save" onclick="valide()" >'.get_lang('EditUserGroupToURL').'</button>';
+		?>
+	</td>
+</tr>
+</table>
+</form>
+<script>
+
+function moveItem(origin , destination) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function sortOptions(options) {
+	newOptions = new Array();
+	for (i = 0 ; i<options.length ; i++)
+		newOptions[i] = options[i];
+
+	newOptions = newOptions.sort(mysort);
+	options.length = 0;
+	for(i = 0 ; i < newOptions.length ; i++)
+		options[i] = newOptions[i];
+
+}
+
+function mysort(a, b) {
+	if(a.text.toLowerCase() > b.text.toLowerCase()){
+		return 1;
+	}
+	if(a.text.toLowerCase() < b.text.toLowerCase()){
+		return -1;
+	}
+	return 0;
+}
+
+function valide(){
+	var options = document.getElementById('destination_users').options;
+	for (i = 0 ; i<options.length ; i++)
+		options[i].selected = true;
+	document.forms.formulaire.submit();
+}
+
+function loadUsersInSelect(select){
+
+	var xhr_object = null;
+
+	if(window.XMLHttpRequest) // Firefox
+		xhr_object = new XMLHttpRequest();
+	else if(window.ActiveXObject) // Internet Explorer
+		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+	else  // XMLHttpRequest non supporté par le navigateur
+	alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+	//xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
+	xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+	xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+	nosessionUsers = makepost(document.getElementById('origin_users'));
+	sessionUsers = makepost(document.getElementById('destination_users'));
+	nosessionClasses = makepost(document.getElementById('origin_classes'));
+	sessionClasses = makepost(document.getElementById('destination_classes'));
+	xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+	xhr_object.onreadystatechange = function() {
+		if(xhr_object.readyState == 4) {
+			document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+		}
+	}
+}
+
+function makepost(select){
+	var options = select.options;
+	var ret = "";
+	for (i = 0 ; i<options.length ; i++)
+		ret = ret + options[i].value +'::'+options[i].text+";;";
+	return ret;
+}
+</script>
+<?php
+Display::display_footer();

+ 1 - 6
main/admin/access_urls.php

@@ -6,9 +6,6 @@
  * @author Julio Montoya <gugli100@gmail.com>
  * @author Yannick Warnier <yannick.warnier@beeznest.com>
  */
-/**
- * Initialization
- */
 // name of the language file that needs to be included
 $language_file = 'admin';
 $cidReset = true;
@@ -30,9 +27,7 @@ Display :: display_header($tool_name);
 $my_user_url_list = api_get_access_url_from_user(api_get_user_id());
 $current_access_url_id = api_get_current_access_url_id();
 $url_list = UrlManager::get_url_data();
-/**
- * Controller
- */
+
 if (isset ($_GET['action'])) {
     if ($_GET['action'] == 'show_message') {
         Display :: display_normal_message(Security::remove_XSS(stripslashes($_GET['message'])));

+ 396 - 0
main/admin/add_courses_to_session.php

@@ -0,0 +1,396 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ * @package chamilo.admin
+ * @todo use formvalidator
+ */
+
+// name of the language file that needs to be included.
+$language_file = 'admin';
+
+// resetting the course id.
+$cidReset = true;
+
+require_once '../inc/global.inc.php';
+require_once api_get_path(LIBRARY_PATH).'add_courses_to_session_functions.lib.php';
+
+$id_session = isset($_GET['id_session']) ? intval($_GET['id_session']) : null;
+$add = isset($_GET['add']) ? Security::remove_XSS($_GET['add']) : null;
+
+SessionManager::protect_session_edit($id_session);
+
+$xajax = new xajax();
+$xajax->registerFunction (array('search_courses', 'AddCourseToSession', 'search_courses'));
+
+// Setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// setting breadcrumbs
+$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session, "name" => get_lang('SessionOverview'));
+
+// Database Table Definitions
+$tbl_session_rel_course_rel_user	= Database::get_main_table(TABLE_MAIN_SESSION_COURSE_USER);
+$tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
+$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER);
+$tbl_session_rel_course				= Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
+$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
+
+// setting the name of the tool
+$tool_name= get_lang('SubscribeCoursesToSession');
+
+$add_type = 'multiple';
+if(isset($_GET['add_type']) && $_GET['add_type']!=''){
+	$add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+
+$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
+
+$xajax -> processRequests();
+
+$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
+$htmlHeadXtra[] = '
+<script type="text/javascript">
+function add_course_to_session (code, content) {
+
+	document.getElementById("course_to_add").value = "";
+	document.getElementById("ajax_list_courses_single").innerHTML = "";
+
+	destination = document.getElementById("destination");
+
+	for (i=0;i<destination.length;i++) {
+		if(destination.options[i].text == content) {
+				return false;
+		}
+	}
+
+	destination.options[destination.length] = new Option(content,code);
+
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+function remove_item(origin)
+{
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+}
+</script>';
+
+$formSent=0;
+$errorMsg=$firstLetterCourse=$firstLetterSession='';
+$CourseList=$SessionList=array();
+$courses=$sessions=array();
+$noPHP_SELF=true;
+
+if (isset($_POST['formSent']) && $_POST['formSent']) {
+	$formSent              = $_POST['formSent'];
+	$firstLetterCourse     = $_POST['firstLetterCourse'];
+	$firstLetterSession    = $_POST['firstLetterSession'];
+	$CourseList            = $_POST['SessionCoursesList'];
+	if (!is_array($CourseList)) {
+		$CourseList = array();
+	}
+	$nbr_courses=0;
+
+	$id_coach = Database::query("SELECT id_coach FROM $tbl_session WHERE id=$id_session");
+	$id_coach = Database::fetch_array($id_coach);
+	$id_coach = $id_coach[0];
+
+	$rs = Database::query("SELECT course_code FROM $tbl_session_rel_course WHERE id_session=$id_session");
+	$existingCourses = Database::store_result($rs);
+
+    // Updating only the RRHH users?? why?
+	//$sql="SELECT id_user FROM $tbl_session_rel_user WHERE id_session = $id_session AND relation_type=".COURSE_RELATION_TYPE_RRHH." ";
+    $sql        = "SELECT id_user FROM $tbl_session_rel_user WHERE id_session = $id_session ";
+	$result     = Database::query($sql);
+	$UserList   = Database::store_result($result);
+
+
+	foreach($CourseList as $enreg_course) {
+		$enreg_course = Database::escape_string($enreg_course);
+		$exists = false;
+		foreach($existingCourses as $existingCourse) {
+			if($enreg_course == $existingCourse['course_code']) {
+				$exists=true;
+			}
+		}
+		if(!$exists) {
+			$sql_insert_rel_course= "INSERT INTO $tbl_session_rel_course(id_session,course_code) VALUES('$id_session','$enreg_course')";
+			Database::query($sql_insert_rel_course);
+
+            $course_info = api_get_course_info($enreg_course);
+            CourseManager::update_course_ranking($course_info['real_id'], $id_session);
+
+			//We add in the existing courses table the current course, to not try to add another time the current course
+			$existingCourses[]=array('course_code'=>$enreg_course);
+			$nbr_users=0;
+			foreach ($UserList as $enreg_user) {
+				$enreg_user = Database::escape_string($enreg_user['id_user']);
+				$sql_insert = "INSERT IGNORE INTO $tbl_session_rel_course_rel_user(id_session,course_code,id_user) VALUES('$id_session','$enreg_course','$enreg_user')";
+				Database::query($sql_insert);
+				if(Database::affected_rows()) {
+					$nbr_users++;
+				}
+			}
+            SessionManager::installCourse($id_session, $course_info['real_id']);
+			Database::query("UPDATE $tbl_session_rel_course SET nbr_users=$nbr_users WHERE id_session='$id_session' AND course_code='$enreg_course'");
+		}
+	}
+
+	foreach ($existingCourses as $existingCourse) {
+		if (!in_array($existingCourse['course_code'], $CourseList)) {
+		    $course_info = api_get_course_info($existingCourse['course_code']);
+            CourseManager::remove_course_ranking($course_info['real_id'], $id_session);
+			Database::query("DELETE FROM $tbl_session_rel_course WHERE course_code='".$existingCourse['course_code']."' AND id_session=$id_session");
+			Database::query("DELETE FROM $tbl_session_rel_course_rel_user WHERE course_code='".$existingCourse['course_code']."' AND id_session=$id_session");
+            SessionManager::unInstallCourse($id_session, $course_info['real_id']);
+
+		}
+	}
+	$nbr_courses=count($CourseList);
+	Database::query("UPDATE $tbl_session SET nbr_courses=$nbr_courses WHERE id='$id_session'");
+
+	if (isset($add)) {
+		header('Location: add_users_to_session.php?id_session='.$id_session.'&add=true');
+    } else {
+		header('Location: resume_session.php?id_session='.$id_session);
+    }
+    exit;
+}
+
+// display the header
+Display::display_header($tool_name);
+
+if ($add_type == 'multiple') {
+	$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$add.'&add_type=unique">'.
+        Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
+	$link_add_type_multiple = Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').' ';
+} else {
+	$link_add_type_unique = Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'&nbsp;&nbsp;&nbsp;';
+	$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$add.'&add_type=multiple">'.
+        Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
+}
+
+// the form header
+$session_info = SessionManager::fetch($id_session);
+echo '<div class="actions">';
+echo $link_add_type_unique.$link_add_type_multiple;
+echo '</div>';
+
+$ajax_search = $add_type == 'unique' ? true : false;
+$nosessionCourses = $sessionCourses = array();
+if ($ajax_search) {
+
+	$sql="SELECT code, title, visual_code, id_session
+			FROM $tbl_course course
+			INNER JOIN $tbl_session_rel_course session_rel_course
+				ON course.code = session_rel_course.course_code
+				AND session_rel_course.id_session = ".intval($id_session)."
+			ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title";
+
+	if (api_is_multiple_url_enabled()) {
+		$tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+		$access_url_id = api_get_current_access_url_id();
+		if ($access_url_id != -1){
+			$sql="SELECT code, title, visual_code, id_session
+			FROM $tbl_course course
+			INNER JOIN $tbl_session_rel_course session_rel_course
+				ON course.code = session_rel_course.course_code
+				AND session_rel_course.id_session = ".intval($id_session)."
+				INNER JOIN $tbl_course_rel_access_url url_course ON (url_course.course_code=course.code)
+				WHERE access_url_id = $access_url_id
+			ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title";
+
+		}
+	}
+
+	$result = Database::query($sql);
+	$Courses = Database::store_result($result);
+
+	foreach ($Courses as $course) {
+		$sessionCourses[$course['code']] = $course ;
+	}
+} else {
+	$sql = "SELECT code, title, visual_code, id_session
+			FROM $tbl_course course
+			LEFT JOIN $tbl_session_rel_course session_rel_course
+				ON course.code = session_rel_course.course_code
+				AND session_rel_course.id_session = ".intval($id_session)."
+			ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title";
+
+	if (api_is_multiple_url_enabled()) {
+		$tbl_course_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_COURSE);
+		$access_url_id = api_get_current_access_url_id();
+		if ($access_url_id != -1){
+			$sql="SELECT code, title, visual_code, id_session
+				FROM $tbl_course course
+				LEFT JOIN $tbl_session_rel_course session_rel_course
+					ON course.code = session_rel_course.course_code
+					AND session_rel_course.id_session = ".intval($id_session)."
+				INNER JOIN $tbl_course_rel_access_url url_course ON (url_course.course_code=course.code)
+				WHERE access_url_id = $access_url_id
+				ORDER BY ".(sizeof($courses)?"(code IN(".implode(',',$courses).")) DESC,":"")." title";
+		}
+	}
+	$result = Database::query($sql);
+	$Courses = Database::store_result($result);
+	foreach($Courses as $course) {
+		if ($course['id_session'] == $id_session) {
+			$sessionCourses[$course['code']] = $course ;
+		} else {
+			$nosessionCourses[$course['code']] = $course ;
+		}
+	}
+}
+unset($Courses);
+?>
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($_GET['add'])) echo '&add=true' ; ?>" style="margin:0px;" <?php if($ajax_search){echo ' onsubmit="valide();"';}?>>
+<legend><?php echo $tool_name.' ('.$session_info['name'].')'; ?></legend>
+<input type="hidden" name="formSent" value="1" />
+
+<?php
+if(!empty($errorMsg))
+{
+	Display::display_normal_message($errorMsg); //main API
+}
+?>
+
+<table border="0" cellpadding="5" cellspacing="0" width="100%" align="center">
+<tr>
+  <td width="45%" align="center"><b><?php echo get_lang('CourseListInPlatform') ?> :</b></td>
+
+  <td width="10%">&nbsp;</td>
+  <td align="center" width="45%"><b><?php echo get_lang('CourseListInSession') ?> :</b></td>
+</tr>
+
+<?php if($add_type == 'multiple') { ?>
+<tr><td width="45%" align="center">
+ <?php echo get_lang('FirstLetterCourse'); ?> :
+     <select name="firstLetterCourse" onchange = "xajax_search_courses(this.value,'multiple')">
+      <option value="%">--</option>
+      <?php
+      echo Display :: get_alphabet_options();
+      echo Display :: get_numeric_options(0,9,'');
+      ?>
+     </select>
+</td>
+<td>&nbsp;</td></tr>
+<?php } ?>
+
+<tr>
+  <td width="45%" align="center">
+
+<?php
+if (!($add_type == 'multiple')) {
+	?>
+	<input type="text" id="course_to_add" onkeyup="xajax_search_courses(this.value,'single')" />
+	<div id="ajax_list_courses_single"></div>
+	<?php
+} else {
+	?>
+	<div id="ajax_list_courses_multiple">
+	<select id="origin" name="NoSessionCoursesList[]" multiple="multiple" size="20" style="width:360px;"> <?php
+	foreach($nosessionCourses as $enreg)
+	{
+		?>
+		<option value="<?php echo $enreg['code']; ?>" <?php echo 'title="'.htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES).'"'; if(in_array($enreg['code'],$CourseList)) echo 'selected="selected"'; ?>><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
+		<?php
+	}
+	?></select>
+	</div>
+	<?php
+}
+unset($nosessionCourses);
+?>
+	</td>
+	<td width="10%" valign="middle" align="center">
+  <?php
+  if ($ajax_search) {
+  ?>
+  	<button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination'))"></button>
+  <?php
+  } else {
+  ?>
+  	<button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))" onclick="moveItem(document.getElementById('origin'), document.getElementById('destination'))"></button>
+	<br /><br />
+	<button class="arrowl" type="button" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))" onclick="moveItem(document.getElementById('destination'), document.getElementById('origin'))"></button>
+  <?php
+  }
+  ?>
+	<br /><br /><br /><br /><br /><br />
+	<?php
+	if(isset($_GET['add'])) {
+		echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('NextStep').'</button>';
+	} else {
+		echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeCoursesToSession').'</button>';
+	}
+	?>
+  </td>
+  <td width="45%" align="center"><select id='destination' name="SessionCoursesList[]" multiple="multiple" size="20" style="width:360px;">
+
+<?php
+foreach($sessionCourses as $enreg)
+{
+?>
+	<option value="<?php echo $enreg['code']; ?>" title="<?php echo htmlspecialchars($enreg['title'].' ('.$enreg['visual_code'].')',ENT_QUOTES); ?>"><?php echo $enreg['title'].' ('.$enreg['visual_code'].')'; ?></option>
+
+<?php
+}
+unset($sessionCourses);
+?>
+  </select></td>
+</tr>
+</table>
+</form>
+<script type="text/javascript">
+function moveItem(origin , destination) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function sortOptions(options) {
+	newOptions = new Array();
+	for (i = 0 ; i<options.length ; i++) {
+		newOptions[i] = options[i];
+	}
+
+	newOptions = newOptions.sort(mysort);
+	options.length = 0;
+
+	for(i = 0 ; i < newOptions.length ; i++){
+		options[i] = newOptions[i];
+	}
+}
+
+function mysort(a, b){
+	if(a.text.toLowerCase() > b.text.toLowerCase()){
+		return 1;
+	}
+	if(a.text.toLowerCase() < b.text.toLowerCase()){
+		return -1;
+	}
+	return 0;
+}
+
+function valide(){
+	var options = document.getElementById('destination').options;
+	for (i = 0 ; i<options.length ; i++)
+		options[i].selected = true;
+
+	document.forms.formulaire.submit();
+}
+</script>
+<?php
+Display::display_footer();

+ 189 - 0
main/admin/add_students_to_session.php

@@ -0,0 +1,189 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ *   @package chamilo.admin
+ */
+
+// name of the language file that needs to be included
+$language_file = array('admin','registration');
+
+// resetting the course id
+$cidReset = true;
+
+// including some necessary files
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/xajax/xajax.inc.php';
+require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
+
+// setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// Access restrictions
+api_protect_admin_script(true);
+
+// setting breadcrumbs
+$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+
+// Setting the name of the tool
+$tool_name = get_lang('SubscribeStudentsToSession');
+$add_type = 'multiple';
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+$form_sent  = 0;
+$errorMsg   = '';
+$users = $sessions = array();
+
+$id = intval($_GET['id']);
+$htmlResult = null;
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent = $_POST['form_sent'];
+    if ($form_sent == 1) {
+        $sessionSourceList = $_POST['sessions'];
+        $sessionDestinationList = $_POST['sessions_destination'];
+        $result = SessionManager::copyStudentsFromSession($sessionSourceList, $sessionDestinationList);
+        foreach ($result as $message) {
+            $htmlResult .= $message;
+        }
+    }
+}
+
+$session_list = SessionManager::get_sessions_list(array(), array('name'));
+$sessionList = array();
+foreach ($session_list as $session) {
+    $sessionList[$session['id']] = $session['name'];
+}
+Display::display_header($tool_name);
+?>
+
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" >
+<?php echo '<legend>'.$tool_name.' </legend>';
+echo $htmlResult;
+echo Display::input('hidden', 'form_sent', '1');
+?>
+    <table border="0" cellpadding="5" cellspacing="0" width="100%">
+        <tr>
+            <td align="center">
+                <b><?php echo get_lang('Sessions') ?> :</b>
+            </td>
+            <td></td>
+            <td align="center">
+                <b><?php echo get_lang('Sessions') ?> :</b>
+            </td>
+        </tr>
+        <tr>
+            <td align="center">
+                <?php
+                 echo Display::select(
+                     'sessions[]',
+                     $sessionList,
+                     '',
+                     array('style'=>'width:360px', 'multiple'=>'multiple', 'id'=>'sessions', 'size'=>'15px'),
+                     false
+                 );
+                ?>
+            </td>
+            <td align="center">
+            </td>
+            <td align="center">
+                <?php
+                echo Display::select(
+                    'sessions_destination[]',
+                    $sessionList,
+                    '',
+                    array('style'=>'width:360px', 'id'=>'courses', 'size'=>'15px'),
+                    false
+                );
+                ?>
+            </td>
+        </tr>
+        <tr>
+            <td colspan="3" align="center">
+                <br />
+                <?php
+                echo '<button class="save" type="submit"" >'.
+                    get_lang('SubscribeStudentsToSession').'</button>';
+                ?>
+            </td>
+        </tr>
+    </table>
+</form>
+<script>
+    function moveItem(origin , destination) {
+        for(var i = 0 ; i<origin.options.length ; i++) {
+            if(origin.options[i].selected) {
+                destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+                origin.options[i]=null;
+                i = i-1;
+            }
+        }
+        destination.selectedIndex = -1;
+        sortOptions(destination.options);
+    }
+
+    function sortOptions(options) {
+        newOptions = new Array();
+        for (i = 0 ; i<options.length ; i++)
+            newOptions[i] = options[i];
+
+        newOptions = newOptions.sort(mysort);
+        options.length = 0;
+        for(i = 0 ; i < newOptions.length ; i++)
+            options[i] = newOptions[i];
+    }
+
+    function mysort(a, b){
+        if (a.text.toLowerCase() > b.text.toLowerCase()){
+            return 1;
+        }
+        if (a.text.toLowerCase() < b.text.toLowerCase()){
+            return -1;
+        }
+        return 0;
+    }
+
+    function valide(){
+        var options = document.getElementById('session_in_promotion').options;
+        for (i = 0 ; i<options.length ; i++)
+            options[i].selected = true;
+        document.forms.formulaire.submit();
+    }
+
+    function loadUsersInSelect(select) {
+        var xhr_object = null;
+        if(window.XMLHttpRequest) // Firefox
+            xhr_object = new XMLHttpRequest();
+        else if(window.ActiveXObject) // Internet Explorer
+            xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+        else  // XMLHttpRequest non supporté par le navigateur
+            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+        //xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
+        xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+        xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+        nosessionUsers = makepost(document.getElementById('session_not_in_promotion'));
+        sessionUsers = makepost(document.getElementById('session_in_promotion'));
+        nosessionClasses = makepost(document.getElementById('origin_classes'));
+        sessionClasses = makepost(document.getElementById('destination_classes'));
+        xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+        xhr_object.onreadystatechange = function() {
+            if(xhr_object.readyState == 4) {
+                document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+                //alert(xhr_object.responseText);
+            }
+        }
+    }
+
+    function makepost(select) {
+        var options = select.options;
+        var ret = "";
+        for (i = 0 ; i<options.length ; i++)
+            ret = ret + options[i].value +'::'+options[i].text+";;";
+        return ret;
+    }
+</script>
+<?php
+Display::display_footer();

+ 193 - 0
main/admin/add_teachers_to_session.php

@@ -0,0 +1,193 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+ *   @package chamilo.admin
+ */
+
+// name of the language file that needs to be included
+$language_file = array('admin','registration');
+
+// resetting the course id
+$cidReset = true;
+
+// including some necessary files
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/xajax/xajax.inc.php';
+require_once api_get_path(LIBRARY_PATH).'sessionmanager.lib.php';
+
+// setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+// Access restrictions
+api_protect_admin_script(true);
+
+// setting breadcrumbs
+$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+
+// Setting the name of the tool
+$tool_name = get_lang('EnrollTrainersFromExistingSessions');
+$add_type = 'multiple';
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
+    $add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+$form_sent  = 0;
+$errorMsg   = '';
+$users = $sessions = array();
+
+$id = intval($_GET['id']);
+$htmlResult = null;
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent = $_POST['form_sent'];
+    if ($form_sent == 1) {
+        $sessions = $_POST['sessions'];
+        $courses = $_POST['courses'];
+
+        $htmlResult = SessionManager::copyCoachesFromSessionToCourse($sessions, $courses);
+    }
+}
+
+$session_list = SessionManager::get_sessions_list(array(), array('name'));
+$sessionList = array();
+foreach ($session_list as $session) {
+    $sessionList[$session['id']] = $session['name'];
+}
+
+$courseList = CourseManager::get_courses_list(0, 0, 'title');
+$courseOptions = array();
+foreach ($courseList as $course) {
+    $courseOptions[$course['id']] = $course['title'];
+}
+Display::display_header($tool_name);
+?>
+
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>" style="margin:0px;" >
+<?php echo '<legend>'.$tool_name.' </legend>';
+echo $htmlResult;
+echo Display::input('hidden', 'form_sent', '1');
+?>
+    <table border="0" cellpadding="5" cellspacing="0" width="100%">
+        <tr>
+            <td align="center">
+                <b><?php echo get_lang('Sessions') ?> :</b>
+            </td>
+            <td></td>
+            <td align="center">
+                <b><?php echo get_lang('Courses') ?> :</b>
+            </td>
+        </tr>
+        <tr>
+            <td align="center">
+                <?php
+                 echo Display::select(
+                     'sessions[]',
+                     $sessionList,
+                     '',
+                     array('style'=>'width:360px', 'multiple'=>'multiple','id'=>'sessions', 'size'=>'15px'),
+                     false
+                 );
+                ?>
+            </td>
+            <td align="center">
+            </td>
+            <td align="center">
+                <?php
+                echo Display::select(
+                    'courses[]',
+                    $courseOptions,
+                    '',
+                    array('style'=>'width:360px', 'id'=>'courses', 'size'=>'15px'),
+                    false
+                );
+                ?>
+            </td>
+        </tr>
+        <tr>
+            <td colspan="3" align="center">
+                <br />
+                <?php
+                echo '<button class="save" type="submit"" >'.
+                    get_lang('SubscribeTeachersToSession').'</button>';
+                ?>
+            </td>
+        </tr>
+    </table>
+</form>
+<script>
+    function moveItem(origin , destination) {
+        for(var i = 0 ; i<origin.options.length ; i++) {
+            if(origin.options[i].selected) {
+                destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+                origin.options[i]=null;
+                i = i-1;
+            }
+        }
+        destination.selectedIndex = -1;
+        sortOptions(destination.options);
+    }
+
+    function sortOptions(options) {
+        newOptions = new Array();
+        for (i = 0 ; i<options.length ; i++)
+            newOptions[i] = options[i];
+
+        newOptions = newOptions.sort(mysort);
+        options.length = 0;
+        for(i = 0 ; i < newOptions.length ; i++)
+            options[i] = newOptions[i];
+    }
+
+    function mysort(a, b){
+        if (a.text.toLowerCase() > b.text.toLowerCase()){
+            return 1;
+        }
+        if (a.text.toLowerCase() < b.text.toLowerCase()){
+            return -1;
+        }
+        return 0;
+    }
+
+    function valide(){
+        var options = document.getElementById('session_in_promotion').options;
+        for (i = 0 ; i<options.length ; i++)
+            options[i].selected = true;
+        document.forms.formulaire.submit();
+    }
+
+    function loadUsersInSelect(select) {
+        var xhr_object = null;
+        if(window.XMLHttpRequest) // Firefox
+            xhr_object = new XMLHttpRequest();
+        else if(window.ActiveXObject) // Internet Explorer
+            xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+        else  // XMLHttpRequest non supporté par le navigateur
+            alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+        //xhr_object.open("GET", "loadUsersInSelect.ajax.php?id_session=<?php echo $id_session ?>&letter="+select.options[select.selectedIndex].text, false);
+        xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+        xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+        nosessionUsers = makepost(document.getElementById('session_not_in_promotion'));
+        sessionUsers = makepost(document.getElementById('session_in_promotion'));
+        nosessionClasses = makepost(document.getElementById('origin_classes'));
+        sessionClasses = makepost(document.getElementById('destination_classes'));
+        xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+        xhr_object.onreadystatechange = function() {
+            if(xhr_object.readyState == 4) {
+                document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+                //alert(xhr_object.responseText);
+            }
+        }
+    }
+
+    function makepost(select) {
+        var options = select.options;
+        var ret = "";
+        for (i = 0 ; i<options.length ; i++)
+            ret = ret + options[i].value +'::'+options[i].text+";;";
+        return ret;
+    }
+</script>
+<?php
+Display::display_footer();

+ 674 - 0
main/admin/add_users_to_session.php

@@ -0,0 +1,674 @@
+<?php
+/* For licensing terms, see /license.txt */
+/**
+*	@package chamilo.admin
+*/
+
+// name of the language file that needs to be included
+$language_file = array('admin','registration');
+
+// resetting the course id
+$cidReset = true;
+
+// including some necessary files
+require_once '../inc/global.inc.php';
+require_once '../inc/lib/xajax/xajax.inc.php';
+$xajax = new xajax();
+
+$xajax->registerFunction('search_users');
+
+// setting the section (for the tabs)
+$this_section = SECTION_PLATFORM_ADMIN;
+
+$id_session = intval($_GET['id_session']);
+
+$addProcess = isset($_GET['add']) ? Security::remove_XSS($_GET['add']) : null;
+
+SessionManager::protect_session_edit($id_session);
+
+// setting breadcrumbs
+$interbreadcrumb[] = array('url' => 'index.php','name' => get_lang('PlatformAdmin'));
+$interbreadcrumb[] = array('url' => 'session_list.php','name' => get_lang('SessionList'));
+$interbreadcrumb[] = array('url' => "resume_session.php?id_session=".$id_session,"name" => get_lang('SessionOverview'));
+
+// Database Table Definitions
+$tbl_session						= Database::get_main_table(TABLE_MAIN_SESSION);
+$tbl_course							= Database::get_main_table(TABLE_MAIN_COURSE);
+$tbl_user							= Database::get_main_table(TABLE_MAIN_USER);
+$tbl_session_rel_user				= Database::get_main_table(TABLE_MAIN_SESSION_USER);
+
+// setting the name of the tool
+$tool_name = get_lang('SubscribeUsersToSession');
+
+$add_type = 'unique';
+
+if (isset($_REQUEST['add_type']) && $_REQUEST['add_type']!='') {
+	$add_type = Security::remove_XSS($_REQUEST['add_type']);
+}
+
+$page = isset($_GET['page']) ? Security::remove_XSS($_GET['page']) : null;
+
+//checking for extra field with filter on
+
+$extra_field_list = UserManager::get_extra_fields();
+
+$new_field_list = array();
+if (is_array($extra_field_list)) {
+    foreach ($extra_field_list as $extra_field) {
+        //if is enabled to filter and is a "<select>" field type
+        if ($extra_field[8]==1 && $extra_field[2]==4) {
+            $new_field_list[] = array('name'=> $extra_field[3], 'variable'=>$extra_field[1], 'data'=> $extra_field[9]);
+        }
+    }
+}
+
+function search_users($needle, $type)
+{
+    global $tbl_user,$tbl_session_rel_user,$id_session;
+    $xajax_response = new XajaxResponse();
+    $return = '';
+
+    if (!empty($needle) && !empty($type)) {
+
+        //normal behaviour
+        if ($type == 'any_session' && $needle == 'false') {
+            $type = 'multiple';
+            $needle = '';
+        }
+
+        // xajax send utf8 datas... datas in db can be non-utf8 datas
+        $charset = api_get_system_encoding();
+        $needle = Database::escape_string($needle);
+        $needle = api_convert_encoding($needle, $charset, 'utf-8');
+
+        $order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
+        $cond_user_id = '';
+
+        //Only for single & multiple
+        if (in_array($type, array('single','multiple')))
+        if (!empty($id_session)) {
+            $id_session = intval($id_session);
+            // check id_user from session_rel_user table
+            $sql = 'SELECT id_user FROM '.$tbl_session_rel_user.'
+                    WHERE id_session ="'.$id_session.'" AND relation_type<>'.SESSION_RELATION_TYPE_RRHH.' ';
+            $res = Database::query($sql);
+            $user_ids = array();
+            if (Database::num_rows($res) > 0) {
+                while ($row = Database::fetch_row($res)) {
+                    $user_ids[] = (int)$row[0];
+                }
+            }
+            if (count($user_ids) > 0) {
+                $cond_user_id = ' AND user.user_id NOT IN('.implode(",",$user_ids).')';
+            }
+        }
+
+        switch ($type) {
+            case 'single':
+                // search users where username or firstname or lastname begins likes $needle
+                $sql = 'SELECT user.user_id, username, lastname, firstname, official_code
+                        FROM '.$tbl_user.' user
+                        WHERE (username LIKE "'.$needle.'%" OR firstname LIKE "'.$needle.'%"
+                            OR lastname LIKE "'.$needle.'%") AND user.status<>6 AND user.status<>'.DRH.''.
+                            $order_clause.
+                            ' LIMIT 11';
+                break;
+            case 'multiple':
+                $sql = 'SELECT user.user_id, username, lastname, firstname, official_code
+                        FROM '.$tbl_user.' user
+                        WHERE '.(api_sort_by_first_name() ? 'firstname' : 'lastname').' LIKE "'.$needle.'%" AND user.status<>'.DRH.' AND user.status<>6 '.$cond_user_id.
+                        $order_clause;
+                break;
+            case 'any_session':
+                $sql = 'SELECT DISTINCT user.user_id, username, lastname, firstname, official_code
+                        FROM '.$tbl_user.' user
+                        LEFT OUTER JOIN '.$tbl_session_rel_user.' s ON (s.id_user = user.user_id)
+                        WHERE   s.id_user IS null AND user.status<>'.DRH.' AND
+                                user.status<>6 '.$cond_user_id.
+                        $order_clause;
+                break;
+        }
+
+        if (api_is_multiple_url_enabled()) {
+            $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+            $access_url_id = api_get_current_access_url_id();
+            if ($access_url_id != -1) {
+                switch($type) {
+                    case 'single':
+                        $sql = 'SELECT user.user_id, username, lastname, firstname, official_code
+                        FROM '.$tbl_user.' user
+                        INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
+                        WHERE access_url_id = '.$access_url_id.'  AND (username LIKE "'.$needle.'%"
+                        OR firstname LIKE "'.$needle.'%"
+                        OR lastname LIKE "'.$needle.'%") AND user.status<>6 AND user.status<>'.DRH.' '.
+                        $order_clause.
+                        ' LIMIT 11';
+                        break;
+                    case 'multiple':
+                        $sql = 'SELECT user.user_id, username, lastname, firstname , official_code
+                        FROM '.$tbl_user.' user
+                        INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
+                        WHERE access_url_id = '.$access_url_id.' AND
+                            '.(api_sort_by_first_name() ? 'firstname' : 'lastname').' LIKE "'.$needle.'%" AND
+                                user.status<>'.DRH.' AND
+                                user.status<>6 '.$cond_user_id.
+                        $order_clause;
+                        break;
+                    case 'any_session' :
+                        $sql = 'SELECT DISTINCT user.user_id, username, lastname, firstname, official_code
+                            FROM '.$tbl_user.' user
+                            LEFT OUTER JOIN '.$tbl_session_rel_user.' s ON (s.id_user = user.user_id)
+                            INNER JOIN '.$tbl_user_rel_access_url.' url_user ON (url_user.user_id=user.user_id)
+                            WHERE
+                                access_url_id = '.$access_url_id.' AND
+                                s.id_user IS null AND
+                                user.status<>'.DRH.' AND
+                                user.status<>6 '.$cond_user_id.
+                        $order_clause;
+                        break;
+                }
+            }
+        }
+
+        $rs = Database::query($sql);
+        $i = 0;
+        if ($type=='single') {
+            while ($user = Database :: fetch_array($rs)) {
+                $i++;
+                if ($i<=10) {
+                    $person_name = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '.$user['official_code'];
+                    $return .= '<a href="javascript: void(0);" onclick="javascript: add_user_to_session(\''.$user['user_id'].'\',\''.$person_name.' '.'\')">'.$person_name.' </a><br />';
+                } else {
+                    $return .= '...<br />';
+                }
+            }
+
+            $xajax_response -> addAssign('ajax_list_users_single','innerHTML',api_utf8_encode($return));
+        } else {
+            global $nosessionUsersList;
+            $return .= '<select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" style="width:360px;">';
+            while ($user = Database :: fetch_array($rs)) {
+                $person_name = api_get_person_name($user['firstname'], $user['lastname']).' ('.$user['username'].') '.$user['official_code'];
+	            $return .= '<option value="'.$user['user_id'].'">'.$person_name.' </option>';
+			}
+			$return .= '</select>';
+			$xajax_response -> addAssign('ajax_list_users_multiple','innerHTML',api_utf8_encode($return));
+		}
+	}
+	return $xajax_response;
+}
+
+$xajax->processRequests();
+
+$htmlHeadXtra[] = $xajax->getJavascript('../inc/lib/xajax/');
+$htmlHeadXtra[] = '
+<script type="text/javascript">
+function add_user_to_session (code, content) {
+	document.getElementById("user_to_add").value = "";
+	document.getElementById("ajax_list_users_single").innerHTML = "";
+
+	destination = document.getElementById("destination_users");
+
+	for (i=0;i<destination.length;i++) {
+		if(destination.options[i].text == content) {
+				return false;
+		}
+	}
+	destination.options[destination.length] = new Option(content,code);
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function remove_item(origin) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+}
+
+function validate_filter() {
+    document.formulaire.add_type.value = \''.$add_type.'\';
+    document.formulaire.form_sent.value=0;
+    document.formulaire.submit();
+}
+
+function checked_in_no_session(checked) {
+    $("#first_letter_user")
+    .find("option")
+    .attr("selected", false);
+    xajax_search_users(checked, "any_session");
+}
+
+function change_select(val) {
+    $("#user_with_any_session_id").attr("checked", false);
+    xajax_search_users(val,"multiple");
+}
+</script>';
+
+$form_sent=0;
+$errorMsg=$firstLetterUser=$firstLetterSession='';
+$UserList=$SessionList=array();
+$sessions=array();
+$noPHP_SELF=true;
+
+if (isset($_POST['form_sent']) && $_POST['form_sent']) {
+    $form_sent             = $_POST['form_sent'];
+    $firstLetterUser       = $_POST['firstLetterUser'];
+    $firstLetterSession    = $_POST['firstLetterSession'];
+    $UserList              = $_POST['sessionUsersList'];
+
+    if (!is_array($UserList)) {
+        $UserList=array();
+    }
+
+    if ($form_sent == 1) {
+        // Added a parameter to send emails when registering a user
+        SessionManager::suscribe_users_to_session($id_session, $UserList, null, true);
+        header('Location: resume_session.php?id_session='.$id_session);
+        exit;
+    }
+}
+
+$session_info = SessionManager::fetch($id_session);
+Display::display_header($tool_name);
+
+$nosessionUsersList = $sessionUsersList = array();
+
+$ajax_search = $add_type == 'unique' ? true : false;
+
+$order_clause = api_sort_by_first_name() ? ' ORDER BY firstname, lastname, username' : ' ORDER BY lastname, firstname, username';
+if ($ajax_search) {
+    $sql = "SELECT user_id, lastname, firstname, username, id_session, official_code
+            FROM $tbl_user u
+            INNER JOIN $tbl_session_rel_user
+                ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                AND $tbl_session_rel_user.id_session = ".intval($id_session)."
+            WHERE u.status<>".DRH." AND u.status<>6 $order_clause";
+
+    if (api_is_multiple_url_enabled()) {
+        $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+        $access_url_id = api_get_current_access_url_id();
+        if ($access_url_id != -1) {
+            $sql="SELECT u.user_id, lastname, firstname, username, id_session, official_code
+            FROM $tbl_user u
+            INNER JOIN $tbl_session_rel_user
+                ON $tbl_session_rel_user.id_user = u.user_id AND $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                AND $tbl_session_rel_user.id_session = ".intval($id_session)."
+                INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+            WHERE access_url_id = $access_url_id AND u.status<>".DRH." AND u.status<>6
+            $order_clause";
+        }
+    }
+    $result = Database::query($sql);
+    $users = Database::store_result($result);
+    foreach ($users as $user) {
+        $sessionUsersList[$user['user_id']] = $user ;
+    }
+    unset($users); //clean to free memory
+} else {
+    //Filter by Extra Fields
+    $use_extra_fields = false;
+    if (is_array($extra_field_list)) {
+        if (is_array($new_field_list) && count($new_field_list)>0 ) {
+            $result_list=array();
+            foreach ($new_field_list as $new_field) {
+                $varname = 'field_'.$new_field['variable'];
+                if (UserManager::is_extra_field_available($new_field['variable'])) {
+                    if (isset($_POST[$varname]) && $_POST[$varname]!='0') {
+                        $use_extra_fields = true;
+                        $extra_field_result[]= UserManager::get_extra_user_data_by_value($new_field['variable'], $_POST[$varname]);
+                    }
+                }
+            }
+        }
+    }
+
+    if ($use_extra_fields) {
+        $final_result = array();
+       	if (count($extra_field_result)>1) {
+	    for($i=0;$i<count($extra_field_result)-1;$i++) {
+                if (is_array($extra_field_result[$i+1])) {
+                    $final_result  = array_intersect($extra_field_result[$i],$extra_field_result[$i+1]);
+                }
+            }
+        } else {
+            $final_result = $extra_field_result[0];
+        }
+
+        $where_filter ='';
+        if (api_is_multiple_url_enabled()) {
+            if (is_array($final_result) && count($final_result)>0) {
+                $where_filter = " AND u.user_id IN  ('".implode("','",$final_result)."') ";
+            } else {
+                //no results
+                $where_filter = " AND u.user_id  = -1";
+            }
+        } else {
+            if (is_array($final_result) && count($final_result)>0) {
+                $where_filter = " WHERE u.user_id IN  ('".implode("','", $final_result)."') ";
+            } else {
+                //no results
+                $where_filter = " WHERE u.user_id  = -1";
+            }
+        }
+    }
+
+    if ($use_extra_fields) {
+        $sql = "SELECT  user_id, lastname, firstname, username, id_session, official_code
+               FROM $tbl_user u
+                    LEFT JOIN $tbl_session_rel_user
+                    ON $tbl_session_rel_user.id_user = u.user_id AND
+                    $tbl_session_rel_user.id_session = '$id_session' AND
+                    $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                $where_filter AND u.status<>".DRH." AND u.status<>6
+                $order_clause";
+
+    } else {
+        $sql = "SELECT  user_id, lastname, firstname, username, id_session, official_code
+                FROM $tbl_user u
+                LEFT JOIN $tbl_session_rel_user
+                ON $tbl_session_rel_user.id_user = u.user_id AND
+                $tbl_session_rel_user.id_session = '$id_session' AND
+                $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                WHERE u.status<>".DRH." AND u.status<>6
+                $order_clause";
+    }
+    if (api_is_multiple_url_enabled()) {
+        $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+        $access_url_id = api_get_current_access_url_id();
+        if ($access_url_id != -1) {
+            $sql = "SELECT  u.user_id, lastname, firstname, username, id_session, official_code
+                    FROM $tbl_user u
+                    LEFT JOIN $tbl_session_rel_user
+                        ON $tbl_session_rel_user.id_user = u.user_id AND
+                        $tbl_session_rel_user.id_session = '$id_session' AND
+                        $tbl_session_rel_user.relation_type <> ".SESSION_RELATION_TYPE_RRHH."
+                    INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+                    WHERE access_url_id = $access_url_id $where_filter AND u.status<>".DRH." AND u.status<>6
+                    $order_clause";
+        }
+    }
+
+    $result   = Database::query($sql);
+    $users    = Database::store_result($result,'ASSOC');
+    foreach ($users as $uid => $user) {
+        if ($user['id_session'] != $id_session) {
+            $nosessionUsersList[$user['user_id']] = array(
+                'fn' => $user['firstname'],
+                'ln' => $user['lastname'],
+                'un' => $user['username'],
+                'official_code' => $user['official_code']
+            ) ;
+            unset($users[$uid]);
+	}
+    }
+    unset($users); //clean to free memory
+
+    //filling the correct users in list
+    $sql="SELECT  user_id, lastname, firstname, username, id_session, official_code
+          FROM $tbl_user u
+          LEFT JOIN $tbl_session_rel_user
+          ON $tbl_session_rel_user.id_user = u.user_id AND
+            $tbl_session_rel_user.id_session = '$id_session' AND
+            $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+          WHERE u.status<>".DRH." AND u.status<>6 $order_clause";
+
+    if (api_is_multiple_url_enabled()) {
+        $tbl_user_rel_access_url= Database::get_main_table(TABLE_MAIN_ACCESS_URL_REL_USER);
+        $access_url_id = api_get_current_access_url_id();
+        if ($access_url_id != -1) {
+            $sql="SELECT  u.user_id, lastname, firstname, username, id_session, official_code
+                FROM $tbl_user u
+                LEFT JOIN $tbl_session_rel_user
+                    ON $tbl_session_rel_user.id_user = u.user_id AND
+                    $tbl_session_rel_user.id_session = '$id_session' AND
+                    $tbl_session_rel_user.relation_type<>".SESSION_RELATION_TYPE_RRHH."
+                INNER JOIN $tbl_user_rel_access_url url_user ON (url_user.user_id=u.user_id)
+                WHERE access_url_id = $access_url_id AND u.status<>".DRH." AND u.status<>6
+                $order_clause";
+        }
+    }
+    $result = Database::query($sql);
+    $users = Database::store_result($result,'ASSOC');
+    foreach ($users as $uid => $user) {
+        if ($user['id_session'] == $id_session) {
+            $sessionUsersList[$user['user_id']] = $user;
+            if (array_key_exists($user['user_id'],$nosessionUsersList)) {
+                unset($nosessionUsersList[$user['user_id']]);
+            }
+        }
+        unset($users[$uid]);
+    }
+    unset($users); //clean to free memory
+}
+
+if ($add_type == 'multiple') {
+	$link_add_type_unique = '<a href="'.api_get_self().'?id_session='.$id_session.'&add='.$addProcess.'&add_type=unique">'.Display::return_icon('single.gif').get_lang('SessionAddTypeUnique').'</a>';
+	$link_add_type_multiple = Display::url(Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple'), '');
+} else {
+	$link_add_type_unique = Display::url(Display::return_icon('single.gif').get_lang('SessionAddTypeUnique'), '');
+	$link_add_type_multiple = '<a href="'.api_get_self().'?id_session='.$id_session.'&amp;add='.$addProcess.'&amp;add_type=multiple">'.Display::return_icon('multiple.gif').get_lang('SessionAddTypeMultiple').'</a>';
+}
+$link_add_group = '<a href="usergroups.php">'.Display::return_icon('multiple.gif',get_lang('RegistrationByUsersGroups')).get_lang('RegistrationByUsersGroups').'</a>';
+
+$newLinks = Display::url(get_lang('EnrollTrainersFromExistingSessions'), api_get_path(WEB_CODE_PATH).'admin/add_teachers_to_session.php');
+$newLinks .= Display::url(get_lang('EnrollStudentsFromExistingSessions'), api_get_path(WEB_CODE_PATH).'admin/add_students_to_session.php');
+?>
+<div class="actions">
+	<?php
+    echo $link_add_type_unique;
+    echo $link_add_type_multiple;
+    echo $link_add_group;
+    echo $newLinks;
+    ?>
+</div>
+<form name="formulaire" method="post" action="<?php echo api_get_self(); ?>?page=<?php echo $page; ?>&id_session=<?php echo $id_session; ?><?php if(!empty($addProcess)) echo '&add=true' ; ?>" style="margin:0px;" <?php if ($ajax_search) { echo ' onsubmit="valide();"';}?>>
+<?php echo '<legend>'.$tool_name.' ('.$session_info['name'].') </legend>'; ?>
+<?php
+if ($add_type=='multiple') {
+	if (is_array($extra_field_list)) {
+		if (is_array($new_field_list) && count($new_field_list)>0 ) {
+			echo '<h3>'.get_lang('FilterUsers').'</h3>';
+			foreach ($new_field_list as $new_field) {
+				echo $new_field['name'];
+				$varname = 'field_'.$new_field['variable'];
+				echo '&nbsp;<select name="'.$varname.'">';
+				echo '<option value="0">--'.get_lang('Select').'--</option>';
+				foreach	($new_field['data'] as $option) {
+					$checked='';
+					if (isset($_POST[$varname])) {
+						if ($_POST[$varname]==$option[1]) {
+							$checked = 'selected="true"';
+						}
+					}
+					echo '<option value="'.$option[1].'" '.$checked.'>'.$option[1].'</option>';
+				}
+				echo '</select>';
+				echo '&nbsp;&nbsp;';
+			}
+			echo '<input type="button" value="'.get_lang('Filter').'" onclick="validate_filter()" />';
+			echo '<br /><br />';
+		}
+	}
+}
+?>
+<input type="hidden" name="form_sent" value="1" />
+<input type="hidden" name="add_type"  />
+
+<?php
+if (!empty($errorMsg)) {
+	Display::display_normal_message($errorMsg); //main API
+}
+?>
+<div class="row">
+    <div class="span5">
+        <div class="multiple_select_header">
+            <b><?php echo get_lang('UserListInPlatform') ?> :</b>
+
+        <?php if ($add_type=='multiple') { ?>
+            <?php echo get_lang('FirstLetterUser'); ?> :
+                <select id="first_letter_user" name="firstLetterUser" onchange = "change_select(this.value);" >
+                <option value = "%">--</option>
+                <?php
+                    echo Display :: get_alphabet_options();
+                ?>
+                </select>
+        <?php } ?>
+        </div>
+            <div id="content_source">
+            <?php
+            if (!($add_type=='multiple')) {
+              ?>
+              <input type="text" id="user_to_add" onkeyup="xajax_search_users(this.value,'single')" />
+              <div id="ajax_list_users_single"></div>
+              <?php
+            } else {
+            ?>
+            <div id="ajax_list_users_multiple">
+            <select id="origin_users" name="nosessionUsersList[]" multiple="multiple" size="15" class="span5">
+              <?php
+              foreach ($nosessionUsersList as $uid => $enreg) {
+              ?>
+                  <option value="<?php echo $uid; ?>" <?php if(in_array($uid,$UserList)) echo 'selected="selected"'; ?>>
+                      <?php echo api_get_person_name($enreg['fn'], $enreg['ln']).' ('.$enreg['un'].') '.$enreg['official_code']; ?>
+                  </option>
+              <?php
+              }
+              ?>
+            </select>
+            </div>
+                <input type="checkbox" onchange="checked_in_no_session(this.checked);" name="user_with_any_session" id="user_with_any_session_id">
+                <label for="user_with_any_session_id"><?php echo get_lang('UsersRegisteredInNoSession'); ?></label>
+            <?php
+            }
+            unset($nosessionUsersList);
+           ?>
+        </div>
+    </div>
+
+    <div class="span2">
+        <div style="padding-top:54px;width:auto;text-align: center;">
+        <?php
+            if ($ajax_search) {
+            ?>
+              <button class="arrowl" type="button" onclick="remove_item(document.getElementById('destination_users'))" ></button>
+            <?php
+        } else {
+            ?>
+                <button class="arrowr" type="button" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))" onclick="moveItem(document.getElementById('origin_users'), document.getElementById('destination_users'))">
+                </button>
+                <br /><br />
+                <button class="arrowl" type="button" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))" onclick="moveItem(document.getElementById('destination_users'), document.getElementById('origin_users'))">
+                </button>
+              <?php
+            }
+        ?>
+        </div>
+        <br />
+        <br />
+		<?php
+		if (!empty($addProcess)) {
+			echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('FinishSessionCreation').'</button>';
+        } else {
+			echo '<button class="save" type="button" value="" onclick="valide()" >'.get_lang('SubscribeUsersToSession').'</button>';
+        }
+		?>
+    </div>
+
+    <div class="span5">
+        <div class="multiple_select_header">
+            <b><?php echo get_lang('UserListInSession') ?> :</b>
+        </div>
+        <select id="destination_users" name="sessionUsersList[]" multiple="multiple" size="15" class="span5">
+        <?php
+        foreach ($sessionUsersList as $enreg) {
+        ?>
+            <option value="<?php echo $enreg['user_id']; ?>">
+                <?php echo api_get_person_name($enreg['firstname'], $enreg['lastname']).' ('.$enreg['username'].') '.$enreg['official_code']; ?>
+            </option>
+        <?php
+        }
+        unset($sessionUsersList);
+        ?>
+        </select>
+    </div>
+</div>
+</form>
+<script>
+function moveItem(origin , destination) {
+	for(var i = 0 ; i<origin.options.length ; i++) {
+		if(origin.options[i].selected) {
+			destination.options[destination.length] = new Option(origin.options[i].text,origin.options[i].value);
+			origin.options[i]=null;
+			i = i-1;
+		}
+	}
+	destination.selectedIndex = -1;
+	sortOptions(destination.options);
+}
+
+function sortOptions(options) {
+	newOptions = new Array();
+	for (i = 0 ; i<options.length ; i++)
+		newOptions[i] = options[i];
+
+	newOptions = newOptions.sort(mysort);
+	options.length = 0;
+	for(i = 0 ; i < newOptions.length ; i++)
+		options[i] = newOptions[i];
+}
+
+function mysort(a, b){
+	if(a.text.toLowerCase() > b.text.toLowerCase()){
+		return 1;
+	}
+	if(a.text.toLowerCase() < b.text.toLowerCase()){
+		return -1;
+	}
+	return 0;
+}
+
+function valide(){
+	var options = document.getElementById('destination_users').options;
+	for (i = 0 ; i<options.length ; i++)
+		options[i].selected = true;
+	document.forms.formulaire.submit();
+}
+
+function loadUsersInSelect(select){
+	var xhr_object = null;
+	if(window.XMLHttpRequest) // Firefox
+		xhr_object = new XMLHttpRequest();
+	else if(window.ActiveXObject) // Internet Explorer
+		xhr_object = new ActiveXObject("Microsoft.XMLHTTP");
+	else  // XMLHttpRequest non supporté par le navigateur
+	alert("Votre navigateur ne supporte pas les objets XMLHTTPRequest...");
+
+	xhr_object.open("POST", "loadUsersInSelect.ajax.php");
+	xhr_object.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
+	nosessionUsers = makepost(document.getElementById('origin_users'));
+	sessionUsers = makepost(document.getElementById('destination_users'));
+	nosessionClasses = makepost(document.getElementById('origin_classes'));
+	sessionClasses = makepost(document.getElementById('destination_classes'));
+	xhr_object.send("nosessionusers="+nosessionUsers+"&sessionusers="+sessionUsers+"&nosessionclasses="+nosessionClasses+"&sessionclasses="+sessionClasses);
+
+	xhr_object.onreadystatechange = function() {
+		if (xhr_object.readyState == 4) {
+			document.getElementById('content_source').innerHTML = result = xhr_object.responseText;
+		}
+	}
+}
+
+function makepost(select) {
+	var options = select.options;
+	var ret = "";
+	for (i = 0 ; i<options.length ; i++)
+		ret = ret + options[i].value +'::'+options[i].text+";;";
+	return ret;
+}
+</script>
+<?php
+
+Display::display_footer();

+ 1 - 1
main/admin/add_users_to_usergroup.php

@@ -11,7 +11,7 @@ $language_file = array('admin','registration');
 $cidReset = true;
 
 // including some necessary files
-require_once '../inc/global.inc.php';
+//require_once '../inc/global.inc.php';
 
 // setting the section (for the tabs)
 $this_section = SECTION_PLATFORM_ADMIN;

+ 2 - 4
main/admin/change_user_session.php

@@ -77,7 +77,5 @@ $(document).ready(function() {
 
 </script>';
 
-$tpl = $app['template'];
-$tpl->assign('message', $message);
-$tpl->assign('content', $content);
-$tpl->display_one_col_template();
+echo $message;
+echo $content;

+ 0 - 47
main/admin/class_add.php

@@ -1,47 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
-*	@package chamilo.admin
-*/
-/**
- * Code
- */
-// Language files that should be included.
-$language_file = 'admin';
-
-// Resetting the course id.
-$cidReset = true;
-
-// Including some necessary dokeos files.
-require_once '../inc/global.inc.php';
-
-// Setting the section (for the tabs).
-$this_section = SECTION_PLATFORM_ADMIN;
-
-// Access restrictions.
-api_protect_admin_script();
-
-// Setting breadcrumbs.
-$interbreadcrumb[] = array('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('Classes'));
-
-// Setting the name of the tool.
-$tool_name = get_lang("AddClasses");
-
-$form = new FormValidator('add_class');
-$form->add_textfield('name', get_lang('ClassName'));
-$form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"');
-if ($form->validate()) {
-    $values = $form->exportValues();
-    ClassManager::create_class($values['name']);
-    header('Location: class_list.php');
-}
-
-// Displaying the header.
-Display :: display_header($tool_name);
-
-// Displaying the form.
-$form->display();
-
-// Displaying the footer.
-Display :: display_footer();

+ 0 - 52
main/admin/class_edit.php

@@ -1,52 +0,0 @@
-<?php
-/* For licensing terms, see /license.txt */
-/**
-*	@package chamilo.admin
-*/
-/**
- * Code
- */
-// Language files that should be included.
-$language_file = 'admin';
-
-// Resetting the course id.
-$cidReset = true;
-
-// Including some necessary dokeos files.
-require_once '../inc/global.inc.php';
-require_once api_get_path(LIBRARY_PATH).'classmanager.lib.php';
-
-// Setting the section (for the tabs).
-$this_section = SECTION_PLATFORM_ADMIN;
-
-// Access restrictions.
-api_protect_admin_script();
-
-// Setting breadcrumbs.
-$interbreadcrumb[] = array ('url' => 'index.php', 'name' => get_lang('PlatformAdmin'));
-$interbreadcrumb[] = array ('url' => 'class_list.php', 'name' => get_lang('AdminClasses'));
-
-
-// Setting the name of the tool.
-$tool_name = get_lang('AddClasses');
-
-$tool_name = get_lang('ModifyClassInfo');
-$class_id = intval($_GET['idclass']);
-$class = ClassManager :: get_class_info($class_id);
-$form = new FormValidator('edit_class', 'post', 'class_edit.php?idclass='.$class_id);
-$form->add_textfield('name',get_lang('ClassName'));
-$form->addElement('style_submit_button', 'submit', get_lang('Ok'), 'class="add"');
-$form->setDefaults(array('name'=>$class['name']));
-if($form->validate())
-{
-    $values = $form->exportValues();
-    ClassManager :: set_name($values['name'], $class_id);
-    header('Location: class_list.php');
-}
-
-Display :: display_header($tool_name);
-//api_display_tool_title($tool_name);
-$form->display();
-
-// Displaying the footer.
-Display :: display_footer();

Some files were not shown because too many files changed in this diff