Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @todo Please document this function.
- * @see http://drupal.org/node/1354
- */
- function formModifications_menu() {
- $items['translate/bulk'] = array(
- 'title' => t('Send Multiple Contents'),
- 'description' => t('Translate multiple nodes'),
- 'page callback' => 'drupal_get_form',
- 'page arguments' => array('formModifications_translate_bulk'),
- 'access arguments' => array('access translator'),
- );
- return $items;
- }
- /**
- * @todo Please document this function.
- * @see http://drupal.org/node/1354
- */
- function formModifications_translate_bulk($form, &$form_state) {
- global $user;
- global $finalFunctionUserName;
- global $finalFunctionPassword;
- $arrayForSendTranslation = array();
- $arrayForSendTranslation = formModCredentialProvider();
- $finalFunctionUserName = $arrayForSendTranslation[0];
- $finalFunctionPassword = $arrayForSendTranslation[1];
- drupal_add_js(drupal_get_path('module', 'formModifications') . '/js/script.js');
- // Get the nodes.
- $chosenContents = "Contents Chosen :";
- $nodes_ser = trim($_GET['nodes']);
- $nodes = explode("-", $nodes_ser);
- $form = array();
- $tarLangId = "Langs:";
- foreach ( $nodes as $key => $value) {
- $node = node_load($value);
- $chosenContents .= $node->title . " , ";
- }
- $finalString = rtrim($chosenContents, ' , ');
- $form['content_information'] = array(
- '#value' => variable_get('content_form_information', $finalString),
- );
- $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' => $finalFunctionUserName, 'Password' => $finalFunctionPassword));
- $ticket = ($arrResponse->LogonResult);
- $getSrcLang = $ServicesLink->GetSourceLanguages(array('Ticket' => $ticket));
- $getDraftProjectIds = $ServicesLink->GetProjectSummariesList(array('Ticket' => $ticket, 'NumberOfProjects' => 100, 'SortOrder' => MostRecent, 'ProjectStatusCode' => 'Draft'));
- $array = array();
- $arrayT = array();
- $forTarLang = array();
- $listOfProjects = array();
- $hopeArray = array();
- foreach ($getSrcLang->GetSourceLanguagesResult->Languages->Language as $language) {
- $array[$language->ID] = $language->Description . "_" . $language->ID;
- $forTarLang[] = $language->ID;
- }
- foreach ($getDraftProjectIds->GetProjectSummariesListResult->ProjectSummaries->ProjectSummary as $projectSummary) {
- $listOfProjects[$projectSummary->ID] = $projectSummary->ID;
- }
- }
- catch (SoapFault $exception) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception . "Kindly check Freeway mapping");
- drupal_goto("user");
- }
- try {
- if (count($forTarLang) != 0) {
- $getTarLang = $ServicesLink->GetTargetLanguages(array('Ticket' => $ticket, 'SourceLanguageID' => $forTarLang[0]));
- foreach ($getTarLang->GetTargetLanguagesResult->Languages->Language as $languageT) {
- //$arrayT[$languageT->ID] = $languageT->Description;
- $arrayT[$languageT->ID] = $languageT->Description . "_" . $languageT->ID;
- }
- }
- }
- catch (Exception $exception1) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception1);
- drupal_goto("user");
- }
- //Sanct SrcLang 16 Feb
- /*
- $form['folks_list'] = array(
- '#type' => 'select',
- '#title' => t('Freeway Source Languages'),
- '#options' => $array,
- '#default_value' => ('English (Canada)_en-ca'),
- // '#attributes' => array('onselect' => "populateTargetlangs();"),
- '#weight' => 7,
- );
- */
- $options_first = _ajax_example_get_first_dropdown_options_lang();
- $selected = isset($form_state['values']['folks_list']) ? $form_state['values']['folks_list'] : key($options_first);
- $form['folks_list'] = array(
- '#type' => 'select',
- '#title' => t('Freeway Source Languages New'),
- '#options' => $array,
- '#default_value' => $selected,
- // Bind an ajax callback to the change event (which is the default for the
- // select form type) of the first dropdown. It will replace the second
- // dropdown when rebuilt
- '#ajax' => array(
- // When 'event' occurs, Drupal will perform an ajax request in the
- // background. Usually the default value is sufficient (eg. change for
- // select elements), but valid values include any jQuery event,
- // most notably 'mousedown', 'blur', and 'submit'.
- // 'event' => 'change',
- 'callback' => 'ajax_example_dependent_dropdown_callback_lang',
- 'wrapper' => 'dropdown-second-replace',
- ),
- );
- $currUser = $user->name;
- $hidden_id = "hidden_id";
- $form['bid'] = array(
- '#type' => 'hidden',
- '#value' => $currUser,
- '#attributes' => array('id' => $hidden_id)
- );
- $form['webDelegate_list'] = array(
- '#type' => 'select',
- '#title' => $options_first[$selected] . ' ' . t('Freeway Target Languages'),
- '#multiple' => true,
- // The entire enclosing div created here gets replaced when dropdown_first
- // is changed.
- '#prefix' => '<div id="webDelegate-list-replace">',
- '#suffix' => '</div>',
- // when the form is rebuilt during ajax processing, the $selected variable
- // will now have the new value and so the options will change
- '#options' => _ajax_example_get_second_dropdown_options($selected),
- '#default_value' => isset($form_state['values']['dropdown_second']) ? $form_state['values']['dropdown_second'] : '',
- );
- $form['projectId'] = array(
- '#type' => 'select',
- '#title' => t('List of Draft projects created by you.'),
- '#weight' => 9,
- '#options' => $listOfProjects,
- );
- $form['translate_node'] = array(
- '#type' => 'submit',
- '#value' => 'Send To Freeway',
- '#weight' => 10,
- );
- return $form;
- }
- function _ajax_example_get_first_dropdown_options_lang() {
- // drupal_map_assoc() just makes an array('String' => 'String'...).
- global $finalFunctionUserName;
- global $finalFunctionPassword;
- $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' => $finalFunctionUserName, 'Password' => $finalFunctionPassword));
- $ticket = ($arrResponse->LogonResult);
- $getSrcLang = $ServicesLink->GetSourceLanguages(array('Ticket' => $ticket));
- $getDraftProjectIds = $ServicesLink->GetProjectSummariesList(array('Ticket' => $ticket, 'NumberOfProjects' => 100, 'SortOrder' => MostRecent, 'ProjectStatusCode' => 'Draft'));
- $array = array();
- $forTarLang = array();
- foreach ($getSrcLang->GetSourceLanguagesResult->Languages->Language as $language) {
- $array[$language->ID] = $language->Description . "_" . $language->ID;
- $forTarLang[] = $language->ID;
- }
- }
- catch (SoapFault $exception) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception . "Kindly check Freeway mapping");
- drupal_goto("user");
- }
- return drupal_map_assoc($array);
- }
- function ajax_example_dependent_dropdown_callback_lang($form, $form_state) {
- return $form['dropdown_second'];
- }
- /**
- * @todo Please document this function.
- * @see http://drupal.org/node/1354
- */
- function formModifications_translate_bulk_submit($form, &$form_state) {
- global $base_root;
- $arrayForSendTranslation = array();
- $arrayForSendTranslation = formModCredentialProvider();
- $finalFunctionUserName = $arrayForSendTranslation[0];
- $finalFunctionPassword = $arrayForSendTranslation[1];
- $targetLangs = array();
- $finalTarArray = array();
- $zipName = "Content";
- $targetLangNames = '';
- // Obtain Src Lang,TargetLanguage(s) and Project ID inside this function.
- $projectID = isset($form_state['values']['projectId']) ? $form_state['values']['projectId'] : key($options_first);
- $srcLang = isset($form_state['values']['folks_list']) ? $form_state['values']['folks_list'] : key($options_first);
- $targetLangs = isset($form_state['values']['webDelegate_list']) ? $form_state['values']['webDelegate_list'] : key($options_first);
- if (count($targetLangs) == 0) {
- drupal_get_messages();
- drupal_set_message("Please select appropriate Freeway Target Languages.");
- drupal_goto($base_root . request_uri());
- }
- foreach ($targetLangs as $langs) {
- list($name, $tarId) = split('[_]', $langs);
- $finalTarArray[] = $tarId;
- }
- // Block to Add task:// Add task to he project - can be hardcoded,Add File and submit.
- $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));
- if ($handle = opendir('./')) {
- while (false !== ($entry = readdir($handle))) {
- if (substr($entry, -3) == "zip") {
- $fileName = $entry;
- }
- }
- //echo("FileName > ".$fileName);
- //echo('<br>');
- closedir($handle);
- }
- try {
- $arrResponse = $LoginClient->Logon(array('Username' => $finalFunctionUserName, 'Password' => $finalFunctionPassword));
- $ticket = ($arrResponse->LogonResult);
- drupal_get_messages();
- drupal_set_message("Here ".$finalTarArray[0].">as>".$finalTarArray[1].">Count>".count($finalTarArray));
- drupal_goto("user");
- for ($j = 0; $j < count($finalTarArray); $j += 1) {
- $addTask = $ServicesLink->AddTaskToProject(array('Ticket' => $ticket, 'ProjectID' => $projectID, 'SourceLanguageID' => $srcLang, 'TargetLanguageID' => $finalTarArray[$j], 'ComponentID' => '', 'SubjectID' => '', 'TaskID' => 'LP', 'SubTaskID' => 'New Words', 'Volume' => '1', 'UOMID' => 'Word'));
- }
- for ($t = 0; $t < count($finalTarArray); $t += 1) {
- $targetLangNames = $targetLangNames . $finalTarArray[$t] . ',';
- }
- $interString = rtrim($targetLangNames, ',');
- $finalString = rtrim($interString, ',');
- $structureTemp = './sites/all/tempfolder/';
- $listInTemp = getFileList($structureTemp);
- for ($v = 0; $v < count($listInTemp); $v += 1) {
- $content = simplexml_load_file($listInTemp[$v]);
- $content->TarLang = $finalString;
- $content->SrcLang = $srcLang;
- $content->asXML($listInTemp[$v]);
- }
- $finalZipName = "DrupalContent.zip";
- Zip('./sites/all/tempfolder', './' . $finalZipName);
- $handle = fopen("./" . $finalZipName, "r");
- $contents = fread($handle, filesize("./" . $finalZipName));
- fclose($handle);
- $addFile = $ServicesLink->AddFileToProject(array('Ticket' => $ticket, 'ProjectID' => $projectID, 'Filename' => $finalZipName, 'FileData' => $contents, 'SourceLanguageID' => $srcLang, 'TargetLanguageIDs' => $finalTarArray, 'Metadata' => null, 'IsReferenceMaterial' => false));
- $fileinfoArray = array();
- foreach ($addFile->AddFileToProjectResult->FileInfoItems->FileInfo as $fileInfo) {
- $fileinfoArray[] = $fileInfo;
- }
- $bottomFileId = $fileinfoArray[0];
- $topFileId = ($bottomFileId - (count($finalTarArray) -1));
- for ($e = 0; $e < count($finalTarArray); $e += 1) {
- // TODO Please convert this statement to the D7 database API syntax.
- db_query("INSERT INTO {freeway_fileid} (freeway_file_id, freeway_tar_lang) VALUES ('$topFileId','$finalTarArray[$e]')");
- $topFileId += 1;
- }
- $topFileId = 0;
- $submitProject = $ServicesLink->SubmitProject(array('Ticket' => $ticket, 'ProjectID' => $projectID));
- }
- catch (SoapFault $exception) {
- drupal_get_messages();
- drupal_set_message("The following exception took place." . $exception . "Kindly check Freeway mapping");
- drupal_goto("user");
- // return $exception;
- }
- // End of Block to add task.
- //Block for deletion of zip and tempfolder.
- unlink('./' . $finalZipName);
- rrmdir('./sites/all/tempfolder');
- // End of Block for Deletions.
- drupal_get_messages();
- drupal_set_message("Project with project ID " . $projectID . " submitted to Freeway");
- drupal_goto("user");
- // drupal_goto("admin/config/freeway");
- }
- /**
- * @todo Please document this function.
- * @see http://drupal.org/node/1354
- */
- function formModifications_form_alter(&$form, &$form_state, $form_id) {
- if ($form_id == 'node_admin_content') {
- $form['admin']['options']['operation']['#options']['send_for_translation'] = t('Send For Translation');
- $form['admin']['options']['submit']['#submit'][] = 'custom_send_for_translation_submit_admin';
- }
- }
- function custom_send_for_translation_submit_admin($form, &$form_state) {
- $zipName = "Content";
- $nodes = array();
- $structurePreClean = './sites/all/tempfolder/';
- if (is_dir($structurePreClean)) {
- rrmdir('./sites/all/tempfolder');
- }
- foreach ($form_state['values']['nodes'] as $key => $value) {
- if ($value != 0) {
- $selected[] = node_load($key);
- }
- }
- if (count($selected) == 0) {
- drupal_get_messages();
- drupal_set_message("No contents selected!");
- drupal_goto('admin/content/node');
- }
- foreach ($selected as $key => $value ) {
- $structure = './sites/all/tempfolder/';
- if (!is_dir($structure)) {
- mkdir($structure, 0, true);
- }
- //Added jan19,2012
- /*
- else{
- rrmdir('./sites/all/tempfolder');
- }
- */
- $fileName = $value->title;
- $sPattern = '/\s*/m';
- $sReplace = '';
- $refinedFileName = preg_replace( $sPattern, $sReplace, $fileName ) . ".xml";
- $finalRefinedFileName = $structure . $refinedFileName;
- $ourFileHandle = fopen($finalRefinedFileName, 'w') or ("can't open file");
- $stringXmlHead = '<?xml version="1.0"?>' . "\r\n";
- fwrite($ourFileHandle, $stringXmlHead);
- $rootNode = "<DrupalConnector>" . "\r\n";
- fwrite($ourFileHandle, $rootNode);
- $nodeIdTagStart = "<NodeId>";
- fwrite($ourFileHandle, $nodeIdTagStart);
- $nodeId = $value->nid;
- fwrite($ourFileHandle, $nodeId);
- $nodeIdTagEnd = "</NodeId>" . "\r\n";
- fwrite($ourFileHandle, $nodeIdTagEnd);
- $drupalVerTagStart = "<DrupalVer>";
- fwrite($ourFileHandle, $drupalVerTagStart);
- $drupalVer = '6.0';
- fwrite($ourFileHandle, $drupalVer);
- $drupalVerTagEnd = "</DrupalVer>" . "\r\n";
- fwrite($ourFileHandle, $drupalVerTagEnd);
- $connectorVerTagStart = "<ConnectorVer>";
- fwrite($ourFileHandle, $connectorVerTagStart);
- $conectorVer = '1.0';
- fwrite($ourFileHandle, $conectorVer);
- $connectorVerTagEnd = "</ConnectorVer>" . "\r\n";
- fwrite($ourFileHandle, $connectorVerTagEnd);
- $srcLangTagStart = "<SrcLang>";
- fwrite($ourFileHandle, $srcLangTagStart);
- $srcLang = '';
- fwrite($ourFileHandle, $srcLang);
- $srcLangTagEnd = "</SrcLang>" . "\r\n";
- fwrite($ourFileHandle, $srcLangTagEnd);
- $tarLangTagStart = "<TarLang>";
- fwrite($ourFileHandle, $tarLangTagStart);
- $tarLang = '';
- fwrite($ourFileHandle, $tarLang);
- $tarLangTagEnd = "</TarLang>" . "\r\n";
- fwrite($ourFileHandle, $tarLangTagEnd);
- $timeTagStart = "<TimeOfSend>";
- fwrite($ourFileHandle, $timeTagStart);
- $time = date("Y-m-d H:i:s");
- fwrite($ourFileHandle, $time);
- $timeTagEnd = "</TimeOfSend>" . "\r\n";
- fwrite($ourFileHandle, $timeTagEnd);
- $nodeTitleTagStart = "<NodeTitle>";
- fwrite($ourFileHandle, $nodeTitleTagStart);
- $nodeTitle = "<![CDATA[" . $value->title . "]]>";
- fwrite($ourFileHandle, $nodeTitle);
- $nodeTitleTagEnd = "</NodeTitle>" . "\r\n";
- fwrite($ourFileHandle, $nodeTitleTagEnd);
- $nodeBodyTagStart = "<NodeBody>";
- fwrite($ourFileHandle, $nodeBodyTagStart);
- $nodeBody = "<![CDATA[" . $value->body . "]]>";
- fwrite($ourFileHandle, $nodeBody);
- $nodeBodyTagEnd = "</NodeBody>" . "\r\n";
- fwrite($ourFileHandle, $nodeBodyTagEnd);
- $rootNodeEnd = "</DrupalConnector>" . "\r\n";
- fwrite($ourFileHandle, $rootNodeEnd);
- $zipName .= "_" . $nodeId;
- $nodes[] = $value->nid;
- }
- fclose($ourFileHandle);
- $finalZipName = $zipName . ".zip";
- // Zip('./sites/all/tempfolder','./'.$finalZipName);
- //zipping done
- $nodes_ser = implode('-', $nodes);
- /*
- drupal_get_messages();
- drupal_set_message("Here ".$nodes_ser."as");
- drupal_goto("user");
- */
- //drupal_goto('translate/bulk', array('query' => array('nodes' => '\' . $nodes_ser')));
- //drupal_goto('translate/bulk', 'nodes='. $nodes_ser);
- drupal_goto('translate/bulk', array('query' => array('nodes' => $nodes_ser)));
- }
- function Zip($source, $destination) {
- if (!extension_loaded('zip') || !file_exists($source)) {
- return false;
- }
- $zip = new ZipArchive();
- if (!$zip->open($destination, ZIPARCHIVE::CREATE)) {
- return false;
- }
- $source = str_replace('\\', '/', realpath($source));
- if (is_dir($source) === true) {
- $files = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($source), RecursiveIteratorIterator::SELF_FIRST);
- foreach ($files as $file) {
- $file = str_replace('\\', '/', realpath($file));
- if (is_dir($file) === true) {
- $zip->addEmptyDir(str_replace($source . '/', '', $file . '/'));
- }
- else if (is_file($file) === true) {
- $zip->addFromString(str_replace($source . '/', '', $file), file_get_contents($file));
- }
- }
- }
- else if (is_file($source) === true) {
- $zip->addFromString(basename($source), file_get_contents($source));
- }
- return $zip->close();
- }
- function rrmdir($dir) {
- if (is_dir($dir)) {
- $objects = scandir($dir);
- foreach ($objects as $object) {
- if ($object != "." && $object != "..") {
- if (filetype($dir . "/" . $object) == "dir") {
- rrmdir($dir . "/" . $object);
- }
- else {
- unlink($dir . "/" . $object);
- }
- }
- }
- reset($objects);
- rmdir($dir);
- }
- }
- function getFileList($dir) {
- // array to hold return value
- $retval = array();
- // add trailing slash if missing
- if (substr($dir, -1) != "/") {
- $dir .= "/";
- }
- // open pointer to directory and read list of files
- $d = @dir($dir) or ("getFileList: Failed opening directory $dir for reading");
- while (false !== ($entry = $d->read())) {
- // skip hidden files
- if ($entry[0] == ".") {
- continue;
- }
- if (!is_dir("$dir$entry") && is_readable("$dir$entry")) {
- $retval[] = "$dir$entry";
- }
- }
- $d->close();
- return $retval;
- }
- function formModCredentialProvider() {
- $arrayWithCredentials = array();
- global $user;
- /*
- 1.Get the current mode.
- 1.1. If curr mode = 0 ;
- Navigate to a page saying "Kindly use user mapping options to provide Freeway Credentials"
- 1.2 If curr mode = 1 ;
- Select freeway uname and pwrd from global table and set them to the variables.
- if uname = '' or pwrd = '' ; -> navigate to page saying "The Freway credentials have not been entered
- correctly in tha mapping page"
- else set the variable with the value obtained.
- 1.3 else if curr mode = 2;
- Get currently logged in user name.
- Select freeway uname and pwrd from non global table where drupal username = 'currently logged in user name'
- if uname = '' or pwrd = '' ; -> navigate to page saying "The Freway credentials have not been entered
- correctly in tha mapping page"
- else set the variable with the value obtained.
- */
- $resultUsPw = db_query("SELECT mode_id FROM {freeway_mode} where sr_id = 1");
- // $rowsUsPw = mysql_num_rows($resultUsPw);
- $rowsUsPw = $resultUsPw->rowCount();
- if ($rowsUsPw == 0) {
- drupal_get_messages();
- drupal_set_message("The Freeway user mapping for Drupal users has not been completed. Kindly associate
- Drupal users with Freeway credentials");
- drupal_goto('user/' . $user->uid . '/freewayUserMapping');
- }
- else {
- //while ($recordUsPw = db_fetch_object($resultUsPw))
- foreach($resultUsPw as $recordUsPw )
- {
- $modeValueUsPw = $recordUsPw->mode_id;
- }
- if ($modeValueUsPw == '0') {
- drupal_get_messages();
- drupal_set_message("Kindly use user mapping options to provide Freeway Credentials");
- drupal_goto('user/' . $user->uid . '/freewayUserMapping');
- }
- else if ($modeValueUsPw == '1') {
- $globalResult = db_query("SELECT freeway_global_username,freeway_global_password FROM {freeway_global_user} where sr_id = 1");
- //$rowsGlobalUsPw = mysql_num_rows($globalResult);
- $rowsGlobalUsPw = $globalResult->rowCount();
- if ($rowsGlobalUsPw == 0) {
- drupal_get_messages();
- drupal_set_message("There is no Freeway credential mapped for the Global user role logged ");
- drupal_goto('user/' . $user->uid . '/freewayGlobalUser');
- }
- else {
- // while ($recordUsPwGl = db_fetch_object($globalResult))
- foreach($globalResult as $recordUsPwGl)
- {
- $freewayGlobalUserName = $recordUsPwGl->freeway_global_username;
- $freewayGlobalPassword = $recordUsPwGl->freeway_global_password;
- if ((strlen($freewayGlobalUserName) == '0') || (strlen($freewayGlobalPassword) == '0')) {
- drupal_get_messages();
- drupal_set_message("Kindly use user mapping options to provide Freeway Credentials for the Global user");
- drupal_goto('user/' . $user->uid . '/freewayGlobalUser');
- }
- else {
- $finalUserName = $freewayGlobalUserName;
- $finalPassword = $freewayGlobalPassword;
- }
- }
- }
- }
- else if ($modeValueUsPw == '2') {
- $userNameCurr = $user->name;
- // TODO Please convert this statement to the D7 database API syntax.
- $nonGlobalResult = db_query("SELECT freeway_username ,freeway_password FROM {freeway_users} where drupal_username = '$userNameCurr'");
- // $rowsNonGlobalUsPw = mysql_num_rows($nonGlobalResult);
- $rowsNonGlobalUsPw = $nonGlobalResult->rowCount();
- if ($rowsNonGlobalUsPw == 0) {
- drupal_get_messages();
- drupal_set_message("There are no Freeway credentials mapped for the currently logged in user " . $userNameCurr . ".");
- drupal_goto('user/' . $user->uid . '/freewayNonGlobalUser');
- }
- else {
- //while ($recordUsPwNonGl = db_fetch_object($nonGlobalResult))
- foreach ($nonGlobalResult as $recordUsPwNonGl )
- {
- $freewayNonGlobalUserName = $recordUsPwNonGl->freeway_username;
- $freewayNonGlobalPassword = $recordUsPwNonGl->freeway_password;
- if ((strlen($freewayNonGlobalUserName) == '0') || (strlen($freewayNonGlobalPassword) == '0')) {
- drupal_get_messages();
- drupal_set_message("There are no Freeway credentials mapped for the currently logged in user " . $userNameCurr . ".");
- drupal_goto('user/' . $user->uid . '/freewayNonGlobalUser');
- }
- else {
- $finalUserName = $freewayNonGlobalUserName;
- $finalPassword = $freewayNonGlobalPassword;
- }
- }
- }
- }
- }
- $arrayWithCredentials[0] = $finalUserName;
- $arrayWithCredentials[1] = $finalPassword;
- return $arrayWithCredentials;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement