Skip to content

Commit

Permalink
better login token
Browse files Browse the repository at this point in the history
  • Loading branch information
danielkerr committed Jun 25, 2015
1 parent dc34dcb commit b79cdf3
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions upload/admin/controller/sale/customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1158,8 +1158,15 @@ public function login() {
$customer_info = $this->model_sale_customer->getCustomer($customer_id);

if ($customer_info) {
$token = md5(mt_rand());

// Create token to login with
$string = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';

$token = '';

for ($i = 0; $i < 64; $i++) {
$token .= $string[rand(0, strlen($string) - 1)];
}

$this->model_sale_customer->editToken($customer_id, $token);

if (isset($this->request->get['store_id'])) {
Expand Down

0 comments on commit b79cdf3

Please sign in to comment.