Merge pull request #2371 from MPOS/development
UPDATE : Development to Master
This commit is contained in:
commit
54d667335c
@ -34,6 +34,10 @@ if (@$_SESSION['USERDATA']['is_admin'] && $user->isAdmin(@$_SESSION['USERDATA'][
|
|||||||
}
|
}
|
||||||
if (class_exists('Memcached')) {
|
if (class_exists('Memcached')) {
|
||||||
$memcache_test = @new 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']);
|
$memcache_test_add = @$memcache_test->addServer($config['memcache']['host'], $config['memcache']['port']);
|
||||||
$randmctv = rand(5,10);
|
$randmctv = rand(5,10);
|
||||||
$memcache_test_set = @$memcache_test->set('test_mpos_setval', $randmctv);
|
$memcache_test_set = @$memcache_test->set('test_mpos_setval', $randmctv);
|
||||||
|
|||||||
@ -88,6 +88,7 @@ class News extends Base {
|
|||||||
if (empty($aData['header'])) return false;
|
if (empty($aData['header'])) return false;
|
||||||
if (empty($aData['content'])) return false;
|
if (empty($aData['content'])) return false;
|
||||||
if (!is_int($account_id)) 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 (?,?,?,?)");
|
$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())
|
if ($stmt && $stmt->bind_param('issi', $account_id, $aData['header'], $aData['content'], $active) && $stmt->execute())
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -19,6 +19,10 @@ class StatsCache {
|
|||||||
require_once(CLASS_DIR . '/memcached.class.php');
|
require_once(CLASS_DIR . '/memcached.class.php');
|
||||||
}
|
}
|
||||||
$this->cache = new Memcached();
|
$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']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -268,6 +268,9 @@ $config['memcache']['keyprefix'] = 'mpos_';
|
|||||||
$config['memcache']['expiration'] = 90;
|
$config['memcache']['expiration'] = 90;
|
||||||
$config['memcache']['splay'] = 15;
|
$config['memcache']['splay'] = 15;
|
||||||
$config['memcache']['force']['contrib_shares'] = false;
|
$config['memcache']['force']['contrib_shares'] = false;
|
||||||
|
$config['memcache']['sasl'] = false;
|
||||||
|
$config['memcache']['sasl']['username'] = '';
|
||||||
|
$config['memcache']['sasl']['password'] = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cookies
|
* Cookies
|
||||||
|
|||||||
@ -18,6 +18,10 @@
|
|||||||
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
|
<input type="hidden" name="action" value="{$smarty.request.action|escape}">
|
||||||
<input type="hidden" name="do" value="add">
|
<input type="hidden" name="do" value="add">
|
||||||
<input type="hidden" name="ctoken" value="{$CTOKEN|escape|default:""}" />
|
<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">
|
<div class="form-group">
|
||||||
<label>Header</label>
|
<label>Header</label>
|
||||||
<input class="form-control" size="30" type="text" name="data[header]" required />
|
<input class="form-control" size="30" type="text" name="data[header]" required />
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user