This commit is contained in:
botanic 2014-09-13 10:30:58 -07:00
parent 13e690b629
commit 2eaf65bb62
9 changed files with 92 additions and 5 deletions

View file

@ -214,7 +214,7 @@ class DBLayer {
} }
$field_option_values = ltrim($field_option_values, ','); $field_option_values = ltrim($field_option_values, ',');
try { 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) { foreach ($data as $key => $value) {
$sth->bindValue(":$key", $value); $sth->bindValue(":$key", $value);

View file

@ -34,7 +34,7 @@ class Helpers {
$smarty -> setCacheDir( $AMS_CACHEDIR ); $smarty -> setCacheDir( $AMS_CACHEDIR );
$smarty -> setConfigDir( $SITEBASE . '/configs/' ); $smarty -> setConfigDir( $SITEBASE . '/configs/' );
// turn smarty debugging on/off // turn smarty debugging on/off
$smarty -> debugging = false; $smarty -> debugging = true;
// caching must be disabled for multi-language support // caching must be disabled for multi-language support
$smarty -> caching = false; $smarty -> caching = false;
$smarty -> cache_lifetime = 300; $smarty -> cache_lifetime = 300;
@ -90,6 +90,14 @@ class Helpers {
$id = session_id(); $id = session_id();
$smarty -> assign( "sessionid", $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) // smarty inheritance for loading the matching wrapper layout (with the matching menu bar)
if ( isset( $vars['permission'] ) && $vars['permission'] == 3 ) { if ( isset( $vars['permission'] ) && $vars['permission'] == 3 ) {
$inherited = "extends:layout_admin.tpl|"; $inherited = "extends:layout_admin.tpl|";

View file

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

View file

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

View file

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

View file

@ -44,6 +44,16 @@ function settings(){
$result['country_array'] = getCountryArray(); $result['country_array'] = getCountryArray();
global $INGAME_WEBPATH; global $INGAME_WEBPATH;
$result['ingame_webpath'] = $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; return $result;
}else{ }else{
//ERROR: not logged in! //ERROR: not logged in!

View file

@ -12,6 +12,7 @@
<div class="alert alert-info"> <div class="alert alert-info">
{$login_info} {$login_info}
</div> </div>
<form method="post" action="index.php{if isset($getstring)}{$getstring}{/if}" class="form-horizontal"> <form method="post" action="index.php{if isset($getstring)}{$getstring}{/if}" class="form-horizontal">
<fieldset> <fieldset>
<div data-rel="tooltip" class="input-prepend" data-original-title="Username/Email"> <div data-rel="tooltip" class="input-prepend" data-original-title="Username/Email">
@ -42,9 +43,13 @@
<strong>{$login_error_message}</strong> <strong>{$login_error_message}</strong>
</div> </div>
{/if} {/if}
<div class="alert alert-info"> <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>
</div><!--/span--> </div><!--/span-->
</div> </div>
{/block} {/block}

View file

@ -12,6 +12,7 @@
<div class="alert alert-info"> <div class="alert alert-info">
{$welcome_message} {$welcome_message}
</div> </div>
{if $userRegistration == '0'|| $userRegistration == '2'}
<form id="signup" class="form-vertical" method="post" action="index.php"> <form id="signup" class="form-vertical" method="post" action="index.php">
<legend>{$title}</legend> <legend>{$title}</legend>
@ -111,6 +112,9 @@
</p> </p>
</form> </form>
{else}
Registration Disabled!
{/if}
</div><!--/span--> </div><!--/span-->

View file

@ -323,6 +323,57 @@
</div> </div>
</div> </div>
</div><!--/span--> </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--> </div><!--/row-->
<script src="js/masonry.pkgd.min.js"></script> <script src="js/masonry.pkgd.min.js"></script>