@@ 321-332 (lines=12) @@ | ||
318 | * @param $app |
|
319 | * @return string |
|
320 | */ |
|
321 | public function getUniqueSecretKey($app) |
|
322 | { |
|
323 | $unique = Str::random(32); |
|
324 | $Customer = $app['eccube.repository.customer']->findBy(array( |
|
325 | 'secret_key' => $unique, |
|
326 | )); |
|
327 | if (count($Customer) == 0) { |
|
328 | return $unique; |
|
329 | } else { |
|
330 | return $this->getUniqueSecretKey($app); |
|
331 | } |
|
332 | } |
|
333 | ||
334 | /** |
|
335 | * ユニークなパスワードリセットキーを返す |
|
@@ 339-350 (lines=12) @@ | ||
336 | * @param $app |
|
337 | * @return string |
|
338 | */ |
|
339 | public function getUniqueResetKey($app) |
|
340 | { |
|
341 | $unique = Str::random(32); |
|
342 | $Customer = $app['eccube.repository.customer']->findBy(array( |
|
343 | 'reset_key' => $unique, |
|
344 | )); |
|
345 | if (count($Customer) == 0) { |
|
346 | return $unique; |
|
347 | } else { |
|
348 | return $this->getUniqueResetKey($app); |
|
349 | } |
|
350 | } |
|
351 | ||
352 | /** |
|
353 | * saltを生成する |