Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- // Database connection.
- mysql_connect("localhost", "root", "admin");
- mysql_select_db("drupal7cms");
- $curuname = trim($_GET['curentUser']);
- $resultFindMode = mysql_query("SELECT mode_id FROM freeway_mode where sr_id = 1");
- while ($recordUsPw = mysql_fetch_object($resultFindMode ))
- {
- $modeValueUsPw = $recordUsPw->mode_id;
- }
- if ($modeValueUsPw == '1'){
- $globalResult = mysql_query("SELECT freeway_global_username,freeway_global_password FROM freeway_global_user where sr_id = 1");
- while ($recordUsPwGl = mysql_fetch_object($globalResult)){
- $fusername = $recordUsPwGl->freeway_global_username;
- $fpassword = $recordUsPwGl->freeway_global_password;
- }
- }
- if ($modeValueUsPw == '2'){
- $nonGlobalResult = mysql_query("SELECT freeway_username ,freeway_password FROM freeway_users where drupal_username = '$curuname'");
- while ($recordUsPwNonGl = mysql_fetch_object($nonGlobalResult)){
- $fusername = $recordUsPwNonGl->freeway_global_username;
- $fpassword = $recordUsPwNonGl->freeway_global_password;
- }
- }
- $myid = trim($_GET['name']);
- $arrayWebD = array();
- $LoginClient = new SoapClient("https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl", array("trace"=>1));
- $ServicesLink = new SoapClient("https://freeway.demo.lionbridge.com/vojo/Service.asmx?wsdl", array("trace"=>1));
- try{
- $arrResponse = $LoginClient->Logon(array ('Username'=>$fusername,'Password'=>$fpassword));
- $ticket = ($arrResponse->LogonResult);
- $getTarLang = $ServicesLink->GetTargetLanguages (array('Ticket'=>$ticket,'SourceLanguageID'=>$myid));
- foreach($getTarLang->GetTargetLanguagesResult->Languages->Language as $languageT)
- {
- $arrayWebD[$languageT->ID] = $languageT->Description."_".$languageT->ID;
- }
- }
- catch (SoapFault $exception){
- return $exception;
- }
- print json_encode($arrayWebD);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement