public function CreateConnection() { $con = new mysqli($this->server, $this->user, $this->password, $this->database); if ($con->connect_error) { WriteLog("failed_connection", "Failed to connect to " . $this->user . "@" . $this->server . " - " . $con->connect_error); die("Connection @" . $this->server . " failed: " . $con->connect_error); } return $con; }
public function Insert_media($mediaid, $medianame, $urlheader, $accessinfo) { $this->sql = "INSERT INTO medias (mediaid,medianame,urlheader,accessinfo)\n VALUES ({$mediaid}','{$medianame}','{$urlheader}','{$accessinfo}')"; if ($this->conn->query($this->sql) === TRUE) { WriteLog(mysql_error()); return "OK"; } else { WriteLog("错误"); return "NO"; } $str = mysql_error($this->conn); WriteLog($str); }
public function Update_image($userid, $image) { $this->sql = "UPDATE users SET headimage='{$image}'\n WHERE userid='{$userid}'"; if ($this->conn->query($this->sql) === TRUE) { WriteLog(mysqli_error()); return "OK"; } else { WriteLog(mysqli_error()); return "NO"; } $str = mysql_error($this->conn); WriteLog($str); }
function &getEntity($class, $key, $params = array(), $mode = READ_MODE, $package = DEFAULT_PACKAGE) { // ñìîòðèì ðåæèì ñêà÷èâàíèÿ (ìîæåò èñïîëüçîâàòüñÿ ïîòîì äëÿ ïðàâ) $mode = intval($mode); if (!$mode) { WriteLog('Invalid mode of entity ' . $class . ' in mode ' . $mode, LOGFILE_ENITY); return; } // èùåì ñóùíîñòü â êåøå (äëÿ óáûñòðåíèÿ è îáñåïå÷åíèÿ ïîâòîðíîãî ÷òåíèÿ) $hash = md5($package . $class . $mode . serialize($params) . serialize($key)); if (!empty($this->_entity[$hash])) { return $this->_entity[$hash]['entity']; } else { //Try build new entity if (empty($class)) { return null; } if (empty($package)) { $package = DEFAULT_PACKAGE; } $class .= "Entity"; $full_path = PACKAGES_DIR . '/' . str_replace('.', '/', $package) . '/' . $class . '.class.php'; if (file_exists($full_path)) { if (!in_array($full_path, get_required_files())) { require_once $full_path; } //Check that needly class exists if (!class_exists(str_replace('.', '_', $package) . '_' . $class)) { class_log('XEntityCache', 'Class ' . $class . ' not found ', ENTITYCACHE_LOG); return null; } else { $full_class = str_replace('.', '_', $package) . '_' . $class; $methods = array_flip(get_class_methods($full_class)); //If called class not derived from entity return null if (!in_array('xentity', $methods)) { return null; } } return $this->_createEntity($full_class, $key, $params, $mode, $hash); } else { $sth = null; return $sth; } } }
function myErrorHandler($errno, $errstr, $errfile, $errline) { $message = ""; switch ($errno) { case FATAL: $message = " Fatal error in line " . $errline . " of file " . $errfile . ""; break; case ERROR: $message = "<b>ERROR</b> [{$errno}] {$errstr} in line " . $errline . " of file " . $errfile . ""; break; case WARNING: $message = "<b>WARNING</b> [{$errno}] {$errstr} in line " . $errline . " of file " . $errfile . ""; break; default: $message = "Unkown error type: [{$errno}] {$errstr} in line " . $errline . " of file " . $errfile . ""; break; } WriteLog($message, LOGFILE_GENERAL); }
function ShowArray(&$array, $varName = null) { WriteLog("=============================="); WriteLog("=======ShowArray Start========"); if (is_array($array)) { WriteLog("=============================="); WriteLog("- print array {$varName} vars:"); while (list($key, $val) = each($array)) { if (is_array($val)) { ShowArray($val); } else { if (!is_object($val)) { WriteLog("- {$key} => {$val}"); } } } WriteLog("- printing finish Array .\n"); WriteLog("=============================="); } else { WriteLog("- {$array} is not an Array"); WriteLog("=============================="); } }
for ($i = 1; $i < $dump['part'] - $dump['part_offset']; $i++) { $mpdatei = $dateistamm . $i . $dateiendung; $sz = byte_output(@filesize($config['paths']['backup'] . $mpdatei)); $out .= "\n" . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $mpdatei . '" class="smallblack">' . $mpdatei . ' (' . $sz . ')</a> ' . $lang['L_DUMP_SUCCESSFUL'] . '<br>'; } } else { $out .= "\n" . '<div class="backupmsg">' . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $dump['backupdatei'] . '" class="smallblack">' . $dump['backupdatei'] . ' (' . byte_output(filesize($config['paths']['backup'] . $dump['backupdatei'])) . ')' . '</a>' . $lang['L_DUMP_SUCCESSFUL'] . '<br>'; } $xtime = time() - $xtime; $aus = array(); $aus[] = '<br>' . "\n"; if ($config['multi_dump'] == 1) { WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished.'); WriteLog('Multidump: ' . count($databases['multi']) . ' Databases in ' . zeit_format($xtime) . '.'); } else { WriteLog('Dump \'' . $dump['backupdatei'] . '\' finished in ' . zeit_format($xtime) . '.'); } if ($config['send_mail'] == 1) { DoEmail(); } for ($i = 0; $i < 3; $i++) { if ($config['ftp_transfer'][$i] == 1) { DoFTP($i); } } $aus[] = '<strong>' . $lang['L_DONE'] . '</strong><br>'; if ($config['multi_dump'] == 1) { $aus[] = sprintf($lang['L_MULTIDUMP'], count($databases['multi'])) . ': '; $aus[] = '<strong>' . implode(', ', $databases['multi']) . '</strong>'; $aus2 = ''; $out = '';
$_POST = array(); foreach ($fap as $key => $val) { $_POST[$key] = $val; } } $settings['merchant_id'] = $SysValue['fondy']['fondy_merchant_id']; $settings['secret_key'] = $SysValue['fondy']['fondy_secret_key']; $valid = FondyForm::isPaymentValid($settings, $_POST); if ($valid == true && $_POST['order_status'] == FondyForm::ORDER_APPROVED) { $order_metod = "fondy"; $success_function = true; // Выключаем функцию обновления статуса заказа, операция уже выполнена в result.php $my_crc = "NoN"; $crc = "NoN"; $inv_id = $_GET['inv_id']; } else { WriteLog($valid); } } } function WriteLog($MY_LMI_HASH) { $handle = fopen("../paymentlog.log", "a+"); $post = null; foreach ($_POST as $k => $v) { $post .= $k . "=" . $v . "\r\n"; } $str = "\n\tFondy Payment Start ------------------\n\tdate=" . date("F j, Y, g:i a") . "\n\t{$post}\n\tMY_LMI_HASH={$MY_LMI_HASH}\n\tREQUEST_URI=" . $_SERVER['REQUEST_URI'] . "\n\tIP=" . $_SERVER['REMOTE_ADDR'] . "\n\tFondy Payment End --------------------\n\t"; fwrite($handle, $str); fclose($handle); }
$msg .= '<p class="small">File \'' . $del[$i] . '\' gelöscht<br>'; WriteLog("deleted '{$del[$i]}'."); } $msg .= '</p>'; } $del = DeleteFilesM($fpath, "*.gz"); } if (isset($_POST['deleteallfilter'])) { //hier kommt alldelete rein $del = DeleteFilesM($fpath, $databases['db_actual'] . "*"); if ($del == 0) { //$msg.="Fehler beim löschen!"; } else { for ($i = 0; $i < sizeof($del); $i++) { $msg .= '<p class="small">File \'' . $del[$i] . '\' gelöscht<br>'; WriteLog("deleted '{$del[$i]}'."); } $msg .= '</p>'; } } ////////////////////////////////// // Upload /////////////////////////////////// if (isset($_POST['upload'])) { $error = false; if (!isset($_FILES['upfile']['name'])) { echo '<span class="error">' . $lang['fm_uploadfilerequest'] . '</span><br><br>'; } else { if (!file_exists($fpath . $_FILES['upfile']['name'])) { // Extension ermitteln -strrpos fängt hinten an und ermittelt somit den letzten Punkt $endung = strrchr($_FILES['upfile']['name'], ".");
if ($result_count == 0) { NoResults(); // If we got more than one entry, then something is really messed up with // the database, there must not be more than one entry with the same data } elseif ($result_count > 1) { MultipleResults(); // If we got one coincidence, then we can proceed to deletion } elseif ($result_count == 1) { // Assigning DN to delete $dn = $search_entries[0]["dn"]; // Deleting ... $del = AssistedLDAPDelete($ldapc, $dn); // If the deleting went OK, we send the notification e-mail to the user if ($del) { $send = AssistedEMail("DeleteUserDo", $mail); } // If the mailing went OK ... if ($send) { // We log the event WriteLog("DeleteUserDo"); // Print the good news to the user Success("DeleteUserDo"); } else { // We fail nicely, at least Fail("DeleteUserDo"); } } } // Closing the connection $ldapx = AssistedLDAPClose($ldapc); require_once "./themes/{$app_theme}/footer.php";
} $bDoneSomething = true; } // // write to the log file // if (!empty($LOGDIR) && isset($SPECIAL_VALUES["logfile"]) && !empty($SPECIAL_VALUES["logfile"])) { // // Hook system: before writing log file // if ($HOOK_DIR !== "") { if (!@(include "{$HOOK_DIR}/fmhookprelog.inc.php")) { @(include "{$HOOK_DIR}/fmhookprelog.inc"); } } WriteLog($LOGDIR . "/" . basename($SPECIAL_VALUES["logfile"])); // // Hook system: after writing log file // if ($HOOK_DIR !== "") { if (!@(include "{$HOOK_DIR}/fmhookpostlog.inc.php")) { @(include "{$HOOK_DIR}/fmhookpostlog.inc"); } } $bDoneSomething = true; } // // send to the CRM // if (isset($SPECIAL_VALUES["crm_url"]) && isset($SPECIAL_VALUES["crm_spec"]) && !empty($SPECIAL_VALUES["crm_url"]) && !empty($SPECIAL_VALUES["crm_spec"])) { $sCRM = GetCRMURL($SPECIAL_VALUES["crm_spec"], $aAllRawValues, $SPECIAL_VALUES["crm_url"]);
} else { $del = DeleteFilesM($fpath, $databases['db_actual'] . "*"); } } // print file-delete-messages if (is_array($del) && sizeof($del) > 0) { foreach ($del as $filename => $success) { if ($success) { $msg .= '<span class="small">'; $msg .= $lang['L_FM_DELETE1'] . ' \'' . $filename . '\' ' . $lang['L_FM_DELETE2']; WriteLog("deleted '{$filename}'."); $msg .= '</span><br>'; } else { $msg .= '<span class="small error">'; $msg .= $lang['L_FM_DELETE1'] . ' \'' . $filename . '\' ' . $lang['L_FM_DELETE3']; WriteLog("deleted '{$filename}'."); $msg .= '</span><br>'; } } } // Upload if (isset($_POST['upload'])) { $error = false; if (!isset($_FILES['upfile']['name'])) { echo '<span class="error">' . $lang['L_FM_UPLOADFILEREQUEST'] . '</span><br><br>'; } else { if (!file_exists($fpath . $_FILES['upfile']['name'])) { // Extension ermitteln -strrpos fängt hinten an und ermittelt somit den letzten Punkt $endung = strrchr($_FILES['upfile']['name'], "."); $erlaubt = array(".gz", ".sql"); if (!in_array($endung, $erlaubt)) {
$in2['uidNumber'] = $in['uidNumber']; // Incrementing maxUID entry $mod = AssistedLDAPModify($ldapc, $moddn, $in2); } // If the modification went OK, we send the notification e-mail to the user if ($mod) { $send = AssistedEMail("NewUserDo", $mail); } // If the mailing went OK ... if ($send) { // We need to get rid of the temporary entry $del_q = sprintf("DELETE FROM NewUser" . " WHERE uid='%s'" . " AND token='%s'", mysql_real_escape_string($uid), mysql_real_escape_string($token)); // Deleting the row from the table ... $del_r = AssistedMYSQLQuery($del_q); // We log the event WriteLog("NewUserDo"); // Print the good news to the user Success("NewUserDo"); } else { // We fail nicely, at least Fail("NewUserDo"); } } } } } // Closing the connection $ldapx = AssistedLDAPClose($ldapc); // Closing the connection $mysqlx = AssistedMYSQLClose($mysqlc); require_once "./themes/{$app_theme}/footer.php";
function DeleteFile($files, $function = 'max') { global $config, $lang; $delfile = explode("|", $files); $r = '<p class="error">' . $lang['L_FM_AUTODEL1'] . '<br>'; $r .= $delfile[3] . "<br>"; $part = $delfile[2]; if ($part > 0) { for ($i = $part; $i > 0; $i--) { $delete = @unlink($config['paths']['backup'] . $delfile[3]); if ($delete) { WriteLog("autodeleted ({$function}) '{$delfile['3']}'."); } } } else { WriteLog("autodeleted ({$function}) '{$delfile['3']}'."); unlink($config['paths']['backup'] . $delfile[3]); } $r .= '</p>'; return $r; }
function Run($mymode = "usual") { /* // âêëþ÷åíèå ïðàâ íà ïðîñìîòð òîé èëè èíîé ñòðàíèöû if ( !$this->_checkGroupPolicy( $this->PageInfo->getAllow(), $this->PageInfo->getDeny() ) ) { // TODO: óáðàòü ýòî echo "íåäîñòóïíîñòü ñòðàíèöû èç-çà ïðàâ"; header( "Location: ".$this->PageInfo->Redirect ); exit; } */ // Создание объектов $this->_createObjects(); // Отработка действий заранее if ($_SERVER['REQUEST_METHOD'] == 'GET') { if (!empty($_GET['ACTION'])) { $this->_action = trim($_GET['ACTION']); } else { $this->_action = null; } $this->Request =& $_GET; } else { if (!empty($_POST['ACTION'])) { $this->_action = trim($_POST['ACTION']); } else { $this->_action = null; } $this->Request =& $_POST; } /* // TODO: получение ключей для UTF8 if ((SITEENCODING != 'utf-8' ) && (!defined('ADMINPANEL'))) { foreach ($this->Request as $key=>$value) { if (is_array($value)) continue; $this->Request[$key] = iconv(SITEENCODING, "utf-8", $value); } } */ //print_r( $this->Request ); // unset($this->Request[ 'ACTION' ]); //Run pre actions $steps = $this->PageInfo->getPreSteps($this->User->getGroups()); // print_r($steps); $this->_runSteps($steps); if (!empty($this->_action)) { $steps = $this->PageInfo->getActionSteps($this->_action, $this->User->getGroups()); $this->_runSteps($steps); } //Run post actions $steps = $this->PageInfo->getPostSteps($this->User->getGroups()); $this->_runSteps($steps); $this->_callShow(); $this->_showOutput($mymode); $tt = preg_split("/\\ /", microtime()); $workTime = intval($tt[1]) + doubleval($tt[0]) - $this->_startTime; WriteLog("Work time - " . $workTime . "s", LOGFILE_STAT); }
<?php include '../libs_global.php'; include '../vars.php'; // ## RESPONSE HEADER ## $response_header = "HTTP/1.1 200 OK"; // ## RESPONSE BODY ## $response_body = "OK"; // ### REQUEST BODY ### $request_body = file_get_contents('php://input'); $json_request = json_decode($request_body, TRUE); //convert JSON into array // echo $request_body ; //print_r($request_body); //print_r($json_request); if (isset($json_request['deliveryInfoNotification'])) { //{ "inboundSMSMessageNotification": { "inboundSMSMessage": { "senderAddress": "tel:+26772333490", "destinationAddress": "+26716968", "message": "BEGIN Test יטא@ END", "dateTime": "2014-04-15T07:40:13Z" } } } //{ "deliveryInfoNotification": { "deliveryInfo": { "address": "tel:+99xxxxxxxxxx", "deliveryStatus": "DeliveredToTerminal" }, "callbackData": "" } } $address = $json_request['deliveryInfoNotification']['deliveryInfo']['address']; $address = str_replace('tel:', '', $address); $deliveryStatus = $json_request['deliveryInfoNotification']['deliveryInfo']['deliveryStatus']; $callbackData = $json_request['deliveryInfoNotification']['callbackData']; $logtxt = 'SMS DR received for ' . $address . ' with deliveryStatus=[' . $deliveryStatus . '] and [' . $callbackData . '] for callbackData value'; $log = WriteLog($filelog, $logtxt); } else { $log = WriteLog($filelog, 'received a request but not a real SMS DR'); }
function SetDefault($load_default = false) { global $config, $databases, $nl, $out, $lang, $preConfig; if ($load_default == true) { if (file_exists($config['files']['parameter']) && is_readable($config['files']['parameter'])) { include $config['files']['parameter']; } // alte Config lesen } $restore_values = array(); $restore_values['cron_dbindex'] = isset($config['cron_dbindex']) ? $config['cron_dbindex'] : -3; $restore_values['cron_dbpraefix_array'] = isset($config['cron_dbpraefix_array']) ? $config['cron_dbpraefix_array'] : ''; if ($restore_values['cron_dbindex'] >= 0 && isset($databases['Name'][$config['cron_dbindex']])) { // Ja, Namen merken, um spaeter den Index wieder herzustellen $restore_values['db_actual_cron'] = $databases['Name'][$config['cron_dbindex']]; } $restore_values['db_actual'] = isset($databases['db_actual']) ? $databases['db_actual'] : ''; $old_lang = isset($config['language']) && in_array($config['language'], $lang['languages']) ? $config['language'] : ''; if ($load_default == true) { if (file_exists($config['files']['parameter'])) { @unlink($config['files']['parameter']); } include "./config.php"; if (is_array($preConfig)) { foreach ($preConfig as $key => $val) { $config[$key] = $val; } } if ($old_lang != '') { $config['language'] = $old_lang; } include "./language/" . $config['language'] . "/lang.php"; } $oldVals = array(); // Zuordnung nach Namen der Db zwischenspeichern, um Eingaben nicht zu verlieren if (isset($databases) && isset($databases['Name'])) { foreach ($databases['Name'] as $k => $v) { if (!isset($oldVals[$k])) { $oldVals[$v] = array(); } $oldVals[$v]['praefix'] = $databases['praefix'][$k]; $oldVals[$v]['command_before_dump'] = $databases['command_before_dump'][$k]; $oldVals[$v]['command_after_dump'] = $databases['command_after_dump'][$k]; } } $oldDbArray = array(); if (isset($databases['Name'])) { $oldDbArray = $databases['Name']; } $databases['Name'] = array(); $found_dbs = array(); //DB-Liste holen MSD_mysql_connect(); $create_statement = 'CREATE TABLE `mysqldumper_test_abcxyvfgh` (`test` varchar(200) default NULL, `id` bigint(20) unsigned NOT NULL auto_increment,' . 'PRIMARY KEY (`id`)) TYPE=MyISAM;'; $res = mysql_query("SHOW DATABASES", $config['dbconnection']); while ($row = mysql_fetch_row($res)) { $found_dbs[] = $row[0]; } $found_dbs = array_merge($oldDbArray, $found_dbs); $found_dbs = array_unique($found_dbs); sort($found_dbs); // now check each db $a = 0; for ($i = 0; $i < count($found_dbs); $i++) { $found_db = $found_dbs[$i]; // Testverbindung - Tabelle erstellen, nachschauen, ob es geklappt hat und dann wieder löschen $use = @mysql_select_db($found_db); if ($use) { if (isset($old_db) && $found_db == $old_db) { $databases['db_selected_index'] = $a; } $databases['Name'][$a] = $found_db; $databases['praefix'][$a] = ""; $databases['command_before_dump'][$a] = ""; $databases['command_after_dump'][$a] = ""; if (isset($oldVals[$found_db])) { $databases['praefix'][$a] = $oldVals[$found_db]['praefix']; $databases['command_before_dump'][$a] = $oldVals[$found_db]['command_before_dump']; $databases['command_after_dump'][$a] = $oldVals[$found_db]['command_after_dump']; } $out .= $lang['L_SAVING_DB_FORM'] . " " . $found_db . " " . $lang['L_ADDED'] . "{$nl}"; $a++; } } if (!isset($databases['db_selected_index'])) { $databases['db_selected_index'] = 0; $databases['db_actual'] = $databases['Name'][0]; } WriteParams(1, $restore_values); if ($load_default === true) { WriteLog("default settings loaded."); } return $out; }
function DeleteFile($files, $function) { global $config, $lang; $delfile = explode("|", $files); $ll = $function == "max" ? $lang['fm_autodel1'] : $lang['fm_autodel2']; $r = "<p class=\"error\">" . $ll . "<br>"; $r .= $delfile[3] . "<br>"; WriteLog("autodeleted ({$function}) '{$delfile['3']}'."); unlink($config['paths']['backup'] . $delfile[3]); $r .= "</p>"; return $r; }
if (!$val_r) { require_once "./libraries/CreateUserTable.inc.php"; } // Encoding the password $userPassword = EncodePassword($userPassword, $ldap_enc); // We build up our query to insert the user data into a temporary MYSQL Database // while the user gets the confirmation e-mail and clicks the link $ins_q = sprintf("INSERT INTO NewUser " . "(uid, givenName, sn, mail, userPassword, description, token) " . "VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s')", mysql_real_escape_string($uid), mysql_real_escape_string($givenName), mysql_real_escape_string($sn), mysql_real_escape_string($mail), mysql_real_escape_string($userPassword), mysql_real_escape_string($description), mysql_real_escape_string($newtoken)); // Inserting the row on the table ... $ins_r = AssistedMYSQLQuery($ins_q); // If the insert went OK, we send the notification e-mail to the user if ($ins_r) { $send = AssistedEMail("NewUserMail", $mail); } // If the mailing went OK ... if ($send) { // We log the event WriteLog("NewUserMail"); // Print the good news to the user Success("NewUserMail"); } else { // We fail nicely, at least Fail("NewUserMail"); } } } // Closing the connection $ldapx = AssistedLDAPClose($ldapc); // Closing the connection $mysqlx = AssistedMYSQLClose($mysqlc); require_once "./themes/{$app_theme}/footer.php";
//Multipart-Restore $nextfile = NextPart($restore['filename']); if (!file_exists($config['paths']['backup'] . $nextfile)) { $done = number_format($restore['eintraege_ready'], 0, ",", "."); $to_do = number_format($restore['anzahl_eintraege'], 0, ",", "."); $aus[] = '<h3>' . $lang['restore'] . '</h3>'; $aus[] = sprintf($lang['restore_db'], $databases['db_actual'], $config['dbhost']); $aus[] = '<p class="error">' . $lang['multi_part'] . ': ' . $lang['file_missing'] . ' \'' . $nextfile . '\' !</p>'; $aus[] = sprintf($lang['restore_run1'], $done, $to_do); $aus[] = sprintf($lang['restore_run2'], $restore['actual_table']); $aus[] = '<p class="small">' . zeit_format(time() - $restore['xtime']) . ', ' . $restore['aufruf'] . ' pages'; //, speed '.$anzahl_zeilen; $aus[] = $fmp > 0 ? ', ' . $lang['file'] . ' ' . $restore['part'] : ''; $aus[] = $restore['errors'] > 0 ? ', <span class="error">' . $restore['errors'] . ' errors</span>' : ''; $aus[] = '</p>' . (isset($restore['EOB']) ? "EOB" : ""); WriteLog('<span class="error">Restore unsuccessful: Cannot find Multipartfile \'' . $nextfile . '\'</span>'); $RestoreFertig = 1; } else { $restore['filename'] = urlencode($nextfile); $restore['offset'] = 0; $restore['part']++; } } } } else { $aus[] = $fpath . $restore['filename'] . ' : ' . $lang['file_open_error']; } //===================================================================== //================= Anzeige =========================================== //===================================================================== //Seite basteln
} $bDoneSomething = true; } // // write to the log file // if (!Settings::isEmpty('LOGDIR') && isset($SPECIAL_VALUES["logfile"]) && !empty($SPECIAL_VALUES["logfile"])) { // // Hook system: before writing log file // if (!Settings::isEmpty('HOOK_DIR')) { if (!@(include Settings::get('HOOK_DIR') . "/fmhookprelog.inc.php")) { @(include Settings::get('HOOK_DIR') . "/fmhookprelog.inc"); } } WriteLog(Settings::get('LOGDIR') . "/" . basename($SPECIAL_VALUES["logfile"])); // // Hook system: after writing log file // if (!Settings::isEmpty('HOOK_DIR')) { if (!@(include Settings::get('HOOK_DIR') . "/fmhookpostlog.inc.php")) { @(include Settings::get('HOOK_DIR') . "/fmhookpostlog.inc"); } } $bDoneSomething = true; } // // send to the CRM // if (isset($SPECIAL_VALUES["crm_url"]) && isset($SPECIAL_VALUES["crm_spec"]) && !empty($SPECIAL_VALUES["crm_url"]) && !empty($SPECIAL_VALUES["crm_spec"])) { $sCRM = GetCRMURL($SPECIAL_VALUES["crm_spec"], $aAllRawValues, $SPECIAL_VALUES["crm_url"]);
$aus[] = '<h3>' . $lang['L_RESTORE'] . '</h3>'; $aus[] = sprintf($lang['L_RESTORE_DB'], $databases['db_actual'], $config['dbhost']); $aus[] = '<p class="error">' . $lang['L_MULTI_PART'] . ': ' . $lang['L_FILE_MISSING'] . ' \'' . $nextfile . '\' !</p>'; $aus[] = sprintf($lang['L_RESTORE_RUN1'], $done, $to_do); $aus[] = sprintf($lang['L_RESTORE_RUN2'], $restore['actual_table']); $aus[] = '<p class="small">' . zeit_format(time() - $restore['xtime']) . ', ' . $restore['aufruf'] . ' ' . $lang['L_PAGE_REFRESHS']; $aus[] = $restore['part'] > 0 ? ', ' . $lang['L_FILE'] . ' ' . $restore['part'] : ''; $aus[] = $restore['errors'] > 0 ? ', <span class="error">' . $restore['errors'] . ' errors</span>' : ''; $aus[] = '</p>'; WriteLog('Restore unsuccessful: Cannot find Multipartfile \'' . $nextfile . '\''); $RestoreFertig = 1; } else { $restore['filename'] = $nextfile; $restore['offset'] = 0; $restore['part']++; WriteLog("Continue Multipart-Restore with File '" . $restore['filename'] . "'"); } } } } else { $aus[] = $config['paths']['backup'] . $restore['filename'] . ' : ' . $lang['L_FILE_OPEN_ERROR']; } $pagefooter = $RestoreFertig == 1 ? MSDFooter() : '</div></BODY></HTML>'; // formerly all parameters were submitted via POST; now we use a session but we need the form to do the js-selfcall $page_parameter = '<form action="restore.php?MySQLDumper=' . session_id() . '" method="POST" name="restore"></form>'; if ($RestoreFertig == 1) { $complete_page = $pageheader . ($aus != '' ? implode("\n", $aus) : '') . $pagefooter; } else { $aus[] = $page_parameter; $_SESSION['restore'] = $restore; $selbstaufruf = '<script language="javascript" type="text/javascript">setTimeout("document.restore.submit()",10);</script>';
// If we got more than one entry, then something is really messed up with // the database, there must not be more than one entry with the same data } elseif ($result_count > 1) { MultipleResults(); // If we got one coincidence, then we can proceed to modification } elseif ($result_count == 1) { // What dn are we going to modify? $moddn = $search_entries['0']['dn']; // We fill in our attribute modificator array $in['userPassword'] = $userPassword; // Modifying ... $mod = AssistedLDAPModify($ldapc, $moddn, $in); // If the modifying went OK, we send the notification e-mail to the user if ($mod) { $send = AssistedEMail("ChangePasswordDo", $mail); } // If the mailing went OK ... if ($send) { // We log the event WriteLog("ChangePasswordDo"); // Print the good news to the user Success("ChangePasswordDo"); } else { // We fail nicely, at least Fail("ChangePasswordDo"); } } } // Closing the connection $ldapx = AssistedLDAPClose($ldapc); require_once "./themes/{$app_theme}/footer.php";
cron_InsertNotificationLogEntry($TYPE, $prow, $db_email_msg); //set message $db_email_msg['message'] = cron_setmessage($prow, $db_email_msg); // send sms to patinet - if not in test mode if ($bTestRun == 0) { cron_SendSMS($prow['phone_cell'], $db_email_msg['email_subject'], $db_email_msg['message'], $db_email_msg['email_sender']); } // larry :: debug echo "\nDEBUG :: sms was sent to= " . $prow['phone_cell'] . " \nsender= " . $db_email_msg['email_sender'] . " \nsbj= " . $db_email_msg['email_subject'] . " \nmsg= " . $db_email_msg['message'] . "\n"; //update entry >> pc_sendalertsms='Yes' cron_updateentry($TYPE, $prow['pid'], $prow['pc_eid']); $strMsg .= " || ALERT SENT SUCCESSFULLY TO " . $prow['phone_cell']; $strMsg .= "\n" . $patient_info . "\n" . $smsgateway_info . "\n" . $data_info . "\n" . $db_email_msg['message']; } // write logs for every reminder sent WriteLog($strMsg); // larry :: update notification data again - todo :: fix change in cron_updateentry $db_email_msg = cron_getNotificationData($TYPE); } unset($mysms); sqlClose(); ?> <html> <head> <title>Conrjob - SMS Notification</title> </head> <body> <center> </center> </body>
function SendViaFTP($i, $source_file, $conn_msg = 1) { global $config, $out, $lang; flush(); if ($conn_msg == 1) { $out .= '<span class="success">' . $lang['L_FILESENDFTP'] . "(" . $config['ftp_server'][$i] . " - " . $config['ftp_user'][$i] . ")</span><br>"; } // Herstellen der Basis-Verbindung if ($config['ftp_useSSL'][$i] == 0) { $conn_id = @ftp_connect($config['ftp_server'][$i], $config['ftp_port'][$i], $config['ftp_timeout'][$i]); } else { $conn_id = @ftp_ssl_connect($config['ftp_server'][$i], $config['ftp_port'][$i], $config['ftp_timeout'][$i]); } // Einloggen mit Benutzername und Kennwort $login_result = @ftp_login($conn_id, $config['ftp_user'][$i], $config['ftp_pass'][$i]); if ($config['ftp_mode'][$i] == 1) { ftp_pasv($conn_id, true); } // Verbindung überprüfen if (!$conn_id || !$login_result) { $out .= '<span class="error">' . $lang['L_FTPCONNERROR'] . $config['ftp_server'][$i] . $lang['L_FTPCONNERROR1'] . $config['ftp_user'][$i] . $lang['L_FTPCONNERROR2'] . '</span><br>'; } else { if ($conn_msg == 1) { $out .= '<span class="success">' . $lang['L_FTPCONNECTED1'] . $config['ftp_server'][$i] . $lang['L_FTPCONNERROR1'] . $config['ftp_user'][$i] . '</span><br>'; } } // Upload der Datei $dest = $config['ftp_dir'][$i] . $source_file; $source = $config['paths']['backup'] . $source_file; $upload = @ftp_put($conn_id, $dest, $source, FTP_BINARY); // Upload-Status überprüfen if (!$upload) { $out .= '<span class="error">' . $lang['L_FTPCONNERROR3'] . "<br>({$source} -> {$dest})</span><br>"; } else { $out .= '<span class="success">' . $lang['L_FILE'] . ' <a href="' . $config['paths']['backup'] . $source_file . '" class="smallblack">' . $source_file . '</a>' . $lang['L_FTPCONNECTED2'] . $config['ftp_server'][$i] . $lang['L_FTPCONNECTED3'] . '</span><br>'; WriteLog("'{$source_file}' sent via FTP."); } // Schließen des FTP-Streams @ftp_quit($conn_id); }
$msg = '<span class="url" onclick="top.OpenUserDialog(\'' . $userid . '\')">' . $username . '</span> �����������ӣ�<a class="url" href="' . $url . '" target="_blank">' . $ti . '</a> [<span class="url" onclick="Re(' . $tid . ')">�ظ�</span>]'; AddMsg_Public("1\t0\t{$msg}", $ChannelId); echo 'Y'; } } break; case 're': if (!$ChannelId) { exit('Channel Error!'); } $tid = Char_Cv('tid'); $co = Char_Cv('co'); $co = oiconv('utf-8', 'gbk', $co); $api = API_Re($tid, $co); if ($api != '1') { WriteLog($api); } if ($api == -1) { echo '<font color=red>�����Ч</font>'; } elseif ($api == -2) { echo '<font color=red>���Ӳ�����</font>'; } else { echo 'Y'; } break; case 'tickout': $uid = Char_Cv('uid'); if (!$uid) { exit('-1'); } if ($uid == $userid) {
return true; } /** Detect if the user's PHP/LibXML is affected by the following bug: - * http://bugs.php.net/bug.php?id=45996 */ function LibXml2IsBuggy() { global $libxml2_test_query; $libxml2_test_query = ''; $testxml = '<xml><libxml2_test_query>select 'a'</libxml2_test_query></xml>'; GetDetailsFromPostedXML($testxml); if (strcasecmp($libxml2_test_query, 'select a') == 0) { //This PHP/LibXML is buggy! return true; } //Not buggy! return false; } /* we can now use SQLyogTunnel.php to log debug informations, which will help us to point out the error */ function WriteLog($loginfo) { if (defined("DEBUG")) { $fp = fopen("yogtunnel.log", "a"); if ($fp == FALSE) { return; } fwrite($fp, $loginfo . "\r\n"); // MY_CHANGE: Because below it was // printing 'Enter' instead of new line fclose($fp); } } function WriteLogTemp($loginfo) { if (defined("DEBUG")) { $fp = fopen("sabya.log", "a"); if ($fp == FALSE) { return; } fwrite($fp, $loginfo . "\r\n"); // MY_CHANGE: Because below it was // printing 'Enter' instead of new line fclose($fp); } } /* Process the query*/ function ProcessQuery() { WriteLog("Enter processquery"); if (CheckPHPVersion() == FALSE) { /* now the call can be of three types 1.) Specific to check tunnel version 2.) Normal where it is expected that the PHP page is 4.3.0 3.) From browser We check this by checking the query string which is sent if just a check is done by SQLyog */ WriteLog("CheckPHPVersion is FALSE"); if (isset($_GET['app'])) { echo tunnelversionstring; echo phpversionerror; } else { WriteLog("CheckPHPVersion is FALSE and app query string not set"); ShowAccessError(); } return; } /* in special case, sqlyog just sends garbage data with query string to check for tunnel version. we need to process that now */ if (isset($_GET['app'])) { WriteLog("app query string not set"); echo tunnelversionstring; echo tunnelversion; return; } /* Starting from 5.1 BETA 4, we dont get the data as URL encoded POST data, we just get it as raw data */ WriteLog("Trying to get php://input"); $xmlrecvd = file_get_contents("php://input"); WriteLog("Got php://input!");
function my_strtok($query, &$found) { WriteLog("Enter my_strok"); global $curpos; $delimiter = ';'; $quote = NULL; $escapedchar = NULL; $ch = NULL; $i = $curpos; $quotestart = 0; $comment = COMMENT_OFF; $found = TRUE; if ($query[$curpos] == NULL) { return 0; } for (; $query[$curpos] != NULL; $curpos++) { $ch = $query[$curpos]; if ($ch == $delimiter) { if (isset($quote) == FALSE && $comment == COMMENT_OFF) { $curpos++; $temp = substr($query, $i, $curpos - $i - 1); return $temp; } else { continue; } } else { if ($ch == '\'' || $ch == '\\"') { // we only do this if the quote is open if ($quote) { // we just check if its the same quote. if ($quote != $query[$curpos]) { continue; } $quote = NULL; } else { if ($comment == COMMENT_OFF) { $quote = $query[$curpos]; continue; } } } else { if ($query[$curpos] == '#') { if ($comment == COMMENT_OFF && $quote == NULL) { $comment = COMMENT_HASH; } } else { if ($query[$curpos] == '-' && $query[$curpos + 1] == '-' && $query[$curpos + 2] == ' ' && $quote == NULL) { if ($comment == COMMENT_OFF) { $curpos += 2; $comment = COMMENT_DASH; } } else { if ($query[$curpos] == '/' && $query[$curpos + 1] == '*' && $quote == NULL) { if ($comment == COMMENT_OFF) { $curpos += 1; $comment = COMMENT_START; } } else { if ($query[$curpos] == chr(13) || $query[$curpos] == chr(10)) { if ($comment != COMMENT_OFF && $comment != COMMENT_START) { $comment = COMMENT_OFF; } } else { if ($query[$curpos] == '*' && $query[$curpos + 1] == '/') { if ($comment == COMMENT_START) { $comment = COMMENT_OFF; } } else { if ($query[$curpos] == '\\') { if ($quote) { $curpos++; } } } } } } } } } } WriteLog("Exit my_strok"); return substr($query, $i, $curpos - $i); }
function getDBInfos() { global $databases, $dump, $config, $tbl_sel, $flipped; for ($ii = 0; $ii < count($databases['multi']); $ii++) { $dump['dbindex'] = $flipped[$databases['multi'][$ii]]; $tabellen = mysql_query('SHOW TABLE STATUS FROM `' . $databases['Name'][$dump['dbindex']] . '`', $config['dbconnection']) or die('getDBInfos: ' . mysql_error()); $num_tables = mysql_num_rows($tabellen); // Array mit den gewünschten Tabellen zusammenstellen... wenn Präfix angegeben, werden die anderen einfach nicht übernommen if ($num_tables > 0) { for ($i = 0; $i < $num_tables; $i++) { $row = mysql_fetch_array($tabellen); if (isset($row['Type'])) { $row['Engine'] = $row['Type']; } if (isset($row['Comment']) && substr(strtoupper($row['Comment']), 0, 4) == 'VIEW') { $dump['table_types'][] = 'VIEW'; } else { $dump['table_types'][] = strtoupper($row['Engine']); } // check if data needs to be backed up if (strtoupper($row['Comment']) == 'VIEW' || isset($row['Engine']) && in_array(strtoupper($row['Engine']), array('MEMORY'))) { $dump['skip_data'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Name']; } if ($config['optimize_tables_beforedump'] == 1 && $dump['table_offset'] == -1) { mysql_query('OPTIMIZE `' . $row['Name'] . '`'); } if (isset($tbl_sel)) { if (in_array($row['Name'], $dump['tblArray'])) { $dump['tables'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Name']; $dump['records'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Rows']; $dump['totalrecords'] += $row['Rows']; } } elseif ($databases['praefix'][$dump['dbindex']] != '' && !isset($tbl_sel)) { if (substr($row['Name'], 0, strlen($databases['praefix'][$dump['dbindex']])) == $databases['praefix'][$dump['dbindex']]) { $dump['tables'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Name']; $dump['records'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Rows']; $dump['totalrecords'] += $row['Rows']; } } else { $dump['tables'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Name']; $dump['records'][] = $databases['Name'][$dump['dbindex']] . '|' . $row['Rows']; // Get nr of records -> need to do it this way because of incorrect returns when using InnoDBs $sql_2 = "SELECT count(*) as `count_records` FROM `" . $databases['Name'][$dump['dbindex']] . "`.`" . $row['Name'] . "`"; $res2 = @mysql_query($sql_2); if ($res2 === false) { $read_error = '(' . mysql_errno() . ') ' . mysql_error(); SQLError($read_error, $sql_2); WriteLog($read_error); if ($config['stop_with_error'] > 0) { die($read_error); } } else { $row2 = @mysql_fetch_array($res2); $row['Rows'] = $row2['count_records']; $dump['totalrecords'] += $row['Rows']; } } } // Correct total number of records; substract skipped data foreach ($dump['skip_data'] as $skip_data) { $index = false; $records_to_skip = 0; //find index of table to get the nr of records $count = sizeof($dump['tables']); for ($a = 0; $a < $count; $a++) { if ($dump['tables'][$a] == $skip_data) { $index = $a; $t = explode('|', $dump['records'][$a]); $rekords_to_skip = $t[1]; break; } } if ($index) { $dump['totalrecords'] -= $rekords_to_skip; } } } } }
function SetDefault($load_default = false) { global $config, $databases, $nl, $out, $lang, $preConfig; if ($load_default == true) { if (file_exists($config['files']['parameter']) && is_readable($config['files']['parameter'])) { include $config['files']['parameter']; } // alte Config lesen } $restore_values = array(); $restore_values['cron_dbindex'] = isset($config['cron_dbindex']) ? $config['cron_dbindex'] : -3; $restore_values['cron_dbpraefix_array'] = isset($config['cron_dbpraefix_array']) ? $config['cron_dbpraefix_array'] : ''; if ($restore_values['cron_dbindex'] >= 0 && isset($databases['Name'][$config['cron_dbindex']])) { // Ja, Namen merken, um spaeter den Index wieder herzustellen $restore_values['db_actual_cron'] = $databases['Name'][$config['cron_dbindex']]; } $restore_values['db_actual'] = isset($databases['db_actual']) ? $databases['db_actual'] : ''; $old_lang = isset($config['language']) && in_array($config['language'], $lang['languages']) ? $config['language'] : ''; if ($load_default == true) { if (file_exists($config['files']['parameter'])) { @unlink($config['files']['parameter']); } include "./config.php"; if (is_array($preConfig)) { foreach ($preConfig as $key => $val) { $config[$key] = $val; } } if ($old_lang != '') { $config['language'] = $old_lang; } include "./language/" . $config['language'] . "/lang.php"; } $oldVals = array(); // Zuordnung nach Namen der Db zwischenspeichern, um Eingaben nicht zu verlieren if (isset($databases) && isset($databases['Name'])) { foreach ($databases['Name'] as $k => $v) { if (!isset($oldVals[$k])) { $oldVals[$v] = array(); } $oldVals[$v]['praefix'] = $databases['praefix'][$k]; $oldVals[$v]['command_before_dump'] = $databases['command_before_dump'][$k]; $oldVals[$v]['command_after_dump'] = $databases['command_after_dump'][$k]; } } $oldDbArray = array(); if (isset($databases['Name'])) { $oldDbArray = $databases['Name']; } $databases['Name'] = array(); $found_dbs = array(); //DB-Liste holen MSD_mysql_connect(); $res = mysqli_query($config['dbconnection'], 'SHOW DATABASES'); while ($row = mysqli_fetch_row($res)) { $found_dbs[] = $row[0]; } $found_dbs = array_merge($oldDbArray, $found_dbs); $found_dbs = array_unique($found_dbs); sort($found_dbs); // now check each db $a = 0; for ($i = 0; $i < count($found_dbs); $i++) { $found_db = $found_dbs[$i]; $use = @(bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE " . $found_db); if ($use) { if (isset($old_db) && $found_db == $old_db) { $databases['db_selected_index'] = $a; } $databases['Name'][$a] = $found_db; $databases['praefix'][$a] = ""; $databases['command_before_dump'][$a] = ""; $databases['command_after_dump'][$a] = ""; if (isset($oldVals[$found_db])) { $databases['praefix'][$a] = $oldVals[$found_db]['praefix']; $databases['command_before_dump'][$a] = $oldVals[$found_db]['command_before_dump']; $databases['command_after_dump'][$a] = $oldVals[$found_db]['command_after_dump']; } $out .= $lang['L_SAVING_DB_FORM'] . " " . $found_db . " " . $lang['L_ADDED'] . "{$nl}"; $a++; } } if (!isset($databases['db_selected_index'])) { $databases['db_selected_index'] = 0; $databases['db_actual'] = $databases['Name'][0]; } WriteParams(1, $restore_values); if ($load_default === true) { WriteLog("default settings loaded."); } return $out; }