. */ require_once dirname(__FILE__) . "/../include/include.php"; admin_header(true); if( !in_array("body_resetpassword", $_SESSION['sess_functions']) ) { echoln("You are not authorized to see this page."); }else { if( isset($_POST['confirm'] ) ) { // Remove password if( $GLOBALS['DB']->update("ab_bodies", $_POST['bodycode'], array("password" => NULL), "bodycode") ) { echoln("Successfully removed the password of ".$_POST['bodycode']."."); echoln(""); }else { echoln("Failed removing the password of ".$_POST['bodycode']."."); } echoln("
Close window"); }else { // Ask for confirmation $queryBuilder = new QueryBuilder($GLOBALS['DB'], "ab_bodies"); $queryBuilder->addField(array("bodycode", "bodyname", "email", "password")); $queryBuilder->addWhereEquals("bodycode", $_GET['bodycode']); if( $GLOBALS['DB']->select($queryBuilder->toQuery()) == 1 ) { $row = $GLOBALS['DB']->fetchAssoc(); if( strlen($row['password']) == 32 ) { echoln("Are you sure you want to delete the password for " . $row['bodyname'] . " (" . $row['bodycode'] . ")?"); echoln("
"); echoln("Note: a new password will be send to the official e-mail address of the body (current set to ".$row['email'].", but this will be reloaded from the main IT system before the password is send) within 24 hours. Deletion is immediate though."); }else { echoln("Cannot reset password for ".$row['bodyname'].""); echoln("
There is no password set for this body."); echoln("
Close window"); } }else { echoln("The password cannot be reset as this body does not exist."); } } } admin_footer(true); ?>