*/
public function canShow(Login $login): bool
{
+ //non-logged-in members cannot show contributions
+ if (!$login->isLogged()) {
+ return false;
+ }
+
//admin and staff users can edit, as well as member itself
if (!$this->id || $this->id && $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
return true;
*/
public function canShow(Login $login): bool
{
+ //non-logged-in members cannot show contributions
+ if (!$login->isLogged()) {
+ return false;
+ }
+
//admin and staff users can edit, as well as member itself
if (!$this->id || $this->id && $login->id == $this->_member || $login->isAdmin() || $login->isStaff()) {
return true;
*
* PHP version 5
*
- * Copyright © 2017 The Galette Team
+ * Copyright © 2017-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package GaletteTests
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2017 The Galette Team
+ * @copyright 2017-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @version SVN: $Id$
* @link http://galette.tuxfamily.org
* @name Contribution
* @package GaletteTests
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2017 The Galette Team
+ * @copyright 2017-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.tuxfamily.org
* @since 2017-06-11
*
* PHP version 5
*
- * Copyright © 2020 The Galette Team
+ * Copyright © 2020-2021 The Galette Team
*
* This file is part of Galette (http://galette.tuxfamily.org).
*
* @package GaletteTests
*
* @author Johan Cwiklinski <johan@x-tnd.be>
- * @copyright 2020 The Galette Team
+ * @copyright 2020-2021 The Galette Team
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL License 3.0 or (at your option) any later version
* @link http://galette.eu
* @since 2020-12-27
namespace Galette;
use atoum;
+use Galette\Core\Db;
+use Galette\Core\History;
+use Galette\Core\I18n;
+use Galette\Core\Login;
+use Galette\Core\Preferences;
+use Galette\Entity\Adherent;
+use Galette\Entity\Contribution;
/**
* Galette tests case main class
*/
abstract class GaletteTestCase extends atoum
{
+ /** @var Db */
protected $zdb;
protected $members_fields;
protected $members_fields_cats;
+ /** @var I18n */
protected $i18n;
+ /** @var Preferences */
protected $preferences;
protected $session;
+ /** @var Login */
protected $login;
+ /** @var History */
protected $history;
protected $logger_storage = '';
+ /** @var Adherent */
protected $adh;
+ /** @var Contribution */
protected $contrib;
protected $adh_ids = [];
protected $contrib_ids = [];