Example #1
0
         $loggers['audit']->info("User activated (username: {$_POST['user_name']})");
         echo 'success';
     } else {
         $loggers['audit']->notice("Failed to activate user (username: {$_POST['user_name']})");
         echo 'failure';
     }
 } else {
     if ($_GET['page'] === 'reset_pass') {
         if (isset($_POST['new'])) {
             header('Content-Type: text/plain');
             echo $pro->updatePassword($_POST['username'], $_POST['new']);
             $loggers['audit']->info("Password reset completed for user {$_POST['username']}");
             exit;
         }
         if (isset($_POST['user_name'])) {
             $mail = $pro->generatePasswordResetLink($_POST['user_name']);
             if ($mail) {
                 $loggers['audit']->info("Initiated password reset for user {$_POST['user_name']}");
                 echo 'success';
             } else {
                 $loggers['audit']->notice("Failed to initiate password reset for user {$_POST['user_name']}");
                 echo 'query failed or link not mailed';
             }
         } else {
             echo 'no user name';
         }
     } else {
         if ($_GET['page'] === 'resetpass-page') {
             $l10n->addResource(__DIR__ . '/l10n/reset-password.json');
             require 'views/reset-password.php';
         } else {