Skip to content

Commit abf6f88

Browse files
committed
Create unLockCustomer.php
1 parent bbad1cb commit abf6f88

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

unLockCustomer.php

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?php
2+
/**
3+
* Magiccart
4+
* @category Magiccart
5+
* @copyright Copyright (c) 2014 Magiccart (http://www.magiccart.net/)
6+
* @license http://www.magiccart.net/license-agreement.html
7+
* @Author: DOng NGuyen<[email protected]>
8+
* @@Create Date: 2018-03-20 21:14:06
9+
* @@Modify Date: 2018-05-31 10:17:23
10+
* @@Function:
11+
*/
12+
ini_set('display_startup_errors', 1);ini_set('display_errors', 1); error_reporting(-1);
13+
//// Setup Base
14+
$folder = ''; //Folder Name
15+
$file = $folder ? "$folder/app/bootstrap.php" : "app/bootstrap.php";
16+
17+
if(!file_exists ($file)) $file = "app/bootstrap.php";
18+
if(file_exists ($file)){
19+
require dirname(__FILE__) .'/' .$file;
20+
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER);
21+
} else {die('Not found bootstrap.php');}
22+
23+
class updateOrder extends \Magento\Framework\App\Http
24+
implements \Magento\Framework\AppInterface {
25+
26+
public function launch()
27+
{
28+
29+
$this->_state->setAreaCode('adminhtml');
30+
// $_storeManager = $this->_objectManager->create('\Magento\Store\Model\StoreManagerInterface');
31+
// $_storeManager->setCurrentStore(0);
32+
$customerId = '2272';
33+
$authentication = $this->_objectManager->create('Magento\Customer\Model\AuthenticationInterface');
34+
$customerRepository = $this->_objectManager->create('Magento\Customer\Api\CustomerRepositoryInterface');
35+
// go to admin url domain.com/admin/customer/locks/unlock/customer_id/1
36+
if ($customerId) {
37+
$authentication->unlock($customerId);
38+
$customer = $customerRepository->getById($customerId);
39+
$customer->setConfirmation(null);
40+
$customerRepository->save($customer);
41+
echo 'done';
42+
}
43+
44+
return $this->_response;
45+
}
46+
47+
}
48+
49+
/** @var \Magento\Framework\App\Http $app */
50+
$app = $bootstrap->createApplication('updateOrder');
51+
$bootstrap->run($app);

0 commit comments

Comments
 (0)