Esempio n. 1
0
function getBoardPermissions($boardid)
{
    // Get specific permissions for a specific board. All is done from the cache.
    global $yakbb;
    $boardid = intval($boardid);
    $perms = loadBoardData($boardid);
    $perms = unserialize($perms["permissions"]);
    // Get permissions
    if (empty($perms) || !isset($perms[$yakbb->user["group"]])) {
        return array("view" => false, "create_thread" => false, "create_poll" => false, "post_reply" => false, "add_attachment" => false, "download_attachment" => false);
    } else {
        return $perms[$yakbb->user["group"]];
    }
}
Esempio n. 2
0
            $subject = 'TaskBoard: New board created!';
            $recipient = $user->username;
            $email = $user->email;
            sendEmail($email, $recipient, $subject, $body);
        }
    }
    $app->response->setBody($jsonResponse->asJson());
});
// Update existing board.
$app->post('/boards/update', function () use($app, $jsonResponse) {
    $data = json_decode($app->environment['slim.input']);
    if (validateToken(true)) {
        $board = R::load('board', $data->boardId);
        if ($board->id) {
            $before = $board->export();
            loadBoardData($board, $data);
            $jsonResponse->addAlert('success', 'Board ' . $board->name . ' edited.');
            $actor = getUser();
            logAction($actor->username . ' updated board ' . $board->name, $before, $board->export());
        }
        $jsonResponse->addBeans(getBoards());
        foreach ($board->sharedUser as $user) {
            $body = getEditBoardEmailBody($board->id, $user->username, $board->name);
            $subject = 'TaskBoard: Board updated!';
            $recipient = $user->username;
            $email = $user->email;
            sendEmail($email, $recipient, $subject, $body);
        }
    }
    $app->response->setBody($jsonResponse->asJson());
});