Commit 70d2a651 authored by Mike Hibler's avatar Mike Hibler

Mike's attempt to fix FS export problem.

parent 3f867d37
...@@ -1115,17 +1115,33 @@ function DOLOGIN_MAGIC($uid, $uid_idx, $email = null, ...@@ -1115,17 +1115,33 @@ function DOLOGIN_MAGIC($uid, $uid_idx, $email = null,
# #
if ($WITHZFS && $ZFS_NOEXPORT) { if ($WITHZFS && $ZFS_NOEXPORT) {
$query_result = $query_result =
DBQueryFatal("select UNIX_TIMESTAMP(weblogin_last) ". DBQueryFatal("select UNIX_TIMESTAMP(weblogin_last),weblogin_last ".
" from users as u ". " from users as u ".
"left join user_stats as s on s.uid_idx=u.uid_idx ". "left join user_stats as s on s.uid_idx=u.uid_idx ".
"where u.uid_idx='$uid_idx'"); "where u.uid_idx='$uid_idx'");
if (mysql_num_rows($query_result)) { if (mysql_num_rows($query_result)) {
$lastrow = mysql_fetch_row($query_result); $lastrow = mysql_fetch_row($query_result);
$lastlogin = $lastrow[0]; $lastlogin = $lastrow[0];
$lastloginstr = $lastrow[1];
if (time() - $lastlogin > (24 * 3600)) { if (time() - $lastlogin > (24 * 3600)) {
SUEXEC("nobody", "nobody", "webexports_setup", # Update weblogin_last first so exports_setup
SUEXEC_ACTION_DIE); # will do something.
DBQueryFatal("update user_stats set ".
" weblogin_last=now() ".
"where uid_idx='$uid_idx'");
$rv = SUEXEC("nobody", "nobody", "webexports_setup",
SUEXEC_ACTION_IGNORE);
# failed, reset the timestamp
if ($rv) {
DBQueryFatal("update user_stats set ".
" weblogin_last='$lastloginstr' ".
"where uid_idx='$uid_idx'");
SUEXECERROR(SUEXEC_ACTION_DIE);
return;
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment