Esempio n. 1
0
    $sp_replace = array('&', '"', ''');
    $siteurl = $_POST['data']['setting']['site_url'];
    if (!empty($siteurl) && substr($siteurl, -1, 1) != '/') {
        $siteurl .= "/";
    }
    $_POST['data']['setting']['site_url'] = $siteurl;
    if (isset($_POST['data']['multita'])) {
        $_POST['data']['setting']['site_description'] = pb_lang_merge($_POST['data']['multita']);
        if (!empty($_POST['data']['setting']['site_description'])) {
            $_POST['data']['setting']['site_description'] = str_replace($sp_search, $sp_replace, $_POST['data']['setting']['site_description']);
        }
    }
    if (!empty($_POST['data']['setting'])) {
        $updated = $setting->replace($_POST['data']['setting']);
        if ($updated) {
            $cache->writeCache("setting", "setting");
        }
    }
    if ($updated) {
        if (!empty($_POST['data']['setting']['site_url']) && !pb_strcomp($_POST['data']['setting']['site_url'], $absolute_uri)) {
            edit_config(array("absolute_uri" => $_POST['data']['setting']['site_url']));
        }
        flash("success", "setting.php?do=basic");
    } else {
        flash();
    }
}
if (isset($_POST['saveauth'])) {
    $updated = $setting->replace($_POST['data']['setting']);
    if ($updated) {
        $cache->writeCache("setting", "setting");
Esempio n. 2
0
    if (!empty($_POST['data']['aname'])) {
        for ($i = 0; $i < count($_POST['data']['aname']); $i++) {
            $pdb->Execute("UPDATE {$tb_prefix}areas SET name = '" . $_POST['data']['aname'][$i] . "' WHERE id='" . $_POST['aid'][$i] . "'");
        }
        for ($i = 0; $i < count($_POST['data']['aname']); $i++) {
            $pdb->Execute("UPDATE {$tb_prefix}areas SET display_order = '" . $_POST['data']['display_order'][$i] . "' WHERE id='" . $_POST['aid'][$i] . "'");
        }
    }
    flash("success");
}
if (isset($_POST['del_country']) && !empty($_POST['id'])) {
    $result = $country->del($_POST['id']);
    if (!$result) {
        flash();
    } else {
        $cache->writeCache("country", "country");
        flash("success", "area.php?do=country");
    }
}
if (isset($_POST['update_country'])) {
    if (!empty($_POST['tid'])) {
        $type_count = count($_POST['tid']);
        for ($i = 0; $i < $type_count; $i++) {
            if (!empty($_POST['data']['name'][$i])) {
                $pdb->Execute("UPDATE {$tb_prefix}countries SET name='" . $_POST['data']['name'][$i] . "',display_order='" . $_POST['data']['display_order'][$i] . "',picture='" . $_POST['data']['picture'][$i] . "' WHERE id=" . $_POST['tid'][$i]);
            }
        }
    }
    if (!empty($_POST['name'])) {
        $name_count = count($_POST['name']);
        for ($j = 0; $j < $name_count; $j++) {
Esempio n. 3
0
require LIB_PATH . "cache.class.php";
uses("service", "typeoption", "setting");
$page = new Pages();
$cache = new Caches();
$setting = new Settings();
$typeoption = new Typeoption();
$service = new Services();
$conditions = null;
$tpl_file = "service";
setvar("Status", $typeoption->get_cache_type("common_status"));
setvar("ServiceTypes", $typeoption->get_cache_type("service_type"));
if (isset($_POST['save_client'])) {
    if (!empty($_POST['data']['setting'])) {
        $updated = $setting->replace($_POST['data']['setting'], 1);
        if ($updated) {
            $cache->writeCache("setting", "setting");
            flash("success");
        }
    }
    flash();
}
if (isset($_POST['save']) && !empty($_POST['data']['service'])) {
    $vals = array();
    $vals = $_POST['data']['service'];
    $vals['modified'] = $time_stamp;
    $result = $service->save($vals, "update", $_POST['id']);
    if (!empty($vals['revert_content'])) {
        $datas = array("actor" => $adminer_info['last_name'], "action" => L("feed_revert", "tpl"), "do" => L("feed_problem", "tpl"), "subject" => '<a href="index.php?do=service&action=detail&id=' . $_POST['id'] . '">' . $vals['title'] . '</a>');
        $sql = "INSERT INTO {$tb_prefix}feeds (type_id,type,member_id,username,data,created,modified,revert_date) VALUE ('1','service'," . $current_adminer_id . ",'" . $adminer_info['last_name'] . "','" . serialize($datas) . "'," . $time_stamp . "," . $time_stamp . "," . $time_stamp . ")";
        $pdb->Execute($sql);
    }
Esempio n. 4
0
 */
require "../libraries/common.inc.php";
uses("expotype");
require "session_cp.inc.php";
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$expotype = new Expotypes();
$conditions = null;
$tpl_file = "fairtype";
if (isset($_POST['del']) && !empty($_POST['id'])) {
    $deleted = false;
    $result = $expotype->del($_POST['id']);
    if (!$result) {
        flash();
    }
    $cache->writeCache("expotype", "expotype");
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "del" && $id) {
        $deleted = false;
        $result = $expotype->del($id);
        if (!$result) {
            flash();
        }
        $cache->writeCache("expotype", "expotype");
    }
    if ($do == "edit") {
Esempio n. 5
0
        $names = explode("\r\n", $_POST['data']['names']);
        $tmp_name = array();
        if (!empty($names)) {
            foreach ($names as $val) {
                $name = $val;
                if (!empty($name)) {
                    $tmp_name[] = "('" . $name . "','" . $_POST['data']['industry']['url'] . "','" . $parent_id . "','" . $top_parentid . "','" . $level . "','" . $_POST['data']['industry']['display_order'] . "','" . $_POST['data']['industry']['industrytype_id'] . "','')";
                }
            }
            $values = implode(",", $tmp_name);
            $sql = "INSERT INTO {$tb_prefix}industries (name,url,parent_id,top_parentid,level,display_order,industrytype_id,path) VALUES " . $values;
            $result = $pdb->Execute($sql);
        }
    }
    if ($result) {
        $cache->writeCache("industry", "industry");
    }
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "level") {
        if (!empty($id)) {
            if ($_GET['action'] == "up") {
                $pdb->Execute("UPDATE {$tb_prefix}industries SET display_order=display_order-1 WHERE id=" . $id);
            } elseif ($_GET['action'] == "down") {
                $pdb->Execute("UPDATE {$tb_prefix}industries SET display_order=display_order+1 WHERE id=" . $id);
            }
        }
Esempio n. 6
0
require LIB_PATH . "file.class.php";
if (file_exists($cache_userpage = CACHE_PATH . "cache_userpage.php")) {
    require $cache_userpage;
}
uses("userpage");
$cache = new Caches();
$userpage = new Userpages();
$conditions = null;
$tpl_file = "userpage";
$file = new Files();
if (isset($_POST['del']) && is_array($_POST['id'])) {
    $deleted = $userpage->del($_POST['id']);
    if (!$deleted) {
        flash();
    }
    $cache->writeCache("userpage", "userpage");
}
if (isset($_POST['save'])) {
    $vals = array();
    $vals = $_POST['data']['userpage'];
    if (!empty($vals['title']) && !empty($vals['name'])) {
        if (!empty($_POST['id'])) {
            $vals['modified'] = $time_stamp;
            $result = $userpage->save($vals, "update", $_POST['id']);
        } else {
            $vals['created'] = $vals['modified'] = $time_stamp;
            $result = $userpage->save($vals);
        }
    }
    if (!$result) {
        flash();
Esempio n. 7
0
 function post()
 {
     global $G, $viewhelper;
     require CLASS_PATH . "validation.class.php";
     $validate = new Validation();
     if (session_id() == '') {
         require_once LIB_PATH . "session_php.class.php";
         $session = new PbSessions();
     }
     uses("trade", "member", "tradefield", "tag");
     $tag = new Tags();
     $offer = new Tradefields();
     $member = new Members();
     $trade = new Trades();
     $expires = cache_read("typeoption", "offer_expire");
     setvar("Genders", cache_read("typeoption", "gender", 1, array("0", "-1")));
     setvar("PhoneTypes", cache_read("typeoption", "phone_type"));
     setvar("ImTypes", cache_read("typeoption", "im_type"));
     $if_visit_post = $G['setting']['vis_post'];
     if (!$if_visit_post) {
         $this->view->flash('visitor_forbid', URL, 0);
     }
     //for temp upgrade.
     if (!file_exists(CACHE_LANG_PATH . "locale.js")) {
         require LIB_PATH . "cache.class.php";
         $cache = new Caches();
         $cache->updateLanguages();
         $cache->writeCache("javascript", "javascript");
     }
     $trade_types = $trade->GetArray("SELECT * FROM " . $trade->table_prefix . "tradetypes");
     foreach ($trade_types as $key => $val) {
         if ($val['parent_id'] == 0) {
             $set_types[$val['id']] = pb_lang_split_recursive($val);
             foreach ($trade_types as $key1 => $val1) {
                 if ($val1['parent_id'] == $val['id']) {
                     $set_types[$val['id']]['child'][$val1['id']] = pb_lang_split_recursive($val1);
                 }
             }
         }
     }
     if (isset($_GET['typeid'])) {
         setvar("type_id", intval($_GET['typeid']));
     }
     if (isset($_GET['industryid'])) {
         setvar("industry_id", intval($_GET['industryid']));
     }
     if (isset($_GET['areaid'])) {
         setvar("area_id", intval($_GET['areaid']));
     }
     setvar("select_tradetypes", $set_types);
     $viewhelper->setPosition(L("free_release_offer", "tpl"));
     setvar("OfferExpires", $expires);
     setvar("sid", md5(uniqid($offer->timestamp)));
     capt_check("capt_post_free");
     render("offer/post");
 }
Esempio n. 8
0
 *      [PHPB2B] Copyright (C) 2007-2099, Ualink Inc. All Rights Reserved.
 *      The contents of this file are subject to the License; you may not use this file except in compliance with the License. 
 *
 *      @version $Revision: 2075 $
 */
require "../libraries/common.inc.php";
require "session_cp.inc.php";
uses("setting");
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$setting = new Settings();
$conditions = null;
$tpl_file = "trust";
$item = $setting->getValues(1);
if (isset($_POST['save_trust_rule'])) {
    $cache->writeCache("setting", "setting");
    $setting->replace($_POST['data']['setting'], 1);
    flash("success");
}
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "rule") {
        $tpl_file = "trust.rule";
        setvar("item", $item);
        template($tpl_file, 1);
    }
}
if (isset($_POST['del']) && !empty($_POST['id'])) {
Esempio n. 9
0
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_url', '" . $siteurl . "')");
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('watertext', '" . $siteurl . "')");
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('auth_key', '{$passwordkey}')");
     $aminer_id = 1;
     $db->query("REPLACE INTO {$tb_prefix}members (id,username, userpass,email,membertype_id,membergroup_id,created,modified,status) VALUES ({$aminer_id},'{$username}','" . md5($password) . "','{$email}',2,9," . $time_stamp . "," . $time_stamp . ",'1')");
     $db->query("REPLACE INTO {$tb_prefix}adminfields (member_id,last_name,created,modified) VALUES ('{$aminer_id}','" . L("administrator", "tpl") . "'," . $time_stamp . "," . $time_stamp . ")");
     $db->free();
     require PHPB2B_ROOT . "libraries" . DS . 'adodb' . DS . 'adodb.inc.php';
     require PHPB2B_ROOT . "libraries" . DS . "cache.class.php";
     $pdb =& NewADOConnection($database);
     $cache = new Caches();
     $conn = $pdb->PConnect($dbhost, $dbuser, $dbpasswd, $dbname);
     if ($dbcharset && mysql_get_server_info() > '4.1') {
         $pdb->Execute("SET NAMES '{$dbcharset}'");
     }
     $cache->writeCache("setting", "setting");
     $cache->writeCache("industry", "industry");
     $cache->writeCache("area", "area");
     $cache->writeCache("membergroup", "membergroup");
     $cache->writeCache("userpage", "userpage");
     $cache->writeCache("trusttype", "trusttype");
     $cache->writeCache("form", "form");
     $cache->writeCache("nav", "nav");
     $cache->writeCache("country", "country");
     $cache->updateTypevars();
     //			$cache->updateLanguages();
     $cache->writeCache("javascript", "javascript");
     $cache->updateTypes();
     $cache->updateIndexCache();
     header("Location:install.php?step={$step}&do=complete&app_lang=" . $app_lang);
 } else {
Esempio n. 10
0
    $vals['allow_offer'] = bindec($_POST['offer']['allow'] . $_POST['offer']['check']);
    $vals['allow_product'] = bindec($_POST['product']['allow'] . $_POST['product']['check']);
    $vals['allow_job'] = bindec($_POST['job']['allow'] . $_POST['job']['check']);
    $vals['allow_companynews'] = bindec($_POST['companynews']['allow'] . $_POST['companynews']['check']);
    $vals['allow_album'] = bindec($_POST['album']['allow'] . $_POST['album']['check']);
    $vals['allow_market'] = bindec($_POST['market']['allow'] . $_POST['market']['check']);
    $vals['allow_company'] = bindec($_POST['company']['allow'] . $_POST['company']['check']);
    if (!empty($id)) {
        $result = $membergroup->save($vals, "update", $id);
    } else {
        $result = $membergroup->save($vals);
    }
    if (!$result) {
        flash();
    } else {
        $cache->writeCache("membergroup", "membergroup");
        flash("success", "membergroup.php?type=" . $_POST['type']);
    }
}
if (isset($_POST['save_data'])) {
    if (!empty($_POST['id'])) {
        $count = count($_POST['id']);
        for ($i = 0; $i < $count; $i++) {
            $result = $pdb->Execute("UPDATE {$tb_prefix}membergroups SET name='" . $_POST['name'][$i] . "',picture='" . $_POST['picture'][$i] . "',point_min='" . $_POST['point_min'][$i] . "',point_max='" . $_POST['point_max'][$i] . "' WHERE id=" . $_POST['id'][$i]);
        }
        if (!$result) {
            flash();
        } else {
            $cache->writeCache("membergroup", "membergroup");
        }
    }
Esempio n. 11
0
 $do = trim($_GET['do']);
 if (!empty($_GET['id'])) {
     $id = intval($_GET['id']);
 }
 if ($do == "uninstall" && !empty($id)) {
     $templet->del($id);
 }
 if ($do == "install" && !empty($_GET['entry'])) {
     $entry = trim($_GET['entry']);
     $templet_controller->install($entry);
     flash("tpl_installed_ok", "templet.php?type=" . $_GET['type']);
 }
 if ($do == "setup" && !empty($_GET['name']) && $pdb->GetRow("SELECT * FROM {$tb_prefix}templets WHERE id=" . $id)) {
     $the_theme = trim($_GET['name']);
     $setting->replace(array("theme" => $the_theme));
     $result = $cache->writeCache("setting", "setting");
     if ($result) {
         $templet->exchangeDefault($id);
         flash("success", "templet.php?type=system");
     } else {
         flash();
     }
 }
 if ($do == "edit") {
     if (!empty($id)) {
         setvar("item", $templet->read("*", $id));
     }
     $user_types = array();
     foreach ($_PB_CACHE['membergroup'] as $key => $val) {
         $user_types[$key] = $val['name'];
     }
Esempio n. 12
0
$adminer = new Adminfields();
$member = new Members();
$setting = new Settings();
$sections = array('admin', 'message');
if (isset($_GET['action'])) {
    if ($_GET['action'] == "dereg") {
        usetcookie("admin", "");
        unset($_SESSION['last_adminer_time']);
    }
}
//for temp upgrade.
if (!file_exists(CACHE_LANG_PATH . "locale.js")) {
    require LIB_PATH . "cache.class.php";
    $cache = new Caches();
    //	$cache->updateLanguages();
    $cache->writeCache("javascript", "javascript");
}
capt_check("capt_login_admin");
if (isset($_POST['do'])) {
    $do = trim($_POST['do']);
    //	if(is_file(CACHE_ROOT.$_POST['data']['language'].DS."lang_admin.php")) {
    usetcookie("lang", $_POST['data']['language']);
    //	}
    if ($do == "login") {
        pb_submit_check('data');
        if (!empty($_POST['data']['username']) && !empty($_POST['data']['userpass'])) {
            $checked = false;
            $uname = $_POST['data']['username'];
            $upass = $_POST['data']['userpass'];
            $checked = $adminer->checkUserLogin($uname, $upass);
            if ($checked > 0) {
Esempio n. 13
0
require "../libraries/common.inc.php";
require "session_cp.inc.php";
uses("nav", "typeoption");
require LIB_PATH . "cache.class.php";
$cache = new Caches();
$nav = new Navs();
$typeoption = new Typeoption();
$conditions = null;
$tpl_file = "nav";
setvar("AskAction", $typeoption->get_cache_type("common_option"));
if (isset($_POST['del']) && is_array($_POST['id'])) {
    $deleted = $nav->del($_POST['id']);
    if (!$deleted) {
        flash();
    }
    $cache->writeCache("nav", "nav");
}
if (isset($_POST['update_prior'])) {
    if (!empty($_POST['nid'])) {
        for ($i = 0; $i < count($_POST['nid']); $i++) {
            $pdb->Execute("UPDATE {$tb_prefix}navs SET display_order='" . $_POST['display_order'][$i] . "',status='" . $_POST['status'][$i] . "' WHERE id='" . $_POST['nid'][$i] . "'");
        }
        $cache->writeCache("nav", "nav");
    }
}
if (isset($_POST['save'])) {
    $vals = array();
    $_POST['data']['nav']['name'] = pb_lang_merge($_POST['data']['multi']);
    $vals = $_POST['data']['nav'];
    //	$vals['description'] = serialize($_POST['data']['lang']);
    //	if(!empty($_POST['data']['lang'][$app_lang])) $vals['name'] = $_POST['data']['lang'][$app_lang];
Esempio n. 14
0
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('site_url', '" . $siteurl . "')");
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('watertext', '" . $siteurl . "')");
     $db->query("REPLACE INTO {$tb_prefix}settings (variable, valued) VALUES ('auth_key', '{$passwordkey}')");
     $aminer_id = 1;
     $db->query("REPLACE INTO {$tb_prefix}members (id,username, userpass,email,membertype_id,membergroup_id,created,modified,status) VALUES ({$aminer_id},'{$username}','" . md5($password) . "','{$email}',2,9," . $time_stamp . "," . $time_stamp . ",'1')");
     $db->query("REPLACE INTO {$tb_prefix}adminfields (member_id,last_name,created,modified) VALUES ('{$aminer_id}','" . L("administrator", "tpl") . "'," . $time_stamp . "," . $time_stamp . ")");
     $db->free();
     require PHPB2B_ROOT . "libraries" . DS . 'adodb' . DS . 'adodb.inc.php';
     require PHPB2B_ROOT . "libraries" . DS . "cache.class.php";
     $cache = new Caches();
     $pdb =& NewADOConnection($database);
     $conn = $pdb->PConnect($dbhost, $dbuser, $dbpasswd, $dbname);
     if ($dbcharset && mysql_get_server_info() > '4.1') {
         $pdb->Execute("SET NAMES '{$dbcharset}'");
     }
     $cache->writeCache("industry", "industry");
     $cache->writeCache("area", "area");
     $cache->writeCache("membergroup", "membergroup");
     $cache->writeCache("userpage", "userpage");
     $cache->writeCache("trusttype", "trusttype");
     $cache->writeCache("form", "form");
     $cache->writeCache("nav", "nav");
     $cache->writeCache("country", "country");
     $cache->updateTypevars();
     $cache->updateLanguages();
     $cache->updateTypes();
     $cache->updateIndexCache();
     header("Location:install.php?step={$step}&do=complete&app_lang=" . $app_lang);
 } else {
     $db_error = true;
     break;