/** * @see Page::assignVariables() */ public function assignVariables() { parent::assignVariables(); // get phpinfo() output ob_start(); phpinfo(); $info = ob_get_contents(); ob_end_clean(); // parse output $info = preg_replace('%^.*<body>(.*)</body>.*$%s', '$1', $info); // style fixes // remove first table $info = preg_replace('%<table.*?</table><br />%s', '', $info, 1); // fix tables $info = preg_replace('%<h2>(.*?)</h2>\\s*<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><div class="containerHead"><h3>\\1</h3></div></div><div class="border borderMarginRemove"><table class="tableList">', $info); $info = preg_replace('%<table border="0" cellpadding="3" width="600">%', '<div class="border titleBarPanel"><table class="tableList">', $info); $info = str_replace('</table>', '</table></div>', $info); $info = str_replace('<tr class="h">', '<thead><tr class="tableHead">', $info); $info = str_replace('</th></tr>', '</th></tr></thead>', $info); $info = preg_replace('%</td></tr>%', '</th></tr></thead>', $info, 1); $info = str_replace('<tr class="tableHead"><td>', '<tr class="tableHead"><th>', $info); $info = preg_replace('%<th(\\s+.*?)?>%', '<th\\1><div><span class="emptyHead">', $info); $info = str_replace('</th>', '</span></div></th>', $info); // fix row colors $info = preg_replace_callback('%<tr>%', array($this, 'insertRowColorsCallback'), $info); // h1, h2 fixes $info = str_replace('</h2>', '</h3>', $info); $info = str_replace('<h2>', '<h3>', $info); $info = str_replace('</h1>', '</h2>', $info); $info = str_replace('<h1', '<h2', $info); WCF::getTPL()->assign(array('phpInfo' => $info)); }
/** * Shows the IP-Adress page. */ public function show() { // check permission WCF::getUser()->checkPermission('admin.general.canViewIpAddress'); // show page parent::show(); }
/** * @see Page::show() */ public function show() { parent::show(); header('Content-Type: application/json'); echo json_encode(array(array('name' => $this->subject, 'type' => 'contestPrice', 'message' => $this->message, 'subject' => $this->subject, 'id' => rand(1, 1000)))); exit; }
/** * @see Page::show() */ public function show() { parent::show(); if (in_array($this->action, self::$validFunctions)) { $this->{$this->action}(); } }
/** * @see Page::show() */ public function show() { // enable menu item WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.admintools.phpinfo'); // show page parent::show(); }
/** * @see Page::assignVariables() */ public function assignVariables() { parent::assignVariables(); if (empty($this->disabledFunctions) && empty($this->recommendFunctions)) { $functionErrorType = 'success'; } else { if (empty($this->disabledFunctions)) { $functionErrorType = 'warning'; } else { $functionErrorType = 'error'; } } $functions = array(); foreach ($this->disabledFunctions as $key => $val) { if (isset($this->recommendFunctions[$key])) { $functions[$key] = array_merge($this->disabledFunctions[$key], $this->recommendFunctions[$key]); } else { $functions[$key] = $this->disabledFunctions[$key]; } } foreach ($this->recommendFunctions as $key => $val) { if (isset($this->disabledFunctions[$key])) { $functions[$key] = array_merge($this->disabledFunctions[$key], $this->recommendFunctions[$key]); } else { $functions[$key] = $this->recommendFunctions[$key]; } } WCF::getTPL()->assign(array('disabledFunctions' => $functions, 'functionErrorType' => $functionErrorType, 'size' => $this->size)); }
/** * @see Page::show() */ public function show() { // enable menu item WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.template.view'); // check permission WCF::getUser()->checkPermission(array('admin.template.canEditTemplate', 'admin.template.canDeleteTemplate')); parent::show(); }
/** * @see Page::show() */ public function show() { // enable menu item WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.package'); // check permission WCF::getUser()->checkPermission(array('admin.system.package.canUpdatePackage', 'admin.system.package.canUninstallPackage')); parent::show(); }
/** * @see Page::show() */ public function show() { if (!MODULE_CHEAT_DATABASE) { throw new IllegalLinkException(); } PageMenu::setActiveMenuItem('wcf.header.menu.cheatDatabase'); parent::show(); }
/** * @see Page::show() */ public function show() { // Set active header menu item require_once WCF_DIR . 'lib/page/util/menu/PageMenu.class.php'; require_once WCF_DIR . 'lib/page/util/menu/HeaderMenu.class.php'; PageMenu::setActiveMenuItem('wcf.header.menu.aboutmepage'); parent::show(); }
public function __construct() { parent::__construct(); $columns = array(); $columns[] = new picon\PropertyColumn('Sample Value', 'value'); $provider = new SampleDataProvider(); $this->add(new \picon\DefaultDataTable('table', $provider, $columns)); }
/** * @see Page::show() */ public function show() { // active default tab UserCPMenu::getInstance()->setActiveMenuItem('wcf.user.usercp.menu.link.modcp.overview'); // check permission WCF::getUser()->checkPermission(array('mod.board.canReadDeletedThread', 'mod.board.canEnableThread', 'mod.board.canReadDeletedPost', 'mod.board.canEnablePost')); parent::show(); }
/** * @see Page::show() */ public function show() { try { // get attachment from database $sql = "SELECT\t*\n\t\t\t\tFROM \twcf" . WCF_N . "_attachment\n\t\t\t\tWHERE \tattachmentID = " . $this->attachmentID . " \n\t\t\t\t\tAND packageID IN (\n\t\t\t\t\t\tSELECT\tdependency\n\t\t\t\t\t\tFROM\twcf" . WCF_N . "_package_dependency\n\t\t\t\t\t\tWHERE\tpackageID = " . PACKAGE_ID . "\n\t\t\t\t\t)"; $this->attachment = WCF::getDB()->getFirstRow($sql); // check attachment id if (!isset($this->attachment['attachmentID'])) { throw new IllegalLinkException(); } // check thumbnail status if ($this->thumbnail && !$this->attachment['thumbnailType']) { throw new IllegalLinkException(); } parent::show(); // reset URI in session if ($this->thumbnail && WCF::getSession()->lastRequestURI) { WCF::getSession()->setRequestURI(WCF::getSession()->lastRequestURI); } // update download count if (!$this->thumbnail) { $sql = "UPDATE\twcf" . WCF_N . "_attachment\n\t\t\t\t\tSET\tdownloads = downloads + 1,\n\t\t\t\t\t\tlastDownloadTime = " . TIME_NOW . "\n\t\t\t\t\tWHERE\tattachmentID = " . $this->attachmentID; WCF::getDB()->registerShutdownUpdate($sql); } // send headers // file type $mimeType = $this->thumbnail ? $this->attachment['thumbnailType'] : $this->attachment['fileType']; if ($mimeType == 'image/x-png') { $mimeType = 'image/png'; } @header('Content-Type: ' . $mimeType); // file name @header('Content-disposition: ' . (!in_array($mimeType, self::$inlineMimeTypes) ? 'attachment; ' : 'inline; ') . 'filename="' . $this->attachment['attachmentName'] . '"'); // send file size @header('Content-Length: ' . ($this->thumbnail ? $this->attachment['thumbnailSize'] : $this->attachment['attachmentSize'])); // no cache headers if (isset($_SERVER['SERVER_PORT']) && $_SERVER['SERVER_PORT'] == 443) { // internet explorer doesn't cache files downloaded from a https website, if 'Pragma: no-cache' was sent // @see http://support.microsoft.com/kb/316431/en @header('Pragma: public'); } else { @header('Pragma: no-cache'); } @header('Expires: 0'); // show attachment readfile(WCF_DIR . 'attachments/' . ($this->thumbnail ? 'thumbnail' : 'attachment') . '-' . $this->attachment['attachmentID']); exit; } catch (Exception $e) { if ($this->embedded == 1) { @header('Content-Type: image/png'); @header('Content-disposition: filename="imageNoPermissionL.png"'); readfile(WCF_DIR . 'icon/imageNoPermissionL.png'); exit; } else { throw $e; } } }
/** * @see Page::show() */ public function show() { // check user if (!WCF::getUser()->userID) { require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php'; throw new PermissionDeniedException(); } parent::show(); }
public function __construct() { parent::__construct(); $self = $this; $this->add(new Link('login', function () use($self) { $_SESSION['auth'] = true; $self->setPage(HomePage::getIdentifier()); })); }
/** * @see Page::show(); */ public function show() { $this->user->checkPermission('user.source.general.canViewSources'); parent::show(); WCF::getCache()->addResource('update-' . $this->source->sourceID . '-' . $this->type, PB_DIR . 'cache/cache.update-' . $this->source->sourceID . '-' . $this->type . '.php', PB_DIR . 'lib/system/cache/CacheBuilderUpdateServer.class.php', 0, 3600); @header('Content-Type: text/xml'); echo WCF::getCache()->get('update-' . $this->source->sourceID . '-' . $this->type); exit; }
/** * @see Page::show */ public function show() { // check user if (!WCF::getUser()->userID) { message('Zutritt nicht erlaubt!'); } parent::show(); echo_foot(); }
/** * @see Page::show() */ public function show() { // permission WCF::getUser()->checkPermission('admin.system.adminTools.canView'); // enable menu item WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.adminTools'); // show page parent::show(); }
/** * @see Page::show() */ public function show() { // set active menu item WCFACP::getMenu()->setActiveMenuItem('wcf.acp.menu.link.autoupdate'); // check permission WCF::getUser()->checkPermission('admin.system.package.canUpdatePackage'); // check master password WCFACP::checkMasterPassword(); parent::show(); }
function __construct() { global $USER; parent::__construct(); $this->hasAlliance = $USER['ally_id'] != 0; $this->hasApply = $this->isApply(); if ($this->hasAlliance && !$this->hasApply) { $this->setAllianceData($USER['ally_id']); } }
/** * @see Page::show() */ public function show() { // set active menu item require_once WCF_DIR . 'lib/page/util/menu/PageMenu.class.php'; PageMenu::setActiveMenuItem('wcf.header.menu.versionChecker'); // check permission WCF::getUser()->checkPermission('user.managepages.canViewversionChecker'); // show form parent::show(); }
public function __construct() { parent::__construct(); $this->domain = new ExampleDomain(); $this->setModel(new CompoundPropertyModel($this, 'domain')); $feedback = new FeedbackPanel('feedback'); $this->add($feedback); $form = new Form('form'); $this->add($form); $self = $this; $form->add(new Button('button', function () use($self) { $self->info('First button pressed, valid form'); }, function () use($self) { $self->info('First button pressed, invalid form'); })); $form->add(new Button('button2', function () use($self) { $self->info('Second button pressed, valid form'); }, function () use($self) { $self->info('Second button pressed, invalid form'); })); $submitedInfo = new MarkupContainer('submitedInfo'); $this->add($submitedInfo); $choices = array('default', 'option', 'other option', 'something else'); $form->add(new TextField('textBox')); $form->add(new TextArea('textArea')); $form->add(new DropDown('select', $choices)); $group = new RadioGroup('rgroup'); $form->add($group); $group->add(new Radio('gradio1', new BasicModel('option1'))); $group->add(new Radio('gradio2', new BasicModel('option2'))); $form->add(new CheckBox('icheck')); $checkGroup = new CheckBoxGroup('cgroup'); $form->add($checkGroup); $checkGroup->add(new Check('check1', new BasicModel('option1'))); $checkGroup->add(new Check('check2', new BasicModel('option2'))); $form->add(new RadioChoice('rchoice', $choices)); $form->add(new CheckChoice('cchoice', $choices)); $form->add(new ListMultiple('mchoice', $choices)); $submitedInfo->add(new Label('textBox')); $submitedInfo->add(new Label('textArea')); $submitedInfo->add(new Label('select')); $submitedInfo->add(new Label('rgroup')); $submitedInfo->add(new Label('icheck')); $submitedInfo->add(new ListView('cgroup', function (&$item) { $item->add(new picon\Label('value', $item->getModel())); })); $submitedInfo->add(new Label('rchoice')); $submitedInfo->add(new ListView('cchoice', function (&$item) { $item->add(new picon\Label('value', $item->getModel())); })); $submitedInfo->add(new ListView('mchoice', function (&$item) { $item->add(new picon\Label('value', $item->getModel())); })); }
/** * @see Page::show() */ public function show() { parent::show(); $vCard = new VCard($this->user); header('Content-Type:text/x-vcard; charset=' . CHARSET); $filename = preg_match('/^[a-z0-9_]+$/i', $this->user->username) ? $this->user->username : $this->userID; header('Content-Disposition: attachment; filename="' . $filename . '.vcf"'); header('Content-Length: ' . strlen($vCard->getContent())); echo $vCard->getContent(); exit; }
public function __construct($key, $title, $parent = null) { parent::__construct($key, $title, $parent); add_action('wp_ajax_' . $this->get_ajax_action(), function () { $this->_ajax_action(); }); if (is_admin() && isset($_REQUEST['page']) && $_REQUEST['page'] == $this->_key && isset($_POST) && !empty($_POST)) { add_action('init', function () { $this->_post_action(); }); } }
/** * @see Page::show() */ public function show() { // check user if (!WCF::getUser()->userID) { require_once WCF_DIR . 'lib/system/exception/PermissionDeniedException.class.php'; throw new PermissionDeniedException(); } parent::show(); foreach ($this->users as $user) { echo htmlentities($user[0]) . "|" . htmlentities($user[1]) . "|" . $user[2] . "|" . $user[3] . "|" . $user[4] . "\n"; } }
public function __construct() { parent::__construct(); $collection = new picon\TabCollection(); $collection->addTab('One', function ($id) { return new TabOnePanel($id); }); $collection->addTab('Two', function ($id) { return new TabTwoPanel($id); }); $this->add(new picon\TabPanel('tabs', $collection)); }
public function __construct() { parent::__construct(); $label = new picon\Label('text', new picon\PropertyModel($this, 'text')); $label->setOutputMarkupId(true); $this->add($label); $self = $this; $this->add(new \picon\AjaxLink('alterLink', function (picon\AjaxRequestTarget $target) use($self, $label) { $self->text = 'Update in callback text'; $target->add($label); })); }
/** * @see Page::show() */ public function show() { parent::show(); $sql = "SELECT *\r\n\t\t\t\tFROM ugml_pbu\r\n\t\t\t\tWHERE userID = " . $this->userID . "\r\n\t\t\t\tORDER BY pbuID\r\n\t\t\t\tDESC\r\n\t\t\t\tLIMIT 1"; $row = WCF::getDB()->getFirstRow($sql); define('SERVER_ID', 7); $pbu = new PBU(null, $row); echo '<br><br>', $userID, '-', $pbuID, '<br>'; var_dump($pbu); var_dump($pbu->getZipFile(true)->read(1 << 27)); exit; }
public function __construct(AbstractModel $model, array $config) { parent::__construct($model, $config); if (array_key_exists('description', $this->config)) { Head::getInstance()->addOg('description', $this->config['description']); } if (!array_key_exists('subtitle', $this->config) || $this->config['subtitle']) { $title = Config::getInstance()->title . ' - ' . $this->config['name']; Head::getInstance()->addOg('title', $title); Head::getInstance()->setTitle($title); } }
public function __construct() { parent::__construct(); $this->add(new picon\Label('text', new picon\PropertyModel($this, 'text'))); $self = $this; $this->add(new \picon\Link('alterLink', function () use($self) { $self->text = 'Update in callback text'; })); $this->add(new \picon\Link('pageLink', function () use($self) { $self->setPage(HomePage::getIdentifier()); })); }