2022-10-15 11:22:08 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace Modules\Auth\Controllers;
|
|
|
|
|
|
|
|
use CodeIgniter\Controller;
|
|
|
|
use CodeIgniter\HTTP\RedirectResponse;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A generic controller to handle Authentication Actions.
|
|
|
|
*/
|
|
|
|
class InteractController extends Controller
|
|
|
|
{
|
2024-12-18 16:05:25 +00:00
|
|
|
public function interactAsActorAction(): RedirectResponse
|
2022-10-15 11:22:08 +00:00
|
|
|
{
|
|
|
|
$rules = [
|
|
|
|
'actor_id' => 'required|numeric',
|
|
|
|
];
|
|
|
|
|
|
|
|
if (! $this->validate($rules)) {
|
|
|
|
return redirect()
|
|
|
|
->back()
|
|
|
|
->withInput()
|
2023-10-03 16:21:08 +00:00
|
|
|
->with('errors', $this->validator->getErrors());
|
2022-10-15 11:22:08 +00:00
|
|
|
}
|
|
|
|
|
2023-08-29 15:42:52 +00:00
|
|
|
$validData = $this->validator->getValidated();
|
|
|
|
|
2022-10-15 11:22:08 +00:00
|
|
|
helper('auth');
|
|
|
|
|
2023-08-29 15:42:52 +00:00
|
|
|
set_interact_as_actor((int) $validData['actor_id']);
|
2022-10-15 11:22:08 +00:00
|
|
|
|
|
|
|
return redirect()->back();
|
|
|
|
}
|
|
|
|
}
|