Beispiel #1
0
        } elseif ($object == 'images' && $action == 'delete') {
            foreach ($data as $image) {
                if (empty($image['pair_id'])) {
                    $response->addError('ERROR_WRONG_OBJECT_DATA', str_replace('[object]', 'images', __('twgadmin_wrong_api_object_data')));
                    continue;
                }
                fn_delete_image_pair($image['pair_id'], 'product');
            }
        }
        $response->returnResponse();
    }
}
if ($mode == 'post') {
    if ($action == 'auth.svc') {
        $connector = new TwigmoConnector();
        $request = $connector->parseResponse($_REQUEST['data']);
        if (!$connector->responseIsOk($request) || empty($request['data']['user_login']) || empty($request['data']['password'])) {
            $connector->onError();
        }
        $_POST = $_REQUEST = array_merge($_REQUEST, $request['data']);
        list($status, $user_data, $user_login, $password, $salt) = fn_auth_routines($_REQUEST, $auth);
        $redirect_to_mv_url = fn_twg_check_for_vendor_url($status, $user_data);
        if ($redirect_to_mv_url) {
            $status = true;
        }
        $is_ok = !empty($user_data) && !empty($password) && fn_generate_salted_password($password, $salt) == $user_data['password'];
        if ($status === false || !$is_ok) {
            $connector->onError();
        }
        $response_data = array('redirect_to_mv_url' => $redirect_to_mv_url, 'company_id' => $user_data['company_id'], 'can_view_orders' => fn_check_user_access($user_data['user_id'], 'view_orders'));
        $connector->respond($response_data);