コード例 #1
0
ファイル: users.php プロジェクト: LOVDnl/LOVD3
 }
 if (!lovd_error()) {
     if (isset($_GET['confirm'])) {
         // User had to enter his/her password for authorization.
         if (!lovd_verifyPassword($_POST['password'], $_AUTH['password'])) {
             lovd_errorAdd('password', 'Please enter your correct password for authorization.');
         }
         if (!lovd_error()) {
             // First, make the current user curator for the genes about to be abandoned by this user.
             $_DB->beginTransaction();
             if ($aCuratedGenes) {
                 $_DB->query('UPDATE ' . TABLE_CURATES . ' SET userid = ? WHERE userid = ? AND geneid IN (?' . str_repeat(', ?', count($aCuratedGenes) - 1) . ')', array_merge(array($_AUTH['id'], $nID), $aCuratedGenes));
             }
             // Query text.
             // This also deletes the entries in TABLE_CURATES.
             $_DATA->deleteEntry($nID);
             $_DB->commit();
             // Write to log...
             lovd_writeLog('Event', LOG_EVENT, 'Deleted user ' . $nID . ' - ' . $zData['username'] . ' (' . $zData['name'] . ') - with level ' . $_SETT['user_levels'][$zData['level']]);
             // Thank the user...
             header('Refresh: 3; url=' . lovd_getInstallURL() . $_PE[0]);
             $_T->printHeader();
             $_T->printTitle();
             lovd_showInfoTable('Successfully deleted the user account!', 'success');
             $_T->printFooter();
             exit;
         } else {
             // Because we're sending the data back to the form, I need to unset the password fields!
             unset($_POST['password']);
         }
     } else {