Fix 1.11 install, mix login with chamilo and sonata/symfony2

ofaj
jmontoyaa 10 years ago
parent c0c44ea693
commit c9a4165d0f
  1. 6
      app/AppKernel.php
  2. 10
      app/Migrations/Schema/V111/Version20160330103045.php
  3. 2
      app/config/assetic.yml
  4. 2
      app/config/fos/fos_user.yml
  5. 49
      app/config/routing.yml
  6. 73
      app/config/routing_front.yml
  7. 11
      app/config/security.yml
  8. 6
      app/config/sonata/sonata_admin.yml
  9. 1
      app/config/sonata/sonata_page.yml
  10. 4
      app/config/sonata/sonata_user.yml
  11. 4
      main/inc/lib/database.lib.php
  12. 4
      main/inc/lib/usermanager.lib.php
  13. 89
      main/install/index.php
  14. 21
      src/Chamilo/AdminBundle/ChamiloAdminBundle.php
  15. 44
      src/Chamilo/AdminBundle/Resources/views/layout.html.twig
  16. 375
      src/Chamilo/AdminBundle/Resources/views/standard_layout.html.twig
  17. 25
      src/Chamilo/PageBundle/Resources/config/doctrine/User.orm.xml
  18. 75
      src/Chamilo/UserBundle/Entity/Group.php
  19. 52
      src/Chamilo/UserBundle/Entity/User.php
  20. 4
      src/Chamilo/UserBundle/Resources/views/ChangePassword/changePassword.html.twig
  21. 8
      src/Chamilo/UserBundle/Resources/views/ChangePassword/changePassword_content.html.twig
  22. 37
      src/Chamilo/UserBundle/Resources/views/Profile/action.html.twig
  23. 26
      src/Chamilo/UserBundle/Resources/views/Profile/edit_authentication.html.twig
  24. 72
      src/Chamilo/UserBundle/Resources/views/Profile/edit_profile.html.twig
  25. 39
      src/Chamilo/UserBundle/Resources/views/Profile/show.html.twig
  26. 19
      src/Chamilo/UserBundle/Resources/views/Registration/register_content.html.twig
  27. 10
      src/Chamilo/UserBundle/Resources/views/Resetting/checkEmail.html.twig
  28. 11
      src/Chamilo/UserBundle/Resources/views/Resetting/email.txt.twig
  29. 10
      src/Chamilo/UserBundle/Resources/views/Resetting/passwordAlreadyRequested.html.twig
  30. 5
      src/Chamilo/UserBundle/Resources/views/Resetting/request.html.twig
  31. 23
      src/Chamilo/UserBundle/Resources/views/Resetting/request_content.html.twig
  32. 5
      src/Chamilo/UserBundle/Resources/views/Resetting/reset.html.twig
  33. 8
      src/Chamilo/UserBundle/Resources/views/Resetting/reset_content.html.twig
  34. 94
      src/Chamilo/UserBundle/Resources/views/Security/base_login.html.twig
  35. 61
      src/Chamilo/UserBundle/Resources/views/Security/login.html.twig
  36. 6
      src/Chamilo/UserBundle/Resources/views/layout.html.twig
  37. 1
      src/Chamilo/UserBundle/Security/Encoder.php
  38. 12
      web/.htaccess

@ -93,10 +93,10 @@ class AppKernel extends Kernel
//new Chamilo\InstallerBundle\ChamiloInstallerBundle(),
new Chamilo\CoreBundle\ChamiloCoreBundle(),
new Chamilo\CourseBundle\ChamiloCourseBundle(),
/* new Chamilo\SettingsBundle\ChamiloSettingsBundle(),
new Chamilo\ThemeBundle\ChamiloThemeBundle(), */
// new Chamilo\SettingsBundle\ChamiloSettingsBundle(),
// new Chamilo\ThemeBundle\ChamiloThemeBundle(),
//new Chamilo\NotificationBundle\ChamiloNotificationBundle(),
//new Chamilo\AdminBundle\ChamiloAdminBundle(),
new Chamilo\AdminBundle\ChamiloAdminBundle(),
//new Chamilo\TimelineBundle\ChamiloTimelineBundle(),
// Based in Sonata

@ -103,8 +103,10 @@ class Version20160330103045 extends AbstractMigration
$this->addSql('DROP INDEX UNIQ_8D93D649F85E0677 ON user');
$this->addSql(
'ALTER TABLE user ADD email_canonical VARCHAR(255) NOT NULL, ADD enabled TINYINT(1) NOT NULL, ADD locked TINYINT(1) NOT NULL, ADD expired TINYINT(1) NOT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', ADD credentials_expired TINYINT(1) NOT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, CHANGE username username VARCHAR(255) NOT NULL, CHANGE username_canonical username_canonical VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL'
'ALTER TABLE user ADD email_canonical VARCHAR(255) NOT NULL, ADD credentials_expired TINYINT(1), ADD credentials_expire_at DATETIME DEFAULT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD expired TINYINT(1), ADD locked TINYINT(1),ADD enabled TINYINT(1) NOT NULL, ADD locked TINYINT(1) NOT NULL, ADD expired TINYINT(1) NOT NULL, ADD expires_at DATETIME DEFAULT NULL, ADD roles LONGTEXT NOT NULL COMMENT \'(DC2Type:array)\', ADD credentials_expired TINYINT(1) NOT NULL, ADD credentials_expire_at DATETIME DEFAULT NULL, CHANGE username username VARCHAR(255) NOT NULL, CHANGE username_canonical username_canonical VARCHAR(255) NOT NULL, CHANGE email email VARCHAR(255) NOT NULL'
);
$this->addSql('ALTER TABLE user ADD enabled TINYINT(1) NOT NULL;');
$this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649A0D96FBF ON user (email_canonical)');
$sql = "UPDATE user SET email_canonical = email";
@ -115,10 +117,16 @@ class Version20160330103045 extends AbstractMigration
$sql = "UPDATE user SET roles = 'a:0:{}'";
$this->addSql($sql);
$sql = "UPDATE user SET enabled = '1' WHERE active = 1" ;
$this->addSql($sql);
$sql = "UPDATE user SET username_canonical = username";
$this->addSql($sql);
$this->addSql("CREATE TABLE fos_user_user_group (user_id INT NOT NULL, group_id INT NOT NULL, INDEX IDX_B3C77447A76ED395 (user_id), INDEX IDX_B3C77447FE54D947 (group_id), PRIMARY KEY(user_id, group_id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
$this->addSql("CREATE TABLE fos_group (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, roles LONGTEXT NOT NULL COMMENT '(DC2Type:array)', code VARCHAR(40) NOT NULL, UNIQUE INDEX UNIQ_4B019DDB5E237E06 (name), UNIQUE INDEX UNIQ_4B019DDB77153098 (code), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB;");
$this->addSql("ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447A76ED395 FOREIGN KEY (user_id) REFERENCES user (id);");
$this->addSql("ALTER TABLE fos_user_user_group ADD CONSTRAINT FK_B3C77447FE54D947 FOREIGN KEY (group_id) REFERENCES fos_group (id);");
}
/**

@ -235,7 +235,7 @@ assetic:
inputs:
- %kernel.root_dir%/../web/bundles/sonatacore/vendor/bootstrap/dist/css/bootstrap.min.css
- %kernel.root_dir%/../web/bundles/sonatacore/vendor/select2/select2.css
- %kernel.root_dir%/../web/bundles/mopabootstrap/css/datepicker.css
# - %kernel.root_dir%/../web/bundles/mopabootstrap/css/datepicker.css
# - %kernel.root_dir%/../web/bundles/sonatademo/css/demo.css
filters:

@ -3,7 +3,7 @@ fos_user:
firewall_name: main
# if you change the class configuration, please also alter the sonata_user.yml file
user_class: Chamilo\UserBundle\Entity\User
user_class: Chamilo\PageBundle\Entity\User
group:
group_class: Chamilo\UserBundle\Entity\Group

@ -4,33 +4,30 @@ home:
index:
path: /
oro_distribution_security_logout:
path: /logout
admin_dashboard:
pattern: /{_locale}/administration/
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: sonata_admin_dashboard
permanent: true # this for 301
admin_without_locale:
pattern: /administration
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: sonata_admin_dashboard
permanent: true # this for 301
admin_dashboard_without_locale:
pattern: /administration/dashboard
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: sonata_admin_dashboard
permanent: true
#admin_dashboard:
# pattern: /administration/
# defaults:
# _controller: FrameworkBundle:Redirect:redirect
# route: sonata_admin_dashboard
# permanent: true # this for 301
#admin_without_locale:
# pattern: /administration
# defaults:
# _controller: FrameworkBundle:Redirect:redirect
# route: sonata_admin_dashboard
# permanent: true # this for 301
#admin_dashboard_without_locale:
# pattern: /administration/dashboard
# defaults:
# _controller: FrameworkBundle:Redirect:redirect
# route: sonata_admin_dashboard
# permanent: true
admin:
resource: '@SonataAdminBundle/Resources/config/routing/sonata_admin.xml'
prefix: /{_locale}/administration
prefix: /administration
#hwi_oauth_redirect:
# resource: "@HWIOAuthBundle/Resources/config/routing/redirect.xml"
@ -53,8 +50,8 @@ sonata_user_admin_security_logout:
#_courses:
# resource: routing_courses.yml
#
#_front:
# resource: routing_front.yml
_front:
resource: routing_front.yml
_admin:
resource: routing_admin.yml

@ -0,0 +1,73 @@
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_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 }

@ -2,6 +2,7 @@
# http://symfony.com/doc/current/book/security.html
security:
access_control:
- { path: ^/administrator, role: ROLE_ADMIN }
- { path: ^/efconnect, role: ROLE_USER }
- { path: ^/elfinder, role: ROLE_USER }
@ -59,9 +60,9 @@ security:
context: user
form_login:
provider: fos_userbundle
login_path: /administration/login
login_path: /login
use_forward: false
check_path: /administration/login_check
check_path: /login_check
failure_path: null
default_target_path: /
# success_handler: chamilo_core.listener.login_success_handler
@ -73,10 +74,4 @@ security:
# handlers: ['sonata.page.cms_manager_selector']
anonymous: ~
switch_user: false
# activate different ways to authenticate
# http_basic: ~
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
# form_login: ~
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html

@ -5,7 +5,7 @@ sonata_admin:
# default value, change it to sonata.admin.security.handler.acl to use ACL
security:
handler: sonata.admin.security.handler.role
title: Chamilo #%sonata_admin.title%
title: Chamilo #%sonata_admin.title%
title_logo: css/themes/chamilo/images/header-logo.png #%sonata_admin.logo_title%
options:
html5_validate: false # does not use html5 validation
@ -15,11 +15,11 @@ sonata_admin:
# 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.
# layout: ChamiloAdminBundle::layout.html.twig
layout: ChamiloAdminBundle::layout.html.twig
# layout: ApplicationSonataAdminBundle::standard_layout.html.twig
#layout: ApplicationSonataAdminBundle::demo_layout.html.twig
layout: SonataAdminBundle::standard_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

@ -49,6 +49,7 @@ sonata_page:
- fos_user(.*)
- sylius_flow(.*)
ignore_routes:
- home
- elfinder

@ -47,9 +47,9 @@ sonata_user:
#- { route: 'sonata_customer_addresses', label: 'link_list_addresses', domain: 'SonataCustomerBundle'}
#- { route: 'sonata_order_index', label: 'order_list', domain: 'SonataOrderBundle'}
form:
type: chamilo_sonata_user_profile
type: sonata_user_registration
handler: sonata.user.profile.form.handler.default
name: chamilo_sonata_user_profile
name: sonata_user_registration_form
validation_groups:
- Profile

@ -665,12 +665,14 @@ class Database
$proxyDir = $path.'app/cache/';
return \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(
$config = \Doctrine\ORM\Tools\Setup::createAnnotationMetadataConfiguration(
$paths,
$isDevMode,
$proxyDir,
$cache,
$isSimpleMode
);
return $config;
}
}

@ -351,7 +351,9 @@ class UserManager
->setLanguage($language)
->setRegistrationDate($now)
->setHrDeptId($hr_dept_id)
->setActive($active);
->setActive($active)
->setEnabled($active)
;
if (!empty($expirationDate)) {
$user->setExpirationDate($expirationDate);

@ -800,13 +800,98 @@ if (@$_POST['step2']) {
$dbPortForm
);
$metadataList = $manager->getMetadataFactory()->getAllMetadata();
$metadataList = $manager->getMetadataFactory()->getAllMetadata();
$schema = $manager->getConnection()->getSchemaManager()->createSchema();
// Create database schema
$tool = new \Doctrine\ORM\Tools\SchemaTool($manager);
$tool->createSchema($metadataList);
$connection = $manager->getConnection();
$connection->executeQuery(
'CREATE TABLE page__site (id INT AUTO_INCREMENT NOT NULL, enabled TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, relative_path VARCHAR(255) DEFAULT NULL, host VARCHAR(255) NOT NULL, enabled_from DATETIME DEFAULT NULL, enabled_to DATETIME DEFAULT NULL, is_default TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, locale VARCHAR(6) DEFAULT NULL, title VARCHAR(64) DEFAULT NULL, meta_keywords VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE page__page (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, parent_id INT DEFAULT NULL, target_id INT DEFAULT NULL, route_name VARCHAR(255) NOT NULL, page_alias VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, decorate TINYINT(1) NOT NULL, edited TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, slug LONGTEXT DEFAULT NULL, url LONGTEXT DEFAULT NULL, custom_url LONGTEXT DEFAULT NULL, request_method VARCHAR(255) DEFAULT NULL, title VARCHAR(255) DEFAULT NULL, meta_keyword VARCHAR(255) DEFAULT NULL, meta_description VARCHAR(255) DEFAULT NULL, javascript LONGTEXT DEFAULT NULL, stylesheet LONGTEXT DEFAULT NULL, raw_headers LONGTEXT DEFAULT NULL, template VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_2FAE39EDF6BD1646 (site_id), INDEX IDX_2FAE39ED727ACA70 (parent_id), INDEX IDX_2FAE39ED158E0B66 (target_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE page__snapshot (id INT AUTO_INCREMENT NOT NULL, site_id INT DEFAULT NULL, page_id INT DEFAULT NULL, route_name VARCHAR(255) NOT NULL, page_alias VARCHAR(255) DEFAULT NULL, type VARCHAR(255) DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, decorate TINYINT(1) NOT NULL, name VARCHAR(255) NOT NULL, url LONGTEXT DEFAULT NULL, parent_id INT DEFAULT NULL, target_id INT DEFAULT NULL, content LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', publication_date_start DATETIME DEFAULT NULL, publication_date_end DATETIME DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_3963EF9AF6BD1646 (site_id), INDEX IDX_3963EF9AC4663E4 (page_id), INDEX idx_snapshot_dates_enabled (publication_date_start, publication_date_end, enabled), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE page__bloc (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, page_id INT DEFAULT NULL, name VARCHAR(255) DEFAULT NULL, type VARCHAR(64) NOT NULL, settings LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\', enabled TINYINT(1) DEFAULT NULL, position INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_FCDC1A97727ACA70 (parent_id), INDEX IDX_FCDC1A97C4663E4 (page_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE classification__category (id INT AUTO_INCREMENT NOT NULL, parent_id INT DEFAULT NULL, context VARCHAR(255) DEFAULT NULL, media_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, slug VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, position INT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_43629B36727ACA70 (parent_id), INDEX IDX_43629B36E25D857E (context), INDEX IDX_43629B36EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE classification__context (id VARCHAR(255) NOT NULL, name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE classification__tag (id INT AUTO_INCREMENT NOT NULL, context VARCHAR(255) DEFAULT NULL, name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, slug VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_CA57A1C7E25D857E (context), UNIQUE INDEX tag_context (slug, context), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE classification__collection (id INT AUTO_INCREMENT NOT NULL, context VARCHAR(255) DEFAULT NULL, media_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, slug VARCHAR(255) NOT NULL, description VARCHAR(255) DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX IDX_A406B56AE25D857E (context), INDEX IDX_A406B56AEA9FDD75 (media_id), UNIQUE INDEX tag_collection (slug, context), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE media__gallery (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, context VARCHAR(64) NOT NULL, default_format VARCHAR(255) NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE media__media (id INT AUTO_INCREMENT NOT NULL, category_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, description TEXT DEFAULT NULL, enabled TINYINT(1) NOT NULL, provider_name VARCHAR(255) NOT NULL, provider_status INT NOT NULL, provider_reference VARCHAR(255) NOT NULL, provider_metadata LONGTEXT DEFAULT NULL COMMENT \'(DC2Type:json)\', width INT DEFAULT NULL, height INT DEFAULT NULL, length NUMERIC(10, 0) DEFAULT NULL, content_type VARCHAR(255) DEFAULT NULL, content_size INT DEFAULT NULL, copyright VARCHAR(255) DEFAULT NULL, author_name VARCHAR(255) DEFAULT NULL, context VARCHAR(64) DEFAULT NULL, cdn_is_flushable TINYINT(1) DEFAULT NULL, cdn_flush_identifier VARCHAR(64) DEFAULT NULL, cdn_flush_at DATETIME DEFAULT NULL, cdn_status INT DEFAULT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_5C6DD74E12469DE2 (category_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'CREATE TABLE media__gallery_media (id INT AUTO_INCREMENT NOT NULL, gallery_id INT DEFAULT NULL, media_id INT DEFAULT NULL, position INT NOT NULL, enabled TINYINT(1) NOT NULL, updated_at DATETIME NOT NULL, created_at DATETIME NOT NULL, INDEX IDX_80D4C5414E7AF8F (gallery_id), INDEX IDX_80D4C541EA9FDD75 (media_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB'
);
$connection->executeQuery(
'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39EDF6BD1646 FOREIGN KEY (site_id) REFERENCES page__site (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39ED727ACA70 FOREIGN KEY (parent_id) REFERENCES page__page (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__page ADD CONSTRAINT FK_2FAE39ED158E0B66 FOREIGN KEY (target_id) REFERENCES page__page (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__snapshot ADD CONSTRAINT FK_3963EF9AF6BD1646 FOREIGN KEY (site_id) REFERENCES page__site (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__snapshot ADD CONSTRAINT FK_3963EF9AC4663E4 FOREIGN KEY (page_id) REFERENCES page__page (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__bloc ADD CONSTRAINT FK_FCDC1A97727ACA70 FOREIGN KEY (parent_id) REFERENCES page__bloc (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE page__bloc ADD CONSTRAINT FK_FCDC1A97C4663E4 FOREIGN KEY (page_id) REFERENCES page__page (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE classification__category ADD CONSTRAINT FK_43629B36727ACA70 FOREIGN KEY (parent_id) REFERENCES classification__category (id) ON DELETE CASCADE'
);
$connection->executeQuery(
'ALTER TABLE classification__category ADD CONSTRAINT FK_43629B36E25D857E FOREIGN KEY (context) REFERENCES classification__context (id)'
);
$connection->executeQuery(
'ALTER TABLE classification__category ADD CONSTRAINT FK_43629B36EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id) ON DELETE SET NULL'
);
$connection->executeQuery(
'ALTER TABLE classification__tag ADD CONSTRAINT FK_CA57A1C7E25D857E FOREIGN KEY (context) REFERENCES classification__context (id)'
);
$connection->executeQuery(
'ALTER TABLE classification__collection ADD CONSTRAINT FK_A406B56AE25D857E FOREIGN KEY (context) REFERENCES classification__context (id)'
);
$connection->executeQuery(
'ALTER TABLE classification__collection ADD CONSTRAINT FK_A406B56AEA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id) ON DELETE SET NULL'
);
$connection->executeQuery(
'ALTER TABLE media__media ADD CONSTRAINT FK_5C6DD74E12469DE2 FOREIGN KEY (category_id) REFERENCES classification__category (id) ON DELETE SET NULL'
);
$connection->executeQuery(
'ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C5414E7AF8F FOREIGN KEY (gallery_id) REFERENCES media__gallery (id)'
);
$connection->executeQuery(
'ALTER TABLE media__gallery_media ADD CONSTRAINT FK_80D4C541EA9FDD75 FOREIGN KEY (media_id) REFERENCES media__media (id)'
);
$sysPath = api_get_path(SYS_PATH);
finishInstallation(

@ -0,0 +1,21 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\AdminBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class ApplicationSonataAdminBundle
* @package Application\Sonata\AdminBundle
*/
class ChamiloAdminBundle extends Bundle
{
/**
* {@inheritdoc}
*/
public function getParent()
{
return 'SonataAdminBundle';
}
}

@ -0,0 +1,44 @@
{# See vendor/sonata-project/admin-bundle/Resources/views/standard_layout.html.twig#}
{% extends '@ChamiloAdmin/standard_layout.html.twig' %}
{% block stylesheets %}
{{ parent() }}
<link rel="stylesheet"
href="{{ asset('bundles/sonataformatter/markitup/skins/sonata/style.css') }}"
type="text/css" media="all"/>
<link rel="stylesheet"
href="{{ asset('bundles/sonataformatter/markitup/sets/markdown/style.css') }}"
type="text/css" media="all"/>
<link rel="stylesheet"
href="{{ asset('bundles/sonataformatter/markitup/sets/html/style.css') }}"
type="text/css" media="all"/>
<link rel="stylesheet"
href="{{ asset('bundles/sonataformatter/markitup/sets/textile/style.css') }}"
type="text/css" media="all"/>
<link rel="stylesheet"
href="{{ asset('bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css') }}"/>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('bundles/ivoryckeditor/ckeditor.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonataformatter/vendor/markitup-markitup/markitup/jquery.markitup.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonataformatter/markitup/sets/markdown/set.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonataformatter/markitup/sets/html/set.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonataformatter/markitup/sets/textile/set.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonatacore/vendor/moment/min/moment.min.js') }}"
type="text/javascript"></script>
<script src="{{ asset('bundles/sonatacore/vendor/eonasdan-bootstrap-datetimepicker/build/js/bootstrap-datetimepicker.min.js') }}"
type="text/javascript"></script>
{% endblock %}
{% block footer %}
{% endblock %}

@ -0,0 +1,375 @@
{#
This file is part of the Sonata package.
(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% 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') %}
{% set _list_filters_actions = block('list_filters_actions') %}
<!DOCTYPE html>
<html {% block html_attributes %}class="no-js"{% endblock %}>
<head>
{% block meta_tags %}
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="UTF-8">
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no'
name='viewport'>
{% endblock %}
{% block stylesheets %}
{% for stylesheet in sonata_admin.adminPool.getOption('stylesheets', []) %}
<link rel="stylesheet" href="{{ asset(stylesheet) }}">
{% endfor %}
{% endblock %}
{% block javascripts %}
<script>
window.SONATA_CONFIG = {
CONFIRM_EXIT: {% if sonata_admin.adminPool.getOption('confirm_exit') %}true{% else %}false{% endif %},
USE_SELECT2: {% if sonata_admin.adminPool.getOption('use_select2') %}true{% else %}false{% endif %},
USE_ICHECK: {% if sonata_admin.adminPool.getOption('use_icheck') %}true{% else %}false{% endif %},
USE_STICKYFORMS: {% if sonata_admin.adminPool.getOption('use_stickyforms') %}true{% else %}false{% endif %}
};
window.SONATA_TRANSLATIONS = {
CONFIRM_EXIT: '{{ 'confirm_exit'|trans({}, 'SonataAdminBundle')|escape('js') }}'
};
// http://getbootstrap.com/getting-started/#support-ie10-width
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style');
msViewportStyle.appendChild(document.createTextNode('@-ms-viewport{width:auto!important}'));
document.querySelector('head').appendChild(msViewportStyle);
}
</script>
{% for javascript in sonata_admin.adminPool.getOption('javascripts', []) %}
<script src="{{ asset(javascript) }}"></script>
{% endfor %}
{% set locale = app.request.locale %}
{# localize moment #}
{% if locale[:2] != 'en' %}
<script src="{{ asset('bundles/sonatacore/vendor/moment/locale/' ~ locale|replace({'_':'-'}) ~ '.js') }}"></script>
{% endif %}
{# localize select2 #}
{% if sonata_admin.adminPool.getOption('use_select2') %}
{% if locale == 'pt' %}{% set locale = 'pt_PT' %}{% endif %}
{# omit default EN locale #}
{% if locale[:2] != 'en' %}
<script src="{{ asset('bundles/sonatacore/vendor/select2/select2_locale_' ~ locale|replace({'_':'-'}) ~ '.js') }}"></script>
{% endif %}
{% endif %}
{% endblock %}
<title>
{% block sonata_head_title %}
{{ 'Admin'|trans({}, 'SonataAdminBundle') }}
{% if _title is not empty %}
{{ _title|raw }}
{% else %}
{% if action is defined %}
-
{% for menu in admin.breadcrumbs(action) %}
{% if not loop.first %}
{% if loop.index != 2 %}
&gt;
{% endif %}
{{ menu.label }}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endblock %}
</title>
</head>
<body {% block body_attributes %}class="sonata-bc skin-black fixed"{% endblock %}>
<div class="wrapper">
{% block sonata_header %}
<header class="main-header">
{% block sonata_header_noscript_warning %}
<noscript>
<div class="noscript-warning">
{{ 'noscript_warning'|trans({}, 'SonataAdminBundle') }}
</div>
</noscript>
{% endblock %}
{% block logo %}
{% spaceless %}
<a class="logo" href="{{ path('sonata_admin_dashboard') }}">
{% if 'single_image' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<img src="{{ asset(sonata_admin.adminPool.titlelogo) }}"
alt="{{ sonata_admin.adminPool.title }}">
{% endif %}
{% if 'single_text' == sonata_admin.adminPool.getOption('title_mode') or 'both' == sonata_admin.adminPool.getOption('title_mode') %}
<span>{{ sonata_admin.adminPool.title }}</span>
{% endif %}
</a>
{% endspaceless %}
{% endblock %}
{% block sonata_nav %}
<nav class="navbar navbar-static-top" role="navigation">
<a href="#" class="sidebar-toggle" data-toggle="offcanvas"
role="button">
<span class="sr-only">Toggle navigation</span>
</a>
<div class="navbar-left">
{% block sonata_breadcrumb %}
<div class="hidden-xs">
{% if _breadcrumb is not empty or action is defined %}
<ol class="nav navbar-top-links breadcrumb">
{% if _breadcrumb is empty %}
{% if action is defined %}
{% for menu in admin.breadcrumbs(action) %}
{% if not loop.last %}
<li>
{% if menu.uri is not empty %}
<a href="{{ menu.uri }}">{{ menu.label|raw }}</a>
{% else %}
{{ menu.label }}
{% endif %}
</li>
{% else %}
<li class="active">
<span>{{ menu.label }}</span>
</li>
{% endif %}
{% endfor %}
{% endif %}
{% else %}
{{ _breadcrumb|raw }}
{% endif %}
</ol>
{% endif %}
</div>
{% endblock sonata_breadcrumb %}
</div>
{% block sonata_top_nav_menu %}
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li class="dropdown">
<a class="dropdown-toggle"
data-toggle="dropdown" href="#">
<i class="fa fa-plus-square fa-fw"></i>
<i class="fa fa-caret-down"></i>
</a>
{% include sonata_admin.adminPool.getTemplate('add_block') %}
</li>
<li class="dropdown user-menu">
<a class="dropdown-toggle"
data-toggle="dropdown" href="#">
<i class="fa fa-user fa-fw"></i> <i
class="fa fa-caret-down"></i>
</a>
<ul class="dropdown-menu dropdown-user">
{% include sonata_admin.adminPool.getTemplate('user_block') %}
</ul>
</li>
</ul>
</div>
{% endblock %}
</nav>
{% endblock sonata_nav %}
</header>
{% endblock sonata_header %}
{% block sonata_wrapper %}
{% block sonata_left_side %}
<aside class="main-sidebar">
<section class="sidebar">
{% block sonata_side_nav %}
{% block sonata_sidebar_search %}
{% if app.user and is_granted('ROLE_SONATA_ADMIN') %}
<form action="{{ path('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.user and is_granted('ROLE_SONATA_ADMIN') %}
{{ knp_menu_render('sonata_admin_sidebar', {template: sonata_admin.adminPool.getTemplate('knp_menu_template')}) }}
{% endif %}
{% endblock side_bar_nav %}
{% block side_bar_after_nav %}
<p class="text-center small"
style="border-top: 1px solid #444444; padding-top: 10px">
{% block side_bar_after_nav_content %}
<a href="https://sonata-project.org"
rel="noreferrer" target="_blank">sonata
project</a>
{% endblock %}
</p>
{% endblock %}
{% endblock sonata_side_nav %}
</section>
</aside>
{% endblock sonata_left_side %}
<div class="content-wrapper">
{% 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 or _list_filters_actions is not empty %}
<nav class="navbar navbar-default"
role="navigation">
<div class="container-fluid">
{% block tab_menu_navbar_header %}
{% if _navbar_title is not empty %}
<div class="navbar-header">
<a class="navbar-brand"
href="#">{{ _navbar_title|raw }}</a>
</div>
{% endif %}
{% endblock %}
<div class="navbar-collapse">
<div class="navbar-left">
{% if _tab_menu is not empty %}
{{ _tab_menu|raw }}
{% endif %}
</div>
{% if admin is defined and action is defined and action == 'list' and admin.listModes|length > 1 %}
<div class="nav navbar-right btn-group">
{% for mode, settings in admin.listModes %}
<a href="{{ admin.generateUrl('list', app.request.query.all|merge({_list_mode: mode})) }}"
class="btn btn-default navbar-btn btn-sm{% if admin.getListMode() == mode %} active{% endif %}"><i
class="{{ settings.class }}"></i></a>
{% endfor %}
</div>
{% endif %}
{% block sonata_admin_content_actions_wrappers %}
{% if _actions|replace({ '<li>': '', '</li>': '' })|trim is not empty %}
<ul class="nav navbar-nav navbar-right">
{% if _actions|split('</a>')|length > 2 %}
<li class="dropdown sonata-actions">
<a href="#"
class="dropdown-toggle"
data-toggle="dropdown">{{ 'link_actions'|trans({}, 'SonataAdminBundle') }}
<b class="caret"></b></a>
<ul class="dropdown-menu"
role="menu">
{{ _actions|raw }}
</ul>
</li>
{% else %}
{{ _actions|raw }}
{% endif %}
</ul>
{% endif %}
{% endblock sonata_admin_content_actions_wrappers %}
{% if _list_filters_actions is not empty %}
{{ _list_filters_actions|raw }}
{% endif %}
</div>
</div>
</nav>
{% endif %}
{% endblock sonata_page_content_nav %}
{% endblock sonata_page_content_header %}
</section>
<section class="content">
{% block sonata_admin_content %}
{% block notice %}
{% include 'SonataCoreBundle:FlashMessage:render.html.twig' %}
{% endblock notice %}
{% if _preview is not empty %}
<div class="sonata-ba-preview">{{ _preview|raw }}</div>
{% endif %}
{% if _content is not empty %}
<div class="sonata-ba-content">{{ _content|raw }}</div>
{% endif %}
{% if _show is not empty %}
<div class="sonata-ba-show">{{ _show|raw }}</div>
{% endif %}
{% if _form is not empty %}
<div class="sonata-ba-form">{{ _form|raw }}</div>
{% endif %}
{% if _list_table is not empty or _list_filters is not empty %}
{% if _list_filters|trim %}
<div class="row">
{{ _list_filters|raw }}
</div>
{% endif %}
<div class="row">
{{ _list_table|raw }}
</div>
{% endif %}
{% endblock sonata_admin_content %}
</section>
{% endblock sonata_page_content %}
</div>
{% endblock sonata_wrapper %}
</div>
{% if sonata_admin.adminPool.getOption('use_bootlint') %}
{% block bootlint %}
{# Bootlint - https://github.com/twbs/bootlint#in-the-browser #}
<script type="text/javascript">
javascript:(function () {
var s = document.createElement("script");
s.onload = function () {
bootlint.showLintReportForCurrentDocument([], {
hasProblems: false,
problemFree: false
});
};
s.src = "https://maxcdn.bootstrapcdn.com/bootlint/latest/bootlint.min.js";
document.body.appendChild(s)
})();
</script>
{% endblock %}
{% endif %}
</body>
</html>

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping
xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping"
xsi="http://www.w3.org/2001/XMLSchema-instance"
schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
<!--
This file has been generated by the EasyExtends bundle ( http://sonata-project.org/easy-extends )
References :
xsd : https://github.com/doctrine/doctrine2/blob/master/doctrine-mapping.xsd
xml mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/xml-mapping/en
association mapping : http://www.doctrine-project.org/projects/orm/2.0/docs/reference/association-mapping/en
-->
<entity
name="Chamilo\PageBundle\Entity\User"
table="user"
>
<id name="id" type="integer" column="id">
<generator strategy="AUTO"/>
</id>
</entity>
</doctrine-mapping>

@ -0,0 +1,75 @@
<?php
/* For licensing terms, see /license.txt */
namespace Chamilo\UserBundle\Entity;
use Sonata\UserBundle\Entity\BaseGroup as BaseGroup;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\Entity(repositoryClass="Chamilo\UserBundle\Repository\GroupRepository")
* @ORM\Table(name="fos_group")
*/
class Group extends BaseGroup
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\ManyToMany(targetEntity="Chamilo\UserBundle\Entity\User", mappedBy="groups")
*
*/
protected $users;
/**
* @var string
* @ORM\Column(name="code", type="string", length=40, nullable=false, unique=true)
*/
private $code;
/**
* Get id
*
* @return integer $id
*/
public function getId()
{
return $this->id;
}
/**
* @return mixed
*/
public function getUsers()
{
return $this->users;
}
/**
* @return string
*/
public function getCode()
{
return $this->code;
}
/**
* @param string $code
* @return Group
*/
public function setCode($code)
{
$this->code = $code;
return $this;
}
}

@ -16,6 +16,7 @@ use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Mapping\ClassMetadata;
use FOS\UserBundle\Model\UserInterface;
use FOS\UserBundle\Model\GroupInterface;
//use Chamilo\CoreBundle\Component\Auth;
//use FOS\MessageBundle\Model\ParticipantInterface;
@ -42,7 +43,7 @@ use FOS\UserBundle\Model\UserInterface;
* @ORM\Entity(repositoryClass="Chamilo\UserBundle\Entity\Repository\UserRepository")
*
*/
class User implements UserInterface//implements ParticipantInterface, ThemeUser
class User implements UserInterface //implements ParticipantInterface, ThemeUser
{
const COURSE_MANAGER = 1;
const TEACHER = 1;
@ -77,10 +78,16 @@ class User implements UserInterface//implements ParticipantInterface, ThemeUser
/**
* @var string
*
* * @ORM\Column(name="username_canonical", type="string", length=100, nullable=false, unique=true)
* @ORM\Column(name="username_canonical", type="string", length=100, nullable=false, unique=true)
*/
protected $usernameCanonical;
/**
* @var string
* @ORM\Column(name="email_canonical", type="string", length=100, nullable=false, unique=true)
*/
protected $emailCanonical;
/**
* @var string
*
@ -88,6 +95,42 @@ class User implements UserInterface//implements ParticipantInterface, ThemeUser
*/
protected $email;
/**
* @var boolean
* @ORM\Column(name="locked", type="boolean")
*/
protected $locked;
/**
* @var boolean
* @ORM\Column(name="enabled", type="boolean")
*/
protected $enabled;
/**
* @var boolean
* @ORM\Column(name="expired", type="boolean")
*/
protected $expired;
/**
* @var boolean
* @ORM\Column(name="credentials_expired", type="boolean")
*/
protected $credentialsExpired;
/**
* @var \DateTime
* @ORM\Column(name="credentials_expire_at", type="datetime", nullable=true, unique=false)
*/
protected $credentialsExpireAt;
/**
* @var \DateTime
* @ORM\Column(name="expires_at", type="datetime", nullable=true, unique=false)
*/
protected $expiresAt;
/**
* @var string
*
@ -339,7 +382,7 @@ class User implements UserInterface//implements ParticipantInterface, ThemeUser
* inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
* )
*/
//protected $groups;
protected $groups;
//private $isActive;
@ -2364,7 +2407,4 @@ class User implements UserInterface//implements ParticipantInterface, ThemeUser
$this->id
) = $data;
}
}

@ -0,0 +1,4 @@
{#{% extends "FOSUserBundle::layout.html.twig" %}#}
{% block fos_user_content %}
{% include "SonataUserBundle:ChangePassword:changePassword_content.html.twig" %}
{% endblock fos_user_content %}

@ -0,0 +1,8 @@
<form action="{{ path('sonata_user_change_password') }}" {{ form_enctype(form) }}
method="POST" class="fos_user_change_password form-horizontal">
{{ form_widget(form) }}
<button type="submit" class="btn btn-danger pull-right"><i
class="icon-lock icon-white glyphicon glyphicon-lock"></i>&nbsp;{{ 'change_password.submit'|trans({}, 'FOSUserBundle') }}
</button>
</form>

@ -0,0 +1,37 @@
{#
This file is part of the Sonata package.
(c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
#}
{% block sonata_page_breadcrumb %}
{% if breadcrumb_context is not defined %}
{% set breadcrumb_context = 'user_index' %}
{% endif %}
<div class="row-fluid clearfix">
{{ sonata_block_render_event('breadcrumb', { 'context': breadcrumb_context, 'current_uri': app.request.requestUri }) }}
</div>
{% endblock %}
<h2>{% block sonata_profile_title %}{% trans from 'SonataUserBundle' %}sonata_profile_title{% endtrans %}{% endblock %}</h2>
<div class="sonata-user-show row row-fluid">
<div class="span2 col-lg-2" style="padding: 8px 0;">
{% block sonata_profile_menu %}
{{ sonata_block_render({'type': 'sonata.user.block.menu'}, {'current_uri': app.request.requestUri}) }}
{% endblock %}
</div>
<div class="span10 col-lg-10">
{% include 'SonataCoreBundle:FlashMessage:render.html.twig' %}
{% block sonata_profile_content '' %}
</div>
</div>

@ -0,0 +1,26 @@
<div class="row">
<div class="span6 col-lg-6">
<div class="panel panel-warning">
<div class="panel-heading">
<h3 class="panel-title">{{ 'title_user_edit_authentication'|trans({}, 'SonataUserBundle') }}</h3>
</div>
<div class="panel-body">
<form action="{{ path('sonata_user_profile_edit_authentication') }}" method="POST" class="form-horizontal">
{{ form_widget(form) }}
<button type="submit" name="submit" class="btn btn-primary pull-right">{{ 'sonata_user_submit'|trans({}, 'SonataUserBundle') }}</button>
</form>
</div>
</div>
</div>
<div class="span6 col-lg-6">
<div class="panel panel-danger">
<div class="panel-heading">
<h3 class="panel-title">{{ 'sonata_change_password_link'|trans({}, 'SonataUserBundle') }}</h3>
</div>
<div class="panel-body">
{% render url("sonata_user_change_password") %}
</div>
</div>
</div>
</div>

@ -0,0 +1,72 @@
{% extends "ChamiloUserBundle:Profile:action.html.twig" %}
{% block sonata_profile_title %}
{{ "title_user_account" | trans({}, 'SonataUserBundle')}} - {{ "title_user_edit_profile" | trans({}, 'SonataUserBundle')}}
{% endblock %}
{% block sonata_profile_content %}
{{ form_errors(form) }}
{% form_theme form _self %}
{#<script type="text/javascript">#}
{#// keep track of how many email fields have been rendered#}
{#var emailCount = '{{ form.extraFieldValues|length }}';#}
{#jQuery(document).ready(function() {#}
{#jQuery('#add-extra-field').click(function(e) {#}
{#e.preventDefault();#}
{#var emailList = jQuery('#field-list');#}
{#// grab the prototype template#}
{#var newWidget = emailList.attr('data-prototype');#}
{#// replace the "__name__" used in the id and name of the prototype#}
{#// with a number that's unique to your emails#}
{#// end name attribute looks like name="contact[emails][2]"#}
{#newWidget = newWidget.replace(/__name__/g, emailCount);#}
{#emailCount++;#}
{#// create a new list element and add it to the list#}
{#var newLi = jQuery('<li></li>').html(newWidget);#}
{#newLi.appendTo(emailList);#}
{#});#}
{#})#}
{#</script>#}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">{{ "title_user_account" | trans({}, 'SonataUserBundle')}}</h3>
</div>
<div class="panel-body">
<form action="{{ path('sonata_user_profile_edit') }}" method="POST" {{ form_enctype(form) }} class="form-horizontal">
{{ form_widget(form) }}
{#<ul id="field-list"#}
{#data-prototype="{{ form_widget(form.extraFieldValues.vars.prototype)|e }}">#}
{#{% for field in form.extraFieldValues %}#}
{#<li>#}
{#{{ form_errors(field) }}#}
{#{{ form_widget(field) }}#}
{#</li>#}
{#{% endfor %}#}
{#</ul>#}
{#<a href="#" id="add-extra-field">Add</a>#}
<div class="form-actions">
<button type="submit" name="submit"
class="btn btn-primary pull-right">
{{ 'sonata_user_submit'|trans({}, 'SonataUserBundle') }}
</button>
</div>
</form>
</div>
</div>
{% render url("sonata_user_profile_edit_authentication") %}
{% endblock %}

@ -0,0 +1,39 @@
{% extends "SonataUserBundle:Profile:action.html.twig" %}
{% block sonata_profile_content %}
<div class="row row-fluid">
{% set has_center = false %}
{% for block in blocks %}
{% if block.position == 'center' %}
{% set has_center = true %}
{% endif %}
{% endfor %}
<div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
{% for block in blocks %}
{% if block.position == 'left' %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
</div>
{% if has_center %}
<div class="span4 col-lg-4">
{% for block in blocks %}
{% if block.position == 'center' %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
</div>
{% endif %}
<div class="{% if has_center %}span4 col-lg-4{% else %}span6 col-lg-6{% endif %}">
{% for block in blocks %}
{% if block.position == 'right' %}
{{ sonata_block_render({ 'type': block.type, 'settings': block.settings}) }}
{% endif %}
{% endfor %}
</div>
</div>
{% endblock %}

@ -0,0 +1,19 @@
<div class="panel panel-success">
<div class="panel-heading">
<h2 class="panel-title">{{ 'title_user_registration'|trans({}, 'SonataUserBundle') }}</h2>
</div>
<div class="panel-body">
<form action="{{ path('fos_user_registration_register') }}" {{ form_enctype(form) }}
method="POST"
class="fos_user_registration_register form-horizontal">
{{ form_widget(form) }}
<div class="form-actions">
<input type="submit"
value="{{ 'registration.submit'|trans({}, 'FOSUserBundle') }}"
class="btn btn-success pull-right"/>
</div>
</form>
</div>
</div>

@ -0,0 +1,10 @@
{% extends "FOSUserBundle::layout.html.twig" %}
{% block fos_user_content %}
<div class="header">
{{ 'resetting.request.submit'|trans({}, 'FOSUserBundle') }}
</div>
<div class="body bg-gray">
{{ 'resetting.check_email'|trans({'%email%': email}, 'FOSUserBundle') }}
</div>
{% endblock %}

@ -0,0 +1,11 @@
{% block subject %}
{% autoescape false %}
{{ 'resetting.email.subject'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{% endautoescape %}
{% endblock %}
{% block body_text %}
{% autoescape false %}
{{ 'resetting.email.message'|trans({'%username%': user.username, '%confirmationUrl%': confirmationUrl}, 'FOSUserBundle') }}
{% endautoescape %}
{% endblock %}
{% block body_html %}{% endblock %}

@ -0,0 +1,10 @@
{% extends "FOSUserBundle::layout.html.twig" %}
{% block fos_user_content %}
<div class="header">
{{ 'resetting.request.submit'|trans({}, 'FOSUserBundle') }}
</div>
<div class="body bg-gray">
<p>{{ 'resetting.password_already_requested'|trans({}, 'FOSUserBundle') }}</p>
</div>
{% endblock fos_user_content %}

@ -0,0 +1,5 @@
{% extends "FOSUserBundle::layout.html.twig" %}
{% block fos_user_content %}
{% include "FOSUserBundle:Resetting:request_content.html.twig" %}
{% endblock fos_user_content %}

@ -0,0 +1,23 @@
<div class="header">
{{ 'resetting.request.submit'|trans({}, 'FOSUserBundle') }}
</div>
<form action="{{ path('fos_user_resetting_send_email') }}" method="POST"
class="fos_user_resetting_request">
<div class="body bg-gray">
<div class="form-group">
{% if invalid_username is defined %}
<p>{{ 'resetting.request.invalid_username'|trans({'%username%': invalid_username}, 'FOSUserBundle') }}</p>
{% endif %}
<label for="username">{{ 'resetting.request.username'|trans({}, 'FOSUserBundle') }}</label>
<input type="text" id="username" name="username"
required="required"/>
</div>
<div class="form-group">
<input type="submit"
value="{{ 'resetting.request.submit'|trans({}, 'FOSUserBundle') }}"/>
</div>
</div>
</form>

@ -0,0 +1,5 @@
{% extends "FOSUserBundle::layout.html.twig" %}
{% block fos_user_content %}
{% include "FOSUserBundle:Resetting:reset_content.html.twig" %}
{% endblock fos_user_content %}

@ -0,0 +1,8 @@
<form action="{{ path('fos_user_resetting_reset', {'token': token}) }}" {{ form_enctype(form) }}
method="POST" class="fos_user_resetting_reset">
{{ form_widget(form) }}
<div>
<input type="submit"
value="{{ 'resetting.reset.submit'|trans({}, 'FOSUserBundle') }}"/>
</div>
</form>

@ -0,0 +1,94 @@
{% extends "@ChamiloUser/layout.html.twig" %}
{% block fos_user_content %}
<div class="row">
<div class="col-sm-6">
{% block sonata_user_login %}
<div class="login-box-body">
<div class="panel-heading">
<h2 class="panel-title">{{ 'title_user_authentication'|trans({}, 'SonataUserBundle') }}</h2>
</div>
<div class="panel-body">
{% block sonata_user_login_error %}
{% if error %}
<div class="alert alert-danger alert-danger">{{ error|trans({}, 'FOSUserBundle') }}</div>
{% endif %}
{% endblock %}
{% block sonata_user_login_form %}
<form action="{{ path("fos_user_security_check") }}"
method="post" role="form"
class="form-horizontal">
<input type="hidden" name="_csrf_token"
value="{{ csrf_token }}"/>
<div class="form-group">
<label for="username"
class="col-sm-4 control-label">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
<div class="col-sm-8"><input type="text"
class="form-control"
id="username"
name="_username"
value="{{ last_username }}"
required="required"/>
</div>
</div>
<div class="form-group control-group">
<label for="password"
class="col-sm-4 control-label">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
<div class="col-sm-8"><input type="password"
class="form-control"
id="password"
name="_password"
required="required"/>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<div class="checkbox control-group">
<label for="remember_me">
<input type="checkbox"
id="remember_me"
name="_remember_me"
value="on"/>
{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
</label>
</div>
</div>
</div>
<div class="form-group control-group">
<div class="controls col-sm-offset-4 col-sm-8">
<a href="{{ path('fos_user_resetting_request') }}">{{ 'forgotten_password'|trans({}, 'SonataUserBundle') }}</a>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<input type="submit" id="_submit"
name="_submit"
class="btn btn-primary"
value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}"/>
</div>
</div>
</form>
{% endblock %}
</div>
</div>
{% endblock %}
</div>
<div class="col-sm-6">
{% block sonata_user_registration %}
{% render controller("SonataUserBundle:RegistrationFOSUser1:register") %}
{% endblock %}
</div>
</div>
{% endblock fos_user_content %}

@ -0,0 +1,61 @@
{% extends "@ChamiloUser/layout.html.twig" %}
{% block fos_user_content %}
{% block sonata_user_login %}
{% block sonata_user_login_error %}
{% if error %}
<div class="alert alert-danger alert-danger">{{ error|trans({}, 'FOSUserBundle') }}</div>
{% endif %}
{% endblock %}
<div class="login-box-body">
{% block sonata_user_login_form %}
<form action="{{ path("fos_user_security_check") }}"
method="post" role="form">
<input type="hidden" name="_csrf_token"
value="{{ csrf_token('authenticate') }}"/>
<div class="form-group has-feedback">
<label for="username"
class="col-sm-4 control-label">{{ 'security.login.username'|trans({}, 'FOSUserBundle') }}</label>
<input type="text" class="form-control" id="username"
name="_username" value="{{ last_username }}"
required="required"/>
</div>
<div class="form-group has-feedback">
<label for="password"
class="col-sm-4 control-label">{{ 'security.login.password'|trans({}, 'FOSUserBundle') }}</label>
<input type="password" class="form-control"
id="password"
name="_password" required="required"/>
</div>
<div class="form-group has-feedback">
<div class="checkbox control-group">
<label for="remember_me">
<input type="checkbox" id="remember_me"
name="_remember_me" value="on"/>
{{ 'security.login.remember_me'|trans({}, 'FOSUserBundle') }}
</label>
</div>
</div>
<div class="form-group has-feedback">
<a href="{{ path('fos_user_resetting_request') }}">{{ 'forgotten_password'|trans({}, 'SonataUserBundle') }}</a>
</div>
<div class="form-group">
<div class="col-sm-offset-4 col-sm-8">
<input type="submit" id="_submit" name="_submit"
class="btn btn-primary"
value="{{ 'security.login.submit'|trans({}, 'FOSUserBundle') }}"/>
</div>
</div>
</form>
{% endblock %}
</div>
{% endblock %}
{% endblock fos_user_content %}

@ -0,0 +1,6 @@
{#{% extends '@ChamiloTheme/Layout/login-layout.html.twig' %}#}
{% block page_content %}
{% block fos_user_content %}
{% endblock %}
{% endblock %}

@ -32,6 +32,7 @@ class Encoder implements PasswordEncoderInterface
*/
public function encodePassword($raw, $salt)
{
switch ($this->method) {
case 'none':
$defaultEncoder = new PlaintextPasswordEncoder();

@ -30,9 +30,9 @@ DirectoryIndex app.php
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
RewriteRule ^(.*) - [E=BASE:%1]
# Sets the HTTP_AUTHORIZATION header removed by apache
# Sets the HTTP_AUTHORIZATION header removed by Apache
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect to URI without front controller to prevent duplicate content
# (with and without `/app.php`). Only do this redirect on the initial
@ -46,15 +46,15 @@ DirectoryIndex app.php
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
# following RewriteCond (best solution)
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^app\.php(/(.*)|$) %{ENV:BASE}/$2 [R=301,L]
RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
# If the requested filename exists, simply serve it.
# We only want to let Apache serve files and not directories.
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [L]
RewriteRule ^ - [L]
# Rewrite all other queries to the front controller.
RewriteRule .? %{ENV:BASE}/app.php [L]
RewriteRule ^ %{ENV:BASE}/app.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
@ -65,4 +65,4 @@ DirectoryIndex app.php
RedirectMatch 302 ^/$ /app.php/
# RedirectTemp cannot be used instead
</IfModule>
</IfModule>
</IfModule>
Loading…
Cancel
Save