doAuthPluginConfiguration.class.php 1.12 KB
Newer Older
Яков's avatar
first  
Яков committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php

/**
 * doAuthPlugin configuration.
 *
 * @package    doAuthPlugin
 * @subpackage config
 * @author     davert
 */
class doAuthPluginConfiguration extends sfPluginConfiguration {
  /**
   * @see sfPluginConfiguration
   */
  public function initialize() {

    if (sfConfig::get('app_doAuth_routes_register', true) && in_array('baseAuth', sfConfig::get('sf_enabled_modules', array()))) {
      $this->dispatcher->connect('routing.load_configuration', array('doAuthRouting', 'listenToRoutingLoadConfigurationEvent'));
    }

    if (sfConfig::get('app_doAuth_email_registration', true) && !sfConfig::get('app_doAuth_activation',false)) {
      $this->dispatcher->connect('user.registered', array('doAuthMailer', 'sendRegistration'));
    }

    if (sfConfig::get('app_doAuth_activation',false) && sfConfig::get('app_doAuth_email_activation',true)) {
        $this->dispatcher->connect('user.registered', array('doAuthMailer', 'sendActivation'));
        
        if (sfConfig::get('app_doAuth_email_registration', true)) {
          $this->dispatcher->connect('user.activated', array('doAuthMailer', 'sendRegistration'));
        }
    }
  }
}