Exemplo n.º 1
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// фильтруем входящие данные
$id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
$text = addslashes(strip_tags(filter_input(INPUT_POST, 'text', FILTER_UNSAFE_RAW)));
$type = filter_input(INPUT_POST, 'type', FILTER_UNSAFE_RAW);
if ($type != 'private' && $type != 'public') {
    $type = 'private';
}
Exemplo n.º 2
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if ($user['rankname'] != 'admin' && $user['rankname'] != 'support') {
    exit;
}
$shop_id = filter_input(INPUT_POST, 'shop_id', FILTER_VALIDATE_INT);
$drop_id = filter_input(INPUT_POST, 'drop_id', FILTER_VALIDATE_INT);
$shipper_id = filter_input(INPUT_POST, 'shipper_id', FILTER_VALIDATE_INT);
if (!isset($shop_id) || empty($shop_id) || $shop_id == '' || $shop_id === false) {
Exemplo n.º 3
0
<?php

require_once "./lib/config.php";
require_once "./lib/dbclass.php";
require_once "./lib/JSON.php";
$json = new Services_JSON();
$node = isset($_POST['node']) && $_POST['node'] != 0 ? $_POST['node'] : 0;
$sql = "select dir.*, user.user_name \n\t\tfrom `dir_data` dir, `user_data` user\n\t\twhere dir.dir_parent = " . $node . "\n\t\tand dir.dir_owner_id = user.user_id";
$db = new dbClass($db_username, $db_password, $db_database, $db_hostname);
$db->start();
$result = $db->query($sql);
while ($arr = $db->getarray($result)) {
    $qtip = '擁有者:' . $arr['user_name'] . "<br>\n\t\t\t 建立日期:" . $arr['dir_creat_time'];
    $nodes[] = array('text' => $arr['dir_name'], 'id' => $arr['dir_id'], 'qtip' => $qtip, 'cls' => 'folder');
}
echo $json->encode($nodes);
/*
// from php manual page
function formatBytes($val, $digits = 3, $mode = "SI", $bB = "B"){ //$mode == "SI"|"IEC", $bB == "b"|"B"
   $si = array("", "K", "M", "G", "T", "P", "E", "Z", "Y");
   $iec = array("", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi");
   switch(strtoupper($mode)) {
       case "SI" : $factor = 1000; $symbols = $si; break;
       case "IEC" : $factor = 1024; $symbols = $iec; break;
       default : $factor = 1000; $symbols = $si; break;
   }
   switch($bB) {
       case "b" : $val *= 8; break;
       default : $bB = "B"; break;
   }
   for($i=0;$i<count($symbols)-1 && $val>=$factor;$i++)
Exemplo n.º 4
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
$id = addslashes(strip_tags(filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT)));
$shop_id = addslashes(strip_tags(filter_input(INPUT_POST, 'shop_id', FILTER_UNSAFE_RAW)));
$dropshopinfo = 'На работал с этим магазином!';
if (is_numeric($shop_id)) {
    $q = "SELECT * FROM `packages` WHERE `drop_id` = " . $id . " AND `shop_id` = " . $shop_id . ";";
    $res = $db->query($q);
    if (isset($res[0])) {
Exemplo n.º 5
0
 * Handler for ajax requests (modern browsers with HTML5 file API) will post here
 */
header('Content-Type: application/json; charset=utf-8');
include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// For error handling tests :)
/*
if(rand(1, 4) == 4) {
    $status = '500 Internal Server Error';
    header("HTTP/1.1 {$status}");
    header("Status: {$status}");
Exemplo n.º 6
0
 $password = $security->makeSafe($_POST['password']);
 if (empty($name) || empty($password)) {
     $response['status'] = '403';
     $response['message'] = 'Name and password cannot be blank.';
     echo json_encode($response);
     return;
 }
 if (dbClass::editPassword($id, $name, $password)) {
     $response['status'] = '200';
     $response['message'] = 'Password has been successfully updated for ' . $name . '.';
     if (isset($_POST['file'])) {
         $file = $_POST['file'];
         if (dbClass::query('DELETE FROM files WHERE password_id="' . $id . '"')) {
             foreach ($file as $fl) {
                 $filename = array_pop(explode('/', $fl));
                 if (dbClass::query('INSERT INTO files (password_id, file) VALUES ("' . $id . '", "' . $filename . '")')) {
                     $response['status'] = '200';
                     $response['message'] = 'Password has been successfully updated for ' . $name . '.';
                 } else {
                     $response['status'] = '500';
                     $response['message'] = 'Could not save the password.';
                 }
             }
         } else {
             $response['status'] = '500';
             $response['message'] = 'Could not edit files.';
             echo json_encode($response);
             return;
         }
     }
 } else {
Exemplo n.º 7
0
<?php

require_once "../../lib/config.php";
require_once "../../lib/dbclass.php";
$owner_id = 1;
$dir_id = $_POST['dirID'];
$ntime = time();
$filename = $_FILES['Filedata']["name"];
//檔案原始名稱
//$filename_fix = str_replace(" ","_",$filename);
$explodestr = explode(".", $filename);
//主、副檔案名稱分割
$x = $explodestr[count($explodestr) - 1];
//x = 副檔名
$randnum = rand();
$uploadname = $ntime . $randnum . "." . $x;
//伺服器上檔案名稱
$filesize = $_FILES['Filedata']["size"];
//取得檔案大小
$filetype = $x;
//取得檔案型態 = 副檔名
$tempfile = $_FILES['Filedata']["tmp_name"];
$filepath = $file_real_path . $uploadname;
//上傳路徑
copy($tempfile, $filepath);
$db = new dbClass($db_username, $db_password, $db_database, $db_hostname);
$db->start();
$sql = "INSERT INTO file_data (`file_owner_id`,\t  `file_name`,    `file_size`,    `file_type`,   `file_upname`,   `file_dir`,  `upload_time`) \n\t\tVALUES \t\t\t\t  ('" . $owner_id . "','" . $filename . "','" . $filesize . "','" . $filetype . "','" . $uploadname . "','" . $dir_id . "', NOW())";
$db->query($sql);
$db->close();
Exemplo n.º 8
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// фильтруем входящие данные
$id = filter_input(INPUT_POST, 'img_id', FILTER_VALIDATE_INT);
if (!isset($id) || !$id || !is_int($id)) {
    exit(json_encode(array('type' => 'error', 'text' => 'ID is empty')));
}
$q = "SELECT * FROM `uploads` WHERE `id` = " . $id . ";";
$res = $db->query($q);
Exemplo n.º 9
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// фильтруем входящие данные
$id = filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT);
if (!isset($id) || !$id || !is_int($id)) {
    exit(json_encode(array('type' => 'error', 'text' => 'ID пусто')));
}
// смотрим можно ли
if ($user['rankname'] != 'admin' && $user['rankname'] != 'support' && $user['rankname'] != 'shipper') {
Exemplo n.º 10
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if ($user['rankname'] != 'labler' && $user['rankname'] != 'admin') {
    exit('Запрещено!');
}
// фильтруем входящие данные
$img_id = filter_input(INPUT_POST, 'img_id', FILTER_VALIDATE_INT);
$pkg_id = filter_input(INPUT_POST, 'pkg_id', FILTER_VALIDATE_INT);
if (!isset($img_id) || !$img_id || !is_int($img_id)) {
Exemplo n.º 11
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if ($user['rankname'] != 'admin' && $user['rankname'] != 'shipper') {
    exit;
}
$text = addslashes(strip_tags(filter_input(INPUT_POST, 'text', FILTER_SANITIZE_SPECIAL_CHARS)));
if ($text === false || $text === NULL) {
    $text = '';
}
Exemplo n.º 12
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if ($user['rankname'] != 'admin' && $user['rankname'] != 'support') {
    exit;
}
$action = filter_input(INPUT_POST, 'action', FILTER_VALIDATE_BOOLEAN);
$drop_id = filter_input(INPUT_POST, 'drop_id', FILTER_VALIDATE_INT);
$shipper_id = filter_input(INPUT_POST, 'shipper_id', FILTER_VALIDATE_INT);
if (!isset($drop_id) || empty($drop_id) || $drop_id == '' || $drop_id === false) {
Exemplo n.º 13
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// фильтруем входящие данные
$name = addslashes(strip_tags(filter_input(INPUT_POST, 'nickname', FILTER_UNSAFE_RAW)));
$email = strip_tags(filter_input(INPUT_POST, 'email', FILTER_VALIDATE_EMAIL));
$xmpp = strip_tags(filter_input(INPUT_POST, 'xmpp', FILTER_VALIDATE_EMAIL));
$pass1 = addslashes(filter_input(INPUT_POST, 'password1', FILTER_UNSAFE_RAW));
$pass2 = addslashes(filter_input(INPUT_POST, 'password2', FILTER_UNSAFE_RAW));
$rank = strip_tags(filter_input(INPUT_POST, 'rank', FILTER_VALIDATE_INT));
Exemplo n.º 14
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
$text = addslashes(strip_tags(filter_input(INPUT_POST, 'text', FILTER_UNSAFE_RAW)));
$hash = addslashes(strip_tags(filter_input(INPUT_POST, 'hash', FILTER_UNSAFE_RAW)));
if (!isset($text) || empty($text)) {
    exit(json_encode(array('type' => 'error', 'text' => 'Нет текста!')));
}
if (preg_match("/^[0-9A-F]+\$/i", $hash) == false) {
    exit(json_encode(array('type' => 'error', 'text' => 'Ошибка хеша!<br>' . $hash)));
Exemplo n.º 15
0
<?php

require_once "../../lib/config.php";
require_once "../../lib/dbclass.php";
$fileID = $_GET['fileId'];
$file_upname = $_GET['fileUpName'];
if (@unlink($file_real_path . $file_upname)) {
    $sql = "delete from file_data\n\t\t\twhere file_id = " . $fileID;
    $db = new dbClass($db_username, $db_password, $db_database, $db_hostname);
    $db->start();
    if ($db->query($sql)) {
        echo "ok";
    } else {
        echo "no";
    }
} else {
    echo "no";
}
$db->close();
Exemplo n.º 16
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
$id = addslashes(strip_tags(filter_input(INPUT_POST, 'id', FILTER_VALIDATE_INT)));
if (!isset($id)) {
    exit(json_encode(array('type' => 'error', 'text' => 'ID empty!')));
}
if ($id != $user['id']) {
    exit(json_encode(array('type' => 'error', 'text' => 'Hack attempt!')));
}
Exemplo n.º 17
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
$country = addslashes(strip_tags(filter_input(INPUT_POST, 'country', FILTER_UNSAFE_RAW)));
$state = addslashes(strip_tags(filter_input(INPUT_POST, 'state', FILTER_UNSAFE_RAW)));
// если просят только чистых
$clear = addslashes(strip_tags(filter_input(INPUT_POST, 'isclear', FILTER_VALIDATE_BOOLEAN)));
$shop_id = addslashes(strip_tags(filter_input(INPUT_POST, 'shop_id', FILTER_VALIDATE_INT)));
//debug($clear);exit();
if ($clear == 1) {
Exemplo n.º 18
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
$pkg_id = addslashes(strip_tags(filter_input(INPUT_POST, 'pkg_id', FILTER_VALIDATE_INT)));
$q = "SELECT * FROM `packages` WHERE `drop_id` = " . $user['id'] . " AND `id` = " . $pkg_id;
$check = $db->query($q);
if (!isset($check) || $check == false) {
    exit(json_encode(array('type' => 'error', 'text' => 'Товар или получатель не найдены!')));
}
if ($check[0]->drop_id != $user['id']) {
Exemplo n.º 19
0
/*
 * Fallback handler (archaic browsers with no File API will send requests here by default form submitting)
 */
include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if (!empty($_FILES) && !empty($_FILES['my-file'])) {
    $fileMeta = $_FILES['my-file'];
    // Key was defined in 'fieldName' option
    if ($fileMeta['type'] == 'image/png') {
        // Do something with received file
    }
Exemplo n.º 20
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
// фильтруем входящие данные
$action = addslashes(strip_tags(filter_input(INPUT_POST, 'action', FILTER_UNSAFE_RAW)));
//$buyer_id = addslashes(strip_tags(filter_input(INPUT_POST, 'buyer_id', FILTER_VALIDATE_INT)));
$currency = addslashes(strip_tags(filter_input(INPUT_POST, 'currency', FILTER_UNSAFE_RAW)));
$drop_id = addslashes(strip_tags(filter_input(INPUT_POST, 'drop_id', FILTER_VALIDATE_INT)));
$item = addslashes(strip_tags(filter_input(INPUT_POST, 'item', FILTER_UNSAFE_RAW)));
$euro = addslashes(strip_tags(filter_input(INPUT_POST, 'euro', FILTER_VALIDATE_INT)));
Exemplo n.º 21
0
<?php

include_once '../gears/config.php';
include_once $cfg['realpath'] . '/gears/headers.php';
include_once $cfg['realpath'] . '/gears/bootstrap.php';
include_once $cfg['realpath'] . '/gears/functions.php';
include_once $cfg['realpath'] . '/gears/l18n.php';
include_once $cfg['realpath'] . '/gears/db.php';
//header('Content-type: application/json');
$_ts = microtime_float();
// смотрим язык пользователя
$cfg['ln'] = getClientLang();
// создаем инстанс подключения к базе
$db = new dbClass($cfg['db']);
// забираем из базы опции и кладем их в конфиг
$options = $db->query("SELECT * FROM options");
// кладем в конфиг все что забрали из базы (все опции)
if (isset($options[0])) {
    foreach ($options as $k => $v) {
        $cfg['options'][$v->option] = $v->value;
    }
}
unset($options);
// смотрим на авторизацию
include $cfg['realpath'] . '/gears/auth_init.php';
if ($user['rankname'] != 'support' && $user['rankname'] != 'admin' && $user['rankname'] != 'shipper') {
    exit('Запрещено!');
}
// фильтруем входящие данные
$idItem = filter_input(INPUT_POST, 'idItem', FILTER_VALIDATE_INT);
$parentId = filter_input(INPUT_POST, 'parentMenuId', FILTER_VALIDATE_INT);
Exemplo n.º 22
0
 public function loginFrontUser($password)
 {
     return dbClass::query('SELECT * FROM passwords WHERE password="******"')->fetch_assoc();
 }