@@ -20,7 +20,7 @@ |
||
| 20 | 20 | public function prePersist($entity) |
| 21 | 21 | { |
| 22 | 22 | if ($entity->getGuid() === null) { |
| 23 | - $entity->setGuid((string)Uuid::uuid4()); |
|
| 23 | + $entity->setGuid((string) Uuid::uuid4()); |
|
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | } |
@@ -13,6 +13,6 @@ |
||
| 13 | 13 | $path = explode("/", __DIR__); |
| 14 | 14 | array_pop($path); |
| 15 | 15 | |
| 16 | - return implode("/", $path)."/../../" . $package; |
|
| 16 | + return implode("/", $path) . "/../../" . $package; |
|
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | \ No newline at end of file |
@@ -39,8 +39,7 @@ |
||
| 39 | 39 | ]); |
| 40 | 40 | |
| 41 | 41 | foreach ($modules as $module) { |
| 42 | - $navigation = json_decode(file_get_contents($this->get("ribs_admin.globals")->getBaseBundlePath |
|
| 43 | - ($module->getPackageName()) . "/Resources/json/navigation.json"), true); |
|
| 42 | + $navigation = json_decode(file_get_contents($this->get("ribs_admin.globals")->getBaseBundlePath($module->getPackageName()) . "/Resources/json/navigation.json"), true); |
|
| 44 | 43 | |
| 45 | 44 | foreach ($navigation["items"] as $item) { |
| 46 | 45 | if ($this->get("ribs_admin.acess_rights")->testRight($item["right"])) { |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | foreach ($modules as $module) { |
| 37 | 37 | $modules_data[] = [ |
| 38 | 38 | "name" => $module->getTitle(), |
| 39 | - "rights" => (array)json_decode(file_get_contents($this->globals->getBaseBundlePath($module->getPackageName()) . "/Resources/json/ribsadmin_rights.json")) |
|
| 39 | + "rights" => (array) json_decode(file_get_contents($this->globals->getBaseBundlePath($module->getPackageName()) . "/Resources/json/ribsadmin_rights.json")) |
|
| 40 | 40 | ]; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -59,6 +59,6 @@ discard block |
||
| 59 | 59 | $rights[] = json_decode(file_get_contents($this->globals->getBaseBundlePath($module->getPackageName()) . "/Resources/json/ribsadmin_rights.json")); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - return (object)$rights; |
|
| 62 | + return (object) $rights; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | \ No newline at end of file |
@@ -75,14 +75,14 @@ |
||
| 75 | 75 | $username = $data->getUser()->getFirstName() . " " . $data->getUser()->getLastName(); |
| 76 | 76 | |
| 77 | 77 | if ($guid === null) { |
| 78 | - $this->addFlash("success-flash", "the account of ". $username . " was created"); |
|
| 78 | + $this->addFlash("success-flash", "the account of " . $username . " was created"); |
|
| 79 | 79 | } else { |
| 80 | - $this->addFlash("success-flash", "the account of ". $username . " was edited"); |
|
| 80 | + $this->addFlash("success-flash", "the account of " . $username . " was edited"); |
|
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | return $this->redirectToRoute("ribsadmin_accounts"); |
| 84 | 84 | } else { |
| 85 | - $this->addFlash("error-flash", "An account with username ". $data->getUsername() . " already exist"); |
|
| 85 | + $this->addFlash("error-flash", "An account with username " . $data->getUsername() . " already exist"); |
|
| 86 | 86 | return $this->redirectToRoute($request->get("_route"), ["guid" => $guid]); |
| 87 | 87 | } |
| 88 | 88 | } |
@@ -94,8 +94,8 @@ |
||
| 94 | 94 | { |
| 95 | 95 | $string = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789"; |
| 96 | 96 | $token = ""; |
| 97 | - srand((double)microtime() * 1000000); |
|
| 98 | - for ($i = 0 ; $i < $length ; $i++) { |
|
| 97 | + srand((double) microtime() * 1000000); |
|
| 98 | + for ($i = 0; $i < $length; $i++) { |
|
| 99 | 99 | $token .= $string[rand() % strlen($string)]; |
| 100 | 100 | } |
| 101 | 101 | |
@@ -77,7 +77,7 @@ |
||
| 77 | 77 | |
| 78 | 78 | $ribs_admin_rights = json_decode(file_get_contents($this->globals->getBaseBundlePath() . "/Resources/json/ribsadmin_rights.json")); |
| 79 | 79 | $modules_rights = $this->module->getModuleRights(); |
| 80 | - $ribs_admin_rights = (object)array_merge((array)$ribs_admin_rights, (array)$modules_rights); |
|
| 80 | + $ribs_admin_rights = (object) array_merge((array) $ribs_admin_rights, (array) $modules_rights); |
|
| 81 | 81 | |
| 82 | 82 | if ($admin_page == "ribsadmin" && strpos($route, "login") === false && strpos($route, "register") === false) { |
| 83 | 83 | //redirection si user pas connecté |