/** * Logs out the current user. * */ public function logout() { // no user logged in if ($this->sessionId === null) { return; } $this->server->logout($this->sessionId); }
/** * logout in ovh. */ protected function logout() { if ($this->soapClient && $this->session) { $this->soapClient->logout($this->session); $this->session = null; } }
function Create($operate_array, $create_array, $client_options_array) { $soap_location = "http://" . $operate_array['ip'] . ":" . $operate_array['port'] . "/remote/index.php"; $soap_uri = "http://" . $operate_array['ip'] . ":" . $operate_array['port'] . "/remote/"; $client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri)); if ($session_id = $client->login($username, $password)) { $arr = $client_options_array; $arr['contact_name'] = $create_array['clientlogin']; $arr['username'] = $create_array['clientlogin']; $arr['password'] = $create_array['clientpassword']; if ($client->client_add($session_id, false, $arr)) { if ($client->logout($session_id)) { return true; } else { return false; } } else { return false; } /* $arr['limit_maildomain'] = $arr['limit_mailbox'] = $arr['limit_mailalias'] = $arr['limit_mailaliasdomain'] = $arr['limit_mailforward'] = $arr['limit_mailcatchall'] = $arr['limit_mailrouting'] = $arr['limit_mailfilter'] = $arr['limit_fetchmail'] = $arr['limit_mailquota'] = $arr['limit_spamfilter_wblist'] = $arr['limit_spamfilter_user'] = $arr['limit_spamfilter_policy'] = $arr['limit_web_domain'] = $arr['limit_web_quota'] = $arr['web_php_options'] = $arr['limit_web_aliasdomain'] = $arr['limit_web_subdomain'] = $arr['limit_ftp_user'] = $arr['limit_shell_user'] = $arr['ssh_chroot'] = $arr['limit_webdav_user'] = $arr['limit_dns_zone'] = $arr['limit_dns_slave_zone'] = $arr['limit_dns_record'] = $arr['limit_client'] = $arr['limit_database'] = $arr['limit_cron'] = $arr['limit_cron_type'] = $arr['limit_cron_frequency'] = $arr['limit_traffic_quota'] = */ } else { return false; } }
public function FTPinfos_serverTotalSpace($localhost_path, $manager_loggin, $manager_pass) { if ($_SERVER['SERVER_ADDR'] == '127.0.0.1') { return disk_total_space($localhost_path); } else { $soap = new \SoapClient("https://www.ovh.com/soapi/soapi-re-1.24.wsdl"); $session_soap = $soap->login($manager_loggin, $manager_pass, "fr", false); $result = $soap->hostingSummary($session_soap, preg_replace('/^www\\./', '', $_SERVER["SERVER_NAME"])); $soap->logout($session_soap); return intval($result->maxWebspace) / 1000 * 1024 * 1024 * 1024; } }
protected function loadData() { $client = new SoapClient(null, array('location' => SOAP_LOCATION, 'uri' => SOAP_URI)); try { //* Login to the remote server if ($session_id = $client->login(SOAP_USER, SOAP_PASS)) { $mail_user = $client->mail_user_get($session_id, array('email' => $this->email)); if (count($mail_user) == 1) { $this->host = $client->server_get($session_id, $mail_user[0]['server_id'], 'server'); $this->user = $mail_user[0]; } else { throw new Exception("Unknown Account"); } } //* Logout $client->logout($session_id); } catch (SoapFault $e) { throw new Exception('SOAP Error: ' . $e->getMessage()); } }
/** */ protected function _changePassword($user, $oldpass, $newpass) { // Connect $soap_uri = $this->_params['soap_uri']; $client = new SoapClient(null, array('location' => $soap_uri . 'index.php', 'uri' => $soap_uri)); // Login try { if (!($session_id = $client->login($this->_params['soap_user'], $this->_params['soap_pass']))) { throw new Passwd_Exception(sprintf(_("Login to %s failed."), $soap_uri)); } } catch (SoapFault $e) { throw new Passwd_Exception($e); } // Get user information try { $users = $client->mail_user_get($session_id, array('login' => $user)); } catch (SoapFault $e) { throw new Passwd_Exception($e); } if (count($users) != 1) { throw new Passwd_Exception(sprintf(_("%d users with login %s found, one expected."), count($users), $user)); } $user = $users[0]; // Check the passwords match $this->_comparePasswords($user['password'], $oldpass); // Set new password $user['password'] = $newpass; // Save information try { $client->mail_user_update($session_id, $user['client_id'], $user['mailuser_id'], $user); } catch (SoapFault $e) { throw new Passwd_Exception($e); } // Logout try { $client->logout($session_id); } catch (SoapFault $e) { throw new Passwd_Exception($e); } }
/** * @name delete($pMail) * @param String * @return VR * @desc Supprime un mail de la mailing liste */ public function delete($pMail) { $lMailingListeValid = new MailingListeValid(); $lVr = $lMailingListeValid->validAjout($pMail); if ($lVr->getValid()) { // Initialisation du Logger $lLogger =& Log::singleton('file', CHEMIN_FICHIER_LOGS); $lLogger->setMask(Log::MAX(LOG_LEVEL)); try { $lSoap = new SoapClient(ADRESSE_WSDL); $lSession = $lSoap->login(SOAP_LOGIN, SOAP_PASS, "fr", false); $lSoap->mailingListSubscriberDel($lSession, MAIL_MAILING_LISTE_DOMAIN, MAIL_MAILING_LISTE, $pMail); $lSoap->logout($lSession); return true; } catch (SoapFault $pFault) { $lLogger->log("Echec de suppression de la mailing liste : " . $pFault . ".", PEAR_LOG_INFO); // Maj des logs return false; } } return $lVr; }
$host_login = $host . '/soap/?wsdl'; $host_tracker = $host . '/plugins/tracker/soap/?wsdl'; // Establish connection to the server $client_login = new SoapClient($host_login, $soap_options); $session_hash = $client_login->login($login, $password)->session_hash; try { // Connecting to the soap's tracker api $client_tracker = new SoapClient($host_tracker, $soap_options); $response = $client_tracker->getArtifactsFromReport($session_hash, $report_id, $offset, $limit); var_dump($response); echo "total_artifacts_number: " . $response->total_artifacts_number . "\n"; foreach ($response->artifacts as $artifact) { $message = "#" . $artifact->artifact_id; foreach ($artifact->value as $value) { if ((string) $value->field_name == "description") { $message .= " " . (string) $value->field_value; } if ((string) $value->field_name == "remaining_effort" && (string) $value->field_value) { $message .= " (" . (string) $value->field_label . ": " . (string) $value->field_value . ")"; } } echo $message . "\n"; } } catch (Exception $e) { echo $e->getMessage(); echo "\n"; echo $client_tracker->__getLastResponse(); echo "\n"; } $client_login->logout($session_hash);
$errors[] = "Error : " . $fault; } //popModifyPassword try { $result = $soap->popModifyPassword($session, $domain, $email_name, $newpass, false); $success .= "popModifyPassword successfull<br/>"; $success .= print_r($result); $success .= "<br/>"; $success .= "<h3>Merci.<br />Mot de passe modifié.</h3>"; $success .= "<h3>Il sera pris en compte d'ici une quinzaine de minutes</h3>"; } catch (SoapFault $fault) { $errors[] = "Error : " . $fault; } //logout try { $result = $soap->logout($session); $success .= "logout successfull<br/>"; } catch (SoapFault $fault) { $errors[] = "Error : " . $fault; } } elseif (strlen($newpass) > 0 && $newpass != $newpass2) { // ici le cas ou le premier nouveau mot de passe ne correspond pas au second $errors[] = "The two passwords are not equal, please check it"; } elseif (strlen($newpass) > 0 && strlen($newpass) < 8) { // Si le mot de passe fait moins de 8 caractères on refuse $errors[] = "Make sure your password has minimum 8 characters."; } } $error_text = ''; if (!empty($errors)) { $error_text .= '<ul class="error-list">';
echo "Finish: transaction has been processed\n"; echo "Tr. ID: " . $response3->tr_id . "\n"; } else { echo "Settlement error: " . $response3->status . " i " . $response3->msg . "\n"; } } else { echo "ConfirmTransaction error: " . $response2->status . " i " . $response2->msg . "\n"; } } elseif ($response->status == 'OK') { echo "Step 2b: Transaction has been accepted, no confirmation required, it can be processed\n"; $request_id = $response->request_id; $response2 = $soap->Settlement($request_id); if ($response2->status == 'OK') { echo "Finish: transaction has been processed\n"; echo "Tr. ID: " . $response2->tr_id . "\n"; } else { echo "Settlement error: " . $response2->status . " i " . $response2->msg . "\n"; } } else { echo "PreAuth error: " . $response->status . " i " . $response->msg . "\n"; } $soap->logout(); echo "Logout\n"; } else { echo "Auth error: " . $response->status . " " . $response->msg . "\n"; } } catch (Exception $e) { var_export($e); } ?> </pre>
<?php if (!isset($_POST['lines'], $_POST['user'], $_POST['password'])) { echo 'Aucune donnée envoyée !'; exit; } try { $soap = new SoapClient("https://www.ovh.com/soapi/soapi-re-1.63.wsdl"); //login $session = $soap->login("", "", "fr", false); foreach (preg_split("/,[\\s]?/", $_POST['lines']) as $line) { $soap->telephonyClick2CallUserAdd($session, $line, "", $_POST['user'], $_POST['password']); } $soap->logout($session); } catch (SoapFault $fault) { echo $fault->getMessage(); }
function ispcfg3_ChangePassword($params) { $username = $params['username']; $password = $params['password']; $clientsdetails = $params['clientsdetails']; $soapuser = $params['configoption1']; $soappassword = $params['configoption2']; $soapsvrurl = $params['configoption3']; $soapsvrssl = $params['configoption4']; if ($soapsvrssl == 'on') { $soap_url = 'https://' . $soapsvrurl . '/remote/index.php'; $soap_uri = 'https://' . $soapsvrurl . '/remote/'; } else { $soap_url = 'http://' . $soapsvrurl . '/remote/index.php'; $soap_uri = 'http://' . $soapsvrurl . '/remote/'; } if (isset($username) && $username != '' && (isset($password) && $password != '')) { try { /* Connect to SOAP Server */ $client = new SoapClient(null, array('location' => $soap_url, 'uri' => $soap_uri, 'exceptions' => 1, 'trace' => false)); /* Authenticate with the SOAP Server */ $session_id = $client->login($soapuser, $soappassword); $domain_id = $client->client_get_by_username($session_id, $username); $client_id = $domain_id['client_id']; $returnresult = $client->client_change_password($session_id, $client_id, $password); logModuleCall('ispconfig', 'ChangePassword', $clientsdetails, $returnresult, '', ''); if ($client->logout($session_id)) { } if ($returnresult == 1) { $successful = '1'; } else { $successful = '0'; $result = "Password change failed"; } } catch (SoapFault $e) { $error = 'SOAP Error: ' . $e->getMessage(); $successful = '0'; } if ($successful == 1) { $result = 'success'; } else { $result = 'Error: ' . $error; } } else { /* * No username or password set. */ $result = 'Username or Password is Blank or Not Set'; } return $result; }
<?php $host = 'shunt.cro.enalean.com'; $soap_client = new SoapClient("http://{$host}/soap/codendi.wsdl.php?wsdl"); $session_hash = $soap_client->login('nicolas', 'nicolas')->session_hash; $svn_client = new SoapClient("http://{$host}/soap/svn/?wsdl", array('cache_wsdl' => WSDL_CACHE_NONE)); $start_date = mktime(0, 0, 0, 3, 1, 2012); $end_date = mktime(0, 0, 0, 5, 1, 2012); echo "=== Top used files ===\n"; var_dump($svn_client->getSvnStatsFiles($session_hash, 101, $start_date, $end_date, 10)); echo "=== Commiters ===\n"; var_dump($svn_client->getSvnStatsUsers($session_hash, 101, $start_date, $end_date)); $soap_client->logout($session_hash);
function save() { $confirm = $this->rcmail_inst->config->get('password_confirm_current'); if ($confirm && !isset($_POST['_curpasswd']) || !isset($_POST['_newpasswd'])) { $this->rcmail_inst->output->command('display_message', $this->gettext('nopassword'), 'error'); } else { $curpwd = rcube_utils::get_input_value('_curpasswd', RCUBE_INPUT_POST); $newpwd = rcube_utils::get_input_value('_newpasswd', RCUBE_INPUT_POST); $pwl = $this->rcmail_inst->config->get('password_min_length'); $checkUpper = $this->rcmail_inst->config->get('password_check_upper'); $checkLower = $this->rcmail_inst->config->get('password_check_lower'); $checkSymbol = $this->rcmail_inst->config->get('password_check_symbol'); $checkNumber = $this->rcmail_inst->config->get('password_check_number'); $error = false; if (!empty($pwl)) { $pwl = max(6, $pwl); } else { $pwl = 6; } if ($confirm && $this->rcmail_inst->decrypt($_SESSION['password']) != $curpwd) { $this->rcmail_inst->output->command('display_message', $this->gettext('passwordincorrect'), 'error'); } else { if (strlen($newpwd) < $pwl) { $error = true; $this->rcmail_inst->output->command('display_message', str_replace("%d", $pwl, $this->gettext('passwordminlength')), 'error'); } if (!$error && $checkNumber && !preg_match("#[0-9]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecknumber'), 'error'); } if (!$error && $checkLower && !preg_match("#[a-z]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecklower'), 'error'); } if (!$error && $checkUpper && !preg_match("#[A-Z]+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordcheckupper'), 'error'); } if (!$error && $checkSymbol && !preg_match("#\\W+#", $newpwd)) { $error = true; $this->rcmail_inst->output->command('display_message', $this->gettext('passwordchecksymbol'), 'error'); } if (!$error) { try { $soap = new SoapClient(null, array('location' => $this->rcmail_inst->config->get('soap_url') . 'index.php', 'uri' => $this->rcmail_inst->config->get('soap_url'))); $session_id = $soap->login($this->rcmail_inst->config->get('remote_soap_user'), $this->rcmail_inst->config->get('remote_soap_pass')); $mail_user = $soap->mail_user_get($session_id, array('login' => $this->rcmail_inst->user->data['username'])); $params = $mail_user[0]; $startdate = array('year' => substr($params['autoresponder_start_date'], 0, 4), 'month' => substr($params['autoresponder_start_date'], 5, 2), 'day' => substr($params['autoresponder_start_date'], 8, 2), 'hour' => substr($params['autoresponder_start_date'], 11, 2), 'minute' => substr($params['autoresponder_start_date'], 14, 2)); $enddate = array('year' => substr($params['autoresponder_end_date'], 0, 4), 'month' => substr($params['autoresponder_end_date'], 5, 2), 'day' => substr($params['autoresponder_end_date'], 8, 2), 'hour' => substr($params['autoresponder_end_date'], 11, 2), 'minute' => substr($params['autoresponder_end_date'], 14, 2)); $params['password'] = $newpwd; $params['autoresponder_end_date'] = $enddate; $params['autoresponder_start_date'] = $startdate; $uid = $soap->client_get_id($session_id, $mail_user[0]['sys_userid']); $update = $soap->mail_user_update($session_id, $uid, $mail_user[0]['mailuser_id'], $params); $soap->logout($session_id); $this->rcmail_inst->output->command('display_message', $this->gettext('successfullysaved'), 'confirmation'); $_SESSION['password'] = $this->rcmail_inst->encrypt($newpwd); $this->rcmail_inst->user->data['password'] = $_SESSION['password']; } catch (SoapFault $e) { $this->rcmail_inst->output->command('display_message', 'Soap Error: ' . $e->getMessage(), 'error'); } } } } $this->init_html(); }
function ovh_GetEPPCode($params) { ini_set("display_errors", "off"); error_reporting(0); try { $url = "https://www.ovh.com/soapi/soapi-re-1.14.wsdl"; $soap = new SoapClient($url, array("trace" => 1)); $username = $params['Username']; $password = $params['Password']; $testmode = $params['TestMode'] ? true : false; $session = $soap->login("" . $username, "" . $password, "en", false); $tld = $params['tld']; $sld = $params['sld']; $domain = "" . $sld . "." . $tld; $information = $soap->domainInfo($session, "" . $domain); $values['eppcode'] = $information->authinfo; } catch (Exception $e) { logModuleCall("ovh", "Get EPP Code", $soap->__getLastRequest(), $e . $url, null, $session); if ($e->faultstring) { return array("error" => $e->faultstring); } return array("error" => "An unhandled error occurred"); } $soap->logout($session); return $values; }
/*if (substr_count($name, '.') > 0) { $name = substr($r->getFilename(), 0, strrpos($r->getFilename(), '.')); }*/ echo "Uploading " . $name . " ..... "; $fileName = basename($r->getPathname()); $fileSize = filesize($r->getPathname()); $fileType = shell_exec('file -bi "' . escapeshellcmd($r->getPathname()) . '"'); try { $itemId = $soap->createDocmanFile($hash, $project_id, $folderhash[$folderpath], $name, '', 'end', 100, 0, array(), array(), $fileSize, $fileName, $fileType, '', 0, $chunkSize); if ($itemId) { $offset = 0; while ($chunk = getChunk($r->getPathname(), $offset, $chunkSize)) { $soap->appendDocmanFileChunk($hash, $project_id, $itemId, $chunk, $offset, $chunkSize); $offset++; } } $uploadedMd5 = $soap->getDocmanFileMD5sum($hash, $project_id, $itemId, 1); if ($uploadedMd5 !== md5_file($r->getPathname())) { echo "ERROR: md5 differs" . PHP_EOL; } else { echo "OK" . PHP_EOL; } } catch (Exception $e) { echo 'ERROR (' . $e->getMessage() . ')' . PHP_EOL; } } } } echo "Files are correctly uploaded in the docman\n"; $soap->logout($hash);
<?php require 'soap_config.php'; $client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1)); try { if ($session_id = $client->login($username, $password)) { echo 'Logged successfull. Session ID:' . $session_id . '<br />'; } //* Set the function parameters. $session = $session_id; echo "Logging out: "; $client->logout($session); //Logged out echo "Logged out."; } catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: ' . $e->getMessage()); }
* Tuleap is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Tuleap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ if ($argc < 2) { die("Usage: " . $argv[0] . " group_id tracker_id \n"); } $serverURL = isset($_SERVER['TULEAP_SERVER']) ? $_SERVER['TULEAP_SERVER'] : 'http://sonde.cro.enalean.com'; $login = isset($_SERVER['TULEAP_USER']) ? $_SERVER['TULEAP_USER'] : '******'; $password = isset($_SERVER['TULEAP_PASSWORD']) ? $_SERVER['TULEAP_PASSWORD'] : '******'; // Establish connexion to the server $soapLogin = new SoapClient($serverURL . '/soap/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); $requesterSessionHash = $soapLogin->login($login, $password)->session_hash; $group_id = $argv[1]; $tracker_id = $argv[2]; // Connecting to the soap's tracker client $soapTracker = new SoapClient($serverURL . '/plugins/tracker/soap/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); //Executing method getTrackerSemantic try { $response = $soapTracker->getTrackerStructure($requesterSessionHash, $group_id, $tracker_id); var_dump($response); } catch (Exception $e) { var_dump($soapTracker->__getLastResponse()); } $soapLogin->logout($requesterSessionHash);
/** * Logout from QuoVadis Service. * * @return bool * @throws SetaPDF_Signer_Exception */ public function logout() { if (!$this->_ticket) { return false; } $client = new SoapClient($this->_wsdl, array_merge($this->_clientOptions, array('trace' => true))); $result = $client->logout(array('logoutRequest' => array('ticket' => $this->_ticket))); $this->_lastResult = $result; if ($result->return->result != 0) { throw new SetaPDF_Signer_Exception(sprintf('QuoVadis logout failed with result code %s.', $result->return->result)); } return true; }
{ echo $str . "\n"; } ini_set('soap.wsdl_cache_enabled', 0); $username = '******'; //$_POST['username']; $password = '******'; //md5($_POST['password']); //$client = new SoapClient("https://srvfh13.fh-luebeck.de/moodle/moodleplugin.wsdl",array('trace'=>1,'login'=>$username,'password'=>$password)); $client = new SoapClient("https://www.myserver.com/moodle/moodleplugin.wsdl"); try { $sessid = ''; out($sessid = $client->login($username, $password)); out($client->addUser($sessid, 'testheinz', '1234', 'Heinz', 'Test', '*****@*****.**')); out($client->updateUser($sessid, 'testheinz', 'Heinzi', 'Tester', '*****@*****.**')); out($sessid = $client->logout($sessid)); out($client->deleteUser($sessid, 'testheinz')); //echo $client->exportUsers(2, 'CF101'); //echo $client->importCourses($xml_string,"Prova"); //echo $client->exportCourses(); //echo $client->exportCourses(3,"Prova"); //echo $client->exportCategories(); } catch (SoapFault $sf) { //echo $client->__getLastRequest(); echo $client->__getLastResponse(); echo $sf->faultstring; } /*else { if (empty($_SERVER[HTTPS])) { $url="https://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI];
<?php require 'soap_config.php'; $client = new SoapClient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1)); try { if ($session_id = $client->login($username, $password)) { echo 'Logged successfull. Session ID:' . $session_id . '<br />'; } //* Set the function parameters. $client_id = 1; $params = array('server_id' => 1, 'parent_domain_id' => 1, 'username' => 'tom', 'password' => 'secret', 'quota_size' => 10000, 'active' => 'y', 'uid' => '5000', 'gid' => '5000', 'dir' => '/home/www/clients/client0/web1', 'quota_files' => -1, 'ul_ratio' => -1, 'dl_ratio' => -1, 'ul_bandwidth' => -1, 'dl_bandwidth' => -1); $affected_rows = $client->sites_ftp_user_add($session_id, $client_id, $params); echo "FTP User ID: " . $affected_rows . "<br>"; if ($client->logout($session_id)) { echo 'Logged out.<br />'; } } catch (SoapFault $e) { echo $client->__getLastResponse(); die('SOAP Error: ' . $e->getMessage()); }
<?php $common_client = new SoapClient('http://shunt.cro.enalean.com/soap/codendi.wsdl.php?wsdl'); // Disciplus is a restricted user $session = $common_client->login('manuel', 'manuel')->session_hash; $svn_client = new SoapClient('http://shunt.cro.enalean.com/soap/svn/?wsdl', array('cache_wsdl' => WSDL_CACHE_NONE)); var_dump($svn_client->getSvnPath($session, 101, '/tags')); $common_client->logout($session);