@@ -128,7 +128,7 @@ |
||
| 128 | 128 | public static function checkDatabaseExist(DBStorageInterface $DBStorage, $dbName) |
| 129 | 129 | { |
| 130 | 130 | try { |
| 131 | - $tables = implode(',', array_map(function ($value) { |
|
| 131 | + $tables = implode(',', array_map(function($value) { |
|
| 132 | 132 | return '\'' . $value . '\''; |
| 133 | 133 | }, self::$tables)); |
| 134 | 134 | |
@@ -74,7 +74,7 @@ |
||
| 74 | 74 | |
| 75 | 75 | if ($this->debug) { |
| 76 | 76 | $this->mailer->SMTPDebug = 2; |
| 77 | - $this->mailer->Debugoutput = function ($str, $level) { |
|
| 77 | + $this->mailer->Debugoutput = function($str, $level) { |
|
| 78 | 78 | logger($str, strtoupper($level)); |
| 79 | 79 | }; |
| 80 | 80 | } |
@@ -268,7 +268,7 @@ discard block |
||
| 268 | 268 | $userToUserGroupService = $this->dic->get(UserToUserGroupService::class); |
| 269 | 269 | |
| 270 | 270 | // Groups in whinch the user is listed in |
| 271 | - $userGroups = array_map(function ($value) { |
|
| 271 | + $userGroups = array_map(function($value) { |
|
| 272 | 272 | return (int)$value->userGroupId; |
| 273 | 273 | }, $userToUserGroupService->getGroupsForUser($this->userData->getId())); |
| 274 | 274 | |
@@ -301,7 +301,7 @@ discard block |
||
| 301 | 301 | */ |
| 302 | 302 | private function getUserInSecondaryUsers($userId) |
| 303 | 303 | { |
| 304 | - return array_values(array_filter($this->accountAclDto->getUsersId(), function ($value) use ($userId) { |
|
| 304 | + return array_values(array_filter($this->accountAclDto->getUsersId(), function($value) use ($userId) { |
|
| 305 | 305 | return (int)$value->id === $userId; |
| 306 | 306 | })); |
| 307 | 307 | } |
@@ -334,7 +334,7 @@ discard block |
||
| 334 | 334 | |
| 335 | 335 | // Comprobar si el grupo del usuario está vinculado desde los grupos secundarios de la cuenta |
| 336 | 336 | return array_filter($this->accountAclDto->getUserGroupsId(), |
| 337 | - function ($value) use ($userGroupId, $isAccountFullGroupAccess, $userGroups) { |
|
| 337 | + function($value) use ($userGroupId, $isAccountFullGroupAccess, $userGroups) { |
|
| 338 | 338 | return (int)$value->id === $userGroupId |
| 339 | 339 | // o... permitir los grupos que no sean el principal del usuario? |
| 340 | 340 | || ($isAccountFullGroupAccess |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | */ |
| 254 | 254 | public function checkMandatory() |
| 255 | 255 | { |
| 256 | - $missing = array_filter(self::EXTENSIONS, function ($v, $k) { |
|
| 256 | + $missing = array_filter(self::EXTENSIONS, function($v, $k) { |
|
| 257 | 257 | return $v === true && !in_array($k, $this->available); |
| 258 | 258 | }, ARRAY_FILTER_USE_BOTH); |
| 259 | 259 | |
@@ -271,7 +271,7 @@ discard block |
||
| 271 | 271 | */ |
| 272 | 272 | public function getMissing() |
| 273 | 273 | { |
| 274 | - return array_filter(self::EXTENSIONS, function ($k) { |
|
| 274 | + return array_filter(self::EXTENSIONS, function($k) { |
|
| 275 | 275 | return !in_array($k, $this->available); |
| 276 | 276 | }, ARRAY_FILTER_USE_KEY); |
| 277 | 277 | } |
@@ -86,7 +86,7 @@ |
||
| 86 | 86 | { |
| 87 | 87 | if (is_array($data) || is_object($data)) { |
| 88 | 88 | array_walk_recursive($data, |
| 89 | - function (&$value) { |
|
| 89 | + function(&$value) { |
|
| 90 | 90 | if (is_object($value)) { |
| 91 | 91 | foreach ($value as $property => $v) { |
| 92 | 92 | if (is_string($v) && $v !== '') { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | /** |
| 69 | 69 | * @return array |
| 70 | 70 | */ |
| 71 | - $passGen = function () use ($alphabet, $length) { |
|
| 71 | + $passGen = function() use ($alphabet, $length) { |
|
| 72 | 72 | $pass = []; |
| 73 | 73 | $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache |
| 74 | 74 | |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | $appTmp = APP_PATH . DIRECTORY_SEPARATOR . 'temp'; |
| 233 | 233 | $file = 'syspass.test'; |
| 234 | 234 | |
| 235 | - $checkDir = function ($dir) use ($file) { |
|
| 235 | + $checkDir = function($dir) use ($file) { |
|
| 236 | 236 | if (file_exists($dir . DIRECTORY_SEPARATOR . $file)) { |
| 237 | 237 | return $dir; |
| 238 | 238 | } |
@@ -361,7 +361,7 @@ discard block |
||
| 361 | 361 | if ($srcClass !== null) { |
| 362 | 362 | $serializedOut = preg_replace_callback( |
| 363 | 363 | '/:\d+:"\x00' . preg_quote($srcClass, '/') . '\x00(\w+)"/', |
| 364 | - function ($matches) { |
|
| 364 | + function($matches) { |
|
| 365 | 365 | return ':' . strlen($matches[1]) . ':"' . $matches[1] . '"'; |
| 366 | 366 | }, |
| 367 | 367 | $serialized); |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | */ |
| 310 | 310 | public function update(AccountRequest $accountRequest) |
| 311 | 311 | { |
| 312 | - $this->transactionAware(function () use ($accountRequest) { |
|
| 312 | + $this->transactionAware(function() use ($accountRequest) { |
|
| 313 | 313 | $accountRequest->changePermissions = AccountAclService::getShowPermission($this->context->getUserData(), $this->context->getUserProfile()); |
| 314 | 314 | |
| 315 | 315 | // Cambiar el grupo principal si el usuario es Admin |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | */ |
| 405 | 405 | public function editPassword(AccountRequest $accountRequest) |
| 406 | 406 | { |
| 407 | - $this->transactionAware(function () use ($accountRequest) { |
|
| 407 | + $this->transactionAware(function() use ($accountRequest) { |
|
| 408 | 408 | $this->addHistory($accountRequest->id); |
| 409 | 409 | |
| 410 | 410 | $pass = $this->getPasswordEncrypted($accountRequest->pass); |
@@ -438,7 +438,7 @@ discard block |
||
| 438 | 438 | */ |
| 439 | 439 | public function editRestore($historyId, $accountId) |
| 440 | 440 | { |
| 441 | - $this->transactionAware(function () use ($historyId, $accountId) { |
|
| 441 | + $this->transactionAware(function() use ($historyId, $accountId) { |
|
| 442 | 442 | $this->addHistory($accountId); |
| 443 | 443 | |
| 444 | 444 | if (!$this->accountRepository->editRestore($historyId, $this->context->getUserData()->getId())) { |
@@ -455,7 +455,7 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | public function delete($id) |
| 457 | 457 | { |
| 458 | - $this->transactionAware(function () use ($id) { |
|
| 458 | + $this->transactionAware(function() use ($id) { |
|
| 459 | 459 | $this->addHistory($id, 1); |
| 460 | 460 | |
| 461 | 461 | if ($this->accountRepository->delete($id) === 0) { |
@@ -117,7 +117,7 @@ |
||
| 117 | 117 | $gridData = new DataGridData(); |
| 118 | 118 | $gridData->setDataRowSourceId('id'); |
| 119 | 119 | $gridData->addDataRowSource('name'); |
| 120 | - $gridData->addDataRowSource('moduleId', false, function ($value) { |
|
| 120 | + $gridData->addDataRowSource('moduleId', false, function($value) { |
|
| 121 | 121 | return CustomFieldDefService::getFieldModuleById($value); |
| 122 | 122 | }); |
| 123 | 123 | $gridData->addDataRowSource('typeName'); |
@@ -133,7 +133,7 @@ |
||
| 133 | 133 | $gridData = new DataGridData(); |
| 134 | 134 | $gridData->setDataRowSourceId('id'); |
| 135 | 135 | $gridData->addDataRowSource('date', false, |
| 136 | - function ($value) { |
|
| 136 | + function($value) { |
|
| 137 | 137 | return DateUtil::getDateFromUnix($value); |
| 138 | 138 | }); |
| 139 | 139 | $gridData->addDataRowSource('type'); |