Sonata working in web/app_dev.php/en/administration

In a fresh installation login with admin user.
ofaj
jmontoyaa 9 years ago
parent cc152ca3ef
commit 605b301abf
  1. 5
      app/Migrations/Schema/V111/Version20160330103045.php
  2. 1
      main/admin/user_edit.php
  3. 5
      main/inc/lib/database.lib.php
  4. 5
      main/inc/lib/usermanager.lib.php
  5. 14
      src/Chamilo/UserBundle/Entity/User.php

@ -117,7 +117,10 @@ class Version20160330103045 extends AbstractMigration
$sql = "UPDATE user SET roles = 'a:0:{}'";
$this->addSql($sql);
$sql = "UPDATE user SET enabled = '1' WHERE active = 1" ;
$sql = "UPDATE user SET enabled = '1' WHERE active = 1";
$this->addSql($sql);
$sql = "ALTER TABLE user ADD created_at DATETIME DEFAULT NULL, ADD updated_at DATETIME DEFAULT NULL;";
$this->addSql($sql);
$sql = "UPDATE user SET username_canonical = username";

@ -467,6 +467,7 @@ if ($form->validate()) {
$currentUserId = api_get_user_id();
$userObj = api_get_user_entity($user_id);
UserManager::add_user_as_admin($userObj);
if ($user_id != $currentUserId) {

@ -135,14 +135,9 @@ class Database
$config->setEntityNamespaces(
array(
'ChamiloClassificationBundle' => 'Chamilo\ClassificationBundle\Entity',
'ChamiloMediaBundle' => 'Chamilo\MediaBundle\Entity',
'ChamiloPageBundle' => 'Chamilo\PageBundle\Entity',
'ChamiloUserBundle' => 'Chamilo\UserBundle\Entity',
'ChamiloCoreBundle' => 'Chamilo\CoreBundle\Entity',
'ChamiloCourseBundle' => 'Chamilo\CourseBundle\Entity',
'FosUserBundle' => 'FOS\UserBundle\Entity',
'SonataUserBundle' => 'Sonata\UserBundle\Entity',
)
);

@ -1,3 +1,4 @@
<?php
/* For licensing terms, see /license.txt */
@ -883,7 +884,6 @@ class UserManager
}
$userManager = self::getManager();
/** @var Chamilo\UserBundle\Entity\User $user */
$user = self::getRepository()->find($user_id);
@ -912,6 +912,7 @@ class UserManager
->setPictureUri($picture_uri)
->setExpirationDate($expiration_date)
->setActive($active)
->setEnabled($active)
->setHrDeptId($hr_dept_id)
;
@ -4775,7 +4776,7 @@ EOF;
Database::query($sql);
}
$user->addRole('ROLE_ADMIN');
$user->addRole('ROLE_SUPER_ADMIN');
self::getManager()->updateUser($user, true);
}
}

@ -325,6 +325,18 @@ class User implements UserInterface //implements ParticipantInterface, ThemeUser
*/
protected $lastLogin;
/**
* @var \DateTime
* @ORM\Column(name="created_at", type="datetime", nullable=true, unique=false)
*/
protected $createdAt;
/**
* @var \DateTime
* @ORM\Column(name="updated_at", type="datetime", nullable=true, unique=false)
*/
protected $updatedAt;
/**
* Random string sent to the user email address in order to verify it
*
@ -340,6 +352,8 @@ class User implements UserInterface //implements ParticipantInterface, ThemeUser
*/
protected $passwordRequestedAt;
/**
* @ORM\OneToMany(targetEntity="Chamilo\CoreBundle\Entity\CourseRelUser", mappedBy="user")
**/

Loading…
Cancel
Save