mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-11-10 01:09:50 +00:00
Fix #122
This commit is contained in:
parent
13e690b629
commit
2eaf65bb62
9 changed files with 92 additions and 5 deletions
|
@ -214,7 +214,7 @@ class DBLayer {
|
|||
}
|
||||
$field_option_values = ltrim($field_option_values, ',');
|
||||
try {
|
||||
$sth = $this->PDO->prepare("UPDATE $tb_name SET $field_option_values WHERE $where ");
|
||||
$sth = $this->PDO->prepare("UPDATE `$tb_name` SET $field_option_values WHERE $where ");
|
||||
|
||||
foreach ($data as $key => $value) {
|
||||
$sth->bindValue(":$key", $value);
|
||||
|
|
|
@ -23,7 +23,7 @@ class Helpers {
|
|||
global $AMS_TRANS;
|
||||
global $INGAME_LAYOUT;
|
||||
global $AMS_CACHEDIR;
|
||||
global $AMS_PLUGINS;
|
||||
global $AMS_PLUGINS;
|
||||
|
||||
// define('SMARTY_SPL_AUTOLOAD',1);
|
||||
require_once $AMS_LIB . '/smarty/libs/Smarty.class.php';
|
||||
|
@ -34,7 +34,7 @@ class Helpers {
|
|||
$smarty -> setCacheDir( $AMS_CACHEDIR );
|
||||
$smarty -> setConfigDir( $SITEBASE . '/configs/' );
|
||||
// turn smarty debugging on/off
|
||||
$smarty -> debugging = false;
|
||||
$smarty -> debugging = true;
|
||||
// caching must be disabled for multi-language support
|
||||
$smarty -> caching = false;
|
||||
$smarty -> cache_lifetime = 300;
|
||||
|
@ -89,6 +89,14 @@ class Helpers {
|
|||
|
||||
$id = session_id();
|
||||
$smarty -> assign( "sessionid", $id );
|
||||
|
||||
$dbl = new DBLayer("lib");
|
||||
$statement = $dbl->executeWithoutParams("SELECT * FROM settings");
|
||||
$rows = $statement->fetchAll();
|
||||
|
||||
foreach ($rows as &$value) {
|
||||
$smarty -> assign( $value['Setting'], $value['Value'] );
|
||||
}
|
||||
|
||||
// smarty inheritance for loading the matching wrapper layout (with the matching menu bar)
|
||||
if ( isset( $vars['permission'] ) && $vars['permission'] == 3 ) {
|
||||
|
|
|
@ -7,6 +7,8 @@
|
|||
{$welcome_message}
|
||||
</div>
|
||||
|
||||
{if $userRegistration == '0'|| $userRegistration == '1'}
|
||||
|
||||
<form name="Page1"
|
||||
method="post"
|
||||
>
|
||||
|
@ -89,6 +91,8 @@
|
|||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
{/if}
|
||||
|
||||
<div id="signupTooltip"
|
||||
class="c2"
|
||||
|
|
|
@ -133,3 +133,7 @@ margin-top: 10px;
|
|||
margin-left: -1;
|
||||
margin-right: -1;
|
||||
}
|
||||
|
||||
.col-sm-4 {
|
||||
width: 33.333%;
|
||||
}
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
function register(){
|
||||
global $TOS_URL;
|
||||
|
||||
$pageElements['TOS_URL'] = $TOS_URL;
|
||||
return $pageElements;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ function settings(){
|
|||
if(($_GET['id'] != $_SESSION['id']) && (!Ticket_User::isMod(unserialize($_SESSION['ticket_user']))) ){
|
||||
//ERROR: No access!
|
||||
$_SESSION['error_code'] = "403";
|
||||
header("Cache-Control: max-age=1");
|
||||
header("Cache-Control: max-age=1");
|
||||
header("Location: index.php?page=error");
|
||||
throw new SystemExit();
|
||||
}else{
|
||||
|
@ -44,6 +44,16 @@ function settings(){
|
|||
$result['country_array'] = getCountryArray();
|
||||
global $INGAME_WEBPATH;
|
||||
$result['ingame_webpath'] = $INGAME_WEBPATH;
|
||||
|
||||
|
||||
$dbl = new DBLayer("lib");
|
||||
$statement = $dbl->executeWithoutParams("SELECT * FROM settings");
|
||||
$rows = $statement->fetchAll();
|
||||
|
||||
foreach ($rows as &$value) {
|
||||
$result[$value['Setting']] = $value['Value'];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}else{
|
||||
//ERROR: not logged in!
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<div class="alert alert-info">
|
||||
{$login_info}
|
||||
</div>
|
||||
|
||||
<form method="post" action="index.php{if isset($getstring)}{$getstring}{/if}" class="form-horizontal">
|
||||
<fieldset>
|
||||
<div data-rel="tooltip" class="input-prepend" data-original-title="Username/Email">
|
||||
|
@ -42,9 +43,13 @@
|
|||
<strong>{$login_error_message}</strong>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
||||
<div class="alert alert-info">
|
||||
<a href="?page=register">{$login_register_message}</a>.<br><a href="?page=forgot_password">{$login_forgot_password_message}</a>
|
||||
{if $userRegistration == '0'|| $userRegistration == '2'}<a href="?page=register">{$login_register_message}</a>.<br>{/if}<a href="?page=forgot_password">{$login_forgot_password_message}</a>
|
||||
</div>
|
||||
|
||||
|
||||
</div><!--/span-->
|
||||
</div>
|
||||
{/block}
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
<div class="alert alert-info">
|
||||
{$welcome_message}
|
||||
</div>
|
||||
{if $userRegistration == '0'|| $userRegistration == '2'}
|
||||
<form id="signup" class="form-vertical" method="post" action="index.php">
|
||||
<legend>{$title}</legend>
|
||||
|
||||
|
@ -111,6 +112,9 @@
|
|||
</p>
|
||||
|
||||
</form>
|
||||
{else}
|
||||
Registration Disabled!
|
||||
{/if}
|
||||
|
||||
|
||||
</div><!--/span-->
|
||||
|
|
|
@ -323,6 +323,57 @@
|
|||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
|
||||
{if $permission == '3'}
|
||||
<div class="col-sm-4 js-masonry-item">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading" data-original-title="">
|
||||
<span class="icon-th"></span> User Registration
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row-fluid">
|
||||
<form id="userRegistration" class="form-vertical" method="post" action="index.php?page=settings&id={$target_id}">
|
||||
<legend>User Registration</legend>
|
||||
|
||||
<div class="control-group gender-list">
|
||||
<div class="controls">
|
||||
<label class="radio">
|
||||
<div id="uniform-optionsRadios2" class="radio"><span class="{if isset($userRegistration) and $userRegistration eq 0}checked{/if}"><input name="userRegistration" id="optionsRadios0" value="0" {if isset($userRegistration) and $userRegistration eq 0}checked=""{/if} type="radio"></span></div>
|
||||
In-Game and Web Registration
|
||||
</label>
|
||||
<div style="clear:both"></div>
|
||||
<label class="radio">
|
||||
<div id="uniform-optionsRadios1" class="radio"><span class="{if isset($userRegistration) and $userRegistration eq 1}checked{/if}"><input name="userRegistration" id="optionsRadios1" value="1" {if isset($userRegistration) and $userRegistration eq 1}checked=""{/if} type="radio"></span></div>
|
||||
In-Game Registration Only
|
||||
</label>
|
||||
<div style="clear:both"></div>
|
||||
<label class="radio">
|
||||
<div id="uniform-optionsRadios2" class="radio"><span class="{if isset($userRegistration) and $userRegistration eq 2}checked{/if}"><input name="userRegistration" id="optionsRadios2" value="2" {if isset($userRegistration) and $userRegistration eq 2}checked=""{/if} type="radio"></span></div>
|
||||
Web Registration Only
|
||||
</label>
|
||||
<div style="clear:both"></div>
|
||||
<label class="radio">
|
||||
<div id="uniform-optionsRadios2" class="radio"><span class="{if isset($userRegistration) and $userRegistration eq 3}checked{/if}"><input name="userRegistration" id="optionsRadios2" value="3" {if isset($userRegistration) and $userRegistration eq 3}checked=""{/if} type="radio"></span></div>
|
||||
No Registration
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="function" value="userRegistration">
|
||||
<input type="hidden" name="target_id" value="{$target_id}">
|
||||
<div class="control-group">
|
||||
<label class="control-label"></label>
|
||||
<div class="controls">
|
||||
<button type="submit" class="btn btn-primary" style="margin-left:5px;">Change Setting</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div><!--/span-->
|
||||
{/if}
|
||||
|
||||
</div><!--/row-->
|
||||
|
||||
<script src="js/masonry.pkgd.min.js"></script>
|
||||
|
|
Loading…
Reference in a new issue