Ejemplo n.º 1
0
 /** Get Api Key
  * @param $login string
  * @param $password string
  * @param $coin string
  * @return bool|mysqli_result
  */
 public static function networkCoins($login, $password, $coin)
 {
     $link = MySql::connect();
     $resultArray = null;
     mysqli_query($link, "SET character_set_results = 'utf8'");
     $query = sprintf("SELECT coins.%s as apikey FROM coins,users WHERE users.Email='%s' AND users.Password='******'", mysqli_real_escape_string($link, trim($coin)), mysqli_real_escape_string($link, trim($login)), mysqli_real_escape_string($link, trim($password)));
     $result = mysqli_query($link, $query);
     $row = mysqli_fetch_array($result);
     $result = $row['apikey'];
     return $result;
 }
Ejemplo n.º 2
0
require 'install_var.php';
require 'install_function.php';
if (function_exists('mysql_connect')) {
    require 'install_mysql.php';
}
$db = new MySql();
$db_host = trim($_POST['db_host']);
$db_user = trim($_POST['db_user']);
$db_pass = trim($_POST['db_pass']);
$db_prefix = trim($_POST['db_prefix']);
$db_name = trim($_POST['db_name']);
$admin_name = trim($_POST['admin_name']);
$admin_password = trim($_POST['admin_password']);
$db_type = (int) trim($_POST['db_demo']);
$act = $_POST['act'];
$db->connect($db_host, $db_user, $db_pass, $db_name, DBCHARSET);
if ($act == 'list') {
    $list = array();
    $dh = opendir('../data/' . $db_type);
    while (($file = readdir($dh)) !== false) {
        if ($file != "." && $file != "..") {
            $list[] = $file;
        }
    }
    echo json_encode(array('status' => 1, 'list' => $list));
} else {
    if ($act == 'insert') {
        $sql = "../data/" . $db_type . "/wst_" . $_POST['table'] . ".sql";
        $sql = file_get_contents($sql);
        runquery($sql, $db_prefix);
        if (intval($_POST['isFinish']) == 1) {
Ejemplo n.º 3
0
<?php

// hangreHandler.php
require_once $_SERVER['DOCUMENT_ROOT'] . '/hangee/m/lib/__core.php';
$handler = new JsonHandler();
$request = $handler->getRequest();
if ($request == null) {
    $handler->sendError('Invalid Request!');
    die;
}
$char = $request->character;
$query = "select * from hangee_words where word like '{$char}%' and page < 500 order by word asc";
$db = new MySql();
$db->connect();
$res = $db->query($query);
$words = array();
while ($row = mysql_fetch_array($res, MYSQL_ASSOC)) {
    $current = new WordRecord();
    $current->wid = $row['id'];
    $current->page = $row['page'];
    $current->word = $row['word'];
    $current->sense = $row['sense'];
    $words[] = $current;
}
$db->close();
$handler->sendData($words);
Ejemplo n.º 4
0
         }
     }
 }
 $mat[0]['error_condition'] = empty($db_server);
 $mat[0]['error_message'] = 'Database server field cannot be empty';
 $mat[1]['error_condition'] = empty($db_user);
 $mat[1]['error_message'] = 'The Database user field cannot be empty';
 $mat[2]['error_condition'] = empty($db_name);
 $mat[2]['error_message'] = 'The Database name field cannot be empty';
 $mat[3]['error_condition'] = empty($plugins_to_install);
 //!isset($_POST['plugins']);
 $mat[3]['error_message'] = 'You must specify at least one plugin to install';
 $mat[4]['error_condition'] = empty($installation_complete_url);
 $mat[4]['error_message'] = 'Specify the URL to redirect to on successful install';
 $db = new MySql();
 $connection_id = @$db->connect($db_server, $db_user, $db_pass, $db_name);
 $mat[5]['error_condition'] = $connection_id === false || $connection_id < 0;
 $mat[5]['error_message'] = 'Unable to connect to the database server. <br/> Make sure the database server name, username and password are correct';
 $validate = Validator::validate($mat);
 if ($validate['error']) {
     $status_message = $validate['status_message'];
     require_once 'installer-form.php';
     exit;
 }
 $content = "<?php" . NL . NL . "require_once('" . PCL_DIR . "/ini.php');" . NL . NL . NL . "/**" . NL . "* database server name" . NL . "*/" . NL . "defined('DB_SERVER') or define('DB_SERVER', '{$db_server}');" . NL . NL . NL . "/**" . NL . "* database user name" . NL . "*/" . NL . "defined('DB_USER') or define('DB_USER', '{$db_user}');" . NL . NL . NL . "/**" . NL . "* database user password" . NL . "*/" . NL . "defined('DB_PASS') or define('DB_PASS', '{$db_pass}');" . NL . NL . NL . "/**" . NL . "* database name" . NL . "*/" . NL . "defined('DB_NAME') or define('DB_NAME', '{$db_name}');" . NL . NL . NL . "/**" . NL . "* database tables prefix" . NL . "*/" . NL . "defined('TABLES_PREFIX') or define('TABLES_PREFIX', '{$tables_prefix}');" . NL . NL . NL . "/**" . NL . "* File system path to installed plugins directory" . NL . "*/" . NL . "defined('PLUGINS_DIR') or define('PLUGINS_DIR',   '{$plugins_dir}');" . NL . "";
 $config_file = new FileWriter('../unified-install.config.php', 'WRITE_ONLY');
 $config_file->write($content);
 $_SESSION['plugins_to_install'] = Util::stringify($plugins_to_install);
 //used to pass the eligible plugins array to 'finalize.php'
 $_SESSION['installation_complete_url'] = $installation_complete_url;
 //ditto
Ejemplo n.º 5
0
// Вывод заголовка;
header('Content-type: text/plain; charset=utf-8');
// Проверка версии (iOS);
if (is_version('IOS', 1, 6, 3)) {
    // Вывод данных;
    //echo json_encode(array('application_lock' => 'Версия приложения устарела'));
    //die();
}
// Проверка версии (Android);
if (is_version('ANDROID', 2, 4, 12)) {
    // Вывод данных;
    //echo json_encode(array('application_lock' => 'Версия приложения устарела'));
    //die();
}
// Обработка параметров;
list($file, $type) = explode(".", basename($_SERVER['REQUEST_URI']) . '.api');
// Подключение настроек;
include $_SERVER['DOCUMENT_ROOT'] . '/config.php';
// Подключение MySQL;
include $_SERVER['DOCUMENT_ROOT'] . '/systems/mysql.php';
// Подключение основных функций;
include $_SERVER['DOCUMENT_ROOT'] . '/systems/functions.php';
// Создание объекта MySQL;
$db = new MySql();
$db->connect($db_host, $db_name, $db_user, $db_password);
// Кодировка;
$db->query("SET NAMES `UTF8`");
// Часовой пояс;
$db->query("SET TIME_ZONE='+06:00'");
// Подключение файла;
include $_SERVER['DOCUMENT_ROOT'] . '/systems/api/' . $file . '.php';