$try_include = @(include 'config.php'); if (!$try_include) { header("Location: setup.php"); } header('Cache-Control: no-cache'); header('Pragma: no-cache'); if (function_exists('getOpenIDStore')) { require_once 'lib/session.php'; require_once 'lib/actions.php'; init(); $action = getAction(); if (!function_exists($action)) { $action = 'action_default'; } $resp = $action(); writeResponse($resp); } else { ?> <html> <head> <title>PHP OpenID Server</title> <body> <h1>PHP OpenID Server</h1> <p> This server needs to be configured before it can be used. Edit <code>config.php</code> to reflect your server's setup, then load this page again. </p> </body> </head> </html>
$_SESSION['canceled'] = false; session_write_close(); if (!$_POST['APC_UPLOAD_PROGRESS']) { writeResponse("<error>You have not sent the APC_UPLOAD_PROGRESS parameter.</error>", 1); exit; } $key = $_POST['APC_UPLOAD_PROGRESS']; if (!$_FILES[$key]) { writeResponse("<error>You have sent an incorrect APC_UPLOAD_PROGRESS key:" . $key . "</error>", 1); exit; } $cnt = 0; $fld = str_replace("[]", "", $key); $msg = "<message>jsupload.php {$version}</message>\n<files>\n"; foreach ($_FILES[$key]['tmp_name'] as $tmpfile) { $size = $_FILES[$key]['size'][$cnt]; $type = $_FILES[$key]['type'][$cnt]; $name = $_FILES[$key]['name'][$cnt]; $field = $fld . '-' . $cnt++; $uploadfile = $uploaddir . $field . ".bin"; $uploadinfo = $uploaddir . $field . ".info"; if (move_uploaded_file($tmpfile, $uploadfile)) { $msg .= " <file>\n <field>{$field}</field>\n <name>{$name}</name> \n <ctype>{$type}</ctype>\n <size>{$size}</size>\n </file>"; $fh = fopen($uploadinfo, 'w'); fwrite($fh, $name . "\n" . $type . "\n" . $size . "\n"); fclose($fh); } } $msg .= "</files>\n<finished>ok</finished>"; writeResponse($msg, 1); }
public function export($query = null) { if (!$query) { $this->error('query was empty'); return; } if ($this->conn->error) { $this->error($this->conn->error); return; } $csv = uniqid(); $result = $this->conn->query($query); $this->sendExportHeader($csv); if (!method_exists($result, 'fetch_fields')) { $this->error('query was not selectable'); return; } if (!method_exists($result, 'fetch_array')) { $this->error('query was not selectable'); return; } $fields = $result->fetch_fields(); foreach ($fields as $idx => $row) { if ($idx > 0) { writeResponse(",", $this->client); } writeResponse($row->name, $this->client); } if ($fields) { writeResponse("\n", $this->client); } while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $idx = 0; foreach ($row as $field => $val) { if ($idx > 0) { writeResponse(",", $this->client); } writeResponse('"' . $val . '"', $this->client); $idx++; } writeResponse("\n", $this->client); } }
$user_path = substr($user, strpos($user, ":")); if ($info->message->isOpenID1() && $req_url_path != $user_path) { register_error(sprintf(elgg_echo("openid_server:loggedin_as_wrong_user"), $req_url, $user)); forward(); } else { $trust_root = $info->trust_root; $trusted = isset($trusted) ? $trusted : isTrusted($identity, $trust_root); if ($trusted) { setRequestInfo(); $server =& getServer(); if ($info->message->isOpenID1()) { $response =& $info->answer(true, null, $req_url); } else { $response =& $info->answer(true, null, getServerURL(), $identity); } addSregFields($response, $info, $identity); $webresponse =& $server->encodeResponse($response); $new_headers = array(); foreach ($webresponse->headers as $k => $v) { $new_headers[] = $k . ": " . $v; } writeResponse(array($new_headers, $webresponse->body)); exit(0); } elseif ($fail_cancels) { setRequestInfo(); forward($info->getCancelURL()); } else { writeResponse(trust_render($info)); } } }