示例#1
0
         $img->setNamespace($_GET['namespace']);
     }
     $img->show();
     // Outputs the image and content headers to the browser
     exit(0);
 case 'sendNewPassword':
     $authService = Core_AuthService::getAuthService();
     if ($authService->isBanned() == FALSE) {
         $image = new Securimage();
         if ($image->check($_POST['captcha']) == TRUE) {
             // Good captcha
             if (isset($_POST['username']) && isset($_POST['email'])) {
                 $json = $loginController->sendNewPassword($_POST['username'], $_POST['email'], TRUE);
                 if ($json['success'] === TRUE) {
                     // Notification
                     bgp_set_alert(T_('Your password has been reset and emailed to you.'), NULL, 'success');
                 }
                 Flight::json($json);
             } else {
                 Flight::redirect('/400');
             }
         } else {
             // Bad captcha
             if (isset($_POST['username']) && isset($_POST['email'])) {
                 $json = $loginController->sendNewPassword($_POST['username'], $_POST['email'], FALSE);
                 Flight::json($json);
             } else {
                 Flight::redirect('/400');
             }
         }
     } else {
示例#2
0
            $_POST['remoteUserHome'] = '';
        }
        if (!isset($_POST['steamcmd'])) {
            $_POST['steamcmd'] = '';
        }
        if (!isset($_POST['notes'])) {
            $_POST['notes'] = '';
        }
        // Call method ===========================================================================
        $return = $controller->postBox($_POST['name'], $_POST['os'], $_POST['ip'], $_POST['port'], $_POST['login'], $_POST['password'], $_POST['remoteUserHome'], $_POST['steamcmd'], $_POST['notes']);
        $return = json_decode($return['data'], TRUE);
        // User notification =====================================================================
        $data['errors'] = $return['errors'];
        if (!empty($data['errors'])) {
            $data['success'] = false;
            // Notification
            $data['msgType'] = 'warning';
            $data['msg'] = T_('Bad Options!');
        } else {
            $data['success'] = true;
            // Notification
            bgp_set_alert(T_('Box Added Successfully!'), NULL, 'success');
        }
        // Return ================================================================================
        header('Content-Type: application/json');
        echo json_encode($data);
        exit(0);
    default:
        Flight::redirect('/400');
}
Flight::redirect('/403');
示例#3
0
        foreach ($_POST as $key => $value) {
            if ($key == 'task') {
                continue;
            }
            unset($_POST[$key]);
            $key = camelToUnderscore($key);
            $_POST[$key] = $value;
        }
        // Call method ===========================================================================
        $return = $controller->updateSysConfigCollection(json_encode($_POST));
        $return = json_decode($return['data'], TRUE);
        // User notification =====================================================================
        $data['errors'] = $return['errors'];
        if (!empty($data['errors'])) {
            $data['success'] = false;
            // Notification
            $data['msgType'] = 'warning';
            $data['msg'] = T_('Bad Settings!');
        } else {
            $data['success'] = true;
            // Notification
            bgp_set_alert(T_('Settings Updated Successfully!'), NULL, 'success');
        }
        // Return ================================================================================
        header('Content-Type: application/json');
        echo json_encode($data);
        exit(0);
    default:
        Flight::redirect('/400');
}
Flight::redirect('/403');
示例#4
0
    }
}
// Call the method
switch ($task) {
    case 'optimizeDB':
        $data = array();
        $data['success'] = true;
        $data['errors'] = array();
        // Call method ===========================================================================
        $return = $controller->optimizeDB();
        $return = json_decode($return['data'], TRUE);
        // User notification =====================================================================
        $data['errors'] = $return['errors'];
        if (!empty($data['errors'])) {
            $data['success'] = false;
            // Notification
            $data['msgType'] = 'warning';
            $data['msg'] = T_('Bad Settings!');
        } else {
            $data['success'] = true;
            // Notification
            bgp_set_alert(T_('Optimizing tables... Done!'), T_('Tables are up to date.'), 'success');
        }
        // Return ================================================================================
        header('Content-Type: application/json');
        echo json_encode($data);
        exit(0);
    default:
        Flight::redirect('/400');
}
Flight::redirect('/403');