Пример #1
0
 * @author Andreas Goetz <*****@*****.**>
 */
function removeCacheFile($url)
{
    // get extension
    if (preg_match("/\\.(jpe?g|gif|png)\$/i", $url, $matches)) {
        // check if file exists
        if (cache_file_exists($url, $cache_file, CACHE_IMG, $matches[1])) {
            @unlink($cache_file);
        }
    }
}
// check for localnet
localnet_or_die();
// multiuser permission check
permission_or_die(PERM_WRITE, get_owner_id($id));
/*
// remove old cover image from cache
$SQL = 'SELECT imgurl FROM '.TBL_DATA.' WHERE id = '.$id;
$res = runSQL($SQL);
if (count($res))
{
    removeCacheFile($res[0]['imgurl']);
}
*/
// remove actual data
runSQL('DELETE FROM ' . TBL_DATA . ' WHERE id = ' . $id);
runSQL('DELETE FROM ' . TBL_VIDEOGENRE . ' WHERE video_id = ' . $id);
//2015-10-6 Alex ADD start
runSQL('DELETE FROM ' . TBL_VIDEOSTUDIO . ' WHERE video_id = ' . $id);
//2015-10-6 Alex ADD end
Пример #2
0
 * @todo    Add error message for unknown genres
 *
 * @package videoDB
 * @author  Andreas Gohr <*****@*****.**>
 * @author  Chinamann <*****@*****.**>
 * @version $Id: edit.php,v 2.90 2013/03/11 19:00:26 andig2 Exp $
 */
require_once './core/functions.php';
require_once './core/genres.php';
require_once './core/custom.php';
require_once './core/edit.core.php';
require_once './engines/engines.php';
// check for localnet
localnet_or_die();
// multiuser permission check
permission_or_die(PERM_WRITE, $id ? get_owner_id($id) : PERM_ANY);
// clean input data
$genres = is_array($genres) ? array_filter($genres) : array();
// ajax autocomplete?
if ($ajax_prefetch_id || $ajax_autocomplete_title || $ajax_autocomplete_subtitle) {
    // add some delay for debugging
    if ($config['debug'] && $_SERVER['SERVER_ADDR'] == '127.0.0.1') {
        usleep(rand(200, 1000) * 1000);
    }
    // prefetch external data
    if ($ajax_prefetch_id) {
        $data = engineGetData($ajax_prefetch_id, engineGetEngine($ajax_prefetch_id));
        if (count($data)) {
            $data['imdbID'] = $ajax_prefetch_id;
            $data['actors'] = $data['cast'];
            $data['imgurl'] = $data['coverurl'];
Пример #3
0
    // add some delay for debugging
    if ($config['debug'] && $_SERVER['SERVER_ADDR'] == '127.0.0.1') {
        usleep(rand(200, 1000) * 1000);
    }
    if (isset($seen)) {
        set_userseen($ajax_update, $seen);
        header('X-JSON: ' . json_encode(array('result' => $seen > 0)));
    } elseif (isset($rating)) {
        // Permission check same as edit.php
        // check for localnet
        localnet_or_die();
        // multiuser permission check
        if (empty($id)) {
            permission_or_die(PERM_WRITE);
        } else {
            permission_or_die(PERM_WRITE, get_owner_id($ajax_update));
        }
        runSQL('UPDATE ' . TBL_DATA . ' SET rating=' . $rating . ' WHERE id=' . $ajax_update);
    }
    // make sure no artifacts
    $smarty->clearCache('list.tpl');
    exit;
}
// random view
if (empty($id)) {
    $count = 0;
    $all = strtoupper($lang['radio_all']);
    $WHERES = '';
    if ($config['multiuser']) {
        // explicit setting of owner
        $owner = session_get('owner');
Пример #4
0
/**
 * Checks if the logged in user has write permissions for the given video
 *
 * @author Chinamann <*****@*****.**>
 * @param  integer $perm USER PERMISSIONS
 * @param  integer $id   VideoID
 * @return boolean
 */
function check_videopermission($perm, $id)
{
    return check_permission($perm, get_owner_id($id));
}
Пример #5
0
 * Handles lending of disks
 *
 * @package videoDB
 * @author  Andreas Gohr <*****@*****.**>
 * @version $Id: borrow.php,v 2.21 2013/03/10 16:20:10 andig2 Exp $
 */
require_once './core/functions.php';
require_once './core/output.php';
// check for localnet
localnet_or_die();
// permission check
permission_or_die(PERM_WRITE, PERM_ANY);
// borrowmanagement for single disk
$editable = false;
if (!empty($diskid)) {
    if (check_permission(PERM_WRITE, get_owner_id($diskid, true))) {
        $editable = true;
        if ($return) {
            $SQL = "DELETE FROM " . TBL_LENT . " WHERE diskid = '" . addslashes($diskid) . "'";
            runSQL($SQL);
        }
        if (!empty($who)) {
            $who = addslashes($who);
            $SQL = "INSERT INTO " . TBL_LENT . " SET who = '" . addslashes($who) . "', diskid = '" . addslashes($diskid) . "'";
            runSQL($SQL);
        }
        $SQL = "SELECT who, DATE_FORMAT(dt,'%d.%m.%Y') AS dt \n                     FROM " . TBL_LENT . " \n                    WHERE diskid = '" . addslashes($diskid) . "'";
        $result = runSQL($SQL);
        $who = $result[0]['who'];
        $dt = $result[0]['dt'];
    }