예제 #1
0
                $Sql->query_inject("DELETE FROM " . PREFIX . "media WHERE id = '" . $key . "'", __LINE__, __FILE__);
                $Sql->query_inject("DELETE FROM " . PREFIX . "com WHERE idprov = '" . $delete . "' AND script = 'media'", __LINE__, __FILE__);
            }
        }
        import('content/syndication/feed');
        Feed::clear_cache('media');
        $media_categories->recount_media_per_cat();
        redirect_confirm(url('moderation_media.php'), $MEDIA_LANG['moderation_success'], TIME_REDIRECT);
    } else {
        redirect(url('moderation_media.php'));
    }
} elseif (!empty($_GET['recount'])) {
    import('content/syndication/feed');
    Feed::clear_cache('media');
    $media_categories->recount_media_per_cat();
    redirect_confirm(url('moderation_media.php'), $MEDIA_LANG['recount_success'], TIME_REDIRECT);
} else {
    $array_cats = $js_array = array();
    if (!empty($_POST['filter'])) {
        $state = retrieve(POST, 'state', 'all', TSTRING);
        $cat = retrieve(POST, 'idcat', 0, TINTEGER);
        $sub_cats = retrieve(POST, 'sub_cats', false, TBOOL);
        if ($state == "visible") {
            $db_where = MEDIA_STATUS_APROBED;
        } elseif ($state == 'unvisible') {
            $db_where = MEDIA_STATUS_UNVISIBLE;
        } elseif ($state == 'unaprobed') {
            $db_where = MEDIA_STATUS_UNAPROBED;
        } else {
            $db_where = null;
        }
예제 #2
0
        $Sql->query_inject("INSERT INTO " . PREFIX . "media (idcat, iduser, timestamp, name, contents, url, mime_type, infos, width, height, users_note) VALUES ('" . $media['idcat'] . "', '" . $User->Get_attribute('user_id') . "', '" . time() . "', '" . $media['name'] . "', '" . strparse($media['contents']) . "', '" . $media['url'] . "', '" . $media['mime_type'] . "', " . "'" . ($User->check_auth($auth_cat, MEDIA_AUTH_WRITE) ? MEDIA_STATUS_APROBED : 0) . "', '" . $media['width'] . "', '" . $media['height'] . "', '')", __LINE__, __FILE__);
        $new_id_media = $Sql->insert_id("SELECT MAX(id) FROM " . PREFIX . "media");
        $media_categories->recount_media_per_cat($media['idcat']);
        import('content/syndication/feed');
        Feed::clear_cache('media');
        if (!$auth_write) {
            import('events/contribution');
            import('events/contribution_service');
            $media_contribution = new Contribution();
            $media_contribution->set_id_in_module($new_id_media);
            $media_contribution->set_description(stripslashes($media['counterpart']));
            $media_contribution->set_entitled(stripslashes(sprintf($MEDIA_LANG['contribution_entitled'], $media['name'])));
            $media_contribution->set_fixing_url('/media/media_action.php?edit=' . $new_id_media);
            $media_contribution->set_poster_id($User->get_attribute('user_id'));
            $media_contribution->set_module('media');
            $media_contribution->set_auth(Authorizations::capture_and_shift_bit_auth(Authorizations::merge_auth($MEDIA_CATS[0]['auth'], $media_categories->compute_heritated_auth($media['idcat'], MEDIA_AUTH_WRITE, AUTH_CHILD_PRIORITY), MEDIA_AUTH_WRITE, AUTH_CHILD_PRIORITY), MEDIA_AUTH_WRITE, CONTRIBUTION_AUTH_BIT));
            ContributionService::save_contribution($media_contribution);
            redirect(HOST . DIR . '/media/contribution.php?cat=' . $media['idcat']);
        } else {
            redirect_confirm('media' . url('.php?id=' . $new_id_media), $MEDIA_LANG['add_success'], TIME_REDIRECT);
        }
    } else {
        $Errorh->handler('e_auth', E_USER_REDIRECT);
        exit;
    }
} else {
    $Errorh->handler('e_auth', E_USER_REDIRECT);
    exit;
}
$Template->pparse('media_action');
require_once '../kernel/footer.php';
예제 #3
0
                        $l_register_confirm = $LANG['confirm_register'] . '<br />' . $LANG['register_valid_admin'];
                        $valid = $LANG['register_valid_admin'];
                    } else {
                        $l_register_confirm = $LANG['confirm_register'] . '<br />' . $LANG['register_ready'];
                        $valid_mail = '';
                        $valid = '';
                    }
                    import('io/mail');
                    $Mail = new Mail();
                    $Mail->send_from_properties($user_mail, sprintf($LANG['register_title_mail'], $CONFIG['site_name']), sprintf($LANG['register_mail'], $login, $CONFIG['site_name'], $CONFIG['site_name'], stripslashes($login), $password, $valid, $CONFIG['sign']), $CONFIG['mail_exp']);
                    if ($CONFIG_USER['activ_mbr'] == 0) {
                        $Sql->query_inject("UPDATE " . DB_TABLE_MEMBER . " SET last_connect='" . time() . "' WHERE user_id = '" . $last_mbr_id . "'", __LINE__, __FILE__);
                        $Session->start($last_mbr_id, $password, 0, SCRIPT, QUERY_STRING, TITLE, 1);
                    }
                    unset($password, $password_hash);
                    redirect_confirm(get_start_page(), sprintf($l_register_confirm, stripslashes($login)), 5);
                }
            } elseif (!empty($_POST['register_valid']) && $password !== $password_bis) {
                redirect(HOST . DIR . '/member/register' . url('.php?error=pass_same') . '#errorh');
            } else {
                redirect(HOST . DIR . '/member/register' . url('.php?error=incomplete') . '#errorh');
            }
        } else {
            redirect(HOST . DIR . '/member/register' . url('.php?error=lenght_mini') . '#errorh');
        }
    } else {
        redirect(HOST . DIR . '/member/register' . url('.php?error=verif_code') . '#errorh');
    }
} elseif (!empty($user_mail)) {
    redirect(HOST . DIR . '/member/register' . url('.php?error=invalid_mail') . '#errorh');
} else {
예제 #4
0
            $nbr_answer = count($array_votes);
            for ($i = 0; $i < $nbr_answer; $i++) {
                if (isset($_POST[$i])) {
                    $array_votes[$i]++;
                    $check_answer = true;
                }
            }
        }
        if ($check_answer) {
            $Sql->query_inject("UPDATE " . PREFIX . "poll SET votes = '" . implode('|', $array_votes) . "' WHERE id = '" . $poll['id'] . "'", __LINE__, __FILE__);
            redirect_confirm(HOST . DIR . '/poll/poll' . url('.php?id=' . $poll['id'], '-' . $poll['id'] . '.php'), $LANG['confirm_vote'], 2);
            if (in_array($poll['id'], $CONFIG_POLL['poll_mini'])) {
                $Cache->Generate_module_file('poll');
            }
        } else {
            redirect_confirm(HOST . DIR . '/poll/poll' . url('.php?id=' . $poll['id'], '-' . $poll['id'] . '.php'), $LANG['no_vote'], 2);
        }
    } else {
        redirect(HOST . DIR . '/poll/poll' . url('.php?id=' . $poll['id'] . '&error=e_unauth_poll', '-' . $poll['id'] . '.php?error=e_unauth_poll', '&') . '#errorh');
    }
} elseif (!empty($poll['id']) && !$archives) {
    $Template->set_filenames(array('poll' => 'poll/poll.tpl'));
    $check_bdd = false;
    if ($CONFIG_POLL['poll_auth'] == -1) {
        $ip = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "poll_ip WHERE ip = '" . USER_IP . "' AND idpoll = '" . $poll['id'] . "'", __LINE__, __FILE__);
        if (!empty($ip)) {
            $check_bdd = true;
        }
    } else {
        $user_id = $Sql->query("SELECT COUNT(*) FROM " . PREFIX . "poll_ip WHERE user_id = '" . $User->get_attribute('user_id') . "' AND idpoll = '" . $poll['id'] . "'", __LINE__, __FILE__);
        if (!empty($user_id)) {