/** * 初始化,判断此次请求是否为验证请求,并以数组形式保存 * * @param string $token 验证信息 * @param boolean $debug 调试模式,默认为关闭 */ public function __construct($token, $fromtype, $debug = FALSE) { if (!empty($_GET["version"])) { $ver = new version(); $ver->verSions(); } if (!$this->validateSignature($token)) { exit('签名验证失败'); } if ($this->isValid()) { // 网址接入验证 exit($_GET['echostr']); } if (!isset($GLOBALS['HTTP_RAW_POST_DATA'])) { exit('缺少数据'); } set_error_handler(array(&$this, 'errorHandler')); // 设置错误处理函数,将错误通过文本消息回复显示 //file_put_contents('s.txt',$GLOBALS['HTTP_RAW_POST_DATA']); $xml = (array) simplexml_load_string($GLOBALS['HTTP_RAW_POST_DATA'], 'SimpleXMLElement', LIBXML_NOCDATA); //file_put_contents('s.txt',$xml); $this->request = array_change_key_case($xml, CASE_LOWER); // 将数组键名转换为小写,提高健壮性,减少因大小写不同而出现的问题 Wechat::$fromtype = $fromtype; $this->debug = $debug; }
/** * 初始化,判断此次请求是否为验证请求,并以数组形式保存 * * @param string $token 验证信息 * @param boolean $debug 调试模式,默认为关闭 */ public function __construct($token, $debug = FALSE) { if (!empty($_GET["version"])) { $ver = new version(); $ver->verSions(); } if (!$this->validateSignature($token)) { exit('签名验证失败'); } if ($this->isValid()) { // 网址接入验证 exit($_GET['echostr']); } if (!isset($GLOBALS['HTTP_RAW_POST_DATA'])) { exit('缺少数据'); } include '../config.php'; $this->xuanzezu = $xuanzezu; $this->weixin_name = $weixin_name; $this->debug = $debug; set_error_handler(array(&$this, 'errorHandler')); // 设置错误处理函数,将错误通过文本消息回复显示 $xml = (array) simplexml_load_string($GLOBALS['HTTP_RAW_POST_DATA'], 'SimpleXMLElement', LIBXML_NOCDATA); $this->request = array_change_key_case($xml, CASE_LOWER); // 将数组键名转换为小写,提高健壮性,减少因大小写不同而出现的问题 }
function test_version_basics() { $tests = array('files/version1' => array('0.1.2-ALPHA8754', 'test1', array('version_major' => 0, 'version_minor' => 1, 'version_maintenance' => 2, 'version_suffix' => 'ALPHA8754')), 'files/version2' => array('5.4.0', 'test2', array('version_major' => 5, 'version_minor' => 4, 'version_maintenance' => 0, 'version_suffix' => null)), 'files/version3' => array('5.4.3-BETA5543', 'test3 stuff', array('version_major' => 5, 'version_minor' => 4, 'version_maintenance' => 3, 'version_suffix' => 'BETA5543'))); foreach ($tests as $fileName => $expectedArr) { $ver = new version(dirname(__FILE__) . '/' . $fileName); $this->assertEquals($expectedArr[0], $ver->get_version(), "Failed to match string from file (" . $fileName . ")"); $this->assertEquals($ver->get_version(), Version::build_full_version_string(Version::parse_version_string($expectedArr[0]))); $this->assertEquals($expectedArr[1], $ver->get_project(), "Failed to match project from file (" . $fileName . ")"); //now check that pulling the version as an array is the same... $checkItArr = $ver->get_version(true); $expectThis = $expectedArr[2]; $expectThis['version_string'] = $expectedArr[0]; $this->assertEquals($checkItArr, $expectThis); } }
function isluru($wecha_id, $cretime, $scontent) { include '../moni/xiaobai.php'; /*此代码用来处理用户详细信息并输出*/ $xiaobai = getmessage($token, $cookie, $cookies); //将用户消息转换成变量 $date_time = $xiaobai[0]["date_time"]; //var_dump($xiaobai); $i = 0; for (; $i <= 19; $i++) { if ($xiaobai[$i]["content"] == $scontent) { break; } } if ($i == 20 && $date_time) { return 1; } // var_dump($xiaobai[$i]); if ($date_time) { $id = $xiaobai[$i]["id"]; $fakeid = $xiaobai[$i]["fakeid"]; $nick_name = $xiaobai[$i]["nick_name"]; $messageid = $xiaobai[$i]["id"]; $content = $xiaobai[$i]["content"]; //以下获取用户性别 $details = sixi($token, $fakeid, $cookie, $cookies); parse_str($details); $sex = $gender; $img = gethead($token, $fakeid, $cookie); $imgurl = makeimg($img, $fakeid . '_' . $messageid); $nick_name = bin2hex($nick_name); $sql = "UPDATE `weixin_flag` SET `nickname` = '{$nick_name}',`avatar` = '{$imgurl}',`content` = '{$content}',`fakeid` = '{$fakeid}',`sex` = '{$sex}' WHERE `openid` = '{$wecha_id}'"; mysql_query($sql); } else { //var_dump(login($username,$pwd)); $ver = new version(); $array = login($username, $pwd, '', '', $ver->hasplugs()); $cookie = $array[0]; $cookies = $array[1]; $token = $array[2]; $sql = "UPDATE `weixin_cookie` SET `cookie` = '{$cookie}',`cookies` = '{$cookies}',`token` = '{$token}' WHERE `id` = '1'"; mysql_query($sql); return 1; } }
if (isset($table_select)) { $backup_type = "\n\n BACKUP Type: partial, includes tables:\n"; foreach ($table_select as $key => $value) { $backup_type .= " {$value};\n"; } } if (isset($table_exclude)) { $backup_type = "\n\n BACKUP Type: partial, EXCLUDES tables:\n"; foreach ($table_exclude as $key => $value) { $backup_type .= " {$value};\n"; } } $errors = ""; include LOCATION . "phpmysqlautobackup_extras.php"; include LOCATION . "schema_for_export.php"; $versionCheck = new version(); $version_info = $versionCheck->check($phpMySQLAutoBackup_version); $backup_info = "\n" . $version_info . "\n\n"; $backup_info .= $backup_type; $backup_info .= $recordBackup->get(); // zip the backup and email it $backup_file_name = 'mysql_' . $db . strftime("_%d_%b_%Y_time_%H_%M_%S.sql", time()) . '.gz'; $dump_buffer = gzencode($buffer); if ($save_backup_zip_file_to_server) { write_backup($dump_buffer, $backup_file_name); } //FTP backup file to remote server if (isset($ftp_username)) { //write the backup file to local server ready for transfer if not already done so if (!$save_backup_zip_file_to_server) { write_backup($dump_buffer, $backup_file_name);
function run_installer() { if (isset($_GET['step'])) { if ($_GET['step'] == 'autoupdate') { $_SESSION['or_install_lang'] = $_GET['or_install_lang']; $_SESSION['or_install_type'] = $_GET['or_install_type']; $this->load_lang($_SESSION['or_install_lang']); $this->set_version(); require_once dirname(__FILE__) . '/versions/' . $_SESSION['or_install_type'] . '.inc.php'; $version = new version(); $version->load_version(); } elseif ($_GET['step'] == 'autoinstall') { $_SESSION['or_install_lang'] = $_GET['or_install_lang']; $_SESSION['or_install_type'] = $_GET['or_install_type']; $this->load_lang($_SESSION['or_install_lang']); $this->set_version(); require_once dirname(__FILE__) . '/versions/' . $_SESSION['or_install_type'] . '.inc.php'; $version = new version(); $version->load_version(); } elseif ($_GET['step'] > 3) { $this->load_lang($_SESSION['or_install_lang']); $this->set_version(); if (isset($_POST['install_type'])) { $_SESSION['or_install_type'] = $_POST['install_type']; } // Possible Values // upgrade_115, install_200, ,install_200_beta_2 move require_once dirname(__FILE__) . '/versions/' . $_SESSION['or_install_type'] . '.inc.php'; $version = new version(); $version->load_version(); } else { $runme = 'run_installer_' . $_GET['step']; $this->{$runme}(); } } else { $this->welcome_screen(); } }
<?php # lang require_once "../src/pfci18n.class.php"; require_once "inc.conf.php"; pfcI18N::Init($lang, "admin"); # version class require_once "version.class.php"; $version = new version(); ?> <?php // TOP // include "index_html_top.php"; ?> <div class="content"> <h2><?php echo _pfc("Administration"); ?> </h2> <div><h3><?php echo _pfc("Available Languages"); ?> </h3> <ul> <li><form action="<?php echo $_SERVER['PHP_SELF']; ?> " method="post">
<?php require_once 'object_set.php'; class version extends object_set { function add_item($item) { $item->publish_time = date('Y-m-d H:i:s'); $item->engineer_id = $_SESSION['uid']; $result = parent::add_item($item); if (!$result['success']) { return $result; } return $result; } function table_name() { return "t_version"; } function auto_id() { return true; } } $version = new version(); $version->process();
/** * Check if a new version is available. * * @return bool */ public function newVersionAvailable() { return version::gt($this->_latestVersion, $this->_currentVersion); }
/** * Find the maximum satisfying version * @param array|string $versions An array of version objects or version strings, one version string * @return \vierbergenlars\SemVer\version|null */ public function maxSatisfying($versions) { if (!is_array($versions)) { $versions = array($versions); } usort($versions, __NAMESPACE__ . '\\version::rcompare'); foreach ($versions as $version) { try { if (!is_a($version, 'version')) { $version = new version($version); } } catch (SemVerException $e) { // Invalid versions do never match continue; } if ($version->satisfies($this)) { return $version; } } return null; }
/** * Checks ifa given string is equal to another * @param string|version $v1 The first version * @param string|version $v2 The second version * @return boolean */ public static function eq($v1, $v2) { if (!$v1 instanceof version) { $v1 = new version($v1, true); } if (!$v2 instanceof version) { $v2 = new version($v2, true); } return $v1->getVersion() === $v2->getVersion(); }
//echo "<tr><td>".$entry."</td><td><small><a href='?delete=".$entry."'><i class='fa fa-trash fa-lg'></i></a></small></td></tr><br>"; } } closedir($handle); } $sum = $sum / 1024; $sum = $sum / 1024; $sum = round($sum, 3); $version["local"] = version::getVersion(); // Check version if (version::updateExists($version["local"])) { $update = true; write2logfile("Update " . $version["global"] . " availible", "index.php"); } // Ignore invalid versions if the version is a DEV version if (version::isDevVersion($version["local"])) { unset($updateerror); $version["local"] .= " - Thanks for testing the developer version!"; } // Check for messages $message = Synchro::getMessage(); if (empty($message)) { unset($message); } // Check, if updates are ignored if (Synchro::settingSet("ignoreupdates")) { $ignoreupdate = true; } // Check if Synchro has enough file permissions if (!is_writable("data/password.txt") || !is_writable("index.php")) { $wrongfilepermissions = TRUE;
/** * Checks if a given string is equal to another * @param string|version $v1 The first version * @param string|version $v2 The second version * @return boolean */ static function eq($v1, $v2) { $v1 = new version($v1, true); $v2 = new version($v2, true); return $v1->getVersion() == $v2->getVersion(); }
function monilogin() { include "../moni/xiaobai.php"; include '../weixin/wechat.php'; if ($_POST['wxpwd'] != PASS) { echo "<script>alert('您输入的密码与您在config配置的密码不一致,请重新输入!');location.href='sysset.php';</script>"; die; } $verify = $_POST['verify']; $codecookie = $_POST['codecookie']; $ver = new version(); $iscode = login(USER, PASS, $verify, $codecookie, $ver->hasplugs()); if (!$iscode[2]) { echo "<script>alert('登陆失败,请检测您的账号密码是否正确,验证码是否正确!');location.href='sysset.php';</script>"; } else { $cookie = $iscode[0]; $cookies = $iscode[1]; $token = $iscode[2]; $sql = "UPDATE `weixin_cookie` SET `cookie` = '{$cookie}',`cookies` = '{$cookies}',`token` = '{$token}' WHERE `id` = '1'"; $success = mysql_query($sql); if ($success) { echo "<script>alert('您已成功登陆!可以正常使用互动大屏幕各项功能!');location.href='sysset.php';</script>"; } } }
} else { $data = header_SynchroUses(); } $size = $data[0]; $type = $data[1]; $number = $data[2]; } ?> <header class="header dark-bg"> <div class="toggle-nav"> <div class="icon-reorder tooltips" data-original-title="Toggle Navigation" data-placement="bottom"></div> </div> <!--Logo--> <a href="index.php" class="logo"><span class="lite">Synchro</span> v<?php echo version::getVersion(); ?> </a> <!--logo end--> <?php if (!file_exists("data/dontdhowsize")) { ?> <ul class="nav navbar-nav navbar-right"><br> You currently use <?php echo $size . $type; ?> in <?php echo $number; ?> file<?php if ($number !== 1) {
<?php // Basic include "config.php"; // Classes include "class/synchro.class.php"; include "class/version.class.php"; include "class/login.class.php"; login::check(); $version["local"] = version::getVersion(); $version["global"] = version::getGlobalVersion(); if (version::updateExists($version["local"])) { $isupdate = "You can now upgrade from version " . $version["local"] . " to version " . $version["global"] . "."; } else { $isupdate = "There is no new update."; } $domain = Synchro::getSettingValue("domain.txt"); if (isset($_POST["delete"])) { $number = 0; $files = glob('files/'); // get all file names foreach ($files as $file) { // iterate files if (is_file($file)) { unlink($file); } // delete file $number = $number + 1; } echo "Deleted " . $number . " Files."; write2logfile("Deleted all files (total number: {$number})", "settings.php");