accounting workflows
This commit is contained in:
@@ -10,10 +10,9 @@ require '../../../assets/utils/db_auth.php';
|
||||
require '../../../assets/utils/classes/UserManager.php';
|
||||
|
||||
$action = $data['action'] ?? '';
|
||||
$um = new UserManager($pdo1, $company_id, $user_id);
|
||||
|
||||
if ($action === 'read') {
|
||||
$um = new UserManager($pdo1, $company_id, $user_id);
|
||||
|
||||
$answer['success'] = 1;
|
||||
$answer['output'] = $um->getCompanyList();
|
||||
$answer['current'] = (int)$_SESSION['login_company_id'];
|
||||
@@ -29,13 +28,7 @@ if ($action === 'update') {
|
||||
exit(json_encode($answer));
|
||||
}
|
||||
|
||||
$sth = $pdo1->prepare(
|
||||
"SELECT company_id, role FROM company_map_user
|
||||
WHERE company_id = :company_id AND user_id = :user_id
|
||||
LIMIT 1"
|
||||
);
|
||||
$sth->execute([':company_id' => $target_company_id, ':user_id' => $user_id]);
|
||||
$target_map = $sth->fetch(PDO::FETCH_ASSOC);
|
||||
$target_map = $um->getCompanyAccess($target_company_id);
|
||||
|
||||
if (!$target_map) {
|
||||
$answer['message'] = 'You do not have access to this company.';
|
||||
|
||||
Reference in New Issue
Block a user