$app->get(
'/logs/flush',
- function ($request, $response, $args) {
+ function ($request, $response) {
return $response
->withStatus(302)
->withHeader(
'login_adh' => custom_html_entity_decode($adh->login, ENT_QUOTES)
)
);
- $mtxt = $texts->getTexts('pwd', $adh->language);
$mail = new GaletteMail($this->preferences);
$mail->setSubject($texts->getSubject());
if (count($error_detected) == 0) {
//all goes well, we can proceed
- $new = false;
- if ($contrib->id == '') {
- $new = true;
- }
-
if (count($error_detected) == 0) {
// send email to member
if (isset($post['mail_confirm']) && $post['mail_confirm'] == '1') {
$params['entries'] = $list;
if (count($class->errors) > 0) {
- $error_detected = array_merge($error_detected, $class->errors);
+ foreach ($class->errors as $error) {
+ $this->flash->addMessage(
+ 'error_detected',
+ $error
+ );
+ }
}
// display page
{
$post = $request->getParsedBody();
$group = new Group((int)$args['id']);
- $error = false;
$group->setName($post['group_name']);
try {
->withHeader('Location', $redirect_url);
}
- $params = array();
-
if (
$this->preferences->pref_mail_method == Mailing::METHOD_DISABLED
&& !GALETTE_MODE === 'DEMO'
$attachment = $attachments[$args['pos']];
$filepath = $attachment->getDestDir() . $attachment->getFileName();
- $ext = pathinfo($attachment->getFileName())['extension'];
$response = $response->withHeader('Content-type', $attachment->getMimeType($filepath));
$body = $response->getBody();
Analog::ERROR
);
throw new \Exception('Unknown mode.');
- exit(0);
}
} else {
$m = new Members();
throw new \RuntimeException(
'Current selected member must be excluded while attaching!'
);
- exit(0);
}
break;
}
}
//store requested groups
- $add_groups = null;
- $groups_adh = null;
- $managed_groups_adh = null;
+ $groups_adh = $post['groups_adh'] ?? null;
+ $managed_groups_adh = $post['groups_managed_adh'] ?? null;
//add/remove user from groups
- if (isset($post['groups_adh'])) {
- $groups_adh = $post['groups_adh'];
- }
$add_groups = Groups::addMemberToGroups(
$member,
$groups_adh
}
//add/remove manager from groups
- if (isset($post['groups_managed_adh'])) {
- $managed_groups_adh = $post['groups_managed_adh'];
- }
$add_groups = Groups::addMemberToGroups(
$member,
$managed_groups_adh,
'trans_desc' => 1,
'id_adh' => 1
);
- $disabled = array();
if ($action === 'edit') {
// initialize transactions structure with database values
/**
* Remove specified entries
*
- * @param integer|array $ids Mailing history entries identifiers
+ * @param integer|array $ids Mailing history entries identifiers
+ * @param History $hist History instance
*
* @return boolean
*/
- public function removeEntries($ids)
+ public function removeEntries($ids, History $hist)
{
- global $hist, $preferences;
-
$list = array();
if (is_numeric($ids)) {
//we've got only one identifier
if (is_array($list)) {
try {
foreach ($list as $id) {
- $mailing = new Mailing($preferences, [], $id);
+ $mailing = new Mailing($this->preferences, [], $id);
$mailing->removeAttachments();
}