Skip to content
Snippets Groups Projects
Commit 15b00725 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

Oops, forgot to transfer usr_modified=now() from old webpage to new

perl script that does this.
parent 8ba5c120
No related branches found
No related tags found
No related merge requests found
...@@ -27,6 +27,7 @@ my $optlist = "kna"; ...@@ -27,6 +27,7 @@ my $optlist = "kna";
my $iskey = 0; my $iskey = 0;
my $verify = 0; my $verify = 0;
my $auditmode = 0; my $auditmode = 0;
my $anonmode = 0;
# #
# Configure variables # Configure variables
...@@ -136,6 +137,8 @@ if (getpwuid($UID) eq "nobody") { ...@@ -136,6 +137,8 @@ if (getpwuid($UID) eq "nobody") {
fatal("*** $0:\n". fatal("*** $0:\n".
" Attempt to insert first key for existing user!\n"); " Attempt to insert first key for existing user!\n");
} }
# Make sure we do not mess with user table.
$anonmode = 1;
} }
elsif (! $verify) { elsif (! $verify) {
if (! UNIX2DBUID($UID, \$db_uid)) { if (! UNIX2DBUID($UID, \$db_uid)) {
...@@ -245,6 +248,13 @@ sub ParseKey($) { ...@@ -245,6 +248,13 @@ sub ParseKey($) {
DBQueryFatal("replace into user_pubkeys ". DBQueryFatal("replace into user_pubkeys ".
"values ('$user', '$comment', '$key', now())"); "values ('$user', '$comment', '$key', now())");
#
# Mark user record as modified so nodes are updated.
#
if (!$anonmode) {
DBQueryFatal("update users set usr_modified=now() where uid='$user'");
}
return 1; return 1;
} }
......
...@@ -27,6 +27,7 @@ my $optlist = "kna"; ...@@ -27,6 +27,7 @@ my $optlist = "kna";
my $iskey = 0; my $iskey = 0;
my $verify = 0; my $verify = 0;
my $auditmode = 0; my $auditmode = 0;
my $anonmode = 0;
# #
# Configure variables # Configure variables
...@@ -136,6 +137,8 @@ if (getpwuid($UID) eq "nobody") { ...@@ -136,6 +137,8 @@ if (getpwuid($UID) eq "nobody") {
fatal("*** $0:\n". fatal("*** $0:\n".
" Attempt to insert first key for existing user!\n"); " Attempt to insert first key for existing user!\n");
} }
# Make sure we do not mess with user table.
$anonmode = 1;
} }
elsif (! $verify) { elsif (! $verify) {
if (! UNIX2DBUID($UID, \$db_uid)) { if (! UNIX2DBUID($UID, \$db_uid)) {
...@@ -245,6 +248,13 @@ sub ParseKey($) { ...@@ -245,6 +248,13 @@ sub ParseKey($) {
DBQueryFatal("replace into user_pubkeys ". DBQueryFatal("replace into user_pubkeys ".
"values ('$user', '$comment', '$key', now())"); "values ('$user', '$comment', '$key', now())");
#
# Mark user record as modified so nodes are updated.
#
if (!$anonmode) {
DBQueryFatal("update users set usr_modified=now() where uid='$user'");
}
return 1; return 1;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment