mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
Add option to restrict Page view to logged user
$logged_access = 0 -> not logged in $logged_access = 1 -> logged in
This commit is contained in:
parent
193e18523d
commit
ada1e391d4
@ -27,7 +27,7 @@ if (version_compare(phpversion(), '8.0', '<')) die('PHP version 8.0 or higher is
|
|||||||
|
|
||||||
const MYAAC = true;
|
const MYAAC = true;
|
||||||
const MYAAC_VERSION = '1.0-dev';
|
const MYAAC_VERSION = '1.0-dev';
|
||||||
const DATABASE_VERSION = 36;
|
const DATABASE_VERSION = 37;
|
||||||
const TABLE_PREFIX = 'myaac_';
|
const TABLE_PREFIX = 'myaac_';
|
||||||
define('START_TIME', microtime(true));
|
define('START_TIME', microtime(true));
|
||||||
define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX'));
|
define('MYAAC_OS', stripos(PHP_OS, 'WIN') === 0 ? 'WINDOWS' : (strtoupper(PHP_OS) === 'DARWIN' ? 'MAC' : 'LINUX'));
|
||||||
|
@ -952,7 +952,7 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
|||||||
return $query['group_id'];
|
return $query['group_id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getAccGroupId()
|
public function getAccGroupId()
|
||||||
|
8
system/migrations/37.php
Normal file
8
system/migrations/37.php
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
// 2023-11-11
|
||||||
|
// Add Guest page access
|
||||||
|
|
||||||
|
use MyAAC\Models\Pages;
|
||||||
|
|
||||||
|
Pages::query()->where('access', 1)->update(['access' => 0]);
|
@ -79,7 +79,7 @@ $ignore = false;
|
|||||||
|
|
||||||
/** @var boolean $logged */
|
/** @var boolean $logged */
|
||||||
/** @var OTS_Account $account_logged */
|
/** @var OTS_Account $account_logged */
|
||||||
$logged_access = 1;
|
$logged_access = 0;
|
||||||
if($logged && $account_logged && $account_logged->isLoaded()) {
|
if($logged && $account_logged && $account_logged->isLoaded()) {
|
||||||
$logged_access = $account_logged->getAccess();
|
$logged_access = $account_logged->getAccess();
|
||||||
}
|
}
|
||||||
|
@ -21,10 +21,12 @@
|
|||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="access">Access</label>
|
<label for="access">Access</label>
|
||||||
<select class="form-control" id="access" name="access">
|
<select class="form-control" id="access" name="access">
|
||||||
|
<option value="0" {% if access == 0 %}selected{% endif %}>Guest*</option>
|
||||||
{% for id, group in groups %}
|
{% for id, group in groups %}
|
||||||
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName()|title }}</option>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
<br>* Guest means everyone will have access to this page. Player means registered and logged in user.
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label for="php">PHP
|
<label for="php">PHP
|
||||||
|
Loading…
x
Reference in New Issue
Block a user