--HG--
branch : develop
This commit is contained in:
botanic 2014-09-13 10:30:58 -07:00
parent 6bb136dca9
commit 765e614c23
9 changed files with 92 additions and 5 deletions

View file

@ -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);

View file

@ -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;
@ -90,6 +90,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 ) {
$inherited = "extends:layout_admin.tpl|";

View file

@ -7,6 +7,8 @@
{$welcome_message}
</div>
{if $userRegistration == '0'|| $userRegistration == '1'}
<form name="Page1"
method="post"
>
@ -90,6 +92,8 @@
</form>
{/if}
<div id="signupTooltip"
class="c2"
inset=""></div>

View file

@ -133,3 +133,7 @@ margin-top: 10px;
margin-left: -1;
margin-right: -1;
}
.col-sm-4 {
width: 33.333%;
}

View file

@ -5,6 +5,7 @@
*/
function register(){
global $TOS_URL;
$pageElements['TOS_URL'] = $TOS_URL;
return $pageElements;
}

View file

@ -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!

View file

@ -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}

View file

@ -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-->

View file

@ -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>