mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-13 13:11:31 +00:00
add subcommand for submitting new translation
This commit is contained in:
parent
84f3942fba
commit
99ba945b75
|
@ -55,7 +55,7 @@ if (isset($_COOKIE["mydms_session"])) {
|
||||||
|
|
||||||
$command = $_REQUEST["command"];
|
$command = $_REQUEST["command"];
|
||||||
switch($command) {
|
switch($command) {
|
||||||
case 'checkpwstrength':
|
case 'checkpwstrength': /* {{{ */
|
||||||
$ps = new Password_Strength();
|
$ps = new Password_Strength();
|
||||||
$ps->set_password($_REQUEST["pwd"]);
|
$ps->set_password($_REQUEST["pwd"]);
|
||||||
if($settings->_passwordStrengthAlgorithm == 'simple')
|
if($settings->_passwordStrengthAlgorithm == 'simple')
|
||||||
|
@ -72,7 +72,7 @@ switch($command) {
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('error'=>0, 'strength'=>$score));
|
echo json_encode(array('error'=>0, 'strength'=>$score));
|
||||||
}
|
}
|
||||||
break;
|
break; /* }}} */
|
||||||
|
|
||||||
case 'sessioninfo': /* {{{ */
|
case 'sessioninfo': /* {{{ */
|
||||||
if($user) {
|
if($user) {
|
||||||
|
@ -243,5 +243,19 @@ switch($command) {
|
||||||
}
|
}
|
||||||
break; /* }}} */
|
break; /* }}} */
|
||||||
|
|
||||||
|
case 'submittranslation': /* {{{ */
|
||||||
|
if($user && !empty($_POST['phrase'])) {
|
||||||
|
if($fp = fopen('/tmp/newtranslations.txt', 'a+')) {
|
||||||
|
fputcsv($fp, array(date('Y-m-d H:i:s'), $user->getLogin(), $_POST['key'], $_POST['lang'], $_POST['phrase']));
|
||||||
|
fclose($fp);
|
||||||
|
}
|
||||||
|
header('Content-Type', 'application/json');
|
||||||
|
echo json_encode(array('success'=>true, 'message'=>'Thank you for your contribution', 'data'=>''));
|
||||||
|
} else {
|
||||||
|
header('Content-Type', 'application/json');
|
||||||
|
echo json_encode(array('success'=>false, 'message'=>'Missing translation', 'data'=>''));
|
||||||
|
}
|
||||||
|
break; /* }}} */
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user