function Bug($Var, $msg = '') { $site = CI()->config->item('site'); if (!$site['debug']) { return; } if (!empty($msg)) { CI()->template_lib->append('debug', "<br /><hr><h2>{$msg}</h2><hr>"); } CI()->template_lib->append('debug', Dump($Var, TRUE)); }
<?php function Dump($var) { if (is_numeric($var)) { var_dump($var); } else { echo gettype($var) . PHP_EOL; } } Dump('hello'); Dump(15); Dump(1.234); Dump(array(1, 2, 3)); Dump((object) [2, 34]);
function ProcessException($ex) { global $DEBUG; global $RSS; global $sid; global $pageTitle; global $body; $log =& LogException($ex); $pageTitle = GetCap('capError'); if ($DEBUG) { print "<br>Exception:<br>" . $log->ToString(1); Dump(); } else { ob_end_clean(); $id = $log->ID(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <title><?php echo $pageTitle; ?> </title> </head> <body <?php echo $body; ?> > <center> <p> <?php echo GetCap('capProblemEncountered'); ?> <br/> <?php echo GetCap('capItWasRecordedAndItWillBeFixed'); ?> <br/> <?php echo GetCap('capProblemID') . ': ' . $id; ?> <br/> </p> </center> </body> </html> <?php } exit; }
function main() { try { global $pageTitle; global $editable; global $session; global $user; $post = $_POST['blnPost']; $username = $_GET['username']; $selUser = new User("username = '******'"); $logout = $_GET['logout']; if ($selUser->IsEmpty()) { print GetCap('capUserNotFound'); $session->ViewedNotFound("Movie", $username); UpdateObject($session, false); Dump(); } if ($logout) { $selUser->Logout(); $session->ForcedLogout($selUser->ID()); } if (isset($user)) { if ($user->ID() == $selUser->ID()) { $sameUser = true; } } if (!$editable && !$selUser->Enabled()) { echo GetCap('capThisAccountHasBeenDisabled'); Dump(); } if ($post) { if (!$editable && !$sameUser) { BlockIfViolation('update'); } ThrowExceptionOnMaliciousInput($_POST['txtInfo'], 'USER_INFO'); if ($editable) { $selUser->Enabled($_POST['chkEnabled'] == '1' ? 1 : 0); } $selUser->PlayTimesLocation($_POST['txtPlayTimesLocation']); $selUser->Email($_POST['txtEmail']); $selUser->Info(strip_tags($_POST['txtInfo'])); UpdateObject($selUser); } else { $session->Viewed("User", $selUser->ID()); } $username = $selUser->UserName(); $pageTitle = $username; $email = $selUser->Email(); $playTimesLocation = $selUser->PlayTimesLocation(); $enabled = $selUser->Enabled(); $info = $selUser->Info(); ?> <br /> <form name="frm" method="post" action="<?php echo $PHP_SELF . "?username="******"> <table> <tr> <td> <font size=6><b><?php echo $username; ?> </b></font> <?php if (!$sameUser) { echo PublicizedInfo($info); } ?> </td> </tr> <?php if ($editable || $sameUser) { ?> <tr> <td> <b><?php echo GetCap('capEmailAddress'); ?> : </b> </td> <td> <input type="text" size=50 name="txtEmail" value="<?php echo $email; ?> "/> <?php echo "<i>(" . GetCap('capPrivate') . ")</i>"; ?> </td> </tr> <?php } if ($editable || $sameUser) { ?> <tr> <td> <b><?php echo GetCap('capPlayTimesLocation'); ?> : </b> </td> <td> <input type="text" size=50 name="txtPlayTimesLocation" value="<?php echo $playTimesLocation; ?> "/> <?php echo "<i>(" . GetCap('capPrivate') . ")</i>"; ?> </td> </tr> <?php } if ($editable || $sameUser) { ?> <tr> <td valign=top> <b><?php echo GetCap('capTellUsAboutYourself'); ?> : </b> <br/> <i>(<?php echo GetCap('capEditAnywayYouWish'); ?> )</i> </td> <td valign=top> <textarea rows="10" cols="57" name="txtInfo"><?php echo $info; ?> </textarea> <?php echo "<i>(" . GetCap('capPublic') . ")</i>"; ?> </td> </tr> <tr valign=top> <td> <b><?php echo GetCap('capPublicView'); ?> : </b> </td> <td> <?php echo PublicizedInfo($info); ?> </td> </tr> <?php } if ($editable) { ?> <tr> <td> <b><?php echo GetCap('capLoggedIn'); ?> : </b> <?php if ($selUser->LoggedIn()) { print GetCap("capYes"); if ($admin) { print "<a href=\"user.php?username={$username}&logout=1\">[" . GetCap('capLogout') . "]</a>"; } } else { print GetCap("capNo"); } ?> </tr> <tr> <td> <b><?php echo GetCap('capEnabled'); ?> : </b> <?php print "<input type=\"checkbox\" name=\"chkEnabled\" value=\"1\" " . ($enabled ? 'checked="checked"' : '') . "/>"; ?> </tr> <?php } if ($editable || $sameUser) { ?> <tr> <td> <input type="submit" name="btnLogin" value="<?php echo GetCap('capSave'); ?> "/> </td> <td> <input type="hidden" name="blnPost" value="1"/> </td> </tr> <?php } ?> </table> </form> <?php } catch (Exception $ex) { ProcessException($ex); } }
function main() { try { global $user; global $PHP_SELF; $id = $_POST['id']; $postID = $_POST['txtPostID']; if ($postID == "") { $postID = $_GET['postID']; } $type = $_POST['cboType']; if ($type == "") { $type = $_GET['type']; } $post = new Post($postID); $bbsRpt = new BBSReport($id); $bbsRpt->Type($type); $username = $post->Username(); $text = $post->Text(); $parent =& $post->Parent(); $parID =& $parent->ID(); $mov =& $post->Movie(); $movTitle = $mov->Title(); $movID = $mov->ID(); $subject = $parent->Subject(); if ($_POST['blnPost'] != 1 && $post->Username() == $user->Username()) { ?> <table> <tr> <td> <?php echo "<h3>" . GetCap("capNote: YouAreReportingOnYourOwnPost") . "</h3>"; ?> </td> </tr> <tr> <td> <?php echo GetCap('capReturnToTopic') . ": "; ?> <?php echo "<a href=\"bbs.php?id={$parID}\">{$subject}</a>"; ?> </td> </tr> </table> <?php } $bbsRpts = new BBSReports("postID = {$postID} and userID = " . $user->ID()); if ($bbsRpts->Count() > 0) { ?> <table> <tr> <td> <?php echo GetCap("capYouHaveAlreadyReportedThisPost"); ?> </td> </tr> <tr> <td> <?php echo GetCap('capReturnToTopic') . ": "; ?> <?php echo "<a href=\"bbs.php?id={$parID}\">{$subject}</a>"; ?> </td> </tr> </table> <?php Dump(); } if ($_POST['blnPost']) { $bbsRpt->PostID($post->ID()); $bbsRpt->UserID($user->ID()); $bbsRpt->Comments($_POST['txtComment']); if (UpdateObject($bbsRpt, true, true)) { ?> <table> <tr> <td> <?php if ($bbsRpt->Type() == REPORT_TYPE_SPAM) { print GetCap('capThankYouForFightingSpam'); } elseif ($bbsRpt->Type() == REPORT_TYPE_ABUSE) { print GetCap('capThankYouForReportingAbuse'); } else { throw new Exception("Report Type: '" . $bbsRpt->Type() . "' not supported"); } ?> </td> </tr> <tr> <td> <?php echo GetCap("capYourReportWillBeReviewed. TheOffendingPostWillBeRemovedIfItViolatesOurPolicies"); ?> </td> </tr> <tr> <td> <?php echo GetCap('capReturnToTopic') . ": "; ?> <?php echo "<a href=\"bbs.php?id={$parID}\">{$subject}</a>"; ?> </td> </tr> </table> <?php } } else { $comments = $bbsRpt->Comments(); $type = $bbsRpt->Type(); $id = $bbsRpt->ID(); ?> <form name="frm" method="post" action="<?php echo $PHP_SELF; ?> "> <table> <tr> <td> <?php echo "<h3><a href=\"movie.php?id={$movID}\">{$movTitle}</a></h3>"; ?> </td> </tr> <tr> <td> <?php echo GetCap('capTopic') . ":"; ?> </td> <td> <?php echo "<a href=\"bbs.php?id={$parID}\">{$subject}</a>"; ?> </td> </tr> <tr> <td> <?php echo GetCap('capUser') . ":"; ?> </td> <td> <?php echo "<a href=\"user.php?username={$username}\">{$username}</a>"; ?> </td> </tr> <tr> <td> <?php echo GetCap('capPost') . ":"; ?> </td> <td> <?php echo "<b>{$text}</b>"; ?> </td> </tr> <tr> <td> <?php echo GetCap('capFlagAs') . ":"; ?> </td> <td> <select name="cboType"> <option value="<?php echo REPORT_TYPE_SPAM; ?> "<?php echo $type == REPORT_TYPE_SPAM ? ' selected="selected"' : ""; ?> ><?php echo GetCap('capSpam'); ?> </option> <option value="<?php echo REPORT_TYPE_ABUSE; ?> "<?php echo $type == REPORT_TYPE_ABUSE ? ' selected="selected"' : ""; ?> ><?php echo GetCap('capAbuse'); ?> </option> </select> </td> </tr> <tr> <td> <?php echo GetCap('capComment/Complaint'); ?> </td> <td> <textarea rows="5" cols="75" name="txtComment"><?php echo $comments; ?> </textarea> </td> </tr> <tr> <td> </td> <td> <input type="submit" name="btnPost" value="<?php echo GetCap('capReport'); ?> "/> </td> <td> <input type="hidden" name="blnPost" value="1"/> </td> <td> <input type="hidden" name="txtPostID" value="<?php echo $postID; ?> "/> </td> </tr> </table> </form> <?php } } catch (Exception $ex) { ProcessException($ex); } require_once 'tailer.php'; }
public function compile() { if (TL_MODE == 'FE') { $strHref = \Environment::get('request'); // Remove an existing file parameter (see #5683) if (preg_match('/(&(amp;)?|\\?)' . $this->strQsParam . '=/', $strHref)) { $strHref = preg_replace('/(&(amp;)?|\\?)' . $this->strQsParam . '=[^&]+/', '', $strHref); } $strDownloadBaseUrl = $strHref . (\Config::get('disableAlias') || strpos($strHref, '?') !== false ? '&' : '?') . $this->strQsParam . '='; //$appInfo = new dbx\AppInfo(\Config::get('dropboxApiKey'), \Config::get('dropboxApiSecret')); //$webAuth = new dbx\WebAuthNoRedirect($appInfo, "PHP-Example/1.0"); //$authorizeUrl = $webAuth->start(); $accessToken = \Config::get('dropboxAccessToken'); $dbxClient = new \DropboxClient($accessToken, "PHP-Example/1.0"); // ========================================================================================================= // get metadata by chooser // ========================================================================================================= if ($this->dropboxChooserFiles !== '') { $children = json_decode($this->dropboxChooserFiles, true); // foreach ($filesList as $f) // { // $f['path'] = $f['name']; // //$f['download_link'] = $dbxClient->createTemporaryDirectLink($f['link']); // } //$this->Template->filesInFolder = $filesList; } // $previewLink = 'https://www.dropbox.com/s/wq6u9zx1psa9nrh/2012-11-26%201%20Battesimo.pdf?dl=0'; // $metadata = $dbxClient->getMetadataSharedLink($previewLink); // ========================================================================================================= // get metadata by path // ========================================================================================================= //$metadata = $dbxClient->getMetadataWithChildren(urldecode($this->dropboxPath)); // $pathError = dbx\Path::findError($this->dropboxPath); // if ($pathError !== null) // { // $this->Template->errors = "Invalid <dropbox-path>: $pathError"; // return; // } Dump($children); if ($this->dropboxPath !== '') { if ($metadata === null) { $this->Template->errors = "No file or folder at that path."; return; } // If it's a folder, remove the 'contents' list from $metadata; print that stuff out after. $children = null; if ($metadata['is_dir']) { $children = $metadata['contents']; unset($metadata['contents']); } $this->Template->metadata = $metadata; } $ff = array(); foreach ($children as $f) { if (array_key_exists('path', $f)) { $name = dbx\Path::getName($f['path']); } else { $name = $f['name']; } // Put a "/" after folder names. $f['name'] = $name . ($f['is_dir'] ? '/' : ''); if ($f['is_dir']) { $f['download_link'] = ''; } else { $f['download_link'] = $strDownloadBaseUrl . \System::urlEncode($name); } $ff[] = $f; } $this->Template->filesInFolder = $ff; Dump($GLOBALS['TL_DCA']['tl_content']['palettes']['__selector__']); } }
---------------------------------------------------------------------- */ /** * eazySales_Connector/dbeS/KategoriePict.php * Synchronisationsscript * * Es gelten die Nutzungs- und Lizenzhinweise unter http://www.jtl-software.de/eazysales.php * * @author JTL-Software <*****@*****.**> * @copyright 2006, JTL-Software * @link http://jtl-software.de/eazysales.php * @version v1.01 / 03.07.06 */ define('OOS_VALID_MOD', 'yes'); require 'syncinclude.php'; $return = 3; logExtra(Dump($_POST)); if (auth()) { $return = 0; /* $KategoriePict = new KategoriePict(); if (intval($_POST['action']) == 1 && $KategoriePict->setzePostDaten() && intval($_POST['KeyKategoriePict'])) { $GLOBALS["DB"]->executeQuery("DELETE FROM tkategoriepict WHERE kKategoriePict=".intval($_POST['KeyKategoriePict']),4); if ($KategoriePict->insertInDB()) $return = 0; else $return = 1; //bilder skalieren $picbig = $picpath . $KategoriePict->cPfad; if (file_exists($picbig)) {