Changeset 12015

Show
Ignore:
Timestamp:
09/05/07 11:00:39 (1 year ago)
Author:
rambo
Message:

made ability to change password configurable

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/MidCOM_2_8/net.nehmer.account/config/config.inc

    r11550 r12015  
    99'allow_register' => true, 
    1010'allow_change_username' => true, 
     11'allow_change_password' => true, 
    1112'allow_cancel_membership' => true, 
    1213'allow_publish' => true, 
  • branches/MidCOM_2_8/net.nehmer.account/handler/maintain.php

    r11550 r12015  
    9292    function _handler_password($handler_id, $args, &$data) 
    9393    { 
     94        if (!$this->_config->get('allow_change_password')) 
     95        { 
     96            $_MIDCOM->generate_error(MIDCOM_ERRCRIT, 'Password changing is disabled'); 
     97            // This will exit() 
     98        } 
    9499        $_MIDCOM->auth->require_valid_user(); 
    95100        $this->_account = $_MIDCOM->auth->user->get_storage(); 
  • branches/MidCOM_2_8/net.nehmer.account/viewer.php

    r11550 r12015  
    180180        } 
    181181 
    182         $this->_request_switch['password'] = Array 
    183         ( 
    184             'handler' => Array('net_nehmer_account_handler_maintain', 'password'), 
    185             'fixed_args' => Array('password'), 
    186         ); 
     182        if ($this->_config->get('allow_change_password')) 
     183        { 
     184            $this->_request_switch['password'] = Array 
     185            ( 
     186                'handler' => Array('net_nehmer_account_handler_maintain', 'password'), 
     187                'fixed_args' => Array('password'), 
     188            ); 
     189        } 
    187190 
    188191        if ($this->_config->get('allow_change_username')) 
     
    491494            } 
    492495 
    493             $this->_view_toolbar->add_item 
    494             ( 
    495                 array 
    496                 ( 
    497                     MIDCOM_TOOLBAR_URL => "password/", 
    498                     MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('change password'), 
    499                     MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/repair.png', 
    500                 ) 
    501             ); 
     496            if ($this->_config->get('allow_change_password')) 
     497            { 
     498                $this->_view_toolbar->add_item 
     499                ( 
     500                    array 
     501                    ( 
     502                        MIDCOM_TOOLBAR_URL => "password/", 
     503                        MIDCOM_TOOLBAR_LABEL => $this->_l10n->get('change password'), 
     504                        MIDCOM_TOOLBAR_ICON => 'stock-icons/16x16/repair.png', 
     505                    ) 
     506                ); 
     507            } 
    502508             
    503509            if ($this->_config->get('allow_change_username'))