Development

Changeset 25175

You must first sign up to be able to contribute.

Changeset 25175

Show
Ignore:
Timestamp:
12/10/09 07:40:53 (3 years ago)
Author:
Annie
Message:

Russian translation for Jobeet 1.2 Lesson 13 has been updated.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doc/branches/1.2/jobeet/ru/13.txt

    r25170 r25175  
    11��13: ���� 
    22===================== 
    3  
    4 **���: �����������nna.tarasenko[at]equelli.com** 
    53 
    64���������� ������ �� ���� PHP ��������Symfony �������������� �����. 
     
    405403</doctrine> 
    406404 
    407 Backend Security 
    408 ---------------- 
    409  
    410 Each plugin has a 
     405�������------------------------ 
     406 
     407������� 
    411408[README](http://www.symfony-project.org/plugins/sfGuardPlugin?tab=plugin_readme) 
    412 file that explains how to configure it. 
    413  
    414 Let's see how to configure the new plugin. As the plugin provides several new 
    415 model classes to manage users, groups, and permissions, you need to rebuild 
    416 your model: 
     409�, �������� ����. 
     410 
     411������ � ������� ������������ �� �� � ��� ���� �������� ���  
     412������ 
    417413 
    418414<propel> 
     
    425421>**TIP** 
    426422<propel> 
    427 >Remember that the `propel:build-all-load` task removes all existing tables 
    428 </propel> 
    429 <doctrine> 
    430 >Remember that the `doctrine:build-all-reload` task removes all existing tables 
    431 </doctrine> 
    432 >before re-creating them. To avoid this, you can build the models, forms, and 
    433 >filters, and then, create the new tables by executing the generated SQL 
    434 >statements stored in `data/sql/`. 
    435  
    436 As always, when new classes are created, you need to clear the symfony ~cache|Cache~: 
     423>������ `propel:build-all-load` ���� ������ 
     424</propel> 
     425<doctrine> 
     426>������ `doctrine:build-all-reload` ���� ������ 
     427</doctrine> 
     428>��� � �� ����� ����� �� �� �����, ���� ����� ������������QL-�����>���� ����data/sql/`. 
     429 
     430���������������� ���Symfony: 
    437431 
    438432    $ php symfony cc 
    439433 
    440434<propel> 
    441 As `sfGuardPlugin` adds several methods to the user class, you need to change 
    442 the base class of `myUser` to `sfGuardSecurityUser`: 
    443 </propel> 
    444 <doctrine> 
    445 As `sfDoctrineGuardPlugin` adds several methods to the user class, you need to 
    446 change the base class of `myUser` to `sfGuardSecurityUser`: 
     435���� `sfGuardPlugin` �������� ��� �����, ��� ����� ���`myUser` �`sfGuardSecurityUser`: 
     436</propel> 
     437<doctrine> 
     438���� `sfDoctrineGuardPlugin` �������� ��� �����, ��� ����� ���`myUser` �`sfGuardSecurityUser`: 
    447439</doctrine> 
    448440 
     
    454446 
    455447<propel> 
    456 `sfGuardPlugin` provides a `signin` action in the `sfGuardAuth` module to 
    457 authenticate users. 
    458 </propel> 
    459 <doctrine> 
    460 `sfDoctrineGuardPlugin` provides a `signin` action in the `sfGuardAuth` module 
    461 to authenticate users. 
    462 </doctrine> 
    463  
    464 Edit the ~`settings.yml`~ file to change the default action used for the login 
    465 page: 
     448`sfGuardPlugin` �������signin` ���`sfGuardAuth` � ���������</propel> 
     449<doctrine> 
     450`sfDoctrineGuardPlugin` �������signin` ���`sfGuardAuth` � ���������</doctrine> 
     451 
     452���� � `settings.yml`, ������ ����, ���� � �������� 
    466453 
    467454    [yml] 
     
    479466        # ... 
    480467 
    481 As plugins are shared amongst all applications of a project, you need to 
    482 explicitly enable the ~modules|Module~ you want to use by adding them in the 
    483 ~`enabled_modules` setting|`enabled_modules` (Setting)~. 
    484  
    485 ![sfGuardPlugin login](http://www.symfony-project.org/images/jobeet/1_2/13/sf_guard_login.png) 
    486  
    487 The last step is to create an administrator user: 
     468������ ����� ���� ������ 
     469������� ����� ���� ������������`enabled_modules`. 
     470 
     471![���� ����http://www.symfony-project.org/images/jobeet/1_2/13/sf_guard_login.png) 
     472 
     473��� � ��� ��� �������: 
    488474 
    489475    $ php symfony guard:create-user fabien SecretPass 
     
    491477 
    492478>**TIP** 
    493 >The `sfGuardPlugin` provides tasks to manage users, groups, and permissions 
    494 >from the ~command line|Command Line~. Use the `list` task to list all task  
    495 >belonging to the `guard` namespace: 
     479<propel> 
     480>`sfGuardPlugin` ���������� ���� ��������>���� �� ��� �� `list`, ����� ���� 
     481>�������guard`: 
     482</propel> 
     483<doctrine> 
     484>`sfDoctrineGuardPlugin` ���������� ���� ��������>���� �� ��� �� `list`, ����� ���� 
     485>�������guard`: 
     486</doctrine> 
    496487> 
    497488>     $ php symfony list guard 
    498489 
    499 When the user is not ~authenticated|Authentication~, we need to hide the menu bar
     490�� ��� � ������, ��� ������
    500491 
    501492    [php] 
     
    516507    <?php endif; ?> 
    517508 
    518 And when the user is authenticated, we need to add a logout link in the menu
     509��������, ������� �� ��`logout`
    519510 
    520511    [php] 
     
    523514 
    524515>**TIP** 
    525 >To list all routes provided by `sfGuardPlugin`, use the `app:routes` task. 
    526  
    527 To polish the Jobeet backend even more, let's add a new module to manage the 
    528 administrator users. Thankfully, `sfGuardPlugin` provides such a module. As 
    529 for the `sfGuardAuth` module, you need to enable it in `settings.yml`: 
     516<propel> 
     517>�� �� � ��, ����fGuardPlugin`, ������app:routes`. 
     518</propel> 
     519<doctrine> 
     520>�� �� � ��, ����fDoctrineGuardPlugin`, ������app:routes`. 
     521</doctrine> 
     522 
     523<propel> 
     524�� � �������Jobeet, ����� ������� ���� ������`sfGuardPlugin` ��������� 
     525���� ����`sfGuardAuth`, ��� �������settings.yml`: 
     526</propel> 
     527<doctrine> 
     528�� � �������Jobeet, ����� ������� ���� ������`sfDoctrineGuardPlugin` ��������� 
     529���� ����`sfGuardAuth`, ��� �������settings.yml`: 
     530</doctrine> 
    530531 
    531532    [yml] 
     
    535536        enabled_modules: [default, sfGuardAuth, sfGuardUser] 
    536537 
    537 Add a link in the menu
     538�������
    538539 
    539540    [php] 
     
    541542    <li><?php echo link_to('Users', '@sf_guard_user') ?></li> 
    542543 
    543 ![Backend menu](http://www.symfony-project.org/images/jobeet/1_2/13/menu.png) 
    544  
    545 We are done! 
    546  
    547 User Testing 
    548 ------------ 
    549  
    550 Today's tutorial is not over as we have not yet talked about user testing. 
    551 As the symfony browser simulates ~cookies|Cookies~, it is quite easy to test user 
    552 behaviors by using the built-in 
    553 [`sfTesterUser`](http://symfony-project.org/api/1_2/sfTesterUser) tester. 
    554  
    555 Let's update the ~functional tests|Functional Testing~ for the menu feature we  
    556 have added today. 
    557 Add the following code at the end of the `job` module functional tests: 
     544![�������(http://www.symfony-project.org/images/jobeet/1_2/13/menu.png) 
     545 
     546� ���! 
     547 
     548���� ��� 
     549------------------------- 
     550 
     551���� ������ �� ���� ������� ���� 
     552�������ymfony ������������������, ��� ��[`sfTesterUser`](http://symfony-project.org/api/1_2/sfTesterUser). 
     553 
     554����� ���� �� ����, ���� �����. 
     555��������������������`job`: 
    558556 
    559557    [php] 
     
    581579    ; 
    582580 
    583 To ease testing, we first reload the fixtures data and restart the browser to 
    584 start with a clean session. 
    585  
    586 The `isAttribute()` method checks a given user attribute. 
    587  
     581�� ������ ��� ���� ��� �� (fixtures) ��� 
     582��� �� �� 
     583 
     584��`isAttribute()` �������� ��� ��� 
    588585>**NOTE** 
    589 >The `sfTesterUser` tester also provides `isAuthenticated()` and 
    590 >`hasCredential()` methods to test user authentication and autorizations. 
    591  
    592 See you Tomorrow 
    593 ---------------- 
    594  
    595 The symfony user classes are a nice way to abstract the PHP session 
    596 management. Coupled with the great symfony plugin system and the 
    597 `sfGuardPlugin` plugin, we have been able to secure the Jobeet backend in a 
    598 matter of minutes. And we have even added a clean interface to manage our 
    599 administrator users for free, thanks to the modules provided by the plugin. 
     586>�� `sfTesterUser` ������� `isAuthenticated()` �`hasCredential()`, ��������� �������. 
     587 
     588��� ��--------------- 
     589 
     590��� �� ����Symfony - ��� ������� 
     591��� PHP-��. ��� ���� ������ymfony ����propel> 
     592`sfGuardPlugin`,  
     593</propel> 
     594<doctrine> 
     595`sfDoctrineGuardPlugin`,  
     596</doctrine> 
     597����� �����Jobeet ���������� 
     598������ ��� ��� � ����������� ��, 
     599�������. 
    600600 
    601601__ORM__