Exemple #1
0
// used to figure out if we should show the finish button in case of an error or not.
if (!$error) {
    // read the manifest
    if (substr($file, -4) == '.zip') {
        $p = new etano_package();
        if (!isset($_GET['finish']) && !isset($_GET['skip_input']) && !isset($_GET['ui_error'])) {
            // first time here
            $dirname = $fileop->extract_zip(_BASEPATH_ . '/tmp/packages/' . $file);
        } else {
            $dirname = substr($file, 0, -4);
        }
        if (is_file(_BASEPATH_ . '/tmp/packages/' . $dirname . '/manifest.xml')) {
            $p->set_file(_BASEPATH_ . '/tmp/packages/' . $dirname . '/manifest.xml');
        } elseif (!empty($dirname)) {
            if (is_dir(_BASEPATH_ . '/tmp/packages/' . $dirname)) {
                $fileop->delete(_BASEPATH_ . '/tmp/packages/' . $dirname);
            }
            $error = true;
            $topass['message']['type'] = MESSAGE_ERROR;
            $topass['message']['text'] = 'Invalid package';
        }
        if (!$p->error) {
            $install_index_start = 0;
            $skip_input = -1;
            if (isset($_GET['finish'])) {
                // no previous error for this package.
                $install_index_start = (int) $_GET['finish'];
                $p->post_install($install_index_start);
                ++$install_index_start;
            }
            if (isset($_GET['skip_input'])) {
Exemple #2
0
 }
 $query = "DELETE FROM `{$dbtable_prefix}comments_profile` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
 $query = "SELECT `photo_id`,`photo` FROM `{$dbtable_prefix}user_photos` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
 require_once _BASEPATH_ . '/includes/classes/fileop.class.php';
 $fileop = new fileop();
 $photo_ids = array();
 for ($i = 0; $i < mysql_num_rows($res); ++$i) {
     $photo = mysql_result($res, $i, 1);
     $photo_ids[] = mysql_result($res, $i, 0);
     $fileop->delete(_PHOTOPATH_ . '/t1/' . $photo);
     $fileop->delete(_PHOTOPATH_ . '/t2/' . $photo);
     $fileop->delete(_PHOTOPATH_ . '/' . $photo);
 }
 $query = "DELETE FROM `{$dbtable_prefix}user_photos` WHERE `photo_id` IN ('" . join("','", $photo_ids) . "')";
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
 $query = "DELETE FROM `{$dbtable_prefix}comments_photo` WHERE `fk_parent_id` IN ('" . join("','", $photo_ids) . "')";
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
 $query = "DELETE FROM `{$dbtable_prefix}comments_photo` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
 if (!($res = @mysql_query($query))) {
     trigger_error(mysql_error(), E_USER_ERROR);
 }
Exemple #3
0
        include_once _BASEPATH_ . '/skins_site/' . $def_skin . '/lang/photos.inc.php';
        include_once _BASEPATH_ . '/events/processors/photo_delete.php';
        if (isset($_on_before_delete)) {
            $GLOBALS['photo_ids'] = array($photo_id);
            for ($i = 0; isset($_on_before_delete[$i]); ++$i) {
                call_user_func($_on_before_delete[$i]);
            }
        }
    }
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    if (!empty($input['photo'])) {
        require_once '../../includes/classes/fileop.class.php';
        $fileop = new fileop();
        $fileop->delete(_PHOTOPATH_ . '/t1/' . $input['photo']);
        $fileop->delete(_PHOTOPATH_ . '/t2/' . $input['photo']);
        $fileop->delete(_PHOTOPATH_ . '/' . $input['photo']);
    }
    $query = "DELETE FROM `{$dbtable_prefix}comments_photo` WHERE `fk_parent_id`={$photo_id}";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    // what to do with the cache for the deleted comments or photo page? clear_cache($photo_id) ????
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'Photo deleted.';
}
if (!empty($return)) {
    $nextpage = _BASEURL_ . '/admin/' . $return;
} else {
    $nextpage = _BASEURL_ . '/admin/photo_search.php';
Exemple #4
0
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $query = "DELETE FROM `{$dbtable_prefix}modules` WHERE `module_code`='{$module_code}'";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $query = "DELETE FROM `{$dbtable_prefix}lang_strings` WHERE `skin`='{$module_code}'";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    if (!empty($config['is_default'])) {
        $query = "SELECT `module_code` FROM `{$dbtable_prefix}modules` WHERE `module_type`=" . MODULE_SKIN . " LIMIT 1";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        if (mysql_num_rows($res)) {
            $module_code = mysql_result($res, 0, 0);
            set_site_option('is_default', $module_code, 1);
        }
    }
    require_once '../../includes/classes/fileop.class.php';
    $fileop = new fileop();
    $fileop->delete(_BASEPATH_ . '/skins_site/' . $config['skin_dir']);
    $topass['message']['type'] = MESSAGE_INFO;
    $topass['message']['text'] = 'Skin deleted.';
} else {
    $topass['message']['type'] = MESSAGE_ERROR;
    $topass['message']['text'] = 'You can\'t delete the last skin of the site!';
}
redirect2page('admin/site_skins.php', $topass, $qs);
Exemple #5
0
function delete_members()
{
    global $dbtable_prefix;
    /* del=1 removes the user and all generated content
       del=2 removes the user but keeps the generated content */
    $query = "SELECT `del`,`fk_user_id` FROM `{$dbtable_prefix}user_profiles` WHERE `del`<>0";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    $uids[1] = array();
    $uids[2] = array();
    while ($rsrow = mysql_fetch_assoc($res)) {
        $uids[$rsrow['del']][] = $rsrow['fk_user_id'];
    }
    $all_uids = array_merge($uids[1], $uids[2]);
    // actions to do for all deleted members
    if (!empty($all_uids)) {
        $query = "DELETE FROM `{$dbtable_prefix}online` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}message_filters` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}payments` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}comments_profile` WHERE `fk_parent_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}queue_message` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "') OR `fk_user_id_other` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `" . USER_ACCOUNTS_TABLE . "` WHERE `" . USER_ACCOUNT_ID . "` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_folders` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_inbox` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_mtpls` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_networks` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "') OR `fk_user_id_other` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_outbox` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "') OR `fk_user_id_other` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_profiles` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_searches` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_settings2` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_spambox` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "') OR `fk_user_id_other` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_stats` WHERE `fk_user_id` IN ('" . join("','", $all_uids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
    }
    // actions to do for members to be totally removed
    if (!empty($uids[1])) {
        $query = "SELECT `blog_id` FROM `{$dbtable_prefix}user_blogs` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $blog_ids = array();
        for ($i = 0; $i < mysql_num_rows($res); ++$i) {
            $blog_ids[] = mysql_result($res, $i, 0);
        }
        if (!empty($blog_ids)) {
            $query = "SELECT `post_id` FROM `{$dbtable_prefix}blog_posts` WHERE `fk_blog_id` IN ('" . join("','", $blog_ids) . "')";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
            $post_ids = array();
            for ($i = 0; $i < mysql_num_rows($res); ++$i) {
                $post_ids[] = mysql_result($res, $i, 0);
            }
            if (!empty($post_ids)) {
                $query = "DELETE FROM `{$dbtable_prefix}comments_blog` WHERE `fk_parent_id` IN ('" . join("','", $post_ids) . "')";
                if (!($res = @mysql_query($query))) {
                    trigger_error(mysql_error(), E_USER_ERROR);
                }
                $query = "DELETE FROM `{$dbtable_prefix}blog_posts` WHERE `post_id` IN ('" . join("','", $post_ids) . "')";
                if (!($res = @mysql_query($query))) {
                    trigger_error(mysql_error(), E_USER_ERROR);
                }
            }
            $query = "DELETE FROM `{$dbtable_prefix}user_blogs` WHERE `blog_id` IN ('" . join("','", $blog_ids) . "')";
            if (!($res = @mysql_query($query))) {
                trigger_error(mysql_error(), E_USER_ERROR);
            }
        }
        $query = "DELETE FROM `{$dbtable_prefix}comments_blog` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_inbox` WHERE `fk_user_id_other` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}comments_profile` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "SELECT `photo_id`,`photo` FROM `{$dbtable_prefix}user_photos` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        require_once _BASEPATH_ . '/includes/classes/fileop.class.php';
        $fileop = new fileop();
        $photo_ids = array();
        for ($i = 0; $i < mysql_num_rows($res); ++$i) {
            $photo = mysql_result($res, $i, 1);
            $photo_ids[] = mysql_result($res, $i, 0);
            $fileop->delete(_PHOTOPATH_ . '/t1/' . $photo);
            $fileop->delete(_PHOTOPATH_ . '/t2/' . $photo);
            $fileop->delete(_PHOTOPATH_ . '/' . $photo);
        }
        $query = "DELETE FROM `{$dbtable_prefix}user_photos` WHERE `photo_id` IN ('" . join("','", $photo_ids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}comments_photo` WHERE `fk_parent_id` IN ('" . join("','", $photo_ids) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "DELETE FROM `{$dbtable_prefix}comments_photo` WHERE `fk_user_id` IN ('" . join("','", $uids[1]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
    }
    if (!empty($uids[2])) {
        $query = "UPDATE `{$dbtable_prefix}user_blogs` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}blog_posts` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}comments_blog` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}comments_profile` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}user_inbox` SET `fk_user_id_other`=0 WHERE `fk_user_id_other` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}user_photos` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
        $query = "UPDATE `{$dbtable_prefix}comments_photo` SET `fk_user_id`=0 WHERE `fk_user_id` IN ('" . join("','", $uids[2]) . "')";
        if (!($res = @mysql_query($query))) {
            trigger_error(mysql_error(), E_USER_ERROR);
        }
    }
    return true;
}
Exemple #6
0
    }
    if (!$error) {
        $input['fileop_mode'] = $_SESSION['install']['write'];
        $input['license_key'] = strtoupper(gen_pass(22));
        $input['license_key_md5'] = md5($input['license_key']);
        $tpl = new phemplate('../skin/', 'remove_nonjs');
        $tpl->set_file('content', 'defines.inc.php');
        $tpl->set_var('input', $input);
        $towrite = $tpl->process('content', 'content', TPL_FINISH);
        define('_BASEPATH_', $input['basepath']);
        define('_FILEOP_MODE_', $input['fileop_mode']);
        define('_FTPHOST_', $input['ftphost']);
        define('_FTPPATH_', $input['ftppath']);
        define('_FTPUSER_', $input['ftpuser']);
        define('_FTPPASS_', $input['ftppass']);
        require_once '../../includes/classes/fileop.class.php';
        $fileop = new fileop();
        $fileop->delete($input['basepath'] . '/includes/defines.inc.php');
        $fileop->file_put_contents($input['basepath'] . '/includes/defines.inc.php', $towrite);
        $_SESSION['install']['input'] = $input;
    } else {
        $nextpage = 'install/step2.php';
        // 		you must re-read all textareas from $_POST like this:
        //		$input['x']=addslashes_mq($_POST['x']);
        $input = sanitize_and_format($input, TYPE_STRING, FORMAT_HTML2TEXT_FULL | FORMAT_STRIPSLASH);
        $topass['input'] = $input;
    }
}
$my_url = str_replace('/install/processors/write_defines.php', '', $_SERVER['PHP_SELF']);
define('_BASEURL_', (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on' ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . $my_url);
redirect2page($nextpage, $topass, $qs);
Exemple #7
0
 public function uninstall()
 {
     global $wpdb, $awpcp_plugin_path, $table_prefix, $awpcp;
     // Remove the upload folders with uploaded images
     $dirname = AWPCPUPLOADDIR;
     if (file_exists($dirname)) {
         require_once $awpcp_plugin_path . '/fileop.class.php';
         $fileop = new fileop();
         $fileop->delete($dirname);
     }
     // Delete the classifieds page(s)
     $pages = awpcp_pages();
     foreach ($pages as $page => $data) {
         wp_delete_post(awpcp_get_page_id_by_ref($page), true);
     }
     // Drop the tables
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_ADFEES);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_ADPHOTOS);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_ADS);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_ADSETTINGS);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_AD_META);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_AD_REGIONS);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_CATEGORIES);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_CREDIT_PLANS);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_MEDIA);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_PAGES);
     $wpdb->query("DROP TABLE IF EXISTS " . AWPCP_TABLE_PAYMENTS);
     // TODO: implement uninstall methods in other modules
     $tables = array($wpdb->prefix . 'awpcp_comments');
     foreach ($tables as $table) {
         $wpdb->query("DROP TABLE IF EXISTS " . $table);
     }
     // remove AWPCP options from options table
     array_map('delete_option', array('awpcp-pending-manual-upgrade', 'awpcp_installationcomplete', 'awpcp_pagename_warning', 'widget_awpcplatestads', 'awpcp_db_version', $awpcp->settings->setting_name));
     // delete payment transactions
     $sql = 'SELECT option_name FROM ' . $wpdb->options . ' ';
     $sql .= "WHERE option_name LIKE 'awpcp-payment-transaction-%%'";
     array_map('delete_option', $wpdb->get_col($sql));
     // remove widgets
     unregister_widget("AWPCP_LatestAdsWidget");
     unregister_widget('AWPCP_RandomAdWidget');
     unregister_widget('AWPCP_Search_Widget');
     // Clear the ad expiration schedule
     wp_clear_scheduled_hook('doadexpirations_hook');
     wp_clear_scheduled_hook('doadcleanup_hook');
     wp_clear_scheduled_hook('awpcp_ad_renewal_email_hook');
     wp_clear_scheduled_hook('awpcp-clean-up-payment-transactions');
     // TODO: use deactivate_plugins function
     // http://core.trac.wordpress.org/browser/branches/3.2/wp-admin/includes/plugin.php#L548
     $current = get_option('active_plugins');
     $thepluginfile = sprintf("%s/awpcp.php", trim(AWPCP_BASENAME, '/'));
     array_splice($current, array_search($thepluginfile, $current), 1);
     update_option('active_plugins', $current);
     do_action('deactivate_' . $thepluginfile);
 }
Exemple #8
0
 function finish()
 {
     global $dbtable_prefix;
     $query = "SELECT max(`sort`)+1 FROM `{$dbtable_prefix}modules`";
     if (!($res = @mysql_query($query))) {
         trigger_error(mysql_error(), E_USER_ERROR);
     }
     $sort = mysql_result($res, 0, 0);
     $query = "INSERT IGNORE INTO `{$dbtable_prefix}modules` SET `module_code`='" . $this->module_code . "',`module_name`='" . $this->module_name . "',`module_type`='" . $this->module_type . "',`version`='" . $this->version . "',`sort`='{$sort}'";
     if (!($res = @mysql_query($query))) {
         trigger_error(mysql_error(), E_USER_ERROR);
     }
     if (!mysql_affected_rows()) {
         // if the insert failed then this is was just an update and the new version should have been set with change-version in one
         // of the requires
     }
     if (!empty($_SESSION[_LICENSE_KEY_]['admin']['install_options'])) {
         $query = "INSERT IGNORE INTO `{$dbtable_prefix}site_options3` (`config_option`,`config_value`,`config_diz`,`option_type`,`choices`,`fk_module_code`,`per_user`) VALUES ";
         foreach ($_SESSION[_LICENSE_KEY_]['admin']['install_options'] as $v) {
             $query = "INSERT IGNORE INTO `{$dbtable_prefix}site_options3` SET `fk_module_code`='" . $this->module_code . "'";
             foreach ($v as $vk => $vv) {
                 $query .= ",`{$vk}`='" . sanitize_and_format($vv, TYPE_STRING, FORMAT_ADDSLASH) . "'";
             }
             @mysql_query($query);
         }
         unset($_SESSION[_LICENSE_KEY_]['admin']['install_options']);
     }
     $fileop = new fileop();
     $fileop->delete($this->package_path);
 }
Exemple #9
0
if (!empty($_SESSION['install']['phpbin'])) {
    $output['phpbin'] = $_SESSION['install']['phpbin'];
} else {
    $output['nophpbin'] = true;
    $output['phpbin'] = '/path/to/php';
}
$output['basepath'] = _BASEPATH_;
$output['baseurl'] = _BASEURL_;
$tplvars = array();
$tplvars['page_title'] = 'Etano Install Process';
$tplvars['css'] = 'finish.css';
$tplvars['page'] = 'finish';
$tpl->set_var('output', $output);
$tpl->set_var('tplvars', $tplvars);
$tpl->process('content', 'content', TPL_OPTIONAL);
$tpl->set_file('frame', 'frame.html');
$message = isset($message) ? $message : (isset($topass['message']) ? $topass['message'] : (isset($_SESSION['topass']['message']) ? $_SESSION['topass']['message'] : array()));
if (!empty($message)) {
    $message['type'] = !isset($message['type']) || $message['type'] == MESSAGE_ERROR ? 'message_error' : 'message_info';
    if (is_array($message['text'])) {
        $message['text'] = join('<br>', $message['text']);
    }
    $tpl->set_var('message', $message);
}
$tpl->set_var('tplvars', $tplvars);
$fileop = new fileop();
$fileop->delete(_BASEPATH_ . '/install');
echo $tpl->process('frame', 'frame', TPL_FINISH | TPL_OPTIONAL | TPL_INCLUDE);
if (isset($_SESSION['topass'])) {
    unset($_SESSION['topass']);
}
Exemple #10
0
$qs_sep = '';
$error = false;
$topass = array();
$cid = isset($_GET['cid']) ? (int) $_GET['cid'] : 0;
if (!empty($cid)) {
    $query = "SELECT `config_value`,`option_type`,`fk_module_code` FROM `{$dbtable_prefix}site_options3` WHERE `config_id`={$cid}";
    if (!($res = @mysql_query($query))) {
        trigger_error(mysql_error(), E_USER_ERROR);
    }
    if (mysql_num_rows($res)) {
        $rsrow = mysql_fetch_assoc($res);
        $qs .= $qs_sep . 'module_code=' . $rsrow['fk_module_code'];
        $qs_sep = '&';
        if ($rsrow['option_type'] == FIELD_FILE) {
            $f = new fileop();
            if (!is_file($rsrow['config_value']) || $f->delete($rsrow['config_value'])) {
                $query = "UPDATE `{$dbtable_prefix}site_options3` SET `config_value`='' WHERE `config_id`={$cid}";
                if (!($res = @mysql_query($query))) {
                    trigger_error(mysql_error(), E_USER_ERROR);
                }
                $topass['message']['type'] = MESSAGE_INFO;
                $topass['message']['text'] = 'File removed';
            } else {
                $error = true;
                $topass['message']['type'] = MESSAGE_ERROR;
                $topass['message']['text'] = 'Unable to remove the file. Permission issues?';
            }
        } else {
            $error = true;
            $topass['message']['type'] = MESSAGE_ERROR;
            $topass['message']['text'] = 'Unable to remove the file';