|
|
|
|
Menu |
|
|
Home |
| |
|
Discussions |
| |
|
Tools |
| |
|
Affiliates |
| |
|
Content |
| |
|
Info |
| | |
|
|
|
|
|
User Info |
|
Membership:
Latest: MichaelSnaRe
New Today: 0
New Yesterday: 0
Overall: 9144
People Online:
Visitors: 39
Members: 0
Total: 39
|
|
|
|
|
|
Full disclosure |
|
|
|
|
|
|
|
|
|
IT Security and Insecurity Portal |
|
|
More 1 to decode! |
|
Posted: Mon Sep 10, 2012 4:49 pm |
|
|
marioaugusto23 |
Regular user |
|
|
Joined: Jul 17, 2012 |
Posts: 9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Posted: Tue Sep 11, 2012 8:58 pm |
|
|
demon |
Moderator |
|
|
Joined: Sep 22, 2010 |
Posts: 485 |
|
|
|
|
|
|
|
Code: | <?php
function linhaProcessada($self, $numLn, $vlinha)
{
$itauBoletoExt = new itauBoleto();
$itauBoletoExt = $itauBoleto->instanceClass(false, false, false, false);
if ($vlinha) {
if ($vlinha["id_registro"] == "1") {
echo "\n <tr>\n <td>" . $numLn . "</td><td>" . $vlinha["nosso_numero"] . "</td><td>" . $vlinha["data_ent_liq"] . "</td><td>" . number_format($vlinha["valor"], 2, ".", "") . "</td><td>" . $itauBoletoExt->checkOurNumer($vlinha["nosso_numero"]) . "</td>\n </tr>\n ";
}
} else
echo "Tipo da linha nã
o identificado<br/>\n";
}
include(dirname(__FILE__) . "/../../config/config.inc.php");
include(dirname(__FILE__) . "/../../init.php");
include(dirname(__FILE__) . "/itauboleto.php");
include(dirname(__FILE__) . "/classes.php");
if (!Tools::getIsset("action"))
exit;
$itauBoleto = new itauBoleto();
$itauBoletoExt = $itauBoleto->instanceClass(false, false, false, false);
global $cookie;
$id_lang = $cookie->id_lang;
$action = Tools::getValue("action");
if ($action == "updatedate") {
$id_order = Tools::getValue("os");
echo $itauBoletoExt->updateDate((int) $id_order);
echo $itauBoletoExt->updateView(0, $id_lang);
}
if ($action == "updatestatus") {
$id_order = Tools::getValue("order");
echo $itauBoletoExt->updateStatus((int) ($id_order));
echo $itauBoletoExt->updateView(0, $id_lang);
}
if ($action == "viewfile") {
$file = Tools::getValue("ofx");
$type = strtolower($itauBoletoExt->getFileType($file));
$filePath = dirname(__FILE__) . "/ofx/" . $file;
if ($type == "ofx") {
$lines = file($filePath);
$split = explode(":", $lines[2]);
if (trim($split[1]) == "102") {
$xml = $itauBoletoExt->ofxParser($filePath);
echo $itauBoletoExt->getOFX($xml, 1) . $itauBoletoExt->showResults($id_lang);
return "102";
} else {
echo $itauBoletoExt->getOFX($filePath) . $itauBoletoExt->showResults($id_lang);
return "103";
}
} else if ($type == "ofc") {
echo $itauBoletoExt->getOFC($filePath) . $itauBoletoExt->showResults($id_lang);
return;
} else if ($type == "ret") {
$cnab400 = new RetornoCNAB400Conv6($filePath, "linhaProcessada");
$retorno = new RetornoBanco($cnab400);
echo "\n <table class=\"table\" width=\"900\" cellpadding=\"0\" cellspacing=\"2\" id=\"form3\">\n <tr>\n <th>\".(\"Ordem\").\"</th><th>\".$itauBoleto->getL(\"Our Number\").\"</th><th>\".$itauBoleto->getL(\"Data Liq\").\"</th><th>\".$itauBoleto->getL(\"Value\").\"</th><th>\".$itauBoleto->getL(\"Status\").\"</th>\n </tr>";
$retorno->processar();
echo "</table><br />";
echo $itauBoletoExt->showResults($id_lang);
return;
} else {
echo "\n <table class=\"table\" width=\"900\" cellpadding=\"0\" cellspacing=\"2\ id=\"form3\">\n <tr>\n <th>\".$itauBoleto->getL(\"Invalid file!\").\"</th>\n </tr></table>";
echo $itauBoletoExt->showResults($id_lang);
return;
}
}
if ($action == "sendpage") {
$page = Tools::getIsset("page") ? Tools::getValue("page") : false;
if ($page) {
$page -= 1;
echo $itauBoleto->updateView($page, $cookie->id_lang);
}
return;
}
if ($action == "register") {
if (count($_POST) == 0)
exit;
foreach ($_POST as $k => $v)
$$k = $v;
$domain = $_SERVER["SERVER_NAME"];
$module = strtoupper($itauBoleto->name . (str_replace(".", "", $itauBoleto->version)));
$version = $itauBoleto->version;
$data["data"] = "id_order=" . $id_order . "&email=" . $email . "&domain=" . $domain . "&pwd=" . $pwd . "&module=" . $module . "&version=" . $version;
$data["domain"] = $domain;
echo $itauBoletoExt->sendRegistration($data);
}
if ($action == "getslip") {
$id_cart = Tools::getValue("id_cart");
$key = Tools::getValue("key");
$id_order = Order::getOrderByCartId((int) $id_cart);
$order = new Order((int) $id_order);
$state = $order->getCurrentState();
$paid = Configuration::get("PS_OS_PAYMENT");
if ($state == $paid) {
echo $itauBoleto->getL("This bank slip is already paid!");
exit;
} else if (!$id_cart && !$key) {
echo $itauBoleto->getL("This page can not be accessed directly!");
exit;
} else {
$date_doc = $itauBoletoExt->validateDate($id_cart);
$validation = $itauBoletoExt->validateItauBoletoRequest($id_cart, $key);
if (!$validation) {
echo $itauBoleto->getL("Invalid data. Please contact the store for more information.");
exit;
} elseif (!$date_doc) {
echo $itauBoleto->getL("Document with validity period expired. Please contact the store for more information.");
exit;
} else {
$dadosboleto = $itauBoletoExt->itauBoletoSlip();
global $smarty;
$smarty->assign(array(
"dadosboleto" => $dadosboleto,
"imgpath" => __PS_BASE_URI__ . "modules/" . $itauBoleto->name . "/img",
"fbarcode" => $itauBoletoExt->fbarcode($dadosboleto["codigo_barras"]),
"this_path_ssl" => Tools::getShopDomainSsl(true, true) . __PS_BASE_URI__ . "modules/" . $itauBoleto->name . "/"
));
return $smarty->display(dirname(__FILE__) . "/slip.tpl");
}
}
}
?> |
|
|
_________________ Go BIG or go HOME ! |
|
|
|
|
www.waraxe.us Forum Index -> PHP script decode requests
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
All times are GMT
Page 1 of 1
|
|
|
Powered by phpBB © 2001-2008 phpBB Group
|
|
|
|
|
|
|