Translate all code comments from Russian to English [skip ci]

This commit is contained in:
ErickSkrauch
2019-07-15 01:59:56 +03:00
parent 31069562b3
commit 3dbf29d34c
64 changed files with 264 additions and 286 deletions

View File

@@ -51,9 +51,8 @@ class Module extends \yii\base\Module implements BootstrapInterface {
}
/**
* Поскольку это legacy метод и документации в новой среде для него не будет,
* нет смысла выставлять на показ внутренние url, так что ограничиваем доступ
* только для заходов по старому домену
* Since this is a legacy method and there will be no documentation for it in the new environment,
* there is no point in displaying the internal API, so we are limiting access only to logons from the old domain.
*
* @throws NotFoundHttpException
*/

View File

@@ -42,24 +42,24 @@ class AuthenticationController extends Controller {
$model = new models\ValidateForm();
$model->load(Yii::$app->request->post());
$model->validateToken();
// В случае успеха ожидается пустой ответ. В случае ошибки же бросается исключение,
// которое обработает ErrorHandler
// If successful, an empty answer is expected.
// In case of an error, an exception is thrown which will be processed by ErrorHandler
}
public function actionSignout() {
$model = new models\SignoutForm();
$model->load(Yii::$app->request->post());
$model->signout();
// В случае успеха ожидается пустой ответ. В случае ошибки же бросается исключение,
// которое обработает ErrorHandler
// If successful, an empty answer is expected.
// In case of an error, an exception is thrown which will be processed by ErrorHandler
}
public function actionInvalidate() {
$model = new models\InvalidateForm();
$model->load(Yii::$app->request->post());
$model->invalidateToken();
// В случае успеха ожидается пустой ответ. В случае ошибки же бросается исключение,
// которое обработает ErrorHandler
// If successful, an empty answer is expected.
// In case of an error, an exception is thrown which will be processed by ErrorHandler
}
}

View File

@@ -7,7 +7,7 @@ use yii\web\HttpException;
class AuthserverException extends HttpException {
/**
* Рефлексия быстрее, как ни странно:
* Reflection is faster, weird as it may seem:
* @url https://coderwall.com/p/cpxxxw/php-get-class-name-without-namespace#comment_19313
*
* @return string

View File

@@ -33,7 +33,7 @@ class AuthenticateData {
];
if ($includeAvailableProfiles) {
// Сами моянги ещё ничего не придумали с этими availableProfiles
// The Moiangs themselves haven't come up with anything yet with these availableProfiles
$availableProfiles[0] = $result['selectedProfile'];
$result['availableProfiles'] = $availableProfiles;
}

View File

@@ -56,7 +56,8 @@ class AuthenticationForm extends ApiForm {
Authserver::error("User with login = '{$this->username}' passed wrong password.");
}
// На старом сервере авторизации использовалось поле nickname, а не username, так что сохраняем эту логику
// The previous authorization server implementation used the nickname field instead of username,
// so we keep such behavior
$attribute = $loginForm->getLoginAttribute();
if ($attribute === 'username') {
$attribute = 'nickname';

View File

@@ -30,11 +30,12 @@ class SignoutForm extends ApiForm {
if (!$loginForm->validate()) {
$errors = $loginForm->getFirstErrors();
if (isset($errors['login']) && $errors['login'] === E::ACCOUNT_BANNED) {
// Считаем, что заблокированный может безболезненно выйти
// We believe that a blocked one can get out painlessly
return true;
}
// На старом сервере авторизации использовалось поле nickname, а не username, так что сохраняем эту логику
// The previous authorization server implementation used the nickname field instead of username,
// so we keep such behavior
$attribute = $loginForm->getLoginAttribute();
if ($attribute === 'username') {
$attribute = 'nickname';

View File

@@ -4,8 +4,8 @@ namespace api\modules\authserver\validators;
use api\modules\authserver\exceptions\IllegalArgumentException;
/**
* Максимальная длина clientToken для нашей базы данных составляет 255.
* После этого мы не принимаем указанный токен
* The maximum length of clientToken for our database is 255.
* If the token is longer, we do not accept the passed token at all.
*/
class ClientTokenValidator extends \yii\validators\RequiredValidator {

View File

@@ -4,8 +4,8 @@ namespace api\modules\authserver\validators;
use api\modules\authserver\exceptions\IllegalArgumentException;
/**
* Для данного модуля нам не принципиально, что там за ошибка: если не хватает хотя бы одного
* параметра - тут же отправляем исключение и дело с концом
* For this module, it is not important for us what the error is: if at least one parameter is missing,
* we immediately throw an exception and that's it.
*/
class RequiredValidator extends \yii\validators\RequiredValidator {