Changeset 11935

Show
Ignore:
Timestamp:
08/31/07 10:19:03 (1 year ago)
Author:
w_i
Message:

Extending account component to support registration workflow. (Work in progress)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/net.nehmer.account/config/config.inc

    r11719 r11935  
    104104 * How many invite email fields should be shown 
    105105 */ 
    106  'email_fields' => 5, 
     106'email_fields' => 5, 
    107107 
    108108/** 
    109109 * Invite email subject 
    110110 */ 
    111  'email_subject' => "invitation subject", 
     111'email_subject' => "invitation subject", 
    112112 
    113113/** 
    114114 * Keep sent invites for x days 
    115115 */ 
    116  'keep_sent_invites' => 30, 
     116'keep_sent_invites' => 30, 
    117117 
    118118/** 
    119119 * The schema to use for invitation registration 
    120120 */ 
    121  'invreg_schema' => 'account', 
     121'invreg_schema' => 'account', 
     122 
     123'auto_login_on_activation' => false, 
     124 
     125'override_registration_steps' => array 
     126
     127    'register/activate' => 'invite', 
     128    'invite' => 'register/finish', 
     129), 
  • trunk/midcom/net.nehmer.account/config/mgdschema.sql

    r11538 r11935  
    66  # other fields/indexes as ALTER TABLE statements 
    77  PRIMARY KEY  (id), 
    8   KEY net_nehmer_accounts_invites_invite_idx ('hash'(30)), 
    9   KEY net_nehmer_accounts_invites_invite_idx ('email'(30)), 
    10   KEY net_nehmer_accounts_invites_invite_idx (`buddy`(30)), 
     8  KEY net_nehmer_accounts_invites_invite_hash_idx (`hash`(30)), 
     9  KEY net_nehmer_accounts_invites_invite_email_idx (`email`(30)), 
     10  KEY net_nehmer_accounts_invites_invite_buddy_idx (`buddy`(30)) 
    1111); 
  • trunk/midcom/net.nehmer.account/handler/invitation.php

    r11776 r11935  
    206206            $_MIDCOM->relocate('sent_invites'); 
    207207            } 
     208             
     209            $step_overrides = $this->_config->get('override_registration_steps'); 
     210            if (array_key_exists('invite', $step_overrides)) 
     211            { 
     212                $prefix = $_MIDCOM->get_context_data(MIDCOM_CONTEXT_ANCHORPREFIX); 
     213                $this->_request_data['skip_url'] = "{$prefix}{$step_overrides['invite']}"; 
     214            } 
     215             
    208216        return true; 
    209217    } 
  • trunk/midcom/net.nehmer.account/handler/register.php

    r11555 r11935  
    115115     */ 
    116116    var $_processing_msg_raw = ''; 
     117     
     118    var $logged_in = false; 
    117119 
    118120    /** 
     
    127129        $this->_request_data['processing_msg'] =& $this->_processing_msg; 
    128130        $this->_request_data['processing_msg_raw'] =& $this->_processing_msg_raw; 
     131        $this->_request_data['logged_in'] =& $this->logged_in; 
    129132    } 
    130133 
     
    957960        } 
    958961    } 
     962     
     963    function _handler_finish($handler_id, $args, &$data) 
     964    { 
     965        return true; 
     966    } 
     967     
     968    function _show_finish($handler_id, &$data) 
     969    { 
     970        midcom_show_style('registration-finished'); 
     971    } 
    959972 
    960973    /** 
     
    10161029 
    10171030        $_MIDCOM->auth->drop_sudo(); 
    1018     } 
    1019  
     1031         
     1032        if ($this->_config->get('auto_login_on_activation')) 
     1033        { 
     1034            $this->logged_in = $_MIDCOM->auth->_auth_backend->create_login_session($username, $password); 
     1035        } 
     1036    } 
     1037     
    10201038    /** 
    10211039     * This call automatically publishes the account details if the component is configured 
  • trunk/midcom/net.nehmer.account/style/registration-account-activated.php

    r5048 r11935  
    1212<?php } ?> 
    1313 
     14<?php 
     15if (!$data['logged_in']) 
     16{ 
     17?> 
    1418<p><a href="&(data['return_url']);"><?php $data['l10n']->show('you may now log in to the system.'); ?></a></p> 
     19<?php 
     20} 
     21?> 
  • trunk/midcom/net.nehmer.account/viewer.php

    r11719 r11935  
    226226        ); 
    227227 
    228 //        if ($this->_config->get('allow_register')) 
    229   //      { 
    230228            // REGISTRATION LINKS 
    231229            $this->_request_switch['register_select_type'] = Array 
     
    233231                'handler' => Array('net_nehmer_account_handler_register', 'select_type'), 
    234232                'fixed_args' => Array('register'), 
     233            ); 
     234            $this->_request_switch['register_finish'] = Array 
     235            ( 
     236                'handler' => Array('net_nehmer_account_handler_register', 'finish'), 
     237                'fixed_args' => Array('register','finish'), 
    235238            ); 
    236239            $this->_request_switch['register'] = Array 
     
    252255                'variable_args' => 1, 
    253256            ); 
    254              
     257 
    255258            // Pending registrations 
    256259            if ($this->_config->get('require_activation'))