Overview

Namespaces

  • Cron
  • None

Classes

  • _HtmlGrid_TableOut
  • _TransactionModel_RawSaveOperation
  • AccessControlComponent
  • AccessControlHelper
  • ActionListHelper
  • ActiveDirectoryUtils
  • AddCurrentPidToSchedulingShellCallLogs
  • AnonymousFunctionOperation
  • ArrayUtil
  • AssociationIntegrityBehavior
  • AtomicOperation
  • AuthenticationComponent
  • AuthenticationController
  • AuthenticationUser
  • AutocompleteDatasourceComponent
  • BaseModelComponent
  • Basics
  • CakeLayersHelper
  • CheckAndRunShell
  • ClassSearcher
  • CommandLineUtil
  • CommonValidationBehavior
  • ConfigurableShellCallsSchedulingTask
  • ConfigurationKey
  • ConfigurationKeys
  • ConfigurationKeysController
  • Context
  • ContextComponent
  • ContextHelper
  • Contexts
  • ControllerInspector
  • ControllerMenuHelper
  • CreateJournalingTables
  • CreateTableConfigurationKeys
  • CreateTableSchedulingConfigurableShellCalls
  • CreateTableSchedulingShellCallLogs
  • CreateTableSettedConfigurationKeys
  • CreateTableUserResetPasswordRequests
  • CreateTableUsers
  • CronSchedulingInstaller
  • CronValidationBehavior
  • CssBox
  • CssController
  • CssProperties
  • CssShell
  • CsvUtil
  • CustomDataModel
  • DatasourceDumperManager
  • DateTimeInput
  • DependencyShell
  • DetailHelper
  • DumperShell
  • ExtendedFieldsAccessControl
  • ExtendedFieldSet
  • ExtendedFieldSetHelper
  • ExtendedFieldsParser
  • ExtendedFormHelper
  • ExtendedHasManyAppModel
  • ExtendedOperationsBehavior
  • FieldDefinition
  • FieldRowDefinition
  • FieldSetDefinition
  • FieldSetLayoutHelper
  • FileOperations
  • FileOperations_Rename
  • FileOperations_SymLink
  • FileOperations_Touch
  • FileOperations_Unlink
  • FileSystem
  • FixConfigurationKeysPrimaryKey
  • FixSettedConfigurationKeysPrimaryKey
  • HasManyUtilsBehavior
  • HtmlDocument
  • HtmlGrid
  • HtmlGrid_Cell
  • HttpClient
  • HttpResponse
  • ImapClient
  • ImapMailBox
  • ImapParserShell
  • IncludePath
  • InputMasked
  • InputSearchable
  • InputsOnSubmit
  • InstallShell
  • JenkinsBuildShell
  • Journal
  • JournalDetail
  • JournalizedBehavior
  • JsonResponseComponent
  • LayoutsHelper
  • Ldap
  • LdapUtils
  • ListFieldSet
  • ListFieldSetHelper
  • ListsHelper
  • MailParser
  • Make
  • MenuHelper
  • MigrationAllPluginsShell
  • ModelOperations
  • ModelOperations_Delete
  • ModelOperations_Save
  • ModelTraverser
  • MysqlDumper
  • OpenLdapUtils
  • PaginatorUtilComponent
  • PaginatorUtilComponentFilter
  • PaginatorUtilHelper
  • Plugin
  • PluginManager
  • Reflections
  • RenameEnabledToActiveFromUsersTable
  • RunShellCallShell
  • ScaffoldUtilComponent
  • ScaffoldUtilHelper
  • Scheduling
  • SchedulingConfigurableShellCall
  • SchedulingConfigurableShellCallsController
  • SchedulingShellCallLog
  • SchedulingShellCallLogsController
  • SettedConfigurationKey
  • StuffreposPluginsRename
  • TimeZoneBehavior
  • TransactionModel
  • TransactionOperation
  • Translator
  • TranslatorShell
  • User
  • UserAuthenticationComponent
  • UserChangePassword
  • UserResetPassword
  • UserResetPasswordRequest
  • UserResetPasswordRequestSubmission
  • UsersController
  • ViewUtilHelper

Interfaces

  • AccessControlFilter
  • CommitableOperation
  • DatasourceDumper
  • MakeListener
  • SchedulingInstaller
  • TasksObject
  • UndoableOperation

Exceptions

  • LdapObjectNotWritableException
  • ModelTraverserException
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: class UsersController extends AppController {
 4: 
 5:     public $scaffold;
 6:     
 7:     public $components = array(
 8:         'ExtendedScaffold.ScaffoldUtil' => array(
 9:             'indexUnsetFields' => array(
10:                 'id',
11:                 'password',
12:                 'modified',
13:             ),
14:             'viewUnsetFields' => array(
15:                 'id',
16:                 'password',
17:             ),
18:             'editUnsetFields,addUnsetFields' => array(
19:                 'password',
20:             )
21:         ),
22:     );
23: 
24:     
25:     public function beforeFilter() {        
26:         parent::beforeFilter();
27:         
28:         if (!$this->Components->loaded('Authentication.Authentication')) {
29:             $this->Authentication = $this->Components->load(
30:                     'Authentication.Authentication'
31:                     , array(
32:                 'userModel' => 'UserAccounts.User',
33:                 'usernameField' => 'email',
34:                 'emailField' => 'email',
35:                 'activeField' => 'active'
36:                     )
37:             );
38:             $this->Authentication->initialize($this);
39:         }
40: 
41:         if ($this->request->action == 'add' && $this->request->isPost()) {
42:             $this->currentPassword = $this->Authentication->generateRandomPassword();
43:             $this->request->data['User']['password'] = $this->currentPassword;
44:         }        
45:     }
46: 
47:     public function beforeRender() {
48:         parent::beforeRender();
49: 
50:         if (!isset($this->request->data['User']['active'])) {
51:             $this->request->data['User']['active'] = true;
52:         }
53:     }
54:     
55:     public function afterScaffoldSave($method) {
56:         if (!parent::afterScaffoldSave($method)) {
57:             return false;
58:         }
59: 
60:         if ($method == 'add' && $this->Components->enabled('Auth')) {
61:             $this->Authentication->sendSelfUserCreationNotification(
62:                     $this->User->id, $this->currentPassword
63:             );
64:         }
65:         
66:         return true;
67:     }
68: 
69: }
70: 
71: ?>
72: 
API documentation generated by ApiGen 2.8.0