Changeset 3ac6d9f for root_commands.c


Ignore:
Timestamp:
2016-03-23T06:44:13Z (3 years ago)
Author:
Dennis Kaarsemaker <dennis@…>
Branches:
master
Children:
e41ba05
Parents:
d701547
git-author:
Dennis Kaarsemaker <dennis@…> (22-02-16 20:04:10)
git-committer:
Dennis Kaarsemaker <dennis@…> (23-03-16 06:44:13)
Message:

Support for locked-down accounts

In certain situations, e.g. when working with pregenerated
configurations, it is useful to be able lock down accounts so they
cannot be deleted and authentication information (user, password,
server) cannot be changed.

We mark such sensitive settings with ACC_SET_LOCKABLE and will refuse to
change them if the account is locked by setting the ACC_FLAG_LOCKED
flag.

This flag is stored in the xml files as account attribute locked="true".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    rd701547 r3ac6d9f  
    388388                irc_rootmsg(irc, "This setting can only be changed when the account is %s-line", "on");
    389389                return 0;
     390        } else if (a->flags & ACC_FLAG_LOCKED && s && s->flags & ACC_SET_LOCKABLE) {
     391                irc_rootmsg(irc, "This setting can not be changed for locked accounts");
     392                return 0;
    390393        }
    391394
     
    547550
    548551        if (len >= 1 && g_strncasecmp(cmd[2], "del", len) == 0) {
    549                 if (a->ic) {
     552                if (a->flags & ACC_FLAG_LOCKED) {
     553                        irc_rootmsg(irc, "Account is locked, can't delete");
     554                }
     555                else if (a->ic) {
    550556                        irc_rootmsg(irc, "Account is still logged in, can't delete");
    551557                } else {
Note: See TracChangeset for help on using the changeset viewer.