+ // retrieve list of active tournaments
+ $usr_sql = sprintf("
+SELECT usr.*, guar.login AS guar_login
+ FROM %susers AS usr
+ JOIN %susers AS guar ON guar.code = usr.guar_code
+ WHERE ( (usr.type & (CAST (X'%x' as integer))) = (CAST (X'%x' as integer)) )
+ AND usr.disa_reas = %d AND usr.code = %d;",
+ $G_dbpfx, $G_dbpfx,
+ USER_FLAG_TY_ALL, USER_FLAG_TY_DISABLE,
+ USER_DIS_REA_NU_TOBECHK, $id);
+ if (($usr_pg = pg_query($bdb->dbconn->db(), $usr_sql)) == FALSE) {
+ log_crit("stat-day: select from tournaments failed");
+ break;
+ }
+ $usr_obj = pg_fetch_object($usr_pg, 0);
+
+ printf("KEY: %s: %s %s<br>\n", $id, $value, $usr_obj->login);
+ // change state
+ $passwd = passwd_gen();
+
+ if (($bdb->user_update_passwd($usr_obj->code, $passwd)) == FALSE) {
+ echo "fail 1.5<br>";
+ break;
+ }
+
+ if (($bdb->user_update_flag_ty($usr_obj->code,
+ USER_FLAG_TY_DISABLE, USER_DIS_REA_NU_TOBECHK,
+ USER_FLAG_TY_NORM, USER_DIS_REA_NONE)) == FALSE) {
+ echo "fail 2<br>";
+ break;
+ }
+
+ $bdb->user_update_login_time($usr_obj->code, 0);
+
+ // send mail
+ $subj = $mlang_umgmt['nu_psubj'][$G_lang];
+ $body_txt = sprintf($mlang_umgmt['nu_ptext'][$G_lang],
+ $usr_obj->login, $passwd);
+ $body_htm = sprintf($mlang_umgmt['nu_phtml'][$G_lang],
+ $usr_obj->login, $passwd);
+
+ if (brisk_mail($usr_obj->email, $subj, $body_txt, $body_htm) == FALSE) {
+ // mail error
+ fprintf(STDERR, "ERROR: mail send FAILED\n");
+ break;
+ }
+ }
+ exit;
+ }
+ else {
+ do {
+ if (($bdb = BriskDB::create()) == FALSE) {
+ log_crit("stat-day: database connection failed");
+ break;
+ }
+
+ // retrieve list of active tournaments
+ $usr_sql = sprintf("
+SELECT usr.*, guar.login AS guar_login
+ FROM %susers AS usr
+ JOIN %susers AS guar ON guar.code = usr.guar_code
+ WHERE ( (usr.type & (CAST (X'%x' as integer))) = (CAST (X'%x' as integer)) )
+ AND usr.disa_reas = %d
+ ORDER BY usr.lintm;",
+ $G_dbpfx, $G_dbpfx,
+ USER_FLAG_TY_ALL, USER_FLAG_TY_DISABLE,
+ USER_DIS_REA_NU_TOBECHK);
+ if (($usr_pg = pg_query($bdb->dbconn->db(), $usr_sql)) == FALSE) {
+ log_crit("stat-day: select from tournaments failed");
+ break;
+ }
+
+ $usr_n = pg_numrows($usr_pg);
+ $tab_lines = "<tr><th></th><th>User</th><th>Guar</th><th>Date</th></tr>";
+ for ($i = 0 ; $i < $usr_n ; $i++) {
+ $usr_obj = pg_fetch_object($usr_pg, $i);
+
+ $tab_lines .= sprintf("<tr><td><input name=\"f_newuser%d\" type=\"checkbox\" %s></td><td>%s</td><td>%s</td><td>%s</td></tr>\n",
+ $usr_obj->code, ($nocheck ? "" : "CHECKED"),
+ eschtml($usr_obj->login), eschtml($usr_obj->guar_login), $usr_obj->lintm);
+ }
+ ?>
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Brisk: email verified user management.</title>
+</head>
+ <body>
+ <h2> E-mail verified user management.</h2>
+ <?php if ($status != "") { echo "$status"; } ?>
+ <form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="POST">
+ <table>
+ <?php
+ echo $tab_lines;
+ ?>
+ </table>
+ <input type="submit" name="f_accept" value="Accept">
+ <input type="submit" name="f_delete" value="Delete">
+ </form>
+ </body>
+ </html>
+ <?php
+ } while(FALSE);
+ } // else of if ($action ...
+ } // else of if ($do ...
+}
+
+main();
+
+?>