public function logout() { $username = $this->dx_auth->get_username(); $this->dx_auth->logout(); set_log("User ID {$username} Success LOGOUT"); redirect(_URL); exit; }
private function recover_file($fileName) { $this->getFile($fileName); if (!empty($this->content)) { $content = explode(';/* MySQLReback Separation */', $this->content); foreach ($content as $i => $sql) { $sql = trim($sql); if (!empty($sql)) { $mes = $this->model->execute($sql); if (false === $mes) { //如果 null 写入失败,换成 '' $table_change = array('null' => '\'\''); $sql = strtr($sql, $table_change); $mes = $this->model->execute($sql); } if (false === $mes) { //如果遇到错误、记录错误 $log_text = '以下代码还原遇到问题:'; $log_text .= "\r\n {$sql}"; set_log($log_text); } } } } else { $this->error('无法读取备份文件!'); } return true; }
private function cron_type($type) { $msg = self::getmsg($this->bduss[0], $type); $db_pid = get_pid($type); set_pid($msg[0]['post_id'], $type); foreach ($msg as $k) { $content = ''; $this->rand_bduss(); $this->getkwdata($k['fname']); if ($db_pid == $k['post_id']) { break; } if (@stristr($this->setting[3], $k['replyer']['name_show']) === false && @stristr($this->setting[4], $k['fname']) === false) { if ($this->setting[5] == 1) { if ($this->kwdata['user_info']['is_sign_in'] == 0) { $this->likekw($k['fname']); set_log($this->signkw($k['fname'])); } } if ($k['is_floor'] == 1) { $pid = $this->floorpid($k['thread_id'], $k['post_id']); $content = "回复 {$k['replyer']['name_show']} :"; } else { $pid = $k['post_id']; } $content .= talk($k['content'], $this->un, $this->setting[1], $this->setting[2]) . $this->setting[6]; $res = $this->reply($k['thread_id'], $pid, $k['fname'], $content); echo "在{$k['fname']}吧贴号{$k['thread_id']}{$res}"; set_log("在{$k['fname']}吧贴号{$k['thread_id']}{$res}"); // 回帖间隔 sleep(3); } } }
public function done() { if ($this->dx_auth->is_logged_in()) { $userid = $this->session->userdata['DX_username']; set_log("USER ID {$userid} LOGOUT"); $this->dx_auth->logout(); } redirect(_URL); exit; }
<?php /** * SCRIPT TO TEST THE WHOLE STUFF * @var integer */ for ($i = 1; $i <= 1; $i++) { //$cod_produto = str_replace('.', '', rand($i, 500) / ($i * ($i^10)+1*50)); $cod_produto = 54321; if ($i % 2 == 0) { $erro = ['identifier' => 'Marketplace - Cnova', 'log_name' => 'cnova_produto_sem_estoque', 'level' => 'warning', 'messages' => 'O produto ' . $cod_produto . ' nao teve estoque atualizado', 'site' => 'titanis']; } else { $erro = ['identifier' => 'Marketplace - Cnova', 'log_name' => 'cnova_pedido_sem_produto', 'level' => 'critical', 'messages' => 'O pedido ' . $cod_produto . ' nao possui itens relacionados a ele', 'site' => 'continentalcenter']; } printr('<br><hr><br><b>Http Code Response: ' . set_log($erro)['http_code']); } /** * END SCRIPT */ /** * STUFF TO SEND CURL POST WITH LOG DATA */ /** * DO SOMETHING AND SEND LOG VIA POST * @param array $logData content with details of the log */ function set_log(array $logData) { $log_name = $logData['level'] . '_' . $logData['log_name']; // PATH TO WHERE API IS HOSTED $url = 'http://localhost/logs-notification/Logs/notification';
set_defaults(); /** @var ModuleAnchor */ $anchor = makePluginAnchor(); Plugin::load($anchor, 'ACTIVE=1 AND NORMAL_HOOKS=1', true); } else { define('ERROR', 'ERROR_DB_CONNECT'); } if ((!defined('CURRENT_SCHEMA') || (int) CURRENT_SCHEMA < (int) REQUIRED_SCHEMA) && !defined('DOING_UPGRADE')) { ?> <html><head><title>Upgrade required</title></head> <body><h1>Upgrade Required</h1><p>Scriptmind::Links has been upgraded. You must now run the <a href="<?php echo DOC_ROOT; ?> /admin/upgrade.php">upgrade program in your admin section</a> to update the database to the current version.</p></body></html><?php exit; } if (DEBUG === 1) { set_log('frontend_log.txt'); } //Initialize template /* @var $tpl SmartyBC */ $tpl = get_tpl(); $tpl->cache_lifetime = 0; $tpl->assign('VERSION', CURRENT_VERSION); require_once 'include/constants.php'; $URLcomponents = @parse_url($_SERVER['REQUEST_URI']); if (is_array($URLcomponents) && !empty($URLcomponents)) { @parse_str($URLcomponents['query'], $URLvariables); }
} else { define('ERROR', 'ERROR_DB_CONNECT'); } if ((!defined('CURRENT_SCHEMA') || (int) CURRENT_SCHEMA < (int) REQUIRED_SCHEMA) && !defined('DOING_UPGRADE')) { ?> <html><head><title>Upgrade required</title></head> <body><h1>Upgrade Required</h1><p>Scriptmind::Links has been upgraded. You must now run the <a href="<?php echo DOC_ROOT; ?> /upgrade.php">upgrade program in your admin section</a> to update the database to the current version.</p></body></html><?php exit; } if (DEBUG === 1) { set_log('admin_log.txt'); } $tpl = get_tpl(); $tpl->assign('date_format', '%D %H:%M:%S'); require_once 'include/constants.php'; $featured_where = "(FEATURED = 1 AND (EXPIRY_DATE > " . $db->DBTimeStamp(time()) . " OR EXPIRY_DATE IS NULL))"; if (empty($_SESSION['user_id'])) { if (!defined('FORBID_AUTO_LOGIN') && !(empty($_REQUEST['usercode']) && empty($_REQUEST['password']))) { login($_REQUEST['usercode'], $_REQUEST['password'], true); } if (empty($_SESSION['user_id'])) { $f = $_SERVER['SCRIPT_NAME']; if (($p = strrpos($f, '/')) !== false) { $f = substr($f, $p + 1); } if ($f != 'login.php') {