Magento管理员使用cURL登录

时间:2012-07-17 11:32:09

标签: magento-1.6

我想使用用户名和密码通过cURL登录管理面板来执行某些操作 不像here

1 个答案:

答案 0 :(得分:2)

试试这个

$APIURL = "http://APIURL:port/API/login/";
$method = "POST";
$http = new Varien_Http_Client(APIURL."?username=".$login['username']."&password=".$login['password']);
$response = $http->request($method);
$body = $response->getBody();

try {
     $verifyUser = json_decode($body);
}
catch (Exception $e) {
    throw Mage::exception('Mage_Core', $e);
}
相关问题