<?php

$logoutUri = $_POST["logoutUri"];
if ($logoutUri == "" || filter_var($logoutUri, FILTER_VALIDATE_URL)) {
    $tenantDomain = API::getTenantDomain();
    $settings = appStorage::getSettings($tenantDomain);
    $organization = json_decode($settings->getPropertyValue('organization'));
    $organization->logoutUri = $logoutUri;
    appStorage::setSettings($tenantDomain, ['organization' => json_encode($organization)]);
    $app->flash("success", "Your organization settings were successfuly updated!");
} else {
    $app->flash("error", "The logoutUri you entered isn't a valid URL.");
}
$app->redirect($app->request->getResourceUri());
Ejemplo n.º 2
0
<?php

$access = $_POST["access"];
$students = isset($_POST["students"]) ? $_POST["students"] : [];
$faculty = isset($_POST["faculty"]) ? $_POST["faculty"] : [];
$staff = isset($_POST["staff"]) ? $_POST["staff"] : [];
//validate that all are valid UUIDs
if ($access == "everyone") {
    $students = $faculty = $staff = [];
}
if (array_search($access, ["everyone", "groups"]) !== FALSE) {
    $tenantDomain = API::getTenantDomain();
    $settings = appStorage::getSettings($tenantDomain);
    appStorage::setSettings($tenantDomain, ['accessGroups' => json_encode(["students" => $students, "faculty" => $faculty, "staff" => $staff]), 'access' => $access]);
    $app->flash("success", "Your permissions were successfuly updated! If you changed permissions, please note that it may take up to 12 hours for users to see the application in their app launcher.");
} else {
    $app->flash("error", "Something went wrong! Please refresh the page and try again.");
}
$app->redirect($app->request->getResourceUri());
Ejemplo n.º 3
0
if (isset($_GET["admin_consent"])) {
    $tenantDomain = API::getTenantDomain();
    $settings = appStorage::getSettings($tenantDomain);
    $accessGroups = ['students' => [], 'faculty' => [], 'staff' => []];
    $webstore = ['account' => null, 'key' => null];
    $organization = ['logoutUri' => ""];
    $access = 'groups';
    if ($settings) {
        $accessGroups = json_decode($settings->getPropertyValue("accessGroups"));
        $webstore = json_decode($settings->getPropertyValue("webstore"));
        $organization = json_decode($settings->getPropertyValue("organization"));
        $access = $settings->getPropertyValue("access");
    }
    $setup = ['installed' => "1", 'access' => $access, 'accessGroups' => json_encode($accessGroups), 'webstore' => json_encode($webstore), 'organization' => json_encode($organization), 'adminConsent' => "1", 'version' => "1"];
    appStorage::setSettings($tenantDomain, $setup);
    $app->flash("success", "The application was successfuly set up in your tenant.");
    $app->redirect("/settings");
} else {
    $tenantDomain = API::getTenantDomain();
    $settings = appStorage::getSettings($tenantDomain);
    $installed = false;
    $adminConsent = false;
    if ($settings) {
        $installed = $settings->getPropertyValue("installed");
        $adminConsent = $settings->getPropertyValue("adminConsent");
    }
    if ($settings && $adminConsent) {
        $app->flash("warning", "The application is already installed in your tenant.");
        $app->redirect("/settings");
    } else {
Ejemplo n.º 4
0
<?php

$account = $_POST["account"];
$key = $_POST["key"];
if ($account && $key) {
    $tenantDomain = API::getTenantDomain();
    $settings = appStorage::getSettings($tenantDomain);
    $webstore = json_decode($settings->getPropertyValue('webstore'));
    $webstore->account = $account;
    $webstore->key = $key;
    appStorage::setSettings($tenantDomain, ['webstore' => json_encode($webstore)]);
    $app->flash("success", "Your Webstore settings were sucessfully updated!");
} else {
    $app->flash("error", "You have to fill out both your Webstore account number and key!");
}
$app->redirect($app->request->getResourceUri());