1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- require_once __DIR__.'/../config.php';
- api_protect_admin_script();
- $plugin = AdvancedSubscriptionPlugin::create();
- $hookPlugin = HookAdvancedSubscription::create();
- $params = [];
- $params['user_id'] = intval($_REQUEST['u']);
- $params['user_field'] = 'drupal_user_id';
- $params['session_id'] = intval($_REQUEST['s']);
- $params['profile_completed'] = 100;
- $params['is_connected'] = true;
- $check_ip = false;
- $ip = trim($_SERVER['REMOTE_ADDR']);
- if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
- list($ip1, $ip2) = split(',', $_SERVER['HTTP_X_FORWARDED_FOR']);
- $ip = trim($ip1);
- }
- if (is_file(api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php')) {
- include api_get_path(WEB_CODE_PATH).'webservices/webservice-auth-ip.conf.php';
- if (!empty($ws_auth_ip)) {
- $check_ip = true;
- }
- }
- global $_configuration;
- if ($check_ip) {
- $security_key = $_configuration['security_key'];
- } else {
- $security_key = $ip.$_configuration['security_key'];
-
- }
- $params['secret_key'] = sha1($security_key);
- $wsUrl = api_get_path(WEB_CODE_PATH).'webservices/registration.soap.php?wsdl';
- $options = [
- 'location' => $wsUrl,
- 'uri' => $wsUrl,
- ];
- try {
-
- $client = new SoapClient(null, $options);
-
- $result = $client->__soapCall('HookAdvancedSubscription..WSSessionGetDetailsByUser', [$params]);
- if (is_object($result) && isset($result->action_url)) {
- echo '<br />';
- echo Display::url("message".$result->message, $result->action_url);
- }
- } catch (\Exception $e) {
- var_dump($e);
- }
|