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

  • DeleteOperation
  • EditBlock
  • Hooks
  • ManageBlock
  • Member
  • Model
  • Module
  • SaveOperation
 1 <?php
 2 
 3 /*
 4  * This file is part of the Icybee 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\Modules\Members;
13 
14 use ICanBoogie\Debug;
15 use ICanBoogie\HTTP\Request;
16 use ICanBoogie\I18n\FormattedString;
17 use ICanBoogie\Uploaded;
18 use ICanBoogie\Operation;
19 
20 use Icybee\Modules\Users\User;
21 
22 class SaveOperation extends \Icybee\Modules\Users\SaveOperation
23 {
24     protected $accept = array
25     (
26         'image/gif',
27         'image/jpeg',
28         'image/png'
29     );
30 
31     protected function validate(\ICanboogie\Errors $errors)
32     {
33         $file = new Uploaded('photo', $this->accept, false);
34 
35         if ($file)
36         {
37             if ($file->er)
38             {
39                 $errors['photo'] = new FormattedString('Unable to upload file %file: :message.', array
40                 (
41                     '%file' => $file->name,
42                     ':message' => $file->er_message
43                 ));
44 
45                 return false;
46             }
47 
48             if ($file->location)
49             {
50                 $this->request['photo'] = $file;
51             }
52         }
53 
54         #
55         # email verify
56         #
57 
58         if (!$this->key && isset($this->properties['email-verify']) && $this->request['email-verify'] != $this->properties['email'])
59         {
60             $errors['email-verify'] = new FormattedString("E-mail and E-mail confirm don't match");
61 
62             return false;
63         }
64 
65         return parent::validate($errors);
66     }
67 }
Autodoc API documentation generated by ApiGen 2.8.0