Beispiel #1
0
/**
 * Assigns the videoinfos to the smarty engine
 */
function tpl_studioedit($studio)
{
    global $smarty, $config, $lang;
    // create a form ready quoted version for each value
    foreach (array_keys($video) as $key) {
        $video['q_' . $key] = formvar($video[$key]);
    }
    // use custom function for language
    $video['f_language'] = custom_language_input('language', $video['language']);
    // create mediatype selectbox
    $smarty->assign('mediatypes', out_mediatypes());
    if (!isset($video['mediatype'])) {
        $video['mediatype'] = $config['mediadefault'];
    }
    // prepare the custom fields
    customfields($video, 'in');
    if ($config['multiuser']) {
        $smarty->assign('owners', out_owners(array('0' => ''), check_permission(PERM_ADMIN) ? false : PERM_WRITE, true));
    }
    // item genres
    $item_genres = getItemGenres($video['id']);
    // new-style
    $smarty->assign('genres', out_genres2($item_genres));
    #dlog(out_genres2($item_genres));
    #dlog($item_genres);
    // classic
    $smarty->assign('genreselect', out_genres($item_genres));
    //2015-10-6 Alex ADD start
    // item studios
    $item_studios = getItemStudios($video['id']);
    // new-style
    $smarty->assign('studios', out_studios2($item_studios));
    // classic
    $smarty->assign('studioselect', out_studios($item_studios));
    //2015-10-6 Alex ADD end
    // assign data
    $smarty->assign('video', $video);
    // get drilldown url for visit link
    if ($video['imdbID']) {
        require_once './engines/engines.php';
        $engine = engineGetEngine($video['imdbID']);
        $smarty->assign('link', engineGetContentUrl($video['imdbID'], $engine));
        $smarty->assign('engine', $engine);
    }
    /*
        // populate autocomplete boxes
        $smarty->assign('audio_codecs', array_extract(runSQL('SELECT DISTINCT audio_codec FROM '.TBL_DATA.' WHERE audio_codec IS NOT NULL'), 'audio_codec'));
        $smarty->assign('video_codecs', array_extract(runSQL('SELECT DISTINCT video_codec FROM '.TBL_DATA.' WHERE video_codec IS NOT NULL'), 'video_codec'));
    */
    $smarty->assign('lookup', array('0' => $lang['radio_look_ignore'], '1' => $lang['radio_look_lookup'], '2' => $lang['radio_look_overwrite']));
    // needed for ajax image lookup
    $smarty->assign('engines', $config['engines']);
}
Beispiel #2
0
}
// allow XML export
if (isset($q)) {
    $link = htmlentities($_SERVER['QUERY_STRING']);
    // encode for XHTML compliance
    if ($link) {
        $link .= '&';
    }
    $link = 'search.php?' . $link;
    if ($config['xls']) {
        $smarty->assign('xls', $link);
    }
    if ($config['xml']) {
        $smarty->assign('xml', $link);
    }
    if ($config['pdf']) {
        $smarty->assign('pdf', $link);
    }
}
if ($config['multiuser']) {
    $smarty->assign('owners', out_owners(array($all => $all), PERM_READ));
    $smarty->assign('owner', $owner);
}
// display templates
smarty_display('header.tpl');
if (!$config['http_caching']) {
    flush();
}
smarty_display('search.tpl');
smarty_display('list.tpl');
smarty_display('footer.tpl');
Beispiel #3
0
        foreach ($lang_ary as $numid => $lang) {
            // take care of english vs. English
            $lang = ucwords($lang);
            $templangs[$lang]['language'] = $lang;
            $templangs[$lang]['count'] += $val['count'];
        }
    }
    usort($templangs, 'compare_count');
    return $templangs;
}
if ($config['multiuser']) {
    // get owner from session- or use current user
    session_default('owner', get_username(get_current_user_id()));
    // build html select box
    $all = strtoupper($lang['radio_all']);
    $smarty->assign('owners', out_owners(array($lang['filter_any'] => $lang['filter_any']), PERM_READ));
    $smarty->assign('owner', $owner);
    // further limit to single owner
    if ($owner == $lang['filter_any']) {
        $WHERES .= " AND owner_id IN (" . get_owner_ids(PERM_READ) . ")";
    } else {
        $WHERES .= " AND owner_id = '" . get_userid($owner) . "'";
    }
}
// Don't count movies which are on the wishlist
$WHERES .= ' AND mediatype != ' . MEDIA_WISHLIST;
$result = runSQL('SELECT COUNT(*) AS count FROM ' . TBL_DATA . ' WHERE 1=1' . $WHERES);
$stats['count_all'] = $result[0]['count'];
$result = runSQL('SELECT COUNT(*) AS count FROM ' . TBL_DATA . ' WHERE istv = 1' . $WHERES);
$stats['count_tv'] = $result[0]['count'];
$result = runSQL('SELECT DISTINCT diskid FROM ' . TBL_DATA . ' WHERE 1=1' . $WHERES);
Beispiel #4
0
// random view
if (empty($id)) {
    $count = 0;
    $all = strtoupper($lang['radio_all']);
    $WHERES = '';
    if ($config['multiuser']) {
        // explicit setting of owner
        $owner = session_get('owner');
        if ($owner && $owner == $all || check_permission(PERM_READ, $uid = get_userid($owner))) {
            if ($owner == $all) {
                $uid = -1;
            }
            $owner_id = $uid;
        } elseif (check_permission(PERM_READ, get_current_user_id())) {
            $owner_id = get_current_user_id();
        } elseif (count($owners = out_owners(false, PERM_READ, true)) == 1) {
            // check if there is only one owner available
            $owners = array_keys($owners);
            $owner_id = $owners[0];
        } else {
            // help! take ALL
            $owner_id = -1;
        }
        session_set('owner', $owner_id && $owner_id >= 0 ? get_username($owner_id) : $all);
        // if we don't have read all permissions, limit visibility using cross-user permissions
        if (!check_permission(PERM_READ)) {
            $JOINS = ' LEFT JOIN ' . TBL_PERMISSIONS . ' ON ' . TBL_DATA . '.owner_id = ' . TBL_PERMISSIONS . '.to_uid';
            $WHERES .= ' AND ' . TBL_PERMISSIONS . '.from_uid = ' . get_current_user_id() . ' AND ' . TBL_PERMISSIONS . '.permissions & ' . PERM_READ . ' != 0';
        }
        // further limit to single owner
        if ($owner_id > 0) {
 * transfer ownerless to moves to one user
 *
 * @package Contrib
 * @author  Chinamann <*****@*****.**>
 * 
 * @meta	ACCESS:PERM_ADMIN
 */
// move out of contrib for includes
chdir('..');
require_once './core/functions.php';
require_once './core/output.php';
// check for localnet
localnet_or_die();
// multiuser permission check
permission_or_die(PERM_ADMIN);
$owners = out_owners(null, 0, true);
if (empty($owner_id)) {
    $owner_id = $_COOKIE['VDBuserid'];
}
if ($convert) {
    runSQL("UPDATE " . TBL_DATA . "\n               SET owner_id = " . $owner_id . "\n             WHERE owner_id = 0");
    // show the saved movie
    header('Location: ../index.php');
    exit;
} else {
    ?>

<html>

<head>
    <title>Transfer ownerless movies to a user</title>
Beispiel #6
0
                                        $perm['read']   = 0;
                                        $perm['write']  = 0;
                                    } 
                                    else 
                                    {
                                        // update
                                        $newperm = PERM_READ * getStateOfCheckbox('readflag_'.$perm['to_uid']) +
                                                   PERM_WRITE * getStateOfCheckbox('writeflag_'.$perm['to_uid']);
                                        $UPDATE = "UPDATE ".TBL_PERMISSIONS." SET permissions=".$newperm." WHERE from_uid=".$from_uid." AND to_uid=".$perm['to_uid'];
                                        runSQL($UPDATE);
                                        $perm['read']   = getStateOfCheckbox('readflag_'.$perm['to_uid']);
                                        $perm['write']  = getStateOfCheckbox('writeflag_'.$perm['to_uid']);
                                    }
                                }
                */
            }
            // clear permission cache
            clear_permission_cache();
        }
        $permlist[] = $perm;
    }
}
// prepare templates
tpl_page();
$smarty->assign('permlist', $permlist);
//$smarty->assign('from_name', $permlist[0]['from_name']);
$smarty->assign('from_uid', $permlist[0]['from_uid']);
$smarty->assign('owners', out_owners(false, false, true));
$smarty->assign('message', $message);
// display templates
tpl_display('permissions.tpl');