edit translations problem

Popular automatic website translation tool

edit translations problem

Postby slweb2 » Fri Dec 16, 2011 2:05 am

To edit the translations you need to go to the language you want to edit and then add ?language_edit=1

That's ok.

I modify the words and then when I want to save, it ask me USER and PASSWORD.

I enter the user and password defined in config.php file but nothing!

What's the problem?

Regards
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Sat Dec 17, 2011 8:08 pm

After you enter your user and password does it ask for user/password again?
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby slweb2 » Fri Dec 23, 2011 9:25 pm

Yes, it ask for user/password again, again and again...

Have you the solution for this problem?

Regards
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Sun Dec 25, 2011 7:51 pm

Hi,

Can you please check with your hosting provider in which mode PHP functions: CGI, fastCGI, Apache module?
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby slweb2 » Tue Dec 27, 2011 8:08 pm

CGI/FastCGI
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Thu Dec 29, 2011 5:34 pm

Hi,

Please read this: post4644.html?hilit=http_authorization#p4644

If the solution is little bit complicated for you I can do that for you myself. I'll need a temporary FTP access.
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby slweb2 » Mon Jan 02, 2012 2:36 pm

Hi, I've added the line below to my .htaccess file

SetEnvIfNoCase Authorization "Basic ([a-z0-9=]+)" REDIRECT_REMOTE_AUTHORIZATION=$1

I 've modified the edit_translation.php:
Code: Select all
<?php
require_once 'config.php';

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);
} else {
    $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';

Now I can edit translation with success but the system doesn't ask me any USER and PASSWORD...

Everyone can change the translatin of my website pages!

What's the issue?
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Wed Jan 04, 2012 4:19 pm

Hi,

You just need to add the described part right after require_once statement without modifying the rest of code.
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby jotamito » Wed Jan 04, 2012 6:43 pm

Hello,

what should be the "described part" ...

can you put please the entire code as it should be?
jotamito
 
Posts: 5
Joined: Fri Dec 02, 2011 9:59 pm

Re: edit translations problem

Postby slweb2 » Wed Jan 04, 2012 7:08 pm

I've done what you said me...

Code: Select all
<?php
require_once 'config.php';

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);
}
if(!isset($_SERVER['PHP_AUTH_USER']) or !isset($_SERVER['PHP_AUTH_PW']) or !($_SERVER['PHP_AUTH_USER'] == USER and $_SERVER['PHP_AUTH_PW'] == PASS)) {
    header('WWW-Authenticate: Basic realm="Restricted area"');
    header('HTTP/1.0 401 Unauthorized');
    echo 'fail';
    exit;
}
else {
    $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';



But so the system answer me USER and PASS again and again without saving...
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Thu Jan 05, 2012 2:25 am

Hi,

If you can give me temporary FTP access, I can look into for you.

BTW. As a temporary solution you can use the previous script to not ask for password and when you are done with editing you can replace it back.
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby slweb2 » Thu Jan 05, 2012 2:04 pm

Ok I've send it to you with private message.

Regards
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby slweb2 » Tue Jan 10, 2012 3:37 pm

News?
slweb2
 
Posts: 14
Joined: Fri Dec 09, 2011 8:41 pm

Re: edit translations problem

Postby Edvard » Mon Jan 16, 2012 4:56 pm

Hi,

I have checked and it seems that your server is misconfigured.

During the auth request, the server responds with: php 4.4 server software and it is very strange...

Please contact your hosting provider and ask them to update your PHP version to the latest one. Currently you use 5.2.6 and the last one is 5.2.17.

Also, ask them to fix the problem with HTTP_AUTHORIZATION php $_SERVER variable is not being set.

Currently in .htaccess joomla uses this, which has no effect at all
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
Regards,

Edvard Ananyan - 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
Edvard
Site Admin
 
Posts: 4184
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia

Re: edit translations problem

Postby casagesa » Wed Oct 19, 2016 2:47 pm

Hello i have the same propblem i add the codes already my php version is 5.4

Please can somehelp ???


I send already the support an message but no response!!!
casagesa
 
Posts: 2
Joined: Wed Oct 19, 2016 2:44 pm

Re: edit translations problem

Postby Yana » Wed Oct 19, 2016 4:35 pm

Hi,
Please post your domain name, so we can 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: 4135
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
cron