Commit cc0d0eb3 authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Added admin tool for joining users

parent 377e18e4
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -68,6 +68,10 @@ class UserHandler {
        $userId1 = $user1->id;
        $userId1 = $user1->id;
        $userId2 = $user2->id;
        $userId2 = $user2->id;


        if ($userId1 === $userId2) {
            return $user1;
        }

        // Call Grouper for moving groups and privileges from one user to the other
        // Call Grouper for moving groups and privileges from one user to the other
        if (isset($this->locator->config->gms)) {
        if (isset($this->locator->config->gms)) {


+1 −2
Original line number Original line Diff line number Diff line
@@ -31,8 +31,7 @@ class ShibbolethLogin extends LoginHandler {
                        $identity->eppn = $eppn;
                        $identity->eppn = $eppn;
                    });
                    });
        } else {
        } else {
            http_response_code(500);
            throw new ServerErrorException("Shib-Session-ID not found!");
            die("Shib-Session-ID not found!");
        }
        }
    }
    }


css/animation.css

deleted100644 → 0
+0 −151
Original line number Original line Diff line number Diff line
@charset "UTF-8";
/*
   Animation example, for spinners
*/
.animate-spin {
    -moz-animation: spin 2s infinite linear;
    -o-animation: spin 2s infinite linear;
    -webkit-animation: spin 2s infinite linear;
    animation: spin 2s infinite linear;
    display: inline-block;
}
@-moz-keyframes spin {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -moz-transform: rotate(359deg);
        -o-transform: rotate(359deg);
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
@-webkit-keyframes spin {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -moz-transform: rotate(359deg);
        -o-transform: rotate(359deg);
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
@-o-keyframes spin {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -moz-transform: rotate(359deg);
        -o-transform: rotate(359deg);
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
@-ms-keyframes spin {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -moz-transform: rotate(359deg);
        -o-transform: rotate(359deg);
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}
@keyframes spin {
    0% {
        -moz-transform: rotate(0deg);
        -o-transform: rotate(0deg);
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -moz-transform: rotate(359deg);
        -o-transform: rotate(359deg);
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}

/*!
 * animate.css -http://daneden.me/animate
 * Version - 3.5.2
 * Licensed under the MIT license - http://opensource.org/licenses/MIT
 *
 * Copyright (c) 2017 Daniel Eden
 */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animated.infinite {
    animation-iteration-count: infinite;
}

.animated.hinge {
    animation-duration: 2s;
}

.animated.flipOutX,
.animated.flipOutY,
.animated.bounceIn,
.animated.bounceOut {
    animation-duration: .75s;
}


@keyframes bounceIn {
    from, 20%, 40%, 60%, 80%, to {
        animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    }

    0% {
        opacity: 0;
        transform: scale3d(.3, .3, .3);
    }

    20% {
        transform: scale3d(1.1, 1.1, 1.1);
    }

    40% {
        transform: scale3d(.9, .9, .9);
    }

    60% {
        opacity: 1;
        transform: scale3d(1.03, 1.03, 1.03);
    }

    80% {
        transform: scale3d(.97, .97, .97);
    }

    to {
        opacity: 1;
        transform: scale3d(1, 1, 1);
    }
}

.bounceIn {
    animation-name: bounceIn;
}
 No newline at end of file
+4 −0
Original line number Original line Diff line number Diff line
@@ -108,6 +108,10 @@ body {
    font-size: 42px;
    font-size: 42px;
}
}


.page-title-wrapper a {
    color: #fff;
}

#main-footer-wrapper {
#main-footer-wrapper {
    position: fixed;
    position: fixed;
    bottom: 0;
    bottom: 0;
+50 −2
Original line number Original line Diff line number Diff line
@@ -25,9 +25,57 @@ function checkUser() {
Flight::route('GET /admin', function() {
Flight::route('GET /admin', function() {
    checkUser();
    checkUser();


    global $VERSION;
    global $locator;
    Flight::render('admin/index.php', array('title' => 'Admin panel',
    Flight::render('admin/index.php', array('title' => 'Admin panel',
        'version' => $VERSION));
        'version' => $locator->getVersion(),
        'contextRoot' => $locator->config->contextRoot));
});

Flight::route('GET /admin-join', function() {
    checkUser();

    global $locator;
    Flight::render('admin/join.php', array('title' => 'Admin panel - Join users',
        'version' => $locator->getVersion(),
        'contextRoot' => $locator->config->contextRoot));
});

Flight::route('POST /admin-join', function() {
    checkUser();

    global $locator;

    $user1Id = filter_input(INPUT_POST, 'user1', FILTER_SANITIZE_STRING);
    $user2Id = filter_input(INPUT_POST, 'user2', FILTER_SANITIZE_STRING);

    if ($user1Id === null) {
        throw new \RAP\BadRequestException("Missing parameter user1");
    }
    if ($user2Id === null) {
        throw new \RAP\BadRequestException("Missing parameter user2");
    }

    $dao = $locator->getUserDAO();
    $user1 = $dao->findUserById($user1Id);
    $user2 = $dao->findUserById($user2Id);

    $locator->getUserHandler()->joinUsers($user1, $user2);

    Flight::redirect($locator->getBasePath() . '/admin-join');
});

Flight::route('GET /admin-search', function() {
    checkUser();

    $searchText = Flight::request()->query['query'];
    if ($searchText === null) {
        throw new \RAP\BadRequestException("Missing query parameter");
    }

    global $locator;
    $users = $locator->getUserDAO()->searchUser($searchText);

    Flight::json($users);
});
});


Flight::route('GET /admin/oauth2_clients', function() {
Flight::route('GET /admin/oauth2_clients', function() {
Loading