Exemple #1
0
     $hash_res = mysql_q($hash_sql);
     $hash = mysql_fetch_assoc($hash_res);
     echo json_encode($hash);
     break;
     // update hash
 // update hash
 case 'updatehash':
     foreach ($_POST as $table => $hash) {
         $update_sql = 'UPDATE `hash` SET ' . $table . ' = "' . $hash . '"';
     }
     $update_res = mysql_q($update_sql);
     break;
     // clean dataabse
 // clean dataabse
 case 'cleandb':
     clean_db();
     break;
     /* #########
      * # VIDEO #
      */
     #########
 /* #########
  * # VIDEO #
  */
 #########
 case 'showvideo':
     $cols = array('id', 'hash');
     echo show($cols, $_GET['table']);
     break;
 case 'addvideo':
     if (isset($_POST['id'])) {
Exemple #2
0
if ($count_error > 0 && !(isset($_REQUEST['force']) && 1 == $_REQUEST['force'])) {
    $AVE_Template->assign('error_is_required', $error_is_required);
    $AVE_Template->display('error.tpl');
    exit;
}
$_REQUEST['step'] = isset($_REQUEST['step']) ? $_REQUEST['step'] : '';
switch ($_REQUEST['step']) {
    case '':
    case '1':
        $AVE_Template->display('step1.tpl');
        break;
    case '2':
        if (false === $db_connect && !empty($_POST['dbname']) && !empty($_POST['dbprefix'])) {
            $db_connect = check_db_connect($_POST['dbhost'], $_POST['dbuser'], $_POST['dbpass'], $_POST['dbname']);
            if ($_REQUEST["clean_db"]) {
                clean_db($_POST['dbname'], $_POST['dbprefix']);
            }
            $check_installed = check_installed($_POST['dbprefix']);
            if (true === $db_connect && false === $check_installed) {
                if (!@is_writeable(BASE_DIR . '/inc/db.config.php')) {
                    $AVE_Template->assign('config_isnt_writeable', 1);
                    $AVE_Template->display('error.tpl');
                    exit;
                }
                $fp = @fopen(BASE_DIR . '/inc/db.config.php', 'w+');
                @fwrite($fp, "<?php\n" . "\$config['dbhost'] = \"" . stripslashes(trim($_POST['dbhost'])) . "\";\n" . "\$config['dbuser'] = \"" . stripslashes(trim($_POST['dbuser'])) . "\";\n" . "\$config['dbpass'] = \"" . stripslashes(trim($_POST['dbpass'])) . "\";\n" . "\$config['dbname'] = \"" . stripslashes(trim($_POST['dbname'])) . "\";\n" . "\$config['dbpref'] = \"" . stripslashes(trim($_POST['dbprefix'])) . "\";\n" . "?>");
                @fclose($fp);
                $AVE_Template->display('step3.tpl');
                exit;
            } elseif (true === $db_connect && true === $check_installed) {
                $AVE_Template->assign('installed_q', $lang_i['installed_q']);