fix teamstore password
This commit is contained in:
@@ -153,7 +153,8 @@ class TeamStoreController extends Controller {
|
|||||||
{
|
{
|
||||||
$m = new TeamStoreModel;
|
$m = new TeamStoreModel;
|
||||||
$post = $request->all();
|
$post = $request->all();
|
||||||
$store_array = $m->selectTeamStore('Password', $post['password']);
|
|
||||||
|
$store_array = $m->checkStorePassword($post['store_id'], $post['password']);
|
||||||
|
|
||||||
if($store_array){
|
if($store_array){
|
||||||
$request->session()->put('teamstore_data_array', $store_array);
|
$request->session()->put('teamstore_data_array', $store_array);
|
||||||
|
|||||||
@@ -39,6 +39,15 @@ class TeamStoreModel extends Model {
|
|||||||
return $i;
|
return $i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkStorePassword($storeid, $password)
|
||||||
|
{
|
||||||
|
$i = DB::table('teamstores')
|
||||||
|
->where('Id', $storeid)
|
||||||
|
->where('Password', $password)
|
||||||
|
->get();
|
||||||
|
return $i;
|
||||||
|
}
|
||||||
|
|
||||||
function selectTeamStoreGroupByCartKey($cartKey)
|
function selectTeamStoreGroupByCartKey($cartKey)
|
||||||
{
|
{
|
||||||
$i = DB::table('cart_tmp')
|
$i = DB::table('cart_tmp')
|
||||||
|
|||||||
@@ -147,6 +147,8 @@
|
|||||||
|
|
||||||
$('.password-protected').click(function(){
|
$('.password-protected').click(function(){
|
||||||
|
|
||||||
|
$('#_teamstore_id').val($(this).data('store-id'))
|
||||||
|
// console.log($(this).data('store-id'))
|
||||||
$('#team-store-login').modal('show')
|
$('#team-store-login').modal('show')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
<strong>Whoops!</strong> {!! \Session::get('errors') !!}.<br><br>
|
<strong>Whoops!</strong> {!! \Session::get('errors') !!}.<br><br>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
<form class="form-horizontal" role="form" method="POST" action="teamstore/checkpassword">
|
<form class="form-horizontal" role="form" method="POST" action="teamstore/checkpassword">
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
<li class="li-custom col-lg-3 col-md-3 col-sm-4 col-xs-12">
|
<li class="li-custom col-lg-3 col-md-3 col-sm-4 col-xs-12">
|
||||||
<div style="border: 1px solid #dddddd; padding: 5px;">
|
<div style="border: 1px solid #dddddd; padding: 5px;">
|
||||||
@if($store->Password != null )
|
@if($store->Password != null )
|
||||||
<a class="thumbnail password-protected" href="#" data-store-url="{{ $store->StoreUrl }}">
|
<a class="thumbnail password-protected" href="#" data-store-id="{{ $store->Id }}" data-store-url="{{ $store->StoreUrl }}">
|
||||||
<img class="store-logo" src="{{ config('site_config.uploads') . 'teamstore/'. $store->ImageFolder . '/' . $store->StoreLogo }}">
|
<img class="store-logo" src="{{ config('site_config.uploads') . 'teamstore/'. $store->ImageFolder . '/' . $store->StoreLogo }}">
|
||||||
</a>
|
</a>
|
||||||
<h4 style="border-top: 1px solid #dddddd; padding: 10px; font-size: 16px; font-weight: bold; text-transform: uppercase;" class="text-center">{{ $store->StoreName }} <i class="fa fa-lock" title="This store is password protected."></i></h4>
|
<h4 style="border-top: 1px solid #dddddd; padding: 10px; font-size: 16px; font-weight: bold; text-transform: uppercase;" class="text-center">{{ $store->StoreName }} <i class="fa fa-lock" title="This store is password protected."></i></h4>
|
||||||
@@ -124,11 +124,12 @@
|
|||||||
|
|
||||||
<form class="form-horizontal" role="form" method="POST" action="{{ url('teamstore/checkpassword') }}">
|
<form class="form-horizontal" role="form" method="POST" action="{{ url('teamstore/checkpassword') }}">
|
||||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||||
|
<input type="hidden" class="form-control" id="_teamstore_id" name="store_id">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-4 control-label">Password</label>
|
<label class="col-md-4 control-label">Password</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
|
|
||||||
<input type="password" class="form-control pwd" name="password">
|
<input type="password" class="form-control pwd" name="password">
|
||||||
<span class="input-group-btn">
|
<span class="input-group-btn">
|
||||||
<button class="btn btn-default reveal-password" type="button"><i class="fa fa-eye"></i></button>
|
<button class="btn btn-default reveal-password" type="button"><i class="fa fa-eye"></i></button>
|
||||||
|
|||||||
Reference in New Issue
Block a user