Overview
Comment:Allow access to accounts list from user subscription, even if logged in user does not have access to accounting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA3-256: b57570cfb3964d64bc61bd3f82b02024e75c0b46cc683c5cc1c92e5cef4b4609
User & Date: bohwaz on 2022-06-23 01:42:44
Other Links: manifest | tags
Context
2022-06-23
21:16
Ignore files that vanished between listing and stat() check-in: a59370ab6a user: bohwaz tags: trunk, stable
01:42
Allow access to accounts list from user subscription, even if logged in user does not have access to accounting check-in: b57570cfb3 user: bohwaz tags: trunk, stable
2022-06-22
14:20
Improve new year screen after year close check-in: 2ed449bbd8 user: bohwaz tags: trunk, stable
Changes

Modified src/www/admin/acc/_inc.php from [b6e3c3f264] to [b33504a9a2].

1
2
3
4
5
6
7
8

9

10
11
12
13
14
15
16
<?php

namespace Garradin;

use Garradin\Accounting\Years;

require_once __DIR__ . '/../_inc.php';


$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);


$current_year_id = $session->get('acc_year');
$current_year = null;

if ($current_year_id) {
	// Check that the year is still valid
	$current_year = Years::get($current_year_id);








>
|
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php

namespace Garradin;

use Garradin\Accounting\Years;

require_once __DIR__ . '/../_inc.php';

if (!defined('Garradin\ALLOW_ACCOUNTS_ACCESS') || !ALLOW_ACCOUNTS_ACCESS) {
	$session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_READ);
}

$current_year_id = $session->get('acc_year');
$current_year = null;

if ($current_year_id) {
	// Check that the year is still valid
	$current_year = Years::get($current_year_id);

Modified src/www/admin/acc/charts/accounts/selector.php from [dbf0dab53e] to [0b96176cb9].

1
2
3
4
5
6
7


8
9
10
11
12
13
14
<?php

namespace Garradin;

use Garradin\Entities\Accounting\Account;
use Garradin\Accounting\Charts;
use Garradin\Accounting\Years;



require_once __DIR__ . '/../../_inc.php';

$targets = qg('targets');
$targets = $targets ? explode(':', $targets) : [];
$chart = (int) qg('chart') ?: null;








>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<?php

namespace Garradin;

use Garradin\Entities\Accounting\Account;
use Garradin\Accounting\Charts;
use Garradin\Accounting\Years;

const ALLOW_ACCOUNTS_ACCESS = true;

require_once __DIR__ . '/../../_inc.php';

$targets = qg('targets');
$targets = $targets ? explode(':', $targets) : [];
$chart = (int) qg('chart') ?: null;