- sh -c "if [ '$DB' = 'pgsql' ]; then psql -d galette_tests -a -f galette/install/scripts/pgsql.sql -U postgres; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'create database IF NOT EXISTS galette_tests;'; fi"
- sh -c "if [ '$DB' = 'mysql' ]; then mysql -e 'use galette_tests; source galette/install/scripts/mysql.sql;'; fi"
- - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" && $DB == "mysql" ]]; then cd galette && composer require squizlabs/php_codesniffer && cd ..; fi
+ - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" && $DB == "mysql" ]]; then cd galette && composer require squizlabs/php_codesniffer && cd ..; fi
script:
- - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.3" && $DB == "mysql" ]]; then galette/vendor/bin/phpcs -n -p --ignore=galette_tcpdf_config.php --standard=phpcs-rules.xml galette/lib/ tests/ galette/webroot/index.php galette/includes/fields_defs/ galette/includes/smarty_plugins/ galette/includes/functions.inc.php galette/includes/galette.inc.php galette/includes/dependencies.php galette/includes/main.inc.php; fi
+ - if [[ ${TRAVIS_PHP_VERSION:0:3} == "7.4" && $DB == "mysql" ]]; then galette/vendor/bin/phpcs -n -p --ignore=galette_tcpdf_config.php --standard=phpcs-rules.xml galette/lib/ tests/ galette/webroot/index.php galette/includes/fields_defs/ galette/includes/smarty_plugins/ galette/includes/functions.inc.php galette/includes/galette.inc.php galette/includes/dependencies.php galette/includes/main.inc.php; fi
- php galette/vendor/bin/atoum -mcn 1 -bf tests/TestsBootstrap.php -d tests/Galette/
- php galette/cron/reminder.php
} else {
$msg = str_replace(
'%id',
- $id,
+ $args['id'],
_T("Unable to impersonate as %id")
);
$this->flash->addMessage(
$field = _T("end date filter");
$filters->end_date_filter = $post['end_date_filter'];
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$error_detected[] = $e->getMessage();
}
}
$sent = $mail->send();
if (!$sent) {
- $txt = preg_replace(
- array('/%name/', '/%email/'),
- array($adh->sname, $adh->getEmail()),
- _T("A problem happened while sending to admin post contribution notification for user %name (%email) contribution")
- );
- $this->history->add($txt);
+ $txt = _T('Post contribution script has failed.');
+ $this->history->add($txt, $message);
$warning_detected[] = $txt;
//Mails are disabled... We log (not safe, but)...
Analog::log(
}
}
- /* TODO: remove */
- if (!isset($contribution['duree_mois_cotis'])
- || $contribution['duree_mois_cotis'] == ''
- ) {
- // On error restore entered value or default to display the form again
- if (isset($_POST['duree_mois_cotis'])
- && $_POST['duree_mois_cotis'] != ''
- ) {
- $contribution['duree_mois_cotis'] = $_POST['duree_mois_cotis'];
- } else {
- $contribution['duree_mois_cotis'] = $this->preferences->pref_membership_ext;
- }
- }
-
if (count($error_detected) > 0) {
//something went wrong.
//store entity in session
_T("An error occurred while storing the group.")
);
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$this->flash->addMessage(
'error_detected',
$e->getMessage()
$field = _T("end date filter");
$filters->end_date_filter = $post['end_date_filter'];
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$error_detected[] = $e->getMessage();
}
}
use Slim\Http\Response;
use Galette\Core\Authentication;
use Galette\Core\GaletteMail;
+use Galette\Core\Password;
use Galette\Core\PasswordImage;
use Galette\Core\Picture;
use Galette\Entity\Adherent;
$password = new Password($this->zdb);
$res = $password->generateNewPassword($member->id);
if ($res == true) {
- $link_validity = new DateTime();
- $link_validity->add(new DateInterval('PT24H'));
+ $link_validity = new \DateTime();
+ $link_validity->add(new \DateInterval('PT24H'));
$mreplaces['change_pass_uri'] = $this->preferences->getURL() .
$this->router->pathFor(
'password-recovery',
} else {
$str = str_replace(
'%s',
- $login_adh,
+ $member->sfullname,
_T("An error occurred storing temporary password for %s. Please inform an admin.")
);
$this->history->add($str);
use Slim\Http\Request;
use Slim\Http\Response;
use Galette\Entity\ImportModel;
+use Galette\Filters\MembersList;
use Galette\IO\Csv;
use Galette\IO\CsvIn;
use Galette\IO\CsvOut;
$results = $this->zdb->execute($select);
$result = $results->current();
$nb_fields = $result->nb;
- } catch (Exception $e) {
+ } catch (\Exception $e) {
Analog::log(
'An error occurred counting l10n entries | ' .
$e->getMessage(),
$field = _T("end date filter");
$filters->end_date_filter = $post['end_date_filter'];
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
$error_detected[] = $e->getMessage();
}
}
if ($result) {
$this->loadFromRs($result);
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
Analog::log(
'Unable to retrieve field type for field ' . $id . ' | ' .
$e->getMessage(),
$this->addTranslation($this->name);
}
}
- } catch (Exception $e) {
+ } catch (\Exception $e) {
Analog::log(
'An error occurred storing field | ' . $e->getMessage(),
Analog::ERROR
$this->zdb->execute($insert);
}
return true;
- } catch (Exception $e) {
+ } catch (\Exception $e) {
Analog::log(
'An error occurred updating dynamic translation for `' .
$text_orig . '` | ' . $e->getMessage(),
);
$this->zdb->execute($delete);
return true;
- } catch (Exception $e) {
+ } catch (\Exception $e) {
Analog::log(
'An error occurred deleting dynamic translation for `' .
$text_orig . ' | ' . $e->getMessage(),
* @param boolean $limit true if we want records pagination
* @param boolean $export true if we are exporting
*
- * @return Adherent[]|ResultSet
+ * @return Adherent[]|Laminas\Db\ResultSet
*/
public function getMembersList(
$as_members = false,
*
* @param integer $length of the random string
*
- * @return random string
+ * @return string
*
* @see https://stackoverflow.com/questions/4356289/php-random-string-generator/31107425#31107425
*/