Exemple #1
0
/**
 * First method to call when using the lib_acl
 * @param string $netid the user's netID
 * @return bool error status
 */
function acl_init($netid)
{
    // initializing ezmam (we'll need it later)
    global $repository_path;
    ezmam_repository_path($repository_path);
    // Retrieving the permissions
    acl_update_permissions_list();
    // All is set, we're good to go
    return true;
}
Exemple #2
0
/**
 * Move an album token up and down
 * @global type $input
 * @global type $repository_path
 * @global type $user_files_path
 */
function album_token_move()
{
    global $input;
    global $repository_path;
    global $user_files_path;
    $album = $input['album'];
    $index = (int) $input['index'];
    $upDown = $input['up_down'];
    $new_index = $upDown == 'up' ? $index - 1 : $index + 1;
    ezmam_repository_path($repository_path);
    user_prefs_repository_path($user_files_path);
    user_prefs_token_swap($_SESSION['user_login'], $index, $new_index);
    acl_update_permissions_list();
    log_append('moved_album_token', 'album token moved from ' . $index . ' to ' . $new_index);
    // lvl, action, album, index_src, index_dest
    trace_append(array('1', 'album_token_move', $album, $index, $new_index));
    view_main(false);
}
Exemple #3
0
function album_delete()
{
    global $input;
    global $repository_path;
    //
    // Sanity checks
    //
    if (!isset($input['album']) || !acl_has_album_permissions($input['album'])) {
        error_print_message(template_get_message('Unauthorized', get_lang()));
        log_append('warning', 'view_asset_details: tried to access album ' . $input['album'] . ' without permission');
        die;
    }
    //
    // The only important thing to do right now is delete both the public and private albums,
    // by calling ezmam
    //
    ezmam_repository_path($repository_path);
    // Deletes the table of contents (EZcast Player)
    toc_album_bookmarks_delete_all($input['album'] . '-priv');
    $res = ezmam_album_delete($input['album'] . '-priv');
    if (!$res) {
        error_print_message(ezmam_last_error());
        die;
    }
    toc_album_bookmarks_delete_all($input['album'] . '-pub');
    $res = ezmam_album_delete($input['album'] . '-pub');
    if (!$res) {
        error_print_message(ezmam_last_error());
        die;
    }
    //
    // Don't forget to update the albums list
    //
    acl_update_permissions_list();
    unset($_SESSION['podman_album']);
    //
    // Finally, we display a nice confirmation message to the user
    //
    require_once template_getpath('popup_album_successfully_deleted.php');
}