Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions include/admin_checks.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@
}
if (class_exists('Memcached')) {
$memcache_test = @new Memcached();
if ($config['memcache']['sasl'] === true) {
$memcache_test->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$memcache_test->setSaslAuthData($config['memcache']['sasl']['username'], $config['memcache']['sasl']['password']);
}
$memcache_test_add = @$memcache_test->addServer($config['memcache']['host'], $config['memcache']['port']);
$randmctv = rand(5,10);
$memcache_test_set = @$memcache_test->set('test_mpos_setval', $randmctv);
Expand Down
1 change: 1 addition & 0 deletions include/classes/news.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public function addNews($account_id, $aData, $active=false) {
if (empty($aData['header'])) return false;
if (empty($aData['content'])) return false;
if (!is_int($account_id)) return false;
if (@$aData['active']) $active = true;
$stmt = $this->mysqli->prepare("INSERT INTO $this->table (account_id, header, content, active) VALUES (?,?,?,?)");
if ($stmt && $stmt->bind_param('issi', $account_id, $aData['header'], $aData['content'], $active) && $stmt->execute())
return true;
Expand Down
4 changes: 4 additions & 0 deletions include/classes/statscache.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ public function __construct($config, $debug) {
require_once(CLASS_DIR . '/memcached.class.php');
}
$this->cache = new Memcached();
if ($config['memcache']['sasl'] === true) {
$this->cache->setOption(Memcached::OPT_BINARY_PROTOCOL, true);
$this->cache->setSaslAuthData($config['memcache']['sasl']['username'], $config['memcache']['sasl']['password']);
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions include/config/global.inc.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,9 @@
$config['memcache']['expiration'] = 90;
$config['memcache']['splay'] = 15;
$config['memcache']['force']['contrib_shares'] = false;
$config['memcache']['sasl'] = false;
$config['memcache']['sasl']['username'] = '';
$config['memcache']['sasl']['password'] = '';

/**
* Cookies
Expand Down
4 changes: 4 additions & 0 deletions templates/bootstrap/admin/news/default.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
<input type="hidden" name="do" value="add">
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
<div class="form-group">
<label>Active</label>
<input type="checkbox" class="switch" data-size="mini" name="data[active]" value="1" checked>
</div>
<div class="form-group">
<label>Header</label>
<input class="form-control" size="30" type="text" name="data[header]" required />
Expand Down