} $aGenes = array_unique($aGenes); $nGenes = count($aGenes); lovd_writeLog('Event', LOG_EVENT, 'Imported ' . $sMessage . '; ran ' . $nDone . ' queries' . (!$aGenes ? '' : ' (' . ($nGenes > 100 ? $nGenes . ' genes' : implode(', ', $aGenes)) . ')') . '.'); lovd_setUpdatedDate($aGenes); } // FIXME: Why is this not empty? //var_dump(implode("\n", $aData)); $_T->printFooter(); exit; } // Errors... $_BAR[0]->remove(); $_BAR[0]->setMessageVisibility('', false); $_BAR[0]->setMessageVisibility('done', false); if (!lovd_error() && !$nDataTotal) { if ($sMode == 'update') { lovd_showInfoTable('No entries found that can be updated via the import file.', 'stop'); } if ($sMode == 'insert') { lovd_showInfoTable('No entries found that need to be imported in the database. Either your uploaded file contains no variants, or all entries are already in the database.', 'stop'); } $_T->printFooter(); exit; } } } else { // Default values. if (in_array(ACTION, array_keys($aModes))) { $_POST['mode'] = ACTION; }
} if (!empty($_POST)) { lovd_errorClean(); if (!isset($_GET['confirm'])) { // Check password. if (!lovd_verifyPassword($_POST['password'], $_AUTH['password'])) { lovd_errorAdd('password', 'Please enter your correct password for authorization.'); } } if (!lovd_error()) { if (isset($_GET['confirm'])) { // Check password. if (!lovd_verifyPassword($_POST['password'], $_AUTH['password'])) { lovd_errorAdd('password', 'Please enter your correct password for authorization.'); } if (!lovd_error()) { // OK, uninstall the lot. print ' <B>Uninstalling LOVD...</B><BR>' . "\n" . ' <BR>' . "\n\n"; require ROOT_PATH . 'class/progress_bar.php'; // This already puts the progress bar on the screen. $_BAR = new ProgressBar('', 'Initiating removal of LOVD...'); $_T->printFooter(false); // The false prevents the footer to actually close the <BODY> and <HTML> tags. // Now we're still in the <BODY> so the progress bar can add <SCRIPT> tags as much as it wants. flush(); // The reason to invert the tables is to handle all foreign key constraints nicely. $aTables = array_reverse($_TABLES); $nTables = count($aTables); $_BAR->setMessage('Removing data tables...'); // Actually run the SQL... $nSQLDone = 0;
$_SESSION['password_force_change'] = true; } // Check if referer is given, check it, then forward the user. if (!empty($_POST['referer'])) { // Location is within this LOVD installation. $sLocation = $_POST['referer']; } else { // Redirect to proper location will be done somewhere else in this code. $sLocation = lovd_getInstallURL() . 'login'; } header('Location: ' . $sLocation); exit; } } // The bad logins end up here! if (!$zUser || !lovd_error() && !lovd_verifyPassword($_POST['password'], $zUser['password'])) { lovd_writeLog('Auth', 'AuthError', $_SERVER['REMOTE_ADDR'] . ' (' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . ') tried logging in using ' . $_POST['username'] . '/' . str_repeat('*', strlen($_POST['password']))); lovd_errorAdd('', 'Invalid Username/Password combination.'); // This may not actually update (user misspelled his username) but we can call the query anyway. if ($_CONF['lock_users']) { $_DB->query('UPDATE ' . TABLE_USERS . ' SET login_attempts = login_attempts + 1 WHERE username = ? AND level < ' . LEVEL_ADMIN, array($_POST['username']), false); } // Check if the user is locked, now. if ($zUser && $zUser['login_attempts'] >= 3 - 1) { lovd_errorAdd('password', 'Your account is now locked, since this is the third time a wrong password was provided.'); } // The "Forgot my password" option. if ($_CONF['allow_unlock_accounts']) { lovd_errorAdd('', 'Did you <A href="reset_password">forget your password</A>?'); } }