Skip to content
Permalink
Browse files

UserSpice 5.0.3

  • Loading branch information...
mudmin committed Sep 5, 2019
1 parent fd27473 commit 75c81775129e1002cb4e1f358718cf2bf09f04f6
@@ -30,7 +30,14 @@
<?php require_once $abs_us_root.$us_url_root.'users/includes/user_spice_ver.php'; ?>

<?php $view = Input::get('view');?>
<?php require_once $abs_us_root.$us_url_root.'users/views/_admin_menu.php'; ?>
<?php require_once $abs_us_root.$us_url_root.'users/views/_admin_menu.php';
if($view == '' || $view == 'dashboard'){
if((time() - strtotime($settings->announce)) > 10800){
$db->update('settings',1,['announce'=>date("Y-m-d H:i:s")]);
require_once $abs_us_root.$us_url_root.'users/views/_admin_announcements.php';
}
}
?>
<div id="right-panel" class="right-panel">

<div id="messages" class="sufee-alert alert with-close alert-primary alert-dismissible fade show d-none">
@@ -248,14 +255,12 @@ function checkAccess ($key,$value) {
</div><!-- /#right-panel -->

<!-- Right Panel -->



<script type="text/javascript">
$(document).ready(function() {
$('[data-toggle="popover"]').popover();
$('[data-toggle="popover"]').popover();
function messages(data) {
console.log("messages found");
$('#messages').removeClass();
$('#message').text("");
$('#messages').show();
@@ -384,53 +389,6 @@ function messages(data) {
}
}
}?>
<?php
if($view == '' || $view == 'dashboard'){
// UserSpice Announcements
$rc = @fsockopen("https://rss.userspice.com",80,$errCode,$errStr,1);
if (is_resource($rc)) {
$filename= 'https://rss.userspice.com/rss.xml';
$file_headers = @get_headers($filename);
if(($file_headers[0] != 'HTTP/1.1 200 OK') && ($file_headers[1] != 'HTTP/1.1 200 OK')){
//logger($user->data()->id,"Errors","UserSpice Announcements feed not found. Please tell UserSpice!");
} else {
$limit = 0;
$dis = $db->query("SELECT * FROM us_announcements")->results();
$dismissed = [];
foreach($dis as $d){
$dismissed[] = $d->dismissed;
}
$xmlDoc = new DOMDocument();
$xmlDoc->load('https://rss.userspice.com/rss.xml');
$x=$xmlDoc->getElementsByTagName('item');
for ($i=0; $i<=2; $i++) {
if($limit == 1){
continue;
}

$dis=$x->item($i)->getElementsByTagName('dis')
->item(0)->childNodes->item(0)->nodeValue;
if(!in_array($dis,$dismissed) && $dis != 0){
$limit = 1;
$ignore=$x->item($i)->getElementsByTagName('ignore')
->item(0)->childNodes->item(0)->nodeValue;
$title=$x->item($i)->getElementsByTagName('title')
->item(0)->childNodes->item(0)->nodeValue;
$class=$x->item($i)->getElementsByTagName('class')
->item(0)->childNodes->item(0)->nodeValue;
$link=$x->item($i)->getElementsByTagName('link')
->item(0)->childNodes->item(0)->nodeValue;
$message=$x->item($i)->getElementsByTagName('message')
->item(0)->childNodes->item(0)->nodeValue;
if(version_compare($ignore, $user_spice_ver) != 1){
continue;
}
}
}
}
}
}
?>
</body>
</html>
@@ -308,8 +308,7 @@ function write_php_ini($array, $file)
function safefilerewrite($fileName, $dataToSave)
{
$security1 = ';<?php';
$security2 = ';die();';
$security = ';<?php die();?>';
if ($fp = fopen($fileName, 'w'))
{
@@ -322,7 +321,7 @@ function safefilerewrite($fileName, $dataToSave)
//file was locked so now we can store information
if ($canWrite)
{ fwrite($fp, $security1.PHP_EOL.$security2.PHP_EOL.$dataToSave);
{ fwrite($fp, $security.PHP_EOL.$dataToSave);
flock($fp, LOCK_UN);
}
fclose($fp);
@@ -1578,7 +1578,9 @@ function getMyHooks($opts = []) {
$data['bottom'] = [];
$counter = 0;
foreach($hooks as $h){
if($h->position == "post"){
if($h->position == "pre"){
$data['pre'][$counter] = $h->folder.'/'.$h->hook;
}elseif($h->position == "post"){
$data['post'][$counter] = $h->folder.'/'.$h->hook;
}elseif($h->position == "form"){
$data['form'][$counter] = $h->folder.'/'.$h->hook;
@@ -6,5 +6,6 @@
'XX4zArPs4tor','pv7r2EHbVvhD','hcA5B3PLhq6E','FyMYJ2oeGCTX','iit5tHSLatiS',
'VNEno3E4zaNz','qPEARSh49fob','2ZB9mg1l0JXe','B9t6He7qmFXa','86FkFVV4TGRg',
'y4A1Y0u9n2Rt','Tm5xY22MM8eC','0YXdrInkjV86F','99plgnkjV86','0DaShInkjV86',
'0DaShInkjVz1','y4A1Y0u9n2SS','0DaShInkjV87','0DaShInkjV88'
'0DaShInkjVz1','y4A1Y0u9n2SS','0DaShInkjV87','0DaShInkjV88','2019-09-04a',
'2019-09-05c',
);
@@ -1,3 +1,3 @@
<?php
$user_spice_ver="5.0.1";
$user_spice_ver="5.0.3";
?>
Binary file not shown.

0 comments on commit 75c8177

Please sign in to comment.
You can’t perform that action at this time.