Ignore:
Timestamp:
2014-02-28T23:17:28Z (10 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
b4b8f1e
Parents:
2e815e5
Message:

Allow use of "ac x set -del password" to use /oper to change the password
"securely". Patch from Flexo, bug #1117.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/account.c

    r2e815e5 r35987a1  
    154154        else if( strcmp( set->key, "password" ) == 0 )
    155155        {
    156                 /* set -del should be allowed now, but I don't want to have any
    157                    NULL pointers to have to deal with. */
    158                 if( !value )
    159                         value = "";
     156                /* set -del allows /oper to be used to change the password or,
     157                   iff oauth is enabled, reset the oauth credential magic.
     158                */
     159                if( !value ) {
     160                        if ( set_getbool( &(acc->set), "oauth" ) ) {
     161                                value = "";
     162                        } else {
     163                                value = PASSWORD_PENDING;
     164                                ((irc_t *)acc->bee->ui_data)->status |= OPER_HACK_ACCOUNT_PASSWORD;
     165                                irc_rootmsg((irc_t *)acc->bee->ui_data, "You may now use /OPER to set the password");
     166                        }
     167                }
    160168               
    161169                g_free( acc->pass );
Note: See TracChangeset for help on using the changeset viewer.