mirror of
https://github.com/Karaka-Management/oms-HumanResourceTimeRecording.git
synced 2026-02-14 03:38:41 +00:00
rector fixes
This commit is contained in:
parent
c845ed5907
commit
67eb6f8d36
|
|
@ -146,15 +146,11 @@ final class ApiController extends Controller
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($request->hasData('account') && ((int) $request->getData('account')) !== $request->header->account
|
if ($request->hasData('account') && ((int) $request->getData('account')) !== $request->header->account && !$this->app->accountManager->get($request->header->account)->hasPermission(
|
||||||
) {
|
PermissionType::CREATE, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN
|
||||||
if (!$this->app->accountManager->get($request->header->account)->hasPermission(
|
)) {
|
||||||
PermissionType::CREATE, $this->app->unitId, $this->app->appId, self::NAME, PermissionCategory::SESSION_ELEMENT_FOREIGN
|
$response->header->status = RequestStatusCode::R_403;
|
||||||
)) {
|
return;
|
||||||
$response->header->status = RequestStatusCode::R_403;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$element = $this->createSessionElementFromRequest($request);
|
$element = $this->createSessionElementFromRequest($request);
|
||||||
|
|
|
||||||
|
|
@ -209,7 +209,7 @@ class Session implements \JsonSerializable
|
||||||
*/
|
*/
|
||||||
public function getStatus() : int
|
public function getStatus() : int
|
||||||
{
|
{
|
||||||
if (\count($this->sessionElements) === 0) {
|
if (empty($this->sessionElements)) {
|
||||||
return ClockingStatus::START;
|
return ClockingStatus::START;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -381,7 +381,7 @@ function phpServe() : void
|
||||||
|
|
||||||
// Execute the command and store the process ID
|
// Execute the command and store the process ID
|
||||||
$output = [];
|
$output = [];
|
||||||
echo \sprintf('Starting server...') . \PHP_EOL;
|
echo 'Starting server...' . \PHP_EOL;
|
||||||
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
|
echo \sprintf(' Current directory: %s', \getcwd()) . \PHP_EOL;
|
||||||
echo \sprintf(' %s', $command);
|
echo \sprintf(' %s', $command);
|
||||||
\exec($command, $output);
|
\exec($command, $output);
|
||||||
|
|
@ -406,7 +406,7 @@ function phpServe() : void
|
||||||
|
|
||||||
// Kill the web server when the process ends
|
// Kill the web server when the process ends
|
||||||
\register_shutdown_function(function() use ($killCommand, $pid) : void {
|
\register_shutdown_function(function() use ($killCommand, $pid) : void {
|
||||||
echo \PHP_EOL . \sprintf('Stopping server...') . \PHP_EOL;
|
echo \PHP_EOL . 'Stopping server...' . \PHP_EOL;
|
||||||
echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL;
|
echo \sprintf(' %s - Killing process with ID %d', \date('r'), $pid) . \PHP_EOL;
|
||||||
\exec($killCommand . $pid);
|
\exec($killCommand . $pid);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user