require_once 'VIH/configuration.php'; require_once 'konstrukt/konstrukt.inc.php'; require_once 'bucket.inc.php'; require_once 'Ilib/ClassLoader.php'; require_once 'Doctrine.php'; spl_autoload_register(array('Doctrine', 'autoload')); class VIH_NotFoundComponent extends k_Component { protected $template; function __construct(k_TemplateFactory $template) { $this->template = $template; } function dispatch() { $tpl = $this->template->create('404'); $response = new k_HtmlResponse($tpl->render($this)); $response->setStatus(404); return $response; } } class VIH_Document extends k_Document { } $factory = new VIH_Factory(); $container = new bucket_Container($factory); if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) { $components = new k_InjectorAdapter($container, new VIH_Document()); $components->setImplementation('k_DefaultPageNotFoundComponent', 'VIH_NotFoundComponent'); k()->setComponentCreator($components)->run('VIH_Controller_Login_Root')->out(); }
</div> <span id='copyright'> <?php $copyright = empty($config->site->copyright) ? '' : $config->site->copyright . '-'; $contact = json_decode($config->company->contact); $company = (empty($contact->site) or $contact->site == $this->server->http_host) ? $config->company->name : html::a('http://' . $contact->site, $config->company->name, "target='_blank'"); echo "© {$copyright}" . date('Y') . ' ' . $company . ' '; ?> </span> <span id='icpInfo'><?php echo $config->site->icpSN; ?> </span> <div id='powerby'> <?php printf($lang->poweredBy, $config->version, k(), $config->version); ?> </div> </div> </footer> <?php if ($config->debug) { js::import($jsRoot . 'jquery/form/min.js'); } if (isset($pageJS)) { js::execute($pageJS); } /* Load hook files for current page. */ $extPath = dirname(dirname(dirname(__FILE__))) . '/common/ext/view/'; $extHookRule = $extPath . 'footer.front.*.hook.php';
function setaccess() { $rid = $_GET['rid']; $db = k("role"); $role = $db->find($rid); $this->assign('role', $role); $node = Rbac::getNodeList($rid); if (!$node) { $this->error("还没有设置权限节点,请设置", 'showaddnode'); } $this->assign('node', $node); $this->display(); }
include_once "./vendor/autoload.php"; ?> <!doctype html> <html lang="it"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <title></title> <meta name="description" content=""> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <?php if (isset($_GET)) { echo '<h2>$_GET</h2>'; k($_GET); } if (isset($_POST)) { echo '<h2>$_POST</h2>'; k($_POST); } if (isset($_REQUEST)) { echo '<h2>$_REQUEST</h2>'; k($_REQUEST); } ?> </body> </html>
if ($tags) { if ($user->send_category_as_array != 1) { $data['category'] = $tags; } else { $data['category'] = implode(',', $tags); } } } // Handle attachments $filename = false; foreach ($_FILES as $file) { // If a photo was included, set the filename to the downloaded file if (preg_match('/image/', $file['type'])) { $filename = $file['tmp_name']; } // Sometimes MMSs are sent with a txt file attached instead of in the body if (preg_match('/text\\/plain/', $file['type'])) { $content = trim(file_get_contents($file['tmp_name'])); if ($content) { $data['content'] = $content; } } } $r = micropub_post_for_user($user, $data, $filename); if (k($r, 'location')) { $result = 'created post at ' . $r['location']; } else { $result = 'error creating post'; } $app->response()->body($result); });
break; default: print "<td></td></tr>"; break; } } ?> </table> </TD></TR> <TR style="background-color=#f5f5f5"><TD> <TABLE BORDER=0 CELLSPACING=2 CELLPADDING=0> <tr><td><b>Full text of the complaint</b> (<A HREF="JavaScript:window.print();">click here to print</A>)</td></tr> <tr><td> </td></tr> <tr><td><?php print nl2br(k($c->message)); ?> </td></tr> <tr><td> </td></tr> <?php if ($c->confirmed == "N") { ?> <tr><td align=center><FORM ACTION="complaint.php?c=<?php print $c->id; ?> &" METHOD=post><input type=submit value="Confirm Receipt"><input name=confirm type=hidden></form></td></tr> <?php } else { ?> <tr><td align=center><input type=button value="Back" onClick="JavaScript:location='members.php';"></td></tr>
// PHP5 64 allowed with warning "PHP Strict standards: Only variables // should be passed by reference", but does not change the original argument // HHVM, allowed quietly, but does not change the original argument var_dump($z); g($z = $z - 2); // same as above var_dump($z); // g($z++); // PHP5 32/64, Error: Only variables can be passed by reference // HHVM, Error: Cannot pass parameter 1 by reference // ($z++)++; // All 3, Error: unexpected '++' g(--$z); // PHP5 32, allowed quietly, but does not change the original argument // PHP5 64 allowed with warning "PHP Strict standards: Only variables // should be passed by reference", but does not change the original argument // HHVM, allowed quietly, but does not change the original argument // ----$z; // All 3, Error: unexpected '--' var_dump($z); //*/ ///* function k() { return 10; } var_dump(k()); g(k()); // PHP5 32, allowed quietly, but (presumably) does not change the original argument // PHP5 64 allowed with warning "PHP Strict standards: Only variables // should be passed by reference", but (presumably) does not change the original argument // k() = 10; // All 3, Error: Can't use function return value in write context // HHVM, allowed quietly, but (presumably) does not change the original argument //*/
function upload_file($type = 'img', $dir = '/media/') { global $app; if ($type == "img") { $file_form = $_FILES['img-file']; } else { if ($type == "doc") { $file_form = $_FILES['doc-file']; } } $maxSize = 25000000; $imgExts = array("gif", "jpeg", "jpg", "png"); $docExts = array("pdf", "doc", "docx", "xls", "xlsx", "csv"); $allowedExts = array_merge($imgExts, $docExts); $allowedTypes = array("image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/x-png", "image/png", "application/pdf", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "application/vnd.ms-excel", "application/msword"); $file_obj = array(); $file_obj['name'] = str_replace(" ", "_", $file_form['name']); $temp = explode(".", $file_obj['name']); $file_obj['ext'] = strtolower(end($temp)); $file_obj['prefix'] = implode("", array_slice($temp, 0, -1)); $file_obj['error'] = $file_form["error"]; $file_obj['app_type'] = $file_form["type"]; $file_obj['size'] = $file_form["size"]; $file_obj['tmp_name'] = $file_form["tmp_name"]; // Check for errors // File exists if (empty($file_form) or empty($file_obj['name'])) { $app['_error'] .= "Missing file or filename.<br>"; return false; } // Allowed extension if (!in_array($file_obj['ext'], $allowedExts)) { k($allowedExts); $app['_error'] .= "<strong>" . $file_obj['ext'] . "</strong> is not an allowed extension.<br>"; return false; } else { // Get file type from extension if (in_array($file_obj['ext'], $imgExts)) { $file_obj['type'] = "file-image"; } else { $file_obj['type'] = "file-document"; } } // Allowed type if (!in_array($file_obj['app_type'], $allowedTypes)) { $app['_error'] .= "<strong>" . $file_obj['app_type'] . "</strong> is not an allowed file type.<br>"; return false; } // Size limit if ($file_obj['size'] > $maxSize) { $megs = number_format($file_obj['size'] / 1000000, 2); $allowedMegs = number_format($maxSize / 1000000, 2); $app['_error'] .= "<strong>{$megs} MB</strong> is too large. The maximum size allowed is {$allowedMegs} MB.<br>"; return false; } // Other file upload errors if ($file_obj['error'] > 0) { $app['_error'] .= "Upload file error: " . $file_obj['error'] . "<br>"; return false; } if ($app['_error'] === "") { $file_obj['path'] = $app['_root_url'] . $dir . $file_obj['name']; $file_obj['root_path'] = $app['_web_root'] . $dir . $file_obj['name']; if (file_exists($app['_web_root'] . $dir . $file_obj['name'])) { $app['_warning'] .= "<strong>Warning: </strong>" . $file_obj['name'] . " already exists. Updating file. <br>"; } if (move_uploaded_file($file_obj['tmp_name'], $file_obj['root_path'])) { $app['_success'] .= "Uploaded file to <strong><a href='" . $file_obj['path'] . "' target='_blank'>" . $file_obj['path'] . "</a></strong>.<br>"; } else { $app['_error'] .= "Error moving uploaded file to requested directory. <br>"; } return $file_obj; } else { return false; } }
<?php include "../../class.krumo.php"; $fp = fopen(__FILE__, "r"); $a = array('first' => $fp, 'last' => new bar(), 'null_var' => null, 'float' => pi(), 'bool' => true, ' leading_space' => 6 * 8, 'trailing_space ' => 'grapes', 'middle space' => 'Mt. Rushmore', 'phones' => array(5036541278, 8714077831, 'x253'), 'long_str' => "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum...", 'empty_arr' => array(), 'func_str' => 'preg_replace', 'address' => array('street' => '123 Fake Street', 'city' => 'Portland', 'state' => 'Maine'), 'unixtime' => 1231241234, 'microtime' => microtime(1)); if (isset($_GET['short']) || php_sapi_name() === 'cli') { kd($a, KRUMO_EXPAND_ALL); } print "<h2>krumo capture</h2>\n"; $str = k(array('foo' => 'bar'), KRUMO_RETURN); print $str; print "<h2>krumo</h2>\n"; k(array('likes', 'kittens', 'and', 'dogs')); print "<h2>krumo passing multiple args</h2>\n"; k('likes', 'kittens', 'and', 'dogs'); print "<h2>krumo + die()</h2>\n"; kd($a); print "If you see this something is broken"; $k = new krumo(); class bar { public $b = 'bb'; public $a = 'aa'; public function foo() { return 'bar'; } }
<?php ob_start(); $ss_timer = microtime(true); require_once '../../conf/global.conf.php'; //create_container(); k()->setComponentCreator(new \Slipstream\Common\Injector\BucketAdapter($i = create_container()))->setLog($debug_log_path)->setDebug($debug_enabled)->run('Slipstream\\JsonRest\\Component\\Root')->out(); //$i->get('Slipstream\Common\Log\Handler')->log($i->get('Slipstream\Common\ConfigurationInterface'),'Execution time'); $i->get('Slipstream\\Common\\Log\\Handler')->log(microtime(true) - $ss_timer, 'Execution time'); ob_end_flush();
$response = ['latitude' => null, 'longitude' => null, 'locality' => null, 'region' => null, 'country' => null, 'best_name' => null, 'full_name' => null, 'timezone' => null, 'offset' => null, 'seconds' => null, 'localtime' => null]; if (k($params, 'input')) { $adr = p3k\Geocoder::geocode($params['input']); } else { $lat = (double) $params['latitude']; $lng = (double) $params['longitude']; $response['latitude'] = $lat; $response['longitude'] = $lng; $adr = p3k\Geocoder::adrFromLocation($lat, $lng); } if ($adr) { $response['latitude'] = $adr->latitude; $response['longitude'] = $adr->longitude; $response['locality'] = $adr->localityName; $response['region'] = $adr->regionName; $response['country'] = $adr->countryName; $response['best_name'] = $adr->bestName; $response['full_name'] = $adr->fullName; } $timezone = p3k\Timezone::timezone_for_location($response['latitude'], $response['longitude'], k($params, 'date')); if ($timezone) { $response['timezone'] = $timezone->name; $response['offset'] = $timezone->offset; $response['seconds'] = $timezone->seconds; $response['localtime'] = $timezone->localtime; } json_response($app, $response); } else { json_response($app, ['error' => 'invalid_request', 'error_description' => 'Request was missing parameters'], 400); } });
$username->addValidator('regex', false, array('/^[a-z]+/')); $username->addValidator('stringLength', false, array(6, 20)); $username->setRequired(true); $username->addFilter('StringToLower'); // Create and configure password element: $password = $form->createElement('password', 'password'); $password->setLabel("Password"); $password->addValidator('StringLength', false, array(6)); $password->setRequired(true); // Add elements to form: $form->addElement($username); $form->addElement($password); // use addElement() as a factory to create 'Login' button: $form->addElement('submit', 'login', array('label' => 'Login')); // Since we're using this outside ZF, we need to supply a default view: $form->setView(new Zend_View()); $this->form = $form; } return $this->form; } } class ZfThanks extends k_Component { function renderHtml() { return sprintf("<p>%s</p>", htmlspecialchars($this->query('flare'))); } } if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) { k()->run('ZfRegistrationForm')->out(); }
<p>The token endpoint did not return an access token. The <code>access_token</code> parameter is the token the client will use to make requests to the Micropub endpoint.</p> <?php } ?> <?php if (!k($this->auth, 'me')) { ?> <h4>Missing <code>me</code></h4> <p>The token endpoint did not return a "me" parameter. The <code>me</code> parameter lets this client know what user the token is for.</p> <?php } ?> <?php if (!k($this->auth, 'scope')) { ?> <h4>Missing <code>scope</code></h4> <p>The token endpoint did not return a "scope" parameter. The <code>scope</code> parameter lets this client what permission the token represents.</p> <?php } ?> <?php } ?> <?php } ?> <?php
<?php require_once dirname(__FILE__) . '/../config/global.inc.php'; k()->setComponentCreator(new k_InjectorAdapter(create_container()))->setLog($debug_log_path)->setDebug($debug_enabled)->run('components_Root')->out();
{ echo '$p ' . (isset($p) ? "is set\n" : "is not set\n"); var_dump($p); return $p; // return undefined variable } $a = array(10, 20, 30); var_dump($a); $d =& k($a[0]); var_dump($d); var_dump($a); $d =& k($a[5]); // non-existant element going in var_dump($d); var_dump($a); $d =& k($a["red"]); // non-existant element going in var_dump($d); var_dump($a); //*/ ///* // returning literals byRef is okay function &m1() { return NULL; } $d =& m1(); var_dump($d); function &m2() { return 1234;
?> "></td></tr> <tr><td align=right style="padding-right:5">Country:</td><td><input name=country type=text size=11 maxlength=20 value="<?php print k($p->country); ?> "></td></tr> <tr><td align=right style="padding-right:5">Username:</td><td><input name=username type=text size=11 maxlength=16 value="<?php print k($p->username); ?> "></td></tr> <tr><td align=right style="padding-right:5">Password:</td><td><input name=password type=text size=11 maxlength=16 value="<?php print k($p->password); ?> "></td></tr> <tr><td align=right style="padding-right:5">Security Question:</td><td><input name=question type=text size=28 maxlength=255 value="<?php print k($p->question); ?> "></td></tr> <tr><td align=right style="padding-right:5">Security Answer:</td><td><input name=answer type=text size=28 maxlength=255 value="<?php print k($p->answer); ?> "></td></tr> <tr><td align=right style="padding-right:5"></td><td style="padding-top:15"><input type=submit value="Create"></td></tr> </table> </form> </TD></TR> </TABLE> <?php include "adminfooter.inc";
return new DummyCollection($sort_by, $ascending); } protected function getKeys() { return $this->getSelection()->getKeys(); } protected function getSelection() { if (!isset($this->collection)) { $this->collection = $this->createSelection($this->query('sort'), $this->query('order') == 'asc'); } return $this->collection; } protected function getPaginator() { if (!isset($this->paginator)) { $this->paginator = new Zend_Paginator(new Zend_Paginator_Adapter_Iterator($this->getSelection())); $this->paginator->setCurrentPageNumber($this->query('page')); $this->paginator->setItemCountPerPage(10); } return $this->paginator; } function renderHtml() { $t = new k_Template('templates/' . $this->template); return $t->render($this, array('collection' => $this->getPaginator(), 'order_asc' => $this->query('order') == 'asc', 'sort' => $this->query('sort'), 'keys' => $this->getKeys(), 'pages' => $this->getPaginator()->getPages())); } } if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) { k()->run('ZfPaginationPage')->out(); }
<?php include_once 'base.php'; /////////////////////////////////////////////////////////////////////////////// // constants k("STDIN", Resource); k("STDOUT", Resource); k("STDERR", Resource); /////////////////////////////////////////////////////////////////////////////// // file handle based file operations f('fopen', Variant, array('filename' => String, 'mode' => String, 'use_include_path' => array(Boolean, 'false'), 'context' => array(Resource, 'null_object'))); f('popen', Variant, array('command' => String, 'mode' => String)); f('fclose', Boolean, array('handle' => Resource)); f('pclose', Variant, array('handle' => Resource)); f('fseek', Variant, array('handle' => Resource, 'offset' => Int64, 'whence' => array(Int64, 'SEEK_SET'))); f('rewind', Boolean, array('handle' => Resource)); f('ftell', Variant, array('handle' => Resource)); f('feof', Boolean, array('handle' => Resource)); f('fstat', Variant, array('handle' => Resource)); f('fread', Variant, array('handle' => Resource, 'length' => Int64)); f('fgetc', Variant, array('handle' => Resource)); f('fgets', Variant, array('handle' => Resource, 'length' => array(Int64, '1024'))); f('fgetss', Variant, array('handle' => Resource, 'length' => array(Int64, '0'), 'allowable_tags' => array(String, 'null_string'))); f('fscanf', Variant, array('handle' => Resource, 'format' => String), ReferenceVariableArguments); f('fpassthru', Variant, array('handle' => Resource)); f('fwrite', Variant, array('handle' => Resource, 'data' => String, 'length' => array(Int64, '0'))); f('fputs', Variant, array('handle' => Resource, 'data' => String, 'length' => array(Int64, '0'))); f('fprintf', Variant, array('handle' => Resource, 'format' => String), VariableArguments); f('vfprintf', Variant, array('handle' => Resource, 'format' => String, 'args' => VariantVec)); f('fflush', Boolean, array('handle' => Resource)); f('ftruncate', Boolean, array('handle' => Resource, 'size' => Int64));
$user->micropub_endpoint = $micropubEndpoint; $user->micropub_access_token = $token['auth']['access_token']; $user->micropub_scope = $token['auth']['scope']; $user->micropub_response = $token['response']; $user->save(); $_SESSION['user_id'] = $user->id(); // Make a request to the micropub endpoint to discover the syndication targets if any. // Errors are silently ignored here. The user will be able to retry from the new post interface and get feedback. get_syndication_targets($user); } unset($_SESSION['auth_state']); if ($redirectToDashboardImmediately) { if (k($_SESSION, 'redirect_after_login')) { $dest = $_SESSION['redirect_after_login']; unset($_SESSION['redirect_after_login']); $app->redirect($dest, 301); } else { $app->redirect('/new', 301); } } else { $html = render('auth_callback', array('title' => 'Sign In', 'me' => $me, 'authorizing' => $me, 'meParts' => parse_url($me), 'tokenEndpoint' => $tokenEndpoint, 'auth' => $token['auth'], 'response' => $token['response'], 'curl_error' => array_key_exists('error', $token) ? $token['error'] : false, 'destination' => k($_SESSION, 'redirect_after_login') ?: '/new')); $app->response()->body($html); } }); $app->get('/signout', function () use($app) { unset($_SESSION['auth']); unset($_SESSION['me']); unset($_SESSION['auth_state']); unset($_SESSION['user_id']); $app->redirect('/', 301); });
// Default to English $phrases = array('Hello' => 'Hello', 'Meatballs' => 'Meatballs'); if ($context->language()->isoCode() == 'sv') { $phrases = array('Hello' => 'Bork, bork, bork!', 'Meatballs' => 'Swedish meatballs'); } return new SimpleTranslator($phrases); } } class VIH_NotFoundComponent extends k_Component { protected $template; function __construct(k_TemplateFactory $template) { $this->template = $template; } function dispatch() { $tpl = $this->template->create('404'); $response = new k_HtmlResponse($tpl->render($this)); $response->setStatus(404); return $response; } } $factory = new VIH_Factory(); $container = new bucket_Container($factory); $mdb2 = $container->get('mdb2_driver_common'); if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) { $components = new k_InjectorAdapter($container, new VIH_Document()); $components->setImplementation('k_DefaultPageNotFoundComponent', 'VIH_NotFoundComponent'); k()->setComponentCreator($components)->setLanguageLoader(new MyLanguageLoader())->setTranslatorLoader(new SimpleTranslatorLoader())->run('VIH_Controller_Root')->out(); }
class SimpleTranslatorLoader implements k_TranslatorLoader { function load(k_Context $context) { return new k_Translation2Translator($context->language()->isoCode()); } } class Root extends k_Component { function map($name) { if ($name == 'template') { return 'Template'; } } function renderHtml() { return '<p>' . $this->translator()->translate('How are you?') . '</p>'; } } class Template extends k_Component { function renderHtml() { $template = new k_Template(dirname(__FILE__) . '/template.php'); return $template->render($this); } } if (realpath($_SERVER['SCRIPT_FILENAME']) == __FILE__) { k()->setLanguageLoader(new MyLanguageLoader())->setTranslatorLoader(new SimpleTranslatorLoader())->run('Root')->out(); }
<?php include_once 'base.php'; /////////////////////////////////////////////////////////////////////////////// // fb extension k("FB_UNSERIALIZE_NONSTRING_VALUE", Int64); k("FB_UNSERIALIZE_UNEXPECTED_END", Int64); k("FB_UNSERIALIZE_UNRECOGNIZED_OBJECT_TYPE", Int64); k("FB_UNSERIALIZE_UNEXPECTED_ARRAY_KEY_TYPE", Int64); f('fb_thrift_serialize', Variant, array('thing' => Variant)); f('fb_thrift_unserialize', Variant, array('thing' => Variant, 'success' => Boolean | Reference, 'errcode' => array(Int32 | Reference, 'null_variant'))); f('fb_serialize', Variant, array('thing' => Variant)); f('fb_unserialize', Variant, array('thing' => Variant, 'success' => Boolean | Reference, 'errcode' => array(Int32 | Reference, 'null_variant'))); f('fb_rename_function', Boolean, array('orig_func_name' => String, 'new_func_name' => String)); f('fb_utf8ize', Boolean, array('input' => String | Reference)); f('fb_call_user_func_safe', VariantVec, array('function' => Variant), VariableArguments); f('fb_call_user_func_safe_return', Variant, array('function' => Variant, 'def' => Variant), VariableArguments); f('fb_call_user_func_array_safe', VariantVec, array('function' => Variant, 'params' => VariantVec)); f('fb_get_code_coverage', Variant); /////////////////////////////////////////////////////////////////////////////// // xhprof f('xhprof_enable', NULL, array('flags' => Int32, 'args' => array(StringVec, 'null_array'))); f('xhprof_disable', Variant); f('xhprof_sample_enable', NULL); f('xhprof_sample_disable', Variant); /////////////////////////////////////////////////////////////////////////////// // php_query f('fb_load_local_databases', NULL, array('servers' => VariantMap)); f('fb_parallel_query', VariantMap, array('sql_map' => VariantMap, 'max_thread' => array(Int32, '50'), 'combine_result' => array(Boolean, 'true'), 'retry_query_on_fail' => array(Boolean, 'true'), 'connect_timeout' => array(Int32, '-1'), 'read_timeout' => array(Int32, '-1'), 'timeout_in_ms' => array(Boolean, 'false'))); f('fb_crossall_query', VariantMap, array('sql' => String, 'max_thread' => array(Int32, '50'), 'retry_query_on_fail' => array(Boolean, 'true'), 'connect_timeout' => array(Int32, '-1'), 'read_timeout' => array(Int32, '-1'), 'timeout_in_ms' => array(Boolean, 'false')));
<?php include_once 'base.php'; /////////////////////////////////////////////////////////////////////////////// k('INF', Double); k('NAN', Double); f('connection_aborted', Int32); f('connection_status', Int32); f('connection_timeout', Int32); f('constant', Variant, array('name' => String)); f('define', Boolean, array('name' => String, 'value' => Variant, 'case_insensitive' => array(Boolean, 'false'))); f('defined', Boolean, array('name' => String)); f('die', Variant, array('status' => array(Variant, 'null_variant'))); f('exit', Variant, array('status' => array(Variant, 'null_variant'))); f('eval', Variant, array('code_str' => String)); f('get_browser', Variant, array('user_agent' => array(String, 'null_string'), 'return_array' => array(Boolean, 'false'))); f('__halt_compiler'); f('highlight_file', Variant, array('filename' => String, 'ret' => array(Boolean, 'false'))); f('show_source', Variant, array('filename' => String, 'ret' => array(Boolean, 'false'))); f('highlight_string', Variant, array('str' => String, 'ret' => array(Boolean, 'false'))); f('ignore_user_abort', Int32, array('setting' => array(Boolean, 'false'))); f('pack', Variant, array('format' => String), VariableArguments); f('php_check_syntax', Boolean, array('filename' => String, 'error_message' => array(String | Reference, 'null'))); f('php_strip_whitespace', String, array('filename' => String)); f('sleep', Int32, array('seconds' => Int32)); f('usleep', NULL, array('micro_seconds' => Int32)); f('time_nanosleep', Variant, array('seconds' => Int32, 'nanoseconds' => Int32)); f('time_sleep_until', Boolean, array('timestamp' => Double)); f('uniqid', String, array('prefix' => array(String, 'null_string'), 'more_entropy' => array(Boolean, 'false'))); f('unpack', Variant, array('format' => String, 'data' => String)); f('sys_getloadavg', VariantMap);
$app->response()->body($html); return; } // Now the basic sanity checks have passed. Time to start providing more helpful messages when there is an error. // An authorization code is in the query string, and we want to exchange that for an access token at the token endpoint. // Discover the endpoints $micropubEndpoint = IndieAuth\Client::discoverMicropubEndpoint($me); $tokenEndpoint = IndieAuth\Client::discoverTokenEndpoint($me); if ($tokenEndpoint) { $token = IndieAuth\Client::getAccessToken($tokenEndpoint, $params['code'], $params['me'], buildRedirectURI(), clientID(), $params['state'], true); } else { $token = array('auth' => false, 'response' => false); } $redirectToDashboardImmediately = false; // If a valid access token was returned, store the token info in the session and they are signed in if ($token['auth'] && k($token['auth'], array('me', 'access_token', 'scope'))) { $_SESSION['auth'] = $token['auth']; $_SESSION['me'] = $params['me']; $user = ORM::for_table('users')->where('url', $me)->find_one(); if ($user) { // Already logged in, update the last login date $user->last_login = date('Y-m-d H:i:s'); // If they have logged in before and we already have an access token, then redirect to the dashboard now if ($user->micropub_access_token) { $redirectToDashboardImmediately = true; } } else { // New user! Store the user in the database $user = ORM::for_table('users')->create(); $user->url = $me; $user->date_created = date('Y-m-d H:i:s');
?> "></td></tr> <tr><td align=right style="padding-right:5">Suite:</td><td><input name=suite type=text size=11 maxlength=10 value="<?php print k($c->suite); ?> "></td></tr> <tr><td align=right style="padding-right:5">City:</td><td><input name=city type=text size=11 maxlength=35 value="<?php print k($c->city); ?> "></td></tr> <tr><td align=right style="padding-right:5">State:</td><td><input name=state type=text size=1 maxlength=2 value="<?php print k($c->state); ?> "></td></tr> <tr><td align=right style="padding-right:5">Zip:</td><td><input name=zip type=text size=11 maxlength=10 value="<?php print k($c->zip); ?> "></td></tr> <tr><td align=right style="padding-right:5">Country:</td><td><input name=country type=text size=11 maxlength=20 value="<?php print k($c->country); ?> "></td></tr> <tr><td align=right style="padding-right:5"></td><td style="padding-top:15"><input type=submit value="Create"></td></tr> </table> </form> </TD></TR> </TABLE> <?php include "adminfooter.inc";
/** * Action to add or edit a asset * @param \ride\library\i18n\I18n $i18n Instance of I18n * @param \ride\library\orm\OrmManager $orm * @param \ride\web\cms\form\AssetComponent * @param string $locale * @param string $asset * @return null */ public function assetFormAction(I18n $i18n, OrmManager $orm, AssetComponent $assetComponent, $locale, $asset = null) { $folderModel = $orm->getAssetFolderModel(); $assetModel = $orm->getAssetModel(); $styleModel = $orm->getImageStyleModel(); // prepare or lookup asset if ($asset) { $asset = $assetModel->getById($asset, $locale, true); if (!$asset) { $this->response->setNotFound(); return; } $folder = $asset->getFolder(); } else { $asset = $assetModel->createEntry(); $folder = $this->request->getQueryParameter('folder'); if ($folder) { $folder = $folderModel->createProxy($folder, $locale); $asset->setFolder($folder); } } $media = null; $referer = $this->getAssetReferer($asset, $locale); $embed = $this->request->getQueryParameter('embed', false); if ($asset->isUrl()) { try { $media = $assetModel->getMediaFactory()->createMediaItem($asset->value); } catch (UnsupportedMediaException $exception) { } } $data = array('asset' => $asset); $styles = $styleModel->find(); foreach ($styles as $style) { $data['style-' . $style->getSlug()] = $asset->getStyleImage($style->getSlug()); } // create form $form = $this->createFormBuilder($data); $form->addRow('asset', 'component', array('component' => $assetComponent, 'embed' => true)); foreach ($styles as $style) { $form->addRow('style-' . $style->getSlug(), 'image', array('path' => $assetComponent->getDirectory())); } $form = $form->build(); // process form if ($form->isSubmitted()) { try { $form->validate(); $data = $form->getData(); $asset = $data['asset']; $asset->setLocale($locale); $assetStyleModel = $orm->getAssetImageStyleModel(); foreach ($styles as $style) { $image = $data['style-' . $style->getSlug()]; $assetStyle = $asset->getStyle($style->getSlug()); if ($image) { if (!$assetStyle) { // style addition $assetStyle = $assetStyleModel->createEntry(); $assetStyle->setStyle($style); $asset->addToStyles($assetStyle); } $assetStyle->setImage($image); } elseif ($assetStyle) { // style removal $asset->removeFromStyles($assetStyle); } } $assetModel->save($asset); if ($this->request->isXmlHttpRequest()) { // ajax request $this->setTemplateView('assets/detail', array('item' => $asset, 'embed' => $embed, 'referer' => $referer, 'locale' => $locale)); } else { // regular client $this->response->setRedirect($referer); } return; } catch (ValidationException $exception) { k($exception->getErrorsAsString()); $this->setValidationException($exception, $form); } } $view = $this->setTemplateView('assets/asset', array('form' => $form->getView(), 'folder' => $folder, 'styles' => $styles, 'asset' => $asset, 'embed' => $embed, 'referer' => $referer, 'media' => $media, 'dimension' => $assetModel->getDimension($asset), 'locales' => $i18n->getLocaleCodeList(), 'locale' => $locale, 'maxSize' => $this->config->get('asset.upload.size.max'))); $form->processView($view); }
if (isset($uiHeader) and $uiHeader) { echo '</div>'; } ?> </div> <nav class="navbar navbar-default navbar-fixed-bottom hidden-sm hidden-xs" role="navigation"> <ul class='breadcrumb pull-left' id='positionBar'> <li><?php echo html::a(helper::createLink('admin', 'index'), $lang->chanzhiEPSx, "id='positionRoot'"); ?> </li> </ul> <div class="collapse navbar-collapse navbar-ex6-collapse"> <div class='navbar-text pull-right'><?php printf($lang->poweredBy, $config->version, k(), "<span class='icon icon-chanzhi'><i class='ic1'></i><i class='ic2'></i><i class='ic3'></i><i class='ic4'></i><i class='ic5'></i><i class='ic6'></i><i class='ic7'></i></span> " . $config->version); ?> </div> </div> </nav> <?php if ($config->debug) { js::import($jsRoot . 'jquery/form/min.js'); } if (isset($pageJS)) { js::execute($pageJS); } /* Load hook files for current page. */ $extPath = dirname(dirname(dirname(__FILE__))) . '/common/ext/view/'; $extHookRule = $extPath . 'footer.admin.*.hook.php';
<?php require_once dirname(__FILE__) . '/../config/global.inc.php'; k()->setComponentCreator(new k_InjectorAdapter(create_container()))->setLog(dirname(__FILE__) . '/../log/debug.log')->setDebug()->run('components_Root')->out();
k("UCOL_QUATERNARY", Int64); k("UCOL_IDENTICAL", Int64); k("UCOL_OFF", Int64); k("UCOL_ON", Int64); k("UCOL_SHIFTED", Int64); k("UCOL_NON_IGNORABLE", Int64); k("UCOL_LOWER_FIRST", Int64); k("UCOL_UPPER_FIRST", Int64); k("UCOL_FRENCH_COLLATION", Int64); k("UCOL_ALTERNATE_HANDLING", Int64); k("UCOL_CASE_FIRST", Int64); k("UCOL_CASE_LEVEL", Int64); k("UCOL_NORMALIZATION_MODE", Int64); k("UCOL_STRENGTH", Int64); k("UCOL_HIRAGANA_QUATERNARY_MODE", Int64); k("UCOL_NUMERIC_COLLATION", Int64); f('array_change_key_case', Variant, array('input' => Variant, 'upper' => array(Boolean, 'false'))); f('array_chunk', Variant, array('input' => Variant, 'size' => Int32, 'preserve_keys' => array(Boolean, 'false'))); f('array_combine', Variant, array('keys' => Variant, 'values' => Variant)); f('array_count_values', Variant, array('input' => Variant)); f('array_fill_keys', Variant, array('keys' => Variant, 'value' => Variant)); f('array_fill', Variant, array('start_index' => Int32, 'num' => Int32, 'value' => Variant)); f('array_filter', Variant, array('input' => Variant, 'callback' => array(Variant, 'null_variant'))); f('array_flip', Variant, array('trans' => Variant)); f('array_key_exists', Boolean, array('key' => Variant, 'search' => Variant)); f('key_exists', Boolean, array('key' => Variant, 'search' => Variant)); f('array_keys', Variant, array('input' => Variant, 'search_value' => array(Variant, 'null_variant'), 'strict' => array(Boolean, 'false'))); f('array_map', Variant, array('callback' => Variant, 'arr1' => Variant), VariableArguments); f('array_merge_recursive', Variant, array('array1' => Variant), VariableArguments); f('array_merge', Variant, array('array1' => Variant), VariableArguments); f('array_replace_recursive', Variant, array('array1' => Variant), VariableArguments);
<?php require_once dirname(__FILE__) . '/../config/global.inc.php'; k()->setLog(dirname(__FILE__) . '/../log/debug.log')->run('components_Root')->out();