problem to save edited translation pro version on wordpress

Popular automatic website translation tool

problem to save edited translation pro version on wordpress

Postby rob migchelsen » Tue Jun 19, 2012 3:02 pm

Every thing looks great, but when i can change the translation but when i push the save button i get
restricted area.
i have put a username and password in de config.php (the same as the administrator of de wordpress site).
Who can help my.
rob migchelsen
 
Posts: 5
Joined: Tue Jun 19, 2012 11:36 am

Re: problem to save edited translation pro version on wordpr

Postby Yana » Tue Jun 19, 2012 3:17 pm

Hi,
When you press save button it should prompt for password. What is your website address? If you can send me username/password I'll check it .
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: problem to save edited translation pro version on wordpr

Postby rob migchelsen » Tue Jun 19, 2012 3:51 pm

rob migchelsen
 
Posts: 5
Joined: Tue Jun 19, 2012 11:36 am

Re: problem to save edited translation pro version on wordpr

Postby Yana » Tue Jun 19, 2012 4:03 pm

Hi,
Please don't post your private info . I've deleted it. I'll check it ASAP .
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: problem to save edited translation pro version on wordpr

Postby Yana » Tue Jun 19, 2012 4:05 pm

Could you please send me FTP info , so I can check the settings. Please use contact form on our homepage.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: problem to save edited translation pro version on wordpr

Postby rob migchelsen » Tue Jun 19, 2012 4:24 pm

ftp info sent with contact form
rob migchelsen
 
Posts: 5
Joined: Tue Jun 19, 2012 11:36 am

Re: problem to save edited translation pro version on wordpr

Postby Yana » Fri Jun 22, 2012 8:52 pm

Hi,
Could you please ask your hosting provider if they support HTTP authentication with PHP: http://php.net/manual/en/features.http-auth.php ?

I've tried to add the following in the script but ir doesn't work.

if (isset($_SERVER["REDIRECT_REMOTE_AUTHORIZATION"]) && $_SERVER["REDIRECT_REMOTE_AUTHORIZATION"]!='') {
$d = base64_decode($_SERVER["REDIRECT_REMOTE_AUTHORIZATION"]);
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $d);
}
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: problem to save edited translation pro version on wordpr

Postby rob migchelsen » Tue Jun 26, 2012 4:04 pm

question send to provider i hope hear sone from them.

Rob Migchelsen
rob migchelsen
 
Posts: 5
Joined: Tue Jun 19, 2012 11:36 am

Re: problem to save edited translation pro version on wordpr

Postby Yana » Tue Jun 26, 2012 7:38 pm

Hi,
You can modify the php code (gtranslate/edit_translation.php file) and temporary disable authentication while editing.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm

Re: problem to save edited translation pro version on wordpr

Postby rob migchelsen » Wed Jun 27, 2012 1:41 am

what do I need to change in the code

thanks
rob migchelsen
rob migchelsen
 
Posts: 5
Joined: Tue Jun 19, 2012 11:36 am

Re: problem to save edited translation pro version on wordpr

Postby Yana » Wed Jun 27, 2012 12:14 pm

Hi,
You should remove the following lines:
header('WWW-Authenticate: Basic realm="Restricted area"');
header('HTTP/1.0 401 Unauthorized');
echo 'fail';
exit;
} else {

Here is the code:
Code: Select all
<?php
require_once 'config.php';

if(!isset($_SERVER['PHP_AUTH_USER']) or !isset($_SERVER['PHP_AUTH_PW']) or !($_SERVER['PHP_AUTH_USER'] == USER and $_SERVER['PHP_AUTH_PW'] == PASS)) {
   
    $file_name = 'cache/' . $_POST['lang'] . '/' . $_POST['md5'];
    if(file_exists($file_name)) {
        $result = json_decode(file_get_contents($file_name));

        $old = isset($result->data->translations[0]->translatedText) ? $result->data->translations[0]->translatedText : null;
        $old = isset($result->TranslateResult) ? $result->TranslateResult : $old;

        $result->TranslateResult = $_POST['new'];
        $result->TranslateResultOld = $old;

        unset($result->data->translations[0]->translatedText);
        unset($result->data->translations[0]->translatedTextOld);

        file_put_contents($file_name.'.human', json_encode($result));
    } else {
        $result = new stdClass;
        $result->TranslateResult = $_POST['new'];
        file_put_contents($file_name.'.human', json_encode($result));
    }

    echo 'success';
    exit;
}

#print_r($_POST);
echo 'fail';
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4133
Joined: Thu Jan 12, 2012 6:21 pm


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

2GLux