Changeset 3ac6d9f
- Timestamp:
- 2016-03-23T06:44:13Z (9 years ago)
- 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)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/account.c
rd701547 r3ac6d9f 67 67 68 68 s = set_add(&a->set, "password", NULL, set_eval_account, a); 69 s->flags |= SET_NOSAVE | SET_NULL_OK | SET_PASSWORD ;69 s->flags |= SET_NOSAVE | SET_NULL_OK | SET_PASSWORD | ACC_SET_LOCKABLE; 70 70 71 71 s = set_add(&a->set, "tag", NULL, set_eval_account, a); … … 73 73 74 74 s = set_add(&a->set, "username", NULL, set_eval_account, a); 75 s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY ;75 s->flags |= SET_NOSAVE | ACC_SET_OFFLINE_ONLY | ACC_SET_LOCKABLE; 76 76 set_setstr(&a->set, "username", user); 77 77 -
protocols/account.h
rd701547 r3ac6d9f 63 63 ACC_SET_OFFLINE_ONLY = 0x02, /* Allow changes only if the acct is offline. */ 64 64 ACC_SET_ONLINE_ONLY = 0x04, /* Allow changes only if the acct is online. */ 65 ACC_SET_LOCKABLE = 0x08 /* Setting cannot be changed if the account is locked down */ 65 66 } account_set_flag_t; 66 67 … … 70 71 ACC_FLAG_HANDLE_DOMAINS = 0x04, /* Contact handles need a domain portion. */ 71 72 ACC_FLAG_LOCAL = 0x08, /* Contact list is local. */ 73 ACC_FLAG_LOCKED = 0x10, /* Account is locked (cannot be deleted, certain settings can't changed) */ 72 74 } account_flag_t; 73 75 -
root_commands.c
rd701547 r3ac6d9f 388 388 irc_rootmsg(irc, "This setting can only be changed when the account is %s-line", "on"); 389 389 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; 390 393 } 391 394 … … 547 550 548 551 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) { 550 556 irc_rootmsg(irc, "Account is still logged in, can't delete"); 551 557 } else { -
storage_xml.c
rd701547 r3ac6d9f 86 86 { 87 87 struct xml_parsedata *xd = data; 88 char *protocol, *handle, *server, *password = NULL, *autoconnect, *tag ;88 char *protocol, *handle, *server, *password = NULL, *autoconnect, *tag, *locked; 89 89 char *pass_b64 = NULL; 90 90 unsigned char *pass_cr = NULL; … … 99 99 autoconnect = xt_find_attr(node, "autoconnect"); 100 100 tag = xt_find_attr(node, "tag"); 101 locked = xt_find_attr(node, "locked"); 101 102 102 103 protocol = xt_find_attr(node, "protocol"); … … 126 127 if (local) { 127 128 acc->flags |= ACC_FLAG_LOCAL; 129 } 130 if (locked && !g_strcasecmp(locked, "true")) { 131 acc->flags |= ACC_FLAG_LOCKED; 128 132 } 129 133 } else { … … 320 324 xt_add_attr(cur, "server", acc->server); 321 325 } 326 if (acc->flags & ACC_FLAG_LOCKED) { 327 xt_add_attr(cur, "locked", "true"); 328 } 322 329 323 330 g_free(pass_b64);
Note: See TracChangeset
for help on using the changeset viewer.