$_SESSION["stylefile"] = $cssname; } if (isset($cssname) && $cssname != "") { if ($_SESSION["stylefile"] != $cssname) { foreach (glob("./templates_c/*.*") as $filename) { unlink($filename); } } $_SESSION["stylefile"] = $cssname; } if (!isset($_SESSION["stylefile"]) || $_SESSION["stylefile"] == '') { $_SESSION["stylefile"] = 'default'; } //Images Path define("Images_Path", "../Public/templates/" . $_SESSION["stylefile"] . "/images"); define("Images_Path_Main", "../Public/templates/" . $_SESSION["stylefile"] . "/images"); define("KICON_PATH", "../Public/templates/" . $_SESSION["stylefile"] . "/images/kicons"); define("INVOICE_IMAGE", isset($A2B->config["global"]['invoice_image']) ? $A2B->config["global"]['invoice_image'] : null); // INCLUDE HELP include LIBDIR . "admin.help.php"; include LIBDIR . "common.defines.php"; // COPYRIGHT if (!isset($disable_check_cp) || $disable_check_cp != true) { define("LCMODAL", check_cp()); } define("RELOAD_ASTERISK_IF_SIPIAX_CREATED", isset($A2B->config["signup"]['reload_asterisk_if_sipiax_created']) ? $A2B->config["signup"]['reload_asterisk_if_sipiax_created'] : 0); if (stripos($URI, "Public/index.php") === FALSE && isset($_SESSION["admin_id"])) { // Insert Log $log->insertLog($_SESSION["admin_id"], 1, "Page Visit", "User Visited the Page", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $log = null; }
getpost_ifset(array ( 'var_export', 'var_export_type' )); if (strlen($var_export) == 0) { $var_export = 'pr_sql_export'; } # Set the parameters: SQL Query, hostname, databasename, dbuser and password $dumpfile = new iam_csvdump; # Call the CSV Dumping function and THAT'S IT!!!! A file named dump.csv is sent to the user for download if (strlen($_SESSION[$var_export]) < 10) { echo gettext("ERROR CSV EXPORT"); } else { $log = new Logger(); if (strcmp($var_export_type, "type_csv") == 0) { $myfileName = "Dump_" . date("Y-m-d"); $log->insertLog($_SESSION["admin_id"], 2, "FILE EXPORTED", "A File in CSV Format is exported by User, File Name= " . $myfileName . ".csv", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $dumpfile->dump($_SESSION[$var_export], $myfileName, "csv", DBNAME, USER, PASS, HOST, DB_TYPE); } elseif (strcmp($var_export_type, "type_xml") == 0) { $myfileName = "Dump_" . date("Y-m-d"); $log->insertLog($_SESSION["admin_id"], 2, "FILE EXPORTED", "A File in XML Format is exported by User, File Name= " . $myfileName . ".xml", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $dumpfile->dump($_SESSION[$var_export], $myfileName, "xml", DBNAME, USER, PASS, HOST, DB_TYPE); } $log = null; }
if ($_POST["pr_login"]) { $pr_login = $_POST["pr_login"]; $pr_password = $_POST["pr_password"]; if ($FG_DEBUG == 1) { echo "<br>3. {$pr_login}-{$pr_password}-{$rights}-{$conf_addcust}"; } $_SESSION["pr_login"] = $pr_login; $_SESSION["pr_password"] = $pr_password; $_SESSION["rights"] = $rights; $_SESSION["is_admin"] = $is_admin; $_SESSION["user_type"] = "ADMIN"; $_SESSION["pr_reseller_ID"] = $pr_reseller_ID; $_SESSION["pr_groupID"] = $pr_groupID; $_SESSION["admin_id"] = $admin_id; $log = new Logger(); $log->insertLog($admin_id, 1, "User Logged In", "User Logged in to website", '', $_SERVER['REMOTE_ADDR'], 'PP_Intro.php', ''); $log = null; } } else { $rights = 0; } } // FUNCTIONS ////////////////////////////////////////////////////////////////////////////// function login($user, $pass) { global $DBHandle; $user = trim($user); $pass = trim($pass); $pass_encoded = hash('whirlpool', $pass); if (strlen($user) == 0 || strlen($user) >= 50 || strlen($pass) == 0 || strlen($pass) >= 50) {
<?php } else { ?> </br> <table width="75%" border="0" cellspacing="2" align="center" class="records"> <TR> <TD style="border-bottom: medium dotted #ED2525" align="center"> </TD> </TR> <tr> <td colspan="2" class="bgcolor_015" style="padding-left: 5px; padding-right: 3px;" align=center> <div align="center"><span class="textcomment"> <br> <?php $log = new Logger(); $log->insertLog($_SESSION["admin_id"], 2, "RATE CARD IMPORTED", $nb_imported . " Ratecards Imported Successfully", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $log = null; ?> <?php echo gettext("Success"); ?> , <?php echo $nb_imported; ?> <?php echo gettext("new rates have been imported"); ?> .<br> </span></div> <br><br>
$sql_str = "ABORT;"; switch ($export_style) { case 'peer-full-csv': array_push($export_fields, 'buyrate', 'buyrateinitblock', 'buyrateincrement', 'rateinitial', 'initblock', 'billingblock', 'connectcharge', 'disconnectcharge', 'stepchargea', 'chargea', 'timechargea', 'billingblocka', 'stepchargeb', 'chargeb', 'timechargeb', 'billingblockb', 'stepchargec', 'chargec', 'timechargec', 'billingblockc'); $sql_str = str_dbparams($DBHandle, 'SELECT ' . implode(', ', $export_fields) . ' FROM cc_ratecard WHERE idtariffplan = %1;', array($id_tp)); $log_str = "Ratecard #%0 exported in csv format, all fields in peer format"; $myfileName = "Ratecard_" . $tp_id; $prolog = "# Export of tp #{$id_tp}\n"; $prolog .= "#fields: " . implode(';', $export_fields) . "\n"; break; default: echo "Wrong export style:" . $export_style . "\n<br>\n"; die; } $myfileName .= date("Y-m-d"); $log->insertLog($_SESSION["admin_id"], 2, "FILE EXPORTED", str_params($log_str, array($id_tp, $export_style)), '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $dumpfile->sep = ';'; $dumpfile->prolog = $prolog; $dumpfile->dump($sql_str, $myfileName, "csv", DBNAME, USER, PASS, HOST, DB_TYPE); DBDisconnect($DBHandle); /* if(strcmp($var_export_type,"type_csv")==0) { $myfileName = "Dump_". date("Y-m-d"); $log -> insertLog($_SESSION["admin_id"], 2, "FILE EXPORTED", "A File in CSV Format is exported by User, File Name= ".$myfileName.".csv", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'],''); $dumpfile->dump($_SESSION[$var_export], $myfileName, "csv", DBNAME, USER, PASS, HOST, DB_TYPE ); } elseif(strcmp($var_export_type,"type_xml")==0) { $myfileName = "Dump_". date("Y-m-d"); $log -> insertLog($_SESSION["admin_id"], 2, "FILE EXPORTED", "A File in XML Format is exported by User, File Name= ".$myfileName.".xml", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'],''); $dumpfile->dump($_SESSION[$var_export], $myfileName, "xml", DBNAME, USER, PASS, HOST, DB_TYPE );
?> </br> <table width="75%" border="0" cellspacing="2" align="center" class="records"> <TR> <TD style="border-bottom: medium dotted #ED2525" align="center"> </TD> </TR> <tr> <td colspan="2" style="padding-left: 5px; padding-right: 3px;" align=center class="bgcolor_015"> <div align="center"><span class="textcomment"> <br> <?php $log = new Logger(); $log->insertLog($_SESSION["admin_id"], 2, "DID IMPORTED", $nb_imported . " New DIDs Imported Successfully", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $log = null; ?> <?php echo gettext("The import of the new DID's have been realized with success!"); ?> <br> <?php echo $nb_imported; ?> <?php echo gettext("new DID's have been imported into your Database."); ?> </span></div> <br><br>
<?php }else{ ?> </br> <table width="75%" border="0" cellspacing="2" align="center" class="records"> <TR> <TD style="border-bottom: medium dotted #ED2525" align="center"> </TD> </TR> <tr> <td colspan="2" class="bgcolor_015" style="padding-left: 5px; padding-right: 3px;" align=center> <div align="center"><span class="textcomment"> <br> <?php $log = new Logger(); $log -> insertLog($_SESSION["admin_id"], 2, "PHONE NUMBER IMPORTED", $nb_imported." Phone Number Imported Successfully", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'],''); $log = null; ?> <?php echo gettext("Success")?>, <?php echo $nb_imported?> <?php echo gettext("new phone number have been imported")?>.<br> </span></div> <br><br> <?php if (!empty($buffer_error)){ ?> <center> <b><i><?php echo gettext("Line that has not been inserted")?>!</i></b> <div class="myscroll"> <span style="color: red;"> <?php echo $buffer_error?> </span> </div> </center>
if ($restircted_url != "PP_intro.php" && $restircted_url != "signup/index.php") { require_once "./lib/Class.Logger.inc.php"; if (!isset($log)) { $log = new Logger(); } // TODO: instance $log->insertLog($_SESSION['pr_userid'], 1, "Page Visit", "User Visited the Page", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); //$log = null; } if (isset($_GET["logout"]) && $_GET["logout"] == "true") { require_once "./lib/Class.Logger.inc.php"; if (!isset($log)) { $log = new Logger(); } //TODO.. $log->insertLog($_SESSION['pr_userid'], 1, "USER LOGGED OUT", "User Logged out from website", '', $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI'], ''); $log = null; session_destroy(); $rights = 0; Header("HTTP/1.0 401 Unauthorized"); Header("Location: index.php"); exit; } function access_sanitize_data($data) { $lowerdata = strtolower($data); $data = str_replace('--', '', $data); $data = str_replace("'", '', $data); $data = str_replace('=', '', $data); $data = str_replace(';', '', $data); if (!(strpos($lowerdata, ' or ') === FALSE)) {
#!/usr/bin/php <?php define("DEFAULT_A2BILLING_CONFIG", '../../a2billing.conf.testing'); // echo DEFAULT_A2BILLING_CONFIG; // echo "\n"; $FG_DEBUG = 2; if (false) { print_r(A2Billing::DBHandle()); } if (false) { require_once 'Class.Logger.php'; $loog = new Logger(); $loog->insertLog(0, 1, "TEST", "test entry!", 'aa', 'bb', 'cc'); } if (false) { require_once 'Class.DynConf.php'; $inst = DynConf::instance(); $inst->PrefetchGroup('general'); $inst->dbg_print_cached_config(); DynConf::instance()->dbg_print_cached_config(); $val = DynConf::GetCfg('general', 'test', 123); print_r($val); echo "\n"; print_r(DynConf::GetCfg('general', 'test2')); echo "\n"; print_r(DynConf::GetCfg('general', 'test')); echo "\n"; } function isnumeric($v) { //return (preg_match('/^\-?[0-9]+$/',$v)>=1);
$pr_password = $_POST["pr_password"]; if ($FG_DEBUG == 1) { echo "<br>3. {$pr_login}-{$pr_password}-{$rights}-{$conf_addcust}"; } $_SESSION["pr_login"] = $pr_login; $_SESSION["pr_password"] = $pr_password; $_SESSION['pr_userid'] = $return['userid']; $_SESSION["rights"] = $rights; $_SESSION["is_admin"] = $is_admin; //$_SESSION["pr_reseller_ID"]=$pr_reseller_ID; $_SESSION["pr_groupID"] = $pr_groupID; $_SESSION["admin_id"] = $admin_id; // *-* must go.. $_SESSION['readonly'] = $return['readonly'] == 't' || $return['readonly'] == '1'; $log = new Logger(); $log->insertLog($return['userid'], 1, "User Logged In", "User Logged in to website", '', $_SERVER['REMOTE_ADDR'], 'PP_Intro.php', ''); $log = null; } } else { $rights = 0; } } // FUNCTIONS ////////////////////////////////////////////////////////////////////////////// function login($user, $pass) { global $DBHandle; if (strlen($user) > 20 || strlen($pass) > 20) { return false; } $QUERY = "SELECT userid, perms, confaddcust, groupid, readonly FROM cc_ui_authen WHERE login = '******' AND password = '******'";