mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 06:53:15 +00:00
Merge branch 'replace_users' of https://github.com/nlegoff/Phraseanet into nlegoff-replace_users
Conflicts: lib/classes/ACL.php lib/classes/User/Adapter.php lib/classes/eventsmanager/notify/autoregister.php lib/classes/eventsmanager/notify/order.php lib/classes/eventsmanager/notify/orderdeliver.php lib/classes/eventsmanager/notify/ordernotdelivered.php lib/classes/eventsmanager/notify/push.php lib/classes/eventsmanager/notify/register.php lib/classes/eventsmanager/notify/validate.php lib/classes/eventsmanager/notify/validationdone.php lib/classes/eventsmanager/notify/validationreminder.php lib/classes/module/report/add.php lib/classes/module/report/edit.php lib/classes/module/report/push.php lib/classes/module/report/sent.php lib/classes/module/report/validate.php lib/classes/record/preview.php
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,13 +81,13 @@ 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');
|
||||
}
|
||||
|
||||
$tmp_user->set_email(null);
|
||||
$tmp_user->setEmail(null);
|
||||
|
||||
unset($users[$id]);
|
||||
} catch (\Exception $e) {
|
||||
|
@@ -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));
|
||||
|
@@ -434,22 +434,23 @@ class module_report_nav extends module_report
|
||||
|
||||
$sql = "
|
||||
SELECT
|
||||
usr_login as identifiant,
|
||||
usr_nom as nom,
|
||||
usr_mail as mail,
|
||||
adresse, tel
|
||||
FROM usr
|
||||
login as identifiant,
|
||||
last_name as nom,
|
||||
email as mail,
|
||||
address AS adresse,
|
||||
phone AS tel
|
||||
FROM Users
|
||||
WHERE $on = :value " . (('' !== $filter_id_apbox) ? "AND (" . $filter_id_apbox . ")" : '');
|
||||
} else {
|
||||
$sql = '
|
||||
SELECT
|
||||
usr_login AS identifiant,
|
||||
usr_nom AS nom,
|
||||
usr_mail AS mail,
|
||||
adresse,
|
||||
tel
|
||||
FROM usr
|
||||
WHERE (usr_id = :value)';
|
||||
login AS identifiant,
|
||||
last_name AS nom,
|
||||
email AS mail,
|
||||
address AS adresse,
|
||||
phone AS tel
|
||||
FROM Users
|
||||
WHERE (id = :value)';
|
||||
}
|
||||
|
||||
$params2 = [':value' => $val];
|
||||
|
@@ -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