$_T->printHeader(); $_T->printTitle('Uninstall LOVD'); // Require DB admin clearance. lovd_requireAUTH(LEVEL_ADMIN); // If we've gotten this far, we apparently have/had an config, status and user // table. This should suffice to uninstall LOVD even if we don't have a working // installation. // Uninstall lock set? if (isset($_CONF['lock_uninstall']) && $_CONF['lock_uninstall']) { // Sorry, can't remove LOVD... lovd_showInfoTable('Can\'t uninstall LOVD - Uninstall lock in place.', 'warning'); $_T->printFooter(); exit; } 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";
function lovd_errorAdd($sField, $sError) { // Based on a function provided by Ileos.nl in the interest of Open Source. // Add error to error variable. global $_ERROR; // Initialize the error array, if it hasn't been initialized yet. if (empty($_ERROR)) { lovd_errorClean(); } $sError = trim($sError); if (strlen($sError)) { $_ERROR['messages'][] = $sError; } $_ERROR['fields'][] = $sField; }