Example #1
0
                                $result = databaseAddService($account_id, $_POST['name'], $_POST['description'], $_POST['identifier']);
                                if (is_integer($result)) {
                                    setServiceParam($result, "due", $_POST['due']);
                                    setServiceParam($result, "price", $_POST['price']);
                                    $message = "Database service has been setup successfully. Note that the database settings and tables are not automatically configured and created. Create the database manually, set the database settings by clicking on the service and setting parameters, and then setup the tables there as well.";
                                } else {
                                    header("Location: account.php?id={$account_id}&message=" . urlencode("Error occurred while setting up database."));
                                }
                            }
                        }
                    }
                }
            }
        } else {
            if ($_POST['action'] == "delete" && isset($_POST['delete_id'])) {
                removeService($_POST['delete_id']);
                $message = "The service has been removed. Note that no service-related files or databases have been erased.";
            }
        }
        if (!isset($_SESSION['noredirect'])) {
            header("Location: account.php?id={$account_id}&message=" . urlencode($message));
        }
    }
    //account info
    $info = adminGetAccount($account_id);
    //services
    $services = getServices($account_id);
    $serviceExtra = getServiceExtra($services);
    //display
    get_page("account", "admin", array('id' => $account_id, 'info' => $info, 'services' => $services, 'serviceExtra' => $serviceExtra, 'message' => $message));
} else {
Example #2
0
     //if the user is adding the service, then add it
     if (isset($_POST['addData'])) {
         addServiceType($serviceType);
     } else {
         addServiceTypeForm($services);
     }
 } else {
     if ($_GET['action'] == remove && $_SESSION['access'] >= 50) {
         //remove a port
         if (isset($_GET['portID'])) {
             $servicePort = new Layer2_service_port($_GET['portID']);
             removeService($servicePort);
         } else {
             //get the service ID and remove that
             $services = new Service($_GET['ID']);
             removeService($services);
         }
     } else {
         if ($_GET['action'] == removeServiceType && $_SESSION['access'] >= 50) {
             $serviceType = new ServiceType($_GET['ID']);
             removeServiceType($serviceType);
         } else {
             if ($_GET['action'] == showAllServiceTypes) {
                 displayAllServiceTypes();
             } else {
                 if ($_GET['action'] == showArchived) {
                     displayAllArchived($services);
                 } else {
                     displayAll($services);
                 }
             }