mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-10 03:23:19 +00:00
Remove User_Adapter
This commit is contained in:
@@ -41,9 +41,7 @@ class module_console_checkExtension extends Command
|
||||
|
||||
$usrId = $input->getArgument('usr_id');
|
||||
|
||||
try {
|
||||
$TestUser = \User_Adapter::getInstance($usrId, $this->container);
|
||||
} catch (\Exception $e) {
|
||||
if (null === $TestUser = $this->container['manipulator.user']->getRepository()->find($usrId)) {
|
||||
$output->writeln("<error>Wrong user !</error>");
|
||||
|
||||
return 1;
|
||||
@@ -52,8 +50,8 @@ class module_console_checkExtension extends Command
|
||||
$output->writeln(
|
||||
sprintf(
|
||||
"\nWill do the check with user <info>%s</info> (%s)\n"
|
||||
, $TestUser->get_display_name()
|
||||
, $TestUser->get_email()
|
||||
, $TestUser->getDisplayName()
|
||||
, $TestUser->getEmail()
|
||||
)
|
||||
);
|
||||
|
||||
@@ -93,7 +91,7 @@ class module_console_checkExtension extends Command
|
||||
|
||||
$output->writeln("\n-- phrasea_create_session --");
|
||||
|
||||
$sessid = phrasea_create_session((string) $TestUser->get_id());
|
||||
$sessid = phrasea_create_session((string) $TestUser->getId());
|
||||
|
||||
if (ctype_digit((string) $sessid)) {
|
||||
$output->writeln("<info>Succes ! </info> got session id $sessid");
|
||||
|
@@ -81,9 +81,9 @@ class module_console_systemMailCheck extends Command
|
||||
$id = $dialog->ask($output, '<question>Which id ?</question>', '');
|
||||
|
||||
try {
|
||||
$tmp_user = User_Adapter::getInstance($id, $this->container);
|
||||
$tmp_user = $this->container['manipulator.user']->getRepository()->find($id);
|
||||
|
||||
if ($tmp_user->get_email() != $email) {
|
||||
if ($tmp_user->getEmail() != $email) {
|
||||
throw new Exception('Invalid user');
|
||||
}
|
||||
|
||||
|
@@ -251,7 +251,7 @@ class module_report
|
||||
$this->dmax = $d2;
|
||||
$this->sbas_id = $sbas_id;
|
||||
$this->list_coll_id = $collist;
|
||||
$this->user_id = $this->app['authentication']->getUser()->get_id();
|
||||
$this->user_id = $this->app['authentication']->getUser()->getId();
|
||||
$this->periode = sprintf(
|
||||
'%s - %s ',
|
||||
$this->app['date-formatter']->getPrettyString(new \DateTime($d1)),
|
||||
|
@@ -295,7 +295,7 @@ class module_report_activity extends module_report
|
||||
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
$stmt->closeCursor();
|
||||
|
||||
$login = User_Adapter::getInstance($usr, $this->app)->get_display_name();
|
||||
$login = $this->app['manipulator.user']->getRepository()->find($usr)->getDisplayName();
|
||||
|
||||
$this->setChamp($rs);
|
||||
|
||||
|
@@ -77,11 +77,8 @@ class module_report_add extends module_report
|
||||
$value = $row['val'];
|
||||
$caption = $value;
|
||||
if ($field == "getter") {
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
|
||||
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
|
||||
$caption = $user->getDisplayName();
|
||||
}
|
||||
} elseif ($field == 'date')
|
||||
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));
|
||||
|
@@ -77,11 +77,8 @@ class module_report_edit extends module_report
|
||||
$value = $row['val'];
|
||||
$caption = $value;
|
||||
if ($field == "getter") {
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
|
||||
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
|
||||
$caption = $user->getDisplayName();
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));
|
||||
|
@@ -78,11 +78,8 @@ class module_report_push extends module_report
|
||||
$value = $row['val'];
|
||||
$caption = $value;
|
||||
if ($field == "getter") {
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
|
||||
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
|
||||
$caption = $user->getDisplayName();
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));
|
||||
|
@@ -78,11 +78,8 @@ class module_report_sent extends module_report
|
||||
$value = $row['val'];
|
||||
$caption = $value;
|
||||
if ($field == "getter") {
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
|
||||
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
|
||||
$caption = $user->getDisplayName();
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));
|
||||
|
@@ -78,11 +78,8 @@ class module_report_validate extends module_report
|
||||
$value = $row['val'];
|
||||
$caption = $value;
|
||||
if ($field == "getter") {
|
||||
try {
|
||||
$user = User_Adapter::getInstance($value, $this->app);
|
||||
$caption = $user->get_display_name();
|
||||
} catch (Exception $e) {
|
||||
|
||||
if (null !== $user = $this->app['manipulator.user']->getRepository()->find($value)) {
|
||||
$caption = $user->getDisplayName();
|
||||
}
|
||||
} elseif ($field == 'date') {
|
||||
$caption = $this->app['date-formatter']->getPrettyString(new DateTime($value));
|
||||
|
Reference in New Issue
Block a user