function do_package_install()
{
    global $package_installer_console;
    global $edit_domain;
    global $adm_login;
    global $pkg_info;
    global $dtcpkg_db_login;
    $package_installer_console .= "=> Starting nuked-klan Installer for nuked-klan sp 4.4<br>";
    $admin_path = getAdminPath($adm_login);
    $vhost_path = $admin_path . "/" . $edit_domain . "/subdomains/" . $_REQUEST["subdomain"] . "/html";
    $hostname = $_REQUEST["subdomain"] . "." . $edit_domain;
    $vhost_url = "http://{$hostname}/";
    $cmd = "mv " . $vhost_path . "/" . $pkg_info["directory"] . " " . $vhost_path . "/" . $_REQUEST["dtcpkg_directory"];
    $data = array();
    $data['board_email'] = $_REQUEST['dtcpkg_email'];
    $data['install_pseudo'] = $_REQUEST['dtcpkg_login'];
    $data['install_pass'] = $_REQUEST['dtcpkg_pass'];
    $data['db_name'] = $_REQUEST['database_name'];
    $data['db_user'] = $dtcpkg_db_login;
    $data['db_passwd'] = $_REQUEST['dtcpkg_db_pass'];
    $url = $vhost_url . $_REQUEST["dtcpkg_directory"] . "/" . $pkg_info["post_script_url"];
    //  print_r($data);
    $package_installer_console .= "=> Calling {$url}<br>";
    $ret = HTTP_Post($url, $data, $url);
    $weblines = explode("\n", $ret);
    // HTTP/1.1 200 OK
    $package_installer_console .= "=> Script returns: " . $weblines[0];
    return 0;
    // Ok, no problem ! :)
}
function do_package_install()
{
    global $package_installer_console;
    global $edit_domain;
    global $adm_login;
    global $pkg_info;
    global $dtcpkg_db_login;
    $package_installer_console .= "=> Starting phpSurveyor Installer <br>";
    $admin_path = getAdminPath($adm_login);
    $vhost_path = $admin_path . "/" . $edit_domain . "/subdomains/" . $_REQUEST["subdomain"] . "/html";
    $hostname = $_REQUEST["subdomain"] . "." . $edit_domain;
    $vhost_url = "http://{$hostname}/";
    $cmd = "mv " . $vhost_path . "/" . $pkg_info["directory"] . " " . $vhost_path . "/" . $_REQUEST["dtcpkg_directory"];
    $data = array();
    $data["lang"] = "english";
    $data["dbms"] = "mysql4";
    $data["upgrade"] = "0";
    $data["dbhost"] = "localhost";
    $data["dbname"] = $_REQUEST["database_name"];
    $data["dbuser"] = $dtcpkg_db_login;
    $data["dbpasswd"] = $_REQUEST["dtcpkg_db_pass"];
    $data["prefix"] = "svy_";
    $data["board_email"] = $_REQUEST["dtcpkg_email"];
    $data["server_name"] = $hostname;
    $data["server_port"] = "80";
    $data["admin_name"] = $_REQUEST["dtcpkg_login"];
    $data["admin_pass1"] = $_REQUEST["dtcpkg_pass"];
    $data["admin_pass2"] = $_REQUEST["dtcpkg_pass"];
    $data["install_step"] = "1";
    $data["cur_lang"] = "english";
    $url = $vhost_url . $_REQUEST["dtcpkg_directory"] . "/" . $pkg_info["post_script_url"];
    //  print_r($data);
    $package_installer_console .= "=> Calling {$url}<br>";
    $ret = HTTP_Post($url, $data, $url);
    $weblines = explode("\n", $ret);
    // HTTP/1.1 200 OK
    $package_installer_console .= "=> Script returns: " . $weblines[0];
    return 0;
    // Ok, no problem ! :)
}
Exemplo n.º 3
0
<?php

/**
 * Created by PhpStorm.
 * User: william mcmillian
 * Date: 7/12/15
 * Time: 8:49 AM
 */
include './header.php';
$newTopicUrl = 'http://boards.endoftheinter.net/postmsg.php?tag=' . $request->tag;
$newTopicPage = HTTP_Get($newTopicUrl, $_SESSION['eticookie']);
if (is_local()) {
    $newTopicPage = file_get_contents('../test_data/test_new_topic.html');
}
$doc = new DOMDocument();
@$doc->loadHTML($newTopicPage);
$signature = $doc->getElementsByTagName('textarea')->item(1)->nodeValue;
$hiddenValue = $doc->getElementsByTagName('input')->item(2)->getAttribute('value');
$messageBody = $request->message;
$fields = array('title' => urlencode($request->title), 'message' => urlencode($messageBody . "\n" . $signature), 'h' => urlencode($hiddenValue), 'tag' => urlencode($request->tag), 'submit' => urlencode('Post Message'));
$newTopicUrl = 'http://boards.endoftheinter.net/postmsg.php';
$newTopic = HTTP_Post($newTopicUrl, $fields);
preg_match('~Location:.*?topic=(\\d+)~su', $newTopic, $topicIdMatch);
$newTopicId = $topicIdMatch[1];
if (is_local()) {
    $newTopicId = '98765';
}
$result = array();
$result['topicId'] = $newTopicId;
echo json_encode($result);
<?php

$search = "가산 에이스";
$url = "http://post.phpschool.com/phps.kr";
$data = array("addr" => "{$search}", "ipkey" => "2930056", "charset" => "EUC-KR", "type" => "new");
// charset이 UTF-8일경우 "UTF-8" 로 기재
// ipkey는 인증메일에서 안내합니다.
// 지번주소로 도로명주소를 찾기위한 검색 "type"=>"newdong"  /* "가산동 371-50" 식으로 동/번지입력 */
// 지번주소로 찾기의 경우  http://post.phpschool.com/post.html 예를 참조바랍니다.
// 구주소검색일경우(구 우편번호로만 찾기) "type"=>"old"
$output = HTTP_Post($url, $data);
$output = substr($output, strpos($output, "\r\n\r\n") + 4);
$output = unserialize($output);
$result = $output['result'];
if ($result > 0) {
    $post_data = unserialize($output['post']);
    echo "검색건수 : {$output[result]}\n";
    echo "검색시간 : {$output[time]}\n";
    echo "조회횟수 : {$output[cnt]}\n";
    echo "조회한도 : {$output[maxcnt]}\n";
    for ($i = 0; $i < $result; $i++) {
        //$post_data[$i]['postnew'];      // 새우편번호 (5자리)
        //$post_data[$i]['post'];         // 우편번호   (6자리)
        //$post_data[$i]['addr_1'];       // 시/도
        //$post_data[$i]['addr_2'];       // 구
        //$post_data[$i]['addr_3'];       // 도로명
        //$post_data[$i]['addr_4'];       // 동/건물
        //$post_data[$i]['addr_5'];       // 구주소 (도로명주소1:1매칭) 도로명주소검색일경우만 리턴
        //$post_data[$i]['addr_eng'];     // 영문주소 / 도로주소검색일경우만 리턴
        print_r($post_data[$i]);
    }
Exemplo n.º 5
0
 * Created by PhpStorm.
 * User: william mcmillian
 * Date: 7/12/15
 * Time: 8:49 pm
 */
include './header.php';
$newMessageUrl = 'http://boards.endoftheinter.net/postmsg.php?topic=' . $request->topicId;
$newTopicPage = HTTP_Get($newMessageUrl, $_SESSION['eticookie']);
if (is_local()) {
    $newTopicPage = file_get_contents('../test_data/test_new_message.html');
}
$doc = new DOMDocument();
@$doc->loadHTML($newTopicPage);
$signature = $doc->getElementsByTagName('textarea')->item(0)->nodeValue;
$hiddenValue = $doc->getElementsByTagName('input')->item(1)->getAttribute('value');
$messageBody = $request->message;
$fields = array('topic' => urlencode($request->topicId), 'message' => urlencode($messageBody . "\n" . $signature), 'h' => urlencode($hiddenValue), 'submit' => urlencode('Post Message'));
$newMessageUrl = 'http://boards.endoftheinter.net/postmsg.php';
$submittedForm = HTTP_Post($newMessageUrl, $fields);
if (is_local()) {
    $submittedForm = 'Location://boards.endoftheinter.net/showmessages.php?topic=9186749&page=99#m160066122';
}
preg_match('~Location:.*?topic=(\\d+)(&page=(\\d+))?#(m\\d+)~su', $submittedForm, $locationMatch);
$newTopicId = $locationMatch[1];
$page = $locationMatch[3];
$messageId = $locationMatch[4];
$result = array();
$result['topicId'] = $newTopicId;
$result['page'] = $page;
$result['messageId'] = $messageId;
echo json_encode($result);
function do_package_install()
{
    global $package_installer_console;
    global $edit_domain;
    global $adm_login;
    global $pkg_info;
    global $dtcpkg_db_login;
    $package_installer_console .= "=> Installer Preparing Configuration for WordPress 2.5.1<br>";
    $admin_path = getAdminPath($adm_login);
    $vhost_path = $admin_path . "/" . $edit_domain . "/subdomains/" . $_REQUEST["subdomain"] . "/html";
    $hostname = $_REQUEST["subdomain"] . "." . $edit_domain;
    $vhost_url = "http://{$hostname}/";
    $cmd = "mv " . $vhost_path . "/" . $pkg_info["directory"] . " " . $vhost_path . "/" . $_REQUEST["dtcpkg_directory"];
    $data = array();
    $data["lang"] = "english";
    $data["dbms"] = "mysql4";
    $data["upgrade"] = "0";
    $data["dbhost"] = "localhost";
    $data["dbname"] = $_REQUEST["database_name"];
    $data["dbuser"] = $dtcpkg_db_login;
    $data["dbpasswd"] = $_REQUEST["dtcpkg_db_pass"];
    $data["prefix"] = "wordpress_";
    $data["server_name"] = $hostname;
    $data["server_port"] = "80";
    $data["admin_name"] = $_REQUEST["dtcpkg_login"];
    $data["admin_pass1"] = $_REQUEST["dtcpkg_pass"];
    $data["admin_pass2"] = $_REQUEST["dtcpkg_pass"];
    $data["install_step"] = "1";
    $data["cur_lang"] = "english";
    //Prepare WordPress Configuration
    function keygen($length)
    {
        $key = '';
        for ($i = 0; $i < $length; $i++) {
            $key .= chr(rand(40, 127));
        }
        return $key;
    }
    $wpconfig = array();
    $wpconfig["gophp"] = "<?php";
    $wpconfig["dbname"] = "define('DB_NAME','" . $data["dbname"] . "');";
    $wpconfig["dbuser"] = "******" . $data["dbuser"] . "');";
    $wpconfig["dbpasswd"] = "define('DB_PASSWORD','" . $data["dbpasswd"] . "');";
    $wpconfig["dbhost"] = "define('DB_HOST','localhost');";
    $wpconfig["dbcharset"] = "define('DB_CHARSET','utf8');";
    $wpconfig["dbcollate"] = "define('DB_COLLATE','');";
    $wpconfig["seckey"] = "define('SECRET_KEY','" . keygen(25) . "');";
    $wpconfig["tblpfx"] = "\$" . "table_prefix = 'wp_';";
    $wpconfig["wplang"] = "define('WPLANG','');";
    $wpconfig["abspath"] = "define('ABSPATH',dirname(__FILE__).'/');";
    $wpconfig["req_once"] = "require_once(ABSPATH.'wp-settings.php');";
    $wpconfig["nophp"] = "?>";
    $wpconf_str = implode("\n", $wpconfig);
    //Write WordPress Config File
    if (!file_put_contents($vhost_path . "/" . $_REQUEST["dtcpkg_directory"] . "/wp-config.php", $wpconf_str)) {
        $package_installer_console .= "=> Error Writing WordPress Configuration 'wp-config.php'<br>";
    } else {
        $package_installer_console .= "=> WordPress Configuration 'wp-config.php' written<br>";
    }
    //Set url for post install script, currently not used,
    //but returns HTTP/1.1 200 OK on WordPress install success.
    $url = $vhost_url . $_REQUEST["dtcpkg_directory"] . "/" . $pkg_info["post_script_url"];
    //  print_r($data);
    $package_installer_console .= "=> Calling {$url}<br>";
    $ret = HTTP_Post($url, $data, $url);
    $weblines = explode("\n", $ret);
    // HTTP/1.1 200 OK
    $package_installer_console .= "=> Script returns: " . $weblines[0] . "\n\n";
    $package_installer_console .= "WordPress will ask for a blog name and admin email address the first time you run it.\n\n  WordPress will then show your admin login and password.  Write it down to avoid trouble!\n\n";
    return 0;
    // Ok, no problem ! :)
}