[2033] in Moira Commits
/svn/moira r4175 - in trunk/moira: clients/stanley db server
daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Tue Jul 22 10:19:23 2014
Date: Tue, 22 Jul 2014 10:19:12 -0400
From: Garry Zacheiss <zacheiss@MIT.EDU>
Message-Id: <201407221419.s6MEJCpw003579@drugstore.mit.edu>
To: moira-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: zacheiss
Date: 2014-07-22 10:19:11 -0400 (Tue, 22 Jul 2014)
New Revision: 4175
Modified:
trunk/moira/clients/stanley/stanley.c
trunk/moira/db/dbopt.sql
trunk/moira/db/schema.sql
trunk/moira/server/increment.pc
trunk/moira/server/queries2.c
Log:
Rename twofactor_enabled to twofactor_status.
Modified: trunk/moira/clients/stanley/stanley.c
===================================================================
--- trunk/moira/clients/stanley/stanley.c 2014-07-21 22:13:13 UTC (rev 4174)
+++ trunk/moira/clients/stanley/stanley.c 2014-07-22 14:19:11 UTC (rev 4175)
@@ -46,7 +46,7 @@
char *newlogin, *uid, *shell, *winshell, *last, *first, *middle, *u_status;
char *clearid, *class, *comment, *secure, *winhomedir, *winprofiledir, *expiration;
-char *alternate_email, *alternate_phone, *twofactor_enabled, *vpn_group;
+char *alternate_email, *alternate_phone, *twofactor_status, *vpn_group;
static char *states[] = {
"Registerable (0)",
@@ -100,7 +100,7 @@
newlogin = uid = shell = winshell = last = first = middle = NULL;
u_status = clearid = class = comment = secure = NULL;
winhomedir = winprofiledir = expiration = alternate_email = alternate_phone = NULL;
- twofactor_enabled = vpn_group = NULL;
+ twofactor_status = vpn_group = NULL;
reservation_add_queue = reservation_remove_queue = NULL;
sponsor = NULL;
whoami = argv[0];
@@ -281,7 +281,7 @@
if (arg - argv < argc - 1) {
arg++;
update_flag++;
- twofactor_enabled = *arg;
+ twofactor_status = *arg;
} else
usage(argv);
}
@@ -449,8 +449,8 @@
argv[U_ALT_EMAIL] = alternate_email;
if (alternate_phone)
argv[U_ALT_PHONE] = alternate_phone;
- if (twofactor_enabled)
- argv[U_TWOFACTOR] = twofactor_enabled;
+ if (twofactor_status)
+ argv[U_TWOFACTOR] = twofactor_status;
else
argv[U_TWOFACTOR] = "0";
if (sponsor)
@@ -574,8 +574,8 @@
argv[19] = alternate_email;
if (alternate_phone)
argv[20] = alternate_phone;
- if (twofactor_enabled)
- argv[21] = twofactor_enabled;
+ if (twofactor_status)
+ argv[21] = twofactor_status;
if (sponsor)
{
argv[17] = sponsor->name;
Modified: trunk/moira/db/dbopt.sql
===================================================================
--- trunk/moira/db/dbopt.sql 2014-07-21 22:13:13 UTC (rev 4174)
+++ trunk/moira/db/dbopt.sql 2014-07-22 14:19:11 UTC (rev 4175)
@@ -10,7 +10,7 @@
create index i_usr_resv on users (reservations);
create index i_usr_sponsor on users (sponsor_id);
create index i_usr_vpn_group on users (default_vpn_group);
-create index i_usr_twofactor on users (twofactor_enabled);
+create index i_usr_twofactor on users (twofactor_status);
create unique index i_krb_usid on krbmap (users_id);
create index i_krb_str on krbmap (string_id);
Modified: trunk/moira/db/schema.sql
===================================================================
--- trunk/moira/db/schema.sql 2014-07-21 22:13:13 UTC (rev 4174)
+++ trunk/moira/db/schema.sql 2014-07-22 14:19:11 UTC (rev 4175)
@@ -61,7 +61,7 @@
affiliation_detailed VARCHAR(40) DEFAULT 'MIT Affiliate' NOT NULL,
last_krb_pwd_change DATE DEFAULT SYSDATE NOT NULL,
default_vpn_group INTEGER DEFAULT 0 NOT NULL,
- twofactor_enabled INTEGER DEFAULT 0 NOT NULL
+ twofactor_status INTEGER DEFAULT 0 NOT NULL
);
create table krbmap
Modified: trunk/moira/server/increment.pc
===================================================================
--- trunk/moira/server/increment.pc 2014-07-21 22:13:13 UTC (rev 4174)
+++ trunk/moira/server/increment.pc 2014-07-22 14:19:11 UTC (rev 4175)
@@ -91,7 +91,7 @@
sprintf(stmt_buf, "SELECT u.login, u.unix_uid, u.shell, "
"u.winconsoleshell, u.last, u.first, u.middle, u.status, "
"u.clearid, u.type, u.users_id, u.winhomedir, u.winprofiledir, "
- "u.potype, u.twofactor_enabled FROM users u WHERE %s", qual);
+ "u.potype, u.twofactor_status FROM users u WHERE %s", qual);
dosql(before);
beforec = 15;
break;
@@ -322,7 +322,7 @@
sprintf(stmt_buf, "SELECT u.login, u.unix_uid, u.shell, "
"u.winconsoleshell, u.last, u.first, u.middle, u.status, "
"u.clearid, u.type, u.users_id, u.winhomedir, u.winprofiledir, "
- "u.potype, u.twofactor_enabled FROM users u WHERE %s", qual);
+ "u.potype, u.twofactor_status FROM users u WHERE %s", qual);
dosql(after);
afterc = 15;
break;
Modified: trunk/moira/server/queries2.c
===================================================================
--- trunk/moira/server/queries2.c 2014-07-21 22:13:13 UTC (rev 4174)
+++ trunk/moira/server/queries2.c 2014-07-22 14:19:11 UTC (rev 4175)
@@ -133,7 +133,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
"affiliation_basic", "affiliation_detailed", "modtime", "modby", "modwith", "created", "creator",
};
@@ -246,7 +246,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
"affiliation_basic", "affiliation_detailed", "modtime", "modby", "modwith", "created", "creator",
};
@@ -302,7 +302,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
"affiliation_basic", "affiliation_detailed", "modtime", "modby", "modwith", "created", "creator",
};
@@ -384,7 +384,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
"affiliation_basic", "affiliation_detailed", "modtime", "modby", "modwith", "created", "creator",
};
@@ -440,7 +440,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
"affiliation_basic", "affiliation_detailed", "modtime", "modby", "modwith", "created", "creator",
};
@@ -603,7 +603,7 @@
"login", "unix_uid", "shell", "winconsoleshell", "last", "first", "middle",
"status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
};
static struct valobj auac2_valobj[] = {
@@ -921,7 +921,7 @@
"newlogin", "unix_uid", "shell", "winconsoleshell", "last", "first",
"middle", "status", "clearid", "class", "comments", "signature", "secure",
"winhomedir", "winprofiledir", "sponsor_type", "sponsor_name", "expiration",
- "alternate_email", "alternate_phone", "twofactor_enabled",
+ "alternate_email", "alternate_phone", "twofactor_status",
};
static struct valobj uuac2_valobj[] = {
@@ -4892,7 +4892,7 @@
MR_Q_RETRIEVE,
"u",
USERS_TABLE,
- "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_enabled, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_status, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
gual_fields,
29,
28,
@@ -5018,7 +5018,7 @@
MR_Q_RETRIEVE,
"u",
USERS_TABLE,
- "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_enabled, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_status, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
guau_fields,
29,
28,
@@ -5144,7 +5144,7 @@
MR_Q_RETRIEVE,
"u",
USERS_TABLE,
- "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_enabled, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_status, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
guan_fields,
30,
28,
@@ -5270,7 +5270,7 @@
MR_Q_RETRIEVE,
"u",
USERS_TABLE,
- "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_enabled, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_status, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
guac_fields,
29,
28,
@@ -5396,7 +5396,7 @@
MR_Q_RETRIEVE,
"u",
USERS_TABLE,
- "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_enabled, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
+ "u.login, u.unix_uid, u.shell, u.winconsoleshell, u.last, u.first, u.middle, u.status, u.clearid, u.type, str.string, CHR(0), u.secure, u.winhomedir, u.winprofiledir, u.sponsor_type, u.sponsor_id, u.expiration, u.alternate_email, u.alternate_phone, u.twofactor_status, u.affiliation_basic, u.affiliation_detailed, TO_CHAR(u.modtime, 'DD-mon-YYYY HH24:MI:SS'), u.modby, u.modwith, TO_CHAR(u.created, 'DD-mon-YYYY HH24:MI:SS'), u.creator FROM users u, strings str",
guam_fields,
29,
28,
@@ -5720,7 +5720,7 @@
/* We set signature to "NVL(CHR(0), '%s')", which is to say, "CHR(0)",
* but using up one argv element.
*/
- "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, twofactor_enabled, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %s)",
+ "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, twofactor_status, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', %d, NVL(CHR(0), '%s'), %s, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %s)",
auac_fields,
21,
21,
@@ -5828,7 +5828,7 @@
MR_Q_APPEND,
"u",
USERS_TABLE,
- "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, twofactor_enabled, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %s)",
+ "INTO users (login, unix_uid, shell, winconsoleshell, last, first, middle, status, clearid, type, comments, signature, secure, winhomedir, winprofiledir, sponsor_type, sponsor_id, expiration, alternate_email, alternate_phone, twofactor_status, users_id, created, creator) VALUES ('%s', %s, '%s', NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, NVL('%s', CHR(0)), '%s', 0, CHR(0), 0, NVL('%s', CHR(0)), NVL('%s', CHR(0)), '%s', %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)), NVL('%s', CHR(0)), %s, %s, SYSDATE, %s)",
auac_fields,
18,
18,
@@ -5960,7 +5960,7 @@
"u",
USERS_TABLE,
/* See comment in auac about signature. */
- "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0)), twofactor_enabled = %s",
+ "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', comments = %d, signature = NVL(CHR(0), '%s'), secure = %s, winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0)), twofactor_status = %s",
uuac_fields,
22,
21,
@@ -6068,7 +6068,7 @@
MR_Q_UPDATE,
"u",
USERS_TABLE,
- "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0)), twofactor_enabled = %s ",
+ "users SET login = '%s', unix_uid = %s, shell = '%s', winconsoleshell = '%s', last = NVL('%s', CHR(0)), first = NVL('%s', CHR(0)), middle = NVL('%s', CHR(0)), status = %s, clearid = NVL('%s', CHR(0)), type = '%s', winhomedir = NVL('%s', CHR(0)), winprofiledir = NVL('%s', CHR(0)), sponsor_type = '%s', sponsor_id = %d, expiration = NVL('%s', CHR(0)), alternate_email = NVL('%s', CHR(0)), alternate_phone = NVL('%s', CHR(0)), twofactor_status = %s ",
uuac_fields,
19,
18,