function actEdit() { global $ST, $get; $field = array('u_id' => $get->getInt('id'), 'login' => '', 'status' => 1, 'name' => '', 'company' => '', 'last_name' => '', 'first_name' => '', 'middle_name' => '', 'phone' => '', 'city' => '', 'address' => '', 'street' => '', 'house' => '', 'flat' => '', 'porch' => '', 'floor' => '', 'mail' => '', 'avat' => '', 'balance' => 0, 'discount' => 0, 'type' => '', 'other_info' => ''); $other_info = array('inn' => ''); if ($field['u_id']) { $rs = $ST->select("SELECT " . join(',', array_keys($field)) . " FROM sc_users WHERE u_id=" . $field['u_id']); if ($rs->next()) { $field = $rs->getRow(); if ($oi = getJSON($field['other_info'])) { $field = array_merge($field, $oi); } if (in_array($field['type'], array('partner'))) { $rs = $ST->select("SELECT * FROM sc_partner_data WHERE userid=" . $field['u_id']); if ($rs->next()) { $field['ank'] = $rs->getRow(); $field['ank']['flowers'] = @unserialize($field['ank']['flowers']); } } } } $field['ank_flowers'] = $this->enum('ank_flowers'); $field['groups'] = $this->enum('u_type'); $this->explorer[] = array('name' => 'Редактировать'); $this->display($field, dirname(__FILE__) . '/users_edit.tpl.php'); }
/** * http://ulogin.ru/constructor.php * */ function actULogin() { $s = file_get_contents('http://ulogin.ru/token.php?token=' . $_POST['token'] . '&host=' . $_SERVER['HTTP_HOST']); $user = getJSON($s); //$user['network'] - соц. сеть, через которую авторизовался пользователь //$user['identity'] - уникальная строка определяющая конкретного пользователя соц. сети //$user['first_name'] - имя пользователя //$user['last_name'] - фамилия пользователя my_session_start(); $login = $user['network'] . $user['uid']; $rs = DB::select("SELECT * FROM sc_users WHERE login='******'"); $data = array('name' => "{$user['first_name']} {$user['last_name']}"); if ($rs->next()) { DB::update('sc_users', $data, "u_id={$rs->getInt('u_id')}"); $_SESSION['_USER']['u_id'] = $rs->getInt('u_id'); $this->setUser($rs->getRow()); } else { $data['login'] = $login; $data['type'] = 'user'; $id = DB::insert('sc_users', $data); $_SESSION['_USER']['u_id'] = $id; $this->setUser($data); } header('Location: /'); exit; }
public function __construct() { $this->projects = getJSON('projects.php'); if (file_exists(BASE_PATH . "/data/" . $_SESSION['user'] . '_acl.php')) { $this->assigned = getJSON($_SESSION['user'] . '_acl.php'); } }
public function Load() { if (!file_exists(DATA . "/settings.php")) { saveJSON('settings.php', array($this->username => array('codiad.username' => $this->username))); } $settings = getJSON('settings.php'); echo formatJSEND("success", $settings[$this->username]); }
function getOwnDictionary() { if (!file_exists(DATA . "/config/" . USERDIC)) { return ""; } $content = getJSON(USERDIC, "config"); return $content['dictionary']; }
function centerMap($location) { $rawjson = getJSON($location); $json = json_decode($rawjson); $general_lat = $json->results[0]->geometry->location->lat; $general_lng = $json->results[0]->geometry->location->lng; return $general_lat . " " . $general_lng; }
function requireParam($argName) { $body = getJSON(); if (!isset($body) || !property_exists($body, $argName)) { error('Missing parameter: ' . $argName, 501); return; } return $body->{$argName}; }
public function getJSON() { $o_return = array(); if (!is_null($this->is_type)) { $o_return["push_notification_type"] = $this->is_type; } if (!is_null($this->io_settlement_batch)) { $o_return["push_notification_settlement_batch"] = $this->io_settlement_batch . getJSON(); } if (!is_null($this->io_bank_account_transaciton)) { $o_return["push_notification_bank_account_transaction"] = $this->io_bank_account_transaciton . getJSON(); } return $o_return; }
public function open() { $this->existDir(); $msg = array(); $msg['content'] = json_encode(getJSON($this->getFileName(), "config")); $msg['name'] = basename($this->getFileName(), ".php") . ".json"; $msg['mtime'] = filemtime($this->getFilePath()); if ($msg['content'] !== false) { $msg['status'] = "success"; } else { $msg['status'] = "error"; $msg['message'] = "Failed to open file!"; } return json_encode($msg); }
public function getByIp($ip) { if (count(explode(".", $ip)) != 4) { return getJSON($this->err['wrong_ip']); } $ip = $this->padIP($ip); if (!$ip) { return $this->getJSON($this->err['wrong_ip']); } $this->get_by_ip->execute(array(":ip" => $ip)); $rs = $this->get_by_ip->fetch(PDO::FETCH_ASSOC); if (!$rs) { return $this->getJSON($this->err['no_ip']); } $answer = array("country_code" => $rs['country_code'], "country_name" => $rs['country_name'], "isp_name" => $rs['isp_name'], "range" => array("start" => $this->padIP($rs['ipv4_range_start'], true), "end" => $this->padIP($rs['ipv4_range_end'], true))); return $this->getJSON($answer); }
public function Authenticate() { $pass = false; $this->EncryptPassword(); $users = getJSON('users.php'); foreach ($users as $user) { if ($user['username'] == $this->username && $user['password'] == $this->password) { $pass = true; $_SESSION['user'] = $this->username; if ($user['project'] != '') { $_SESSION['project'] = $user['project']; } } } if ($pass) { echo formatJSEND("success", array("username" => $this->username)); } else { echo formatJSEND("error", "Incorrect Username or Password"); } }
function KeywordLink_insTB($target, $mother) { global $configVal; requireComponent('Textcube.Function.misc'); $data = setting::fetchConfigVal($configVal); if (!$data['apikey']) { return $target . "<p><font color=red>※API 키가 입력되어있지 않습니다 by KeywordLink Plugin※</font></p>"; } else { $apikey = $data['apikey']; } $obj = getJSON($target, $apikey); //JSON결과 OBJ변수에 담기 $itemCount = $obj->itemCount; //키워드 문맥 추출 결과 총 갯수 // 본문 키워드 추출후 카운트 갯수에 따라 테이블 줄수를 증가시켜 출력 if ($itemCount > 0) { $target = $target . "\r\n\t\t\t<p>\r\n\t\t\t<table border=0 cellpadding=0 cellspacing=0> \r\n \r\n\r\n\t\t\t<table border=0 cellpadding=5 cellspacing=1> \r\n\t\t\t<tr>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>중요도</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>반복 횟수</font></td>\r\n\t\t\t\t<td bgcolor=black align=center width=110><font color=white>키워드 위치</font></td>\r\n\t\t\t</tr>"; for ($i = 0; $i < $itemCount; $i++) { $target .= "<td bgcolor=white width=110>" . $obj->items[$i]->keyword . "</td>"; $target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->score . "</td>"; $target .= "<td bgcolor=white width=110><center>" . $obj->items[$i]->count . "</center></td>"; $locationCount = $obj->items[$i]->count; if ($locationCount > 1) { for ($j = 0; $j < $locationCount; $j++) { $target .= "<td><center>" . $obj->items[$i]->locations[$j] . "</center></td>"; } } else { $target .= "<td><center>" . $obj->items[$i]->locations[0] . "</center></td>"; } $target .= "</tr>"; } //} $target = $target . "</table>"; } else { return $target . '<p><font color=red>※키워드 추출 결과 : 결과값이 없습니다※</font></p>'; } return $target; }
public function pull() { $cli_params = array(); $cli_params[] = "--non-interactive"; if ($this->username != '') { $cli_params[] = "--username " . $this->username; } if ($this->password != '') { //Need to clean up the password so it can be passed to the cli, If anyone find's or thinks of more let me know tholum@couleetechlink.com $this->password = str_replace(array("*", "^", "&", '"'), array('\\*', '\\^', '\\&', '\\"'), $this->password); $cli_params[] = "--password " . $this->password; } if ($this->svnrepo) { if (!$this->isAbsPath($this->path)) { if (!file_exists(WORKSPACE . '/' . $this->path)) { $this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params); } else { die(formatJSEND("success", array("message" => "Folder already exists"))); } } else { if (!file_exists($this->path)) { $this->command_exec = "cd " . WORKSPACE . " && svn co \"" . $this->svnrepo . "\" " . $this->path . " " . implode(" ", $cli_params); } else { die(formatJSEND("success", array("message" => "Folder already exists"))); } } if ($this->newproject) { $this->projects = getJSON('projects.php'); $this->projects[] = array("name" => $this->name, "path" => $this->path); saveJSON('projects.php', $this->projects); } $this->ExecuteCMD(); echo formatJSEND("success", array("message" => "Repo cloned")); } else { echo formatJSEND("error", array("message" => "No Repo specified")); } }
<!DOCTYPE html> <html lang="en"> <?php include_once './funcs.php'; session_start(); handleAction(); if (!isset($_SESSION['id'])) { $pessoa = getJSON(); } ?> <head> <meta charset="utf-8"> <title>SafeGuard</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content=""> <meta name="author" content=""> <!-- Le styles --> <link href="./css/bootstrap.css" rel="stylesheet"> <link href="./css/bootstrap-responsive.css" rel="stylesheet"> <style type="text/css"> body { padding-top: 60px; padding-bottom: 40px; #map-canvas { height: 100% } } </style>
public function getLocalVersion() { if (file_exists(BASE_PATH . "/.git/HEAD")) { $tmp = file_get_contents(BASE_PATH . "/.git/HEAD"); if (strpos($tmp, "ref:") === false) { $data[0]['version'] = trim($tmp); } else { $data[0]['version'] = trim(file_get_contents(BASE_PATH . "/.git/" . trim(str_replace('ref: ', '', $tmp)))); } $data[0]['name'] = ""; if (file_exists(DATA . "/version.php")) { $data[0]['optout'] = "true"; } } else { $data = getJSON('version.php'); } return $data; }
return $json; } for ($i = 1; $i <= (int) $loops; $i++) { echo "Fetching {$i} of {$loops}"; $time_start = microtime(true); $retries = 0; while (1) { try { $packages = getJSON("{$url}/packages.json"); break; } catch (RuntimeException $e) { $retries++; } } foreach ($packages['provider-includes'] as $path => $info) { $path = str_replace('%hash%', $info['sha256'], $path); while (1) { try { getJSON("{$url}/{$path}"); break; } catch (RuntimeException $e) { $retries++; } } } $times[] = microtime(true) - $time_start; echo ' - time: ' . end($times) . " secs" . ($retries ? " (with {$retries} retries)" : '') . "\n"; } sort($times); $middle = floor($loops / 2); echo "\nMin: " . min($times) . " secs\nMax: " . max($times) . " secs\nMean: " . array_sum($times) / $loops . " secs\nMedian: " . ($loops % 2 === 0 ? ($times[$middle] + $times[$middle + 1]) / 2 : $times[$middle]) . " secs\n";
<form> <?php break; ////////////////////////////////////////////////////////////////////// // Set Project Access ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// // Set Project Access ////////////////////////////////////////////////////////////////////// case 'projects': // Get project list $projects = getJSON('projects.php'); // Get control list (if exists) $projects_assigned = false; if (file_exists(BASE_PATH . "/data/" . $_GET['username'] . '_acl.php')) { $projects_assigned = getJSON($_GET['username'] . '_acl.php'); } ?> <form> <input type="hidden" name="username" value="<?php echo $_GET['username']; ?> "> <label><?php i18n("Project Access for "); echo ucfirst($_GET['username']); ?> </label> <select name="access_level" onchange="if($(this).val()=='0'){ $('#project-selector').slideUp(300); }else{ $('#project-selector').slideDown(300).css({'overflow-y':'scroll'}); }"> <option value="0" <?php if (!$projects_assigned) {
function getFacturas() { $sql = 'SELECT * FROM vista_invoices'; return getJSON($sql); }
$u++; if ($objval != "") { $finalfile .= "{$objid}: {$objval}\n"; } if ($u == $numberofkeys) { // last $finalfile .= "\n\n"; } } } } ////////// if ($usergroup >= 4) { foreach ($FourPackages as $package) { $thisident = $debnames[$package]; $package_stuff = getJSON("all_packages/{$thisident}"); $numberofkeys = count(array_keys($package_stuff)); $y = 0; foreach ($package_stuff as $objid => $objval) { $y++; if ($objval != "") { $finalfile .= "{$objid}: {$objval}\n"; } if ($y == $numberofkeys) { // last $finalfile .= "\n\n"; } } } } file_put_contents("Packages", $finalfile);
} else { // If it doesn't exist $userudid = $_POST['udid']; $newuserlevel = $_POST['level']; $newusername = $_POST['name']; $oldarray = getJSON("approved_udids_2"); $newarray = array($userudid, $newuserlevel, $newusername); array_push($oldarray, $newarray); saveJSON("approved_udids_2", $oldarray); echo "User added!"; $finaladdr = $CurrentDirectory . "ManageUDID.php"; echo "<META http-equiv='refresh' content='1;URL={$finaladdr}'>"; } } else { // Otherwise, show. $approved_udids = getJSON("approved_udids_2"); if ($detect->isiOS()) { ?> <!DOCTYPE html> <html> <head> <link href="ios7css.css" rel="stylesheet"> <meta content="width=device-width, user-scalable=no" name="viewport"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>All UDIDs</title></head><body> <!-- <ul><li><p>Hello, <?php // echo $_SERVER["HTTP_X_MACHINE"]; ?> !</p></li></ul> --> <header><h1>All UDIDs</h1></header> <h2>Users</h2> <ul><li><p><?php
function getOrden() { $sql = 'SELECT * FROM vista_orders'; return getJSON($sql); }
<?php if (checkAccess()) { ?> <th width="70"><?php i18n("Delete"); ?> </th><?php } ?> </tr> </table> <div class="project-wrapper"> <table class="codiad" width="100%" style="word-wrap: break-word;word-break: break-all;"> <?php // Get projects JSON data $projects = getJSON('projects.php'); sort($projects); foreach ($projects as $project => $data) { $show = true; if ($projects_assigned && !in_array($data['path'], $projects_assigned)) { $show = false; } if ($show) { ?> <tr <?php if ($_SESSION['project'] == $data['path']) { ?> class="active-project-row" <?php } ?> >
public function __construct() { $this->actives = getJSON('active.php'); }
$rs = $db->query($sql); if ($rs) { while ($row = $rs->fetch_object()) { $result[] = $row; } if (empty($result)) { $result = array("message" => "empty result set "); } } else { $result = array("error" => "query fail"); } break; case "delete": //db.php?token=ESEMPIODITOKENVALIDO&action=delete&table=tablename&where={"field1":1,"field1":2} $table = get("table"); $where = getJSON("where"); $sql = buildDELETE($table, $where); $rs = $db->query($sql); if ($rs) { $result = array("message" => "{$db->affected_rows} row(s) deleted"); } else { $result = array("error" => "query fail"); } break; default: $result = array("error" => "action undefined"); } } catch (Exception $e) { $result = array("error" => $e->getMessage()); } $db->close();
if ($session === true) { unset($_SESSION['redirlink']); if (isset($_POST['submitted'])) { $BetaModeStatus = $_POST['betamode']; if ($BetaModeStatus == "true") { $finalarray = array(true); } if ($BetaModeStatus == "false") { $finalarray = array(false); } saveJSON("beta_mode", $finalarray); echo "Updated!"; $finaladdr = $CurrentDirectory . "BetaMode.php"; echo "<META http-equiv='refresh' content='1;URL={$finaladdr}'>"; } else { $betamode = getJSON("beta_mode"); if ($betamode[0] == true) { $betamodeword = "true"; } elseif ($betamode[0] == false) { $betamodeword = "false"; } else { $betamodeword = "error :("; } if ($detect->isiOS()) { ?> <!DOCTYPE html> <html> <head> <link href="ios7css.css" rel="stylesheet"> <meta content="width=device-width, user-scalable=no" name="viewport"> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"><title>All Packages</title></head><body>
public function Load() { return getJSON("/config/" . get_called_class() . ".php"); }
$description_nobr = $descriptsarray[$askedident]; $description = nl2br($description_nobr); } else { echo "Couldn't find that file!"; exit; } $con = mysqli_connect($Database, $DBUser, $DBPass, $DB_DB); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con, "SELECT * FROM downloads"); $storeDownloadedPackages = array(); while ($row = mysqli_fetch_array($result, MYSQL_ASSOC)) { $storeDownloadedPackages[] = $row['filename']; } $debnames = getJSON("../debnames"); $allpackages = array_keys($debnames); $currentdeb_notfound = false; // Deprecated ^^ if (in_array($askedident, $storeDownloadedPackages)) { $download_count = mysqli_query($con, "SELECT * FROM `downloads` WHERE filename='{$askedident}'"); $download_count = mysqli_fetch_array($download_count); $download_count2 = $download_count['count']; if ($download_count2 == 1) { $afterres = "time"; } else { $afterres = "times"; } } else { // if not in database $download_count2 = "0";
saveJSON("package_groups", $package_groups); // Alright, removed from package_groups, now remove from debnames $debnames2 = getJSON("debnames"); unset($debnames2[$ident]); saveJSON("debnames", $debnames2); // This is where we'd delete the depiction, if that's ok // Ok, removed from debnames. Now we're done, show success message. echo "Successfully deleted {$ident}!"; } else { echo "That doesn't exist!"; exit; } if ($_POST['depictiondelete'] === "yes") { // if they said yes, delete from depiction $desc_names = getJSON("descriptions/names"); $desc_desc = getJSON("descriptions/description"); $identifier = $_POST['identifier']; unset($desc_names[$identifier]); saveJSON("descriptions/names", $desc_names); unset($desc_desc[$identifier]); saveJSON("descriptions/description", $desc_desc); } } else { echo "Mmm, be sure to confirm it."; } } else { if ($detect->isiOS()) { ?> <!DOCTYPE html> <html> <head>
public static function checkPath($path) { if (file_exists(DATA . "/" . $_SESSION['user'] . '_acl.php')) { foreach (getJSON($_SESSION['user'] . '_acl.php') as $projects => $data) { if (strpos($path, $data) === 0) { return true; } } } else { foreach (getJSON('projects.php') as $project => $data) { if (strpos($path, $data['path']) === 0) { return true; } } } return false; }
} } elseif (isset($_GET["rawpost"])) { $onload = manageOnLoad("rawpost"); $text .= manageRawPostForm(); } elseif (isset($_GET["logout"])) { $_SESSION['tinyib'] = ''; session_destroy(); die('--> --> --><meta http-equiv="refresh" content="0;url=' . $returnlink . '?manage">'); } if ($text == '') { $text = manageStatus(); } } else { $onload = manageOnLoad('login'); $text .= manageLogInForm(); } echo managePage($text, $onload); } elseif (!file_exists('index.html') || countThreads() == 0) { rebuildIndexes(); } elseif (isset($_GET['json']) && TINYIB_JSON) { $redirect = false; $json = $_GET['json']; if ($json == '') { echo '{"id": ' . 0 . ', "name": "' . TINYIB_BOARD . '", "threads":' . getJSON(allThreads(true)) . '}'; } else { echo '{"id": ' . $json . ', "posts":' . getJSON(postsInThreadByID($json, true, true)) . '}'; } } if ($redirect) { echo '--> --> --><meta http-equiv="refresh" content="' . (isset($slow_redirect) ? '3' : '0') . ';url=' . (is_string($redirect) ? $redirect : 'index.html') . '">'; }