Autodoc
  • Namespace
  • Class
  • Tree

Namespaces

  • BlueTihi
    • Context
  • Brickrouge
    • Element
      • Nodes
    • Renderer
    • Widget
  • ICanBoogie
    • ActiveRecord
    • AutoConfig
    • CLDR
    • Composer
    • Core
    • Event
    • Exception
    • HTTP
      • Dispatcher
      • Request
    • I18n
      • Translator
    • Mailer
    • Modules
      • Taxonomy
        • Support
      • Thumbnailer
        • Versions
    • Object
    • Operation
      • Dispatcher
    • Prototype
    • Routes
    • Routing
      • Dispatcher
    • Session
  • Icybee
    • ActiveRecord
      • Model
    • ConfigOperation
    • Document
    • EditBlock
    • Element
      • ActionbarContextual
      • ActionbarSearch
      • ActionbarToolbar
    • FormBlock
    • Installer
    • ManageBlock
    • Modules
      • Articles
      • Cache
        • Collection
        • ManageBlock
      • Comments
        • ManageBlock
      • Contents
        • ManageBlock
      • Dashboard
      • Editor
        • Collection
      • Files
        • File
        • ManageBlock
      • Forms
        • Form
        • ManageBlock
      • I18n
      • Images
        • ManageBlock
      • Members
      • Modules
        • ManageBlock
      • Nodes
        • ManageBlock
        • Module
      • Pages
        • BreadcrumbElement
        • LanguagesElement
        • ManageBlock
        • NavigationBranchElement
        • NavigationElement
        • Page
        • PageController
      • Registry
      • Search
      • Seo
      • Sites
        • ManageBlock
      • Taxonomy
        • Terms
          • ManageBlock
        • Vocabulary
          • ManageBlock
      • Users
        • ManageBlock
        • NonceLogin
        • Roles
      • Views
        • ActiveRecordProvider
        • Collection
        • View
    • Operation
      • ActiveRecord
      • Constructor
      • Module
      • Widget
    • Rendering
  • None
  • Patron
  • PHP

Classes

  • CoreConfigRequirement
  • DatabaseForm
  • DatabaseOperation
  • DocumentDecorator
  • InstallForm
  • InstallOperation
  • InstallRequirements
  • LanguageElement
  • Operation
  • PanelDecorator
  • PanelForm
  • PDODriversRequirement
  • RepositoryRequirement
  • Requirement
  • Requirements
  • RequirementsOperation
  • SiteForm
  • SiteOperation
  • StepsController
  • TellMeMore
  • UserConfigRequirement
  • UserForm
  • UserOperation
  • WelcomePanel
  • WelcomeRequirements

Functions

  • t
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee/Installer package.
 5  *
 6  * (c) Olivier Laviale <olivier.laviale@gmail.com>
 7  *
 8  * For the full copyright and license information, please view the LICENSE
 9  * file that was distributed with this source code.
10  */
11 
12 namespace Icybee\Installer;
13 
14 use ICanBoogie\Errors;
15 use ICanBoogie\HTTP\Request;
16 use ICanBoogie\I18n;
17 use ICanBoogie\I18n\FormattedString;
18 
19 use Brickrouge\Element;
20 
21 class UserOperation extends Operation
22 {
23     protected function get_controls()
24     {
25         return array
26         (
27             self::CONTROL_FORM => true
28         )
29 
30         + parent::get_controls();
31     }
32 
33     protected function get_form()
34     {
35         $form = new UserForm;
36 
37         $form->children['password'][Element::REQUIRED] = true;
38         $form->children['password_confirm'][Element::REQUIRED] = true;
39 
40         return $form;
41     }
42 
43     public function __invoke(Request $request)
44     {
45         $random_password = $request['random_password'];
46 
47         if ($random_password && !$request['password'] && !$request['password_confirm'])
48         {
49             $request['password'] = $random_password;
50             $request['password_confirm'] = $random_password;
51         }
52 
53         return parent::__invoke($request);
54     }
55 
56     protected function validate(Errors $errors)
57     {
58         $request = $this->request;
59 
60         $password = $request['password'];
61         $password_confirm = $request['password_confirm'];
62 
63         if ($password != $password_confirm)
64         {
65             $errors['password'] = I18n\t('panel.user.error.password_match');
66             $errors['password_confirm'] = true;
67         }
68 
69         return $errors;
70     }
71 
72     protected function process()
73     {
74         global $core;
75 
76         $request = $this->request;
77 
78         $core->session->install['user'] = array
79         (
80             'username' => $request['username'],
81             'email' => $request['email'],
82             'password' => $request['password'],
83             'language' => $request['language']
84         );
85 
86         $this->response->message = I18n\t('panel.user.success');
87 
88         return parent::process();
89     }
90 }
Autodoc API documentation generated by ApiGen 2.8.0