mirror of
https://github.com/easy-wi/developer.git
synced 2025-02-20 11:23:28 +08:00
Merge pull request #1272 from Nexus633/master
Fix Updater, Add easy-wi update email Template
This commit is contained in:
commit
79f19d4c62
@ -41,37 +41,40 @@
|
||||
if (isset($include) and $include == true) {
|
||||
|
||||
$query = $sql->prepare("INSERT INTO `easywi_version` (`version`,`de`,`en`) VALUES
|
||||
('6.1.7','<div align=\"right\">19.07.2020</div>
|
||||
('6.1.7','<div align=\"right\">21.07.2020</div>
|
||||
<b>Änderungen:</b><br/>
|
||||
<ul>
|
||||
<li>General
|
||||
<ul>
|
||||
<li>Update Email-Template Hinzugefügt</li>
|
||||
<li>Beispiel Modul Hinzugefügt</li>
|
||||
<li>kosmetische Fehler behoben</li>
|
||||
<li>Ticketsystem überarbeitet</li>
|
||||
<li>Modul Liste geupdatet -> Example Modules</li>
|
||||
<li>PhpMailer auf version 6 geupdated</li>
|
||||
</ul></li></li></ul>
|
||||
</ul></li></ul>
|
||||
<b>Bugfixes:</b>
|
||||
<ul>
|
||||
<li>Updater Bug Behoben</li>
|
||||
<li>Sendmail Bug Behoben</li>
|
||||
<li>Ticketsystem unterkategorie Bug behoben</li>
|
||||
<li>Masterapps MC update Bug Behoben</li>
|
||||
<li>DNS bei der Gameserver Anzeige Bug Behoben</li>
|
||||
</ul>','<div align=\"right\">19.07.2020</div>
|
||||
</ul>','<div align=\"right\">21.07.2020</div>
|
||||
<b>Changes:</b><br/>
|
||||
<ul>
|
||||
<li>General
|
||||
<ul>
|
||||
<li>Update Email-Template Added </li>
|
||||
<li>Exemple Module Added </li>
|
||||
<li>cosmetic errors fixed</li>
|
||||
<li>Ticketsystem upgraded</li>
|
||||
<li>Modul List Updated -> Example Modules</li>
|
||||
<li>Upgrade PhpMailer to version 6</li>
|
||||
<li>
|
||||
</ul></li></li>
|
||||
</ul></li></ul>
|
||||
<b>Bugfixes:</b>
|
||||
<ul>
|
||||
<li>Updater Bug Fixed</li>
|
||||
<li>Sendmail Bug Fixed</li>
|
||||
<li>Supportsystem Subcategory Bug Fixed</li>
|
||||
<li>Masterapps Minecraft update Bug Fixed</li>
|
||||
@ -100,7 +103,7 @@ if (isset($include) and $include == true) {
|
||||
];
|
||||
|
||||
if($modulesid != 0){
|
||||
$query4 = $sql->prepare("SELECT `id` FROM `translations` WHERE `type`='mo' AND `lang`=? And `transID`=? LIMIT 1");
|
||||
$query4 = $sql->prepare("SELECT `transID` FROM `translations` WHERE `type`='mo' AND `lang`=? And `transID`=? LIMIT 1");
|
||||
$query5 = $sql->prepare("INSERT INTO `translations` (`type`, `lang`, `transID`, `resellerID`, `text`) VALUES (?,?,?,?,?) ON DUPLICATE KEY UPDATE `text`=VALUES(`text`)");
|
||||
foreach ($modullanguage as $lang){
|
||||
$query4->execute(array($lang["lang"], $modulesid));
|
||||
|
@ -118,6 +118,7 @@
|
||||
<templates>Images/Templates</templates>
|
||||
<traffic>Traffic</traffic>
|
||||
<update>Aktualisieren</update>
|
||||
<update_easy>Easy-Wi Update</update_easy>
|
||||
<upload>Upload</upload>
|
||||
<use>Anwenden</use>
|
||||
<used>Belegt</used>
|
||||
|
@ -98,6 +98,7 @@
|
||||
<templates>Images/Templates</templates>
|
||||
<traffic>Trafik</traffic>
|
||||
<update>Opdater</update>
|
||||
<update_easy>Easy-Wi Opdater</update_easy>
|
||||
<upload>Upload</upload>
|
||||
<use>Brug</use>
|
||||
<used></used>
|
||||
|
@ -122,6 +122,7 @@
|
||||
<templates>Modelli</templates>
|
||||
<traffic>Traffico</traffic>
|
||||
<update>Aggiorna</update>
|
||||
<update_easy>Easy-Wi Aggiorna</update_easy>
|
||||
<upload>Carica</upload>
|
||||
<use>Utilizza</use>
|
||||
<used>In uso</used>
|
||||
|
@ -122,6 +122,7 @@
|
||||
<templates>Imagems/Modelos</templates>
|
||||
<traffic>Tráfego</traffic>
|
||||
<update>Update</update>
|
||||
<update_easy>Easy-Wi Update</update_easy>
|
||||
<upload>Enviar</upload>
|
||||
<use>Usar</use>
|
||||
<used>Usado</used>
|
||||
|
@ -120,6 +120,7 @@
|
||||
<templates>Картинки/Шаблоны</templates>
|
||||
<traffic>Траффик</traffic>
|
||||
<update>Обновить</update>
|
||||
<update_easy>Easy-Wi Обновить</update_easy>
|
||||
<upload>Загрузить</upload>
|
||||
<use>Использовать</use>
|
||||
<used>Использовано</used>
|
||||
|
@ -122,6 +122,7 @@
|
||||
<templates>Images/Templates</templates>
|
||||
<traffic>Traffic</traffic>
|
||||
<update>Update</update>
|
||||
<update_easy>Easy-Wi Update</update_easy>
|
||||
<upload>Upload</upload>
|
||||
<use>Use</use>
|
||||
<used>Used</used>
|
||||
|
19
reboot.php
19
reboot.php
@ -88,21 +88,20 @@ if (!isset($ip) or $ui->escaped('SERVER_ADDR', 'server') == $ip or in_array($ip,
|
||||
|
||||
echo "<br><br>New Easy-Wi{$developerVersion} version available: {$rSA['version']}\r\n";
|
||||
|
||||
if (date('G') == 5) {
|
||||
|
||||
$updateMail = "A new Easy-Wi{$developerVersion} version is available. The version is {$rSA['version']}.\r\nYou can download it at https://github.com/easy-wi/developer/releases/tag/{$rSA['version']}";
|
||||
$updateMail = "A new Easy-Wi{$developerVersion} version is available. The version is {$rSA['version']}.\r\nYou can download it at https://github.com/easy-wi/developer/releases/tag/{$rSA['version']}";
|
||||
|
||||
$query = $sql->prepare("SELECT `id`,`cname`,`mail` FROM `userdata` WHERE `accounttype`='a' AND `active`='Y'");
|
||||
$query->execute();
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (sendmail('easy-wi-update', $row['id'], $updateMail, 'Y')) {
|
||||
echo "<br>Update notification send to user {$row['cname']} ({$row['mail']})\r\n";
|
||||
} else {
|
||||
echo "<br>Sending update notification to user {$row['cname']} ({$row['mail']}) failed\r\n";
|
||||
}
|
||||
$query = $sql->prepare("SELECT `id`,`cname`,`mail` FROM `userdata` WHERE `accounttype`='a' AND `active`='Y'");
|
||||
$query->execute();
|
||||
while ($row = $query->fetch(PDO::FETCH_ASSOC)) {
|
||||
if (sendmail('emaileasyupdate', $row['id'], $updateMail, 'Y')) {
|
||||
echo "<br>Update notification send to user {$row['cname']} ({$row['mail']})\r\n";
|
||||
} else {
|
||||
echo "<br>Sending update notification to user {$row['cname']} ({$row['mail']}) failed\r\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
echo "<br>You are running the latest Easy-Wi{$developerVersion} version: {$installedEasyWiVersion}.\r\n";
|
||||
}
|
||||
|
@ -85,6 +85,9 @@ $emailTemplates = array(
|
||||
),
|
||||
'emailgserverupdate' => array(
|
||||
'query' => "INSERT INTO `settings_email_template` (`id`, `reseller_id`, `language`, `active`, `category`, `email_setting_name`, `subject`, `email_body`, `ccmailing`, `bccmailing`, `attachments`) VALUES (16, ?, 'de', '1', '6', 'emailgserverupdate', 'Game Server wurde upgedatet!', '<div style=\"text-align:center\">\r\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color:#FAFAFA\" width=\"100%\">\r\n <tbody>\r\n <tr>\r\n <td align=\"center\" valign=\"top\"> \r\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:1px solid #DDDDDD\">\r\n <tbody>\r\n <tr>\r\n <td align=\"center\" valign=\"top\">\r\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td valign=\"top\">\r\n <h1 style=\"background-color:#505050;border-bottom:10px solid #12438f;padding:20px;line-height:130%;color:#D2CFCF;margin:0px;font-size:20px\">%topic%</h1>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"border-bottom:1px solid #eee;background-color:#fff;padding:15px;font-size:13px\" valign=\"top\"><strong>%topic%</strong>\r\n <p>%salutation% %fullname%,</p>\r\n\r\n <p>eine veraltete Version wurde an Ihrem Game Master Server entdeckt. Diese wurde nun erfolgreich upgedatet. Alle Ihre Server sollten weiterhin erreichbar sein.</p>\r\n\r\n <p>Ihr<br />\r\n Easy-Wi Team</p>\r\n\r\n <center><small>%noreply%</small></center>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" valign=\"top\">\r\n <table border=\"0\" cellpadding=\"10\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td valign=\"top\">\r\n <table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"100%\">\r\n <tbody>\r\n <tr>\r\n <td colspan=\"2\" valign=\"middle\">\r\n <div style=\"color:#999;font-size:11px;text-align:center\">Powered by <a href=\"http://www.easy-wi.com\" target=\"_blank\">Easy-Wi</a></div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n</div>\r\n', '', '', '')"
|
||||
),
|
||||
'emaileasyupdate' => array(
|
||||
'query' => "INSERT INTO `settings_email_template` (`id`, `reseller_id`, `language`, `active`, `category`, `email_setting_name`, `subject`, `email_body`, `ccmailing`, `bccmailing`, `attachments`) VALUES (17, ?, 'de', '1', '4', 'emaileasyupdate', 'Eine neue Easy-Wi version ist verügbar!', '<div style=\"text-align:center\">\r\n<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"background-color:#FAFAFA\" width=\"100%\">\r\n <tbody>\r\n <tr>\r\n <td align=\"center\" valign=\"top\"> \r\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"border:1px solid #DDDDDD\">\r\n <tbody>\r\n <tr>\r\n <td align=\"center\" valign=\"top\">\r\n <table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td valign=\"top\">\r\n <h1 style=\"background-color:#505050;border-bottom:10px solid #12438f;padding:20px;line-height:130%;color:#D2CFCF;margin:0px;font-size:20px\">%topic%</h1>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"border-bottom:1px solid #eee;background-color:#fff;padding:15px;font-size:13px\" valign=\"top\"><strong>%topic%</strong>\r\n <p>%salutation% %fullname%,</p>\r\n\r\n <p>eine neue Easy-Wi version ist vorhanden.</p>\r\n\r\n <p>Ihr<br />\r\n Easy-Wi Team</p>\r\n\r\n <center><small>%noreply%</small></center>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td align=\"center\" valign=\"top\">\r\n <table border=\"0\" cellpadding=\"10\" cellspacing=\"0\">\r\n <tbody>\r\n <tr>\r\n <td valign=\"top\">\r\n <table border=\"0\" cellpadding=\"10\" cellspacing=\"0\" width=\"100%\">\r\n <tbody>\r\n <tr>\r\n <td colspan=\"2\" valign=\"middle\">\r\n <div style=\"color:#999;font-size:11px;text-align:center\">Powered by <a href=\"http://www.easy-wi.com\" target=\"_blank\">Easy-Wi</a></div>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n </td>\r\n </tr>\r\n </tbody>\r\n</table>\r\n</div>\r\n', '', '', '')"
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -661,7 +661,6 @@ if (!function_exists('passwordgenerate')) {
|
||||
$writerid = $shorten[1];
|
||||
$topicid = $shorten[2];
|
||||
$shorten = $shorten[0];
|
||||
|
||||
}
|
||||
|
||||
//Load costomer
|
||||
@ -1254,25 +1253,47 @@ if (!function_exists('passwordgenerate')) {
|
||||
return $return;
|
||||
}
|
||||
|
||||
function licenceRequest($return = false) {
|
||||
|
||||
function licenceRequest($return = false, $boolreturn = false) {
|
||||
global $sql, $ui, $rSA;
|
||||
|
||||
$developer = (isset($rSA['developer'])) ? $rSA['developer'] : 'N';
|
||||
$user_agent = isset($ui->server['HTTP_HOST']) ? $ui->server['HTTP_HOST'] : $rSA['paneldomain'];
|
||||
$host = "https://api.github.com/repos/easy-wi/developer/" . (($developer == 'Y') ? 'tags' : 'releases/latest');
|
||||
$header = [
|
||||
"Accept: application/vnd.github.v3+json",
|
||||
"User-Agent: " . $user_agent
|
||||
];
|
||||
|
||||
$apiResponse = webhostRequest('api.github.com', isset($ui->server['HTTP_HOST']) ? $ui->server['HTTP_HOST'] : $rSA['paneldomain'], '/repos/easy-wi/developer/' . (($developer == 'Y') ? 'tags' : 'releases/latest'), null, 443);
|
||||
$json = @json_decode($apiResponse);
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $host);
|
||||
curl_setopt($curl, CURLOPT_HEADER, true);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true);
|
||||
$respones = curl_exec($curl);
|
||||
$request_info = curl_getinfo($curl);
|
||||
curl_close($curl);
|
||||
|
||||
if (($developer == 'N' and is_object($json) and property_exists($json, 'tag_name') or ($developer == 'Y' and is_array($json) and isset($json[0]) and is_object($json[0]) and property_exists($json[0], 'name')))) {
|
||||
list($header, $content) = parseHeaders($respones);
|
||||
if($request_info["http_code"] == 200){
|
||||
$json = json_decode($content);
|
||||
|
||||
$version = ($developer == 'Y') ? $json[0]->name : $json->tag_name;
|
||||
$apiResponse = array('v' => $version);
|
||||
if (($developer == 'N' and is_object($json) and property_exists($json, 'tag_name') or ($developer == 'Y' and is_array($json) and isset($json[0]) and is_object($json[0]) and property_exists($json[0], 'name')))) {
|
||||
|
||||
$query = $sql->prepare("UPDATE `settings` SET `version`=? WHERE `resellerid`=0 LIMIT 1");
|
||||
$query->execute(array($version));
|
||||
$version = ($developer == 'Y') ? $json[0]->name : $json->tag_name;
|
||||
$rSA['version'] = $version;
|
||||
$apiResponse = array('v' => $version);
|
||||
|
||||
$query = $sql->prepare("UPDATE `settings` SET `version`=? WHERE `resellerid`=0 LIMIT 1");
|
||||
$query->execute(array($version));
|
||||
}
|
||||
|
||||
|
||||
return ($return == true) ? $json : $boolreturn;
|
||||
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
|
||||
return ($return == true) ? $apiResponse : false;
|
||||
}
|
||||
|
||||
function token ($check = false) {
|
||||
@ -1660,4 +1681,25 @@ $(function() {
|
||||
function getLoginHeader($valueOfTitle){
|
||||
return preg_replace('/(.+)[\s](.+)/i', '<b>${1}</b> $2', $valueOfTitle, -1, $count);
|
||||
}
|
||||
|
||||
function parseHeaders($data)
|
||||
{
|
||||
list($header, $content) = explode("\r\n\r\n", $data);
|
||||
$headers = explode("\r\n", $header);
|
||||
|
||||
$head = array();
|
||||
foreach( $headers as $k=>$v )
|
||||
{
|
||||
$t = explode( ':', $v, 2 );
|
||||
if( isset( $t[1] ) )
|
||||
$head[ trim($t[0]) ] = trim( $t[1] );
|
||||
else
|
||||
{
|
||||
$head[] = $v;
|
||||
if( preg_match( "#HTTP/[0-9\.]+\s+([0-9]+)#",$v, $out ) )
|
||||
$head['reponse_code'] = intval($out[1]);
|
||||
}
|
||||
}
|
||||
return [$head, $content];
|
||||
}
|
||||
}
|
@ -122,6 +122,13 @@
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input type="checkbox" id="inputTemplate-emaileasyupdate" name="templates[]" value="emaileasyupdate">
|
||||
<?php echo $gsprache->update_easy;?>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="checkbox">
|
||||
<label>
|
||||
<input id="checkAll" type="checkbox" value="yes" onclick="checkall(this.checked,'templates[]')">
|
||||
|
@ -66,6 +66,15 @@
|
||||
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<?php if(isset($toooldversion)){ ?>
|
||||
<!-- Messages: style can be found in dropdown.less-->
|
||||
<li class="dropdown messages-menu hidden-xs">
|
||||
<a href="admin.php?w=vc" class="dropdown-toggle">
|
||||
<i class="fa fa-cloud"></i>
|
||||
<span class="label label-warning"><?php echo $rSA['version'];?></span>
|
||||
</a>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php if($statsArray['ticketsTotal']>0){ ?>
|
||||
<!-- Messages: style can be found in dropdown.less-->
|
||||
<li class="dropdown messages-menu hidden-xs">
|
||||
|
Loading…
x
Reference in New Issue
Block a user