fix teamstore password
This commit is contained in:
@@ -151,9 +151,10 @@ class TeamStoreController extends Controller {
|
||||
|
||||
public function checkTeamStorePassword(Request $request)
|
||||
{
|
||||
$m = new TeamStoreModel;
|
||||
$post = $request->all();
|
||||
$store_array = $m->selectTeamStore('Password', $post['password']);
|
||||
$m = new TeamStoreModel;
|
||||
$post = $request->all();
|
||||
|
||||
$store_array = $m->checkStorePassword($post['store_id'], $post['password']);
|
||||
|
||||
if($store_array){
|
||||
$request->session()->put('teamstore_data_array', $store_array);
|
||||
|
||||
@@ -39,6 +39,15 @@ class TeamStoreModel extends Model {
|
||||
return $i;
|
||||
}
|
||||
|
||||
function checkStorePassword($storeid, $password)
|
||||
{
|
||||
$i = DB::table('teamstores')
|
||||
->where('Id', $storeid)
|
||||
->where('Password', $password)
|
||||
->get();
|
||||
return $i;
|
||||
}
|
||||
|
||||
function selectTeamStoreGroupByCartKey($cartKey)
|
||||
{
|
||||
$i = DB::table('cart_tmp')
|
||||
|
||||
@@ -147,6 +147,8 @@
|
||||
|
||||
$('.password-protected').click(function(){
|
||||
|
||||
$('#_teamstore_id').val($(this).data('store-id'))
|
||||
// console.log($(this).data('store-id'))
|
||||
$('#team-store-login').modal('show')
|
||||
return false;
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
<strong>Whoops!</strong> {!! \Session::get('errors') !!}.<br><br>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<form class="form-horizontal" role="form" method="POST" action="teamstore/checkpassword">
|
||||
<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">
|
||||
<div style="border: 1px solid #dddddd; padding: 5px;">
|
||||
@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 }}">
|
||||
</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>
|
||||
@@ -124,11 +124,12 @@
|
||||
|
||||
<form class="form-horizontal" role="form" method="POST" action="{{ url('teamstore/checkpassword') }}">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token() }}">
|
||||
|
||||
<input type="hidden" class="form-control" id="_teamstore_id" name="store_id">
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label">Password</label>
|
||||
<div class="col-md-6">
|
||||
<div class="input-group">
|
||||
|
||||
<input type="password" class="form-control pwd" name="password">
|
||||
<span class="input-group-btn">
|
||||
<button class="btn btn-default reveal-password" type="button"><i class="fa fa-eye"></i></button>
|
||||
|
||||
Reference in New Issue
Block a user