-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#384 Sediakan ganti password saat selesai login jika menggunakan pass…
…word masih default.
- Loading branch information
Showing
7 changed files
with
264 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/* | ||
* File ini bagian dari: | ||
* | ||
* OpenDK | ||
* | ||
* Aplikasi dan source code ini dirilis berdasarkan lisensi GPL V3 | ||
* | ||
* Hak Cipta 2017 - 2022 Perkumpulan Desa Digital Terbuka (https://opendesa.id) | ||
* | ||
* Dengan ini diberikan izin, secara gratis, kepada siapa pun yang mendapatkan salinan | ||
* dari perangkat lunak ini dan file dokumentasi terkait ("Aplikasi Ini"), untuk diperlakukan | ||
* tanpa batasan, termasuk hak untuk menggunakan, menyalin, mengubah dan/atau mendistribusikan, | ||
* asal tunduk pada syarat berikut: | ||
* | ||
* Pemberitahuan hak cipta di atas dan pemberitahuan izin ini harus disertakan dalam | ||
* setiap salinan atau bagian penting Aplikasi Ini. Barang siapa yang menghapus atau menghilangkan | ||
* pemberitahuan ini melanggar ketentuan lisensi Aplikasi Ini. | ||
* | ||
* PERANGKAT LUNAK INI DISEDIAKAN "SEBAGAIMANA ADANYA", TANPA JAMINAN APA PUN, BAIK TERSURAT MAUPUN | ||
* TERSIRAT. PENULIS ATAU PEMEGANG HAK CIPTA SAMA SEKALI TIDAK BERTANGGUNG JAWAB ATAS KLAIM, KERUSAKAN ATAU | ||
* KEWAJIBAN APAPUN ATAS PENGGUNAAN ATAU LAINNYA TERKAIT APLIKASI INI. | ||
* | ||
* @package OpenDK | ||
* @author Tim Pengembang OpenDesa | ||
* @copyright Hak Cipta 2017 - 2022 Perkumpulan Desa Digital Terbuka (https://opendesa.id) | ||
* @license http://www.gnu.org/licenses/gpl.html GPL V3 | ||
* @link https://github.com/OpenSID/opendk | ||
*/ | ||
|
||
namespace App\Http\Controllers\Auth; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Http\Requests\ChangeRequest; | ||
|
||
class ChangeDefaultController extends Controller | ||
{ | ||
/** | ||
* Create a new controller instance. | ||
* | ||
* @return void | ||
*/ | ||
public function __construct() | ||
{ | ||
parent::__construct(); | ||
} | ||
|
||
/** | ||
* Show the application dashboard. | ||
* | ||
* @return \Illuminate\Contracts\Support\Renderable | ||
*/ | ||
public function index() | ||
{ | ||
return view('auth/change'); | ||
} | ||
|
||
public function store(ChangeRequest $request) | ||
{ | ||
auth()->user()->update(['email' => $request->email, 'password' => $request->password]); | ||
return redirect()->route('dashboard'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
/* | ||
* File ini bagian dari: | ||
* | ||
* OpenDK | ||
* | ||
* Aplikasi dan source code ini dirilis berdasarkan lisensi GPL V3 | ||
* | ||
* Hak Cipta 2017 - 2022 Perkumpulan Desa Digital Terbuka (https://opendesa.id) | ||
* | ||
* Dengan ini diberikan izin, secara gratis, kepada siapa pun yang mendapatkan salinan | ||
* dari perangkat lunak ini dan file dokumentasi terkait ("Aplikasi Ini"), untuk diperlakukan | ||
* tanpa batasan, termasuk hak untuk menggunakan, menyalin, mengubah dan/atau mendistribusikan, | ||
* asal tunduk pada syarat berikut: | ||
* | ||
* Pemberitahuan hak cipta di atas dan pemberitahuan izin ini harus disertakan dalam | ||
* setiap salinan atau bagian penting Aplikasi Ini. Barang siapa yang menghapus atau menghilangkan | ||
* pemberitahuan ini melanggar ketentuan lisensi Aplikasi Ini. | ||
* | ||
* PERANGKAT LUNAK INI DISEDIAKAN "SEBAGAIMANA ADANYA", TANPA JAMINAN APA PUN, BAIK TERSURAT MAUPUN | ||
* TERSIRAT. PENULIS ATAU PEMEGANG HAK CIPTA SAMA SEKALI TIDAK BERTANGGUNG JAWAB ATAS KLAIM, KERUSAKAN ATAU | ||
* KEWAJIBAN APAPUN ATAS PENGGUNAAN ATAU LAINNYA TERKAIT APLIKASI INI. | ||
* | ||
* @package OpenDK | ||
* @author Tim Pengembang OpenDesa | ||
* @copyright Hak Cipta 2017 - 2022 Perkumpulan Desa Digital Terbuka (https://opendesa.id) | ||
* @license http://www.gnu.org/licenses/gpl.html GPL V3 | ||
* @link https://github.com/OpenSID/opendk | ||
*/ | ||
|
||
namespace App\Http\Requests; | ||
|
||
use Illuminate\Foundation\Http\FormRequest; | ||
|
||
class ChangeRequest extends FormRequest | ||
{ | ||
/** | ||
* Determine if the user is authorized to make this request. | ||
* | ||
* @return bool | ||
*/ | ||
public function authorize() | ||
{ | ||
return true; | ||
} | ||
|
||
/** | ||
* Get the validation rules that apply to the request. | ||
* | ||
* @return array | ||
*/ | ||
public function rules() | ||
{ | ||
return [ | ||
'email' => 'required|unique:users,email', | ||
'password' => 'required', | ||
'password_confirmation' => 'required_with:password|same:password|min:6' | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<!DOCTYPE html> | ||
<html lang="{{ app()->getLocale() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<title>{{ config('app.name', 'Laravel') }} | Login</title> | ||
<!-- Tell the browser to be responsive to screen width --> | ||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> | ||
<!-- CSRF Token --> | ||
<meta name="csrf-token" content="{{ csrf_token() }}"> | ||
<!-- Favicon --> | ||
<link rel="icon" type="image/png" href="{{ is_logo($profil->file_logo) }}"/> | ||
<link rel="stylesheet" href="{{ asset("/bower_components/bootstrap/dist/css/bootstrap.min.css") }}"> | ||
<!-- Font Awesome --> | ||
<link rel="stylesheet" href="{{ asset("/bower_components/font-awesome/css/font-awesome.min.css") }}"> | ||
<!-- Ionicons --> | ||
<link rel="stylesheet" href="{{ asset("/bower_components/Ionicons/css/ionicons.min.css") }}"> | ||
<!-- Theme style --> | ||
<link rel="stylesheet" href="{{ asset("/bower_components/admin-lte/dist/css/AdminLTE.min.css") }}"> | ||
<!-- iCheck --> | ||
<link rel="stylesheet" href="{{ asset("/bower_components/admin-lte/plugins/iCheck/square/blue.css") }}"> | ||
<!-- Google Font --> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic"> | ||
<style> | ||
html { | ||
height: auto; | ||
} | ||
</style> | ||
</head> | ||
<body class="hold-transition login-page"> | ||
<div class="login-box" style="background-color: white;"> | ||
<!-- /.login-logo --> | ||
<div class="login-box-body"> | ||
<div class="login-logo" style="padding-top: 10px;"> | ||
<a href="{{ route('beranda') }}"> | ||
<img class="" src="{{ is_logo($profil->file_logo) }}" style="max-width:80px;white-space:normal" alt="" width="70px"> | ||
<h3>PEMERINTAH KAB. {{ strtoupper($profil->nama_kabupaten) }}<br/><b>{{ strtoupper($sebutan_wilayah . ' ' . $profil->nama_kecamatan) }}</b></h3> | ||
</a> | ||
</div> | ||
<hr/> | ||
|
||
<div class="alert alert-danger">Kata sandi anda tidak memenuhi syarat keamanan dan harus diganti</div> | ||
|
||
@include('partials.flash_message') | ||
<form method="POST" action="{{ route('changedefault.store') }}"> | ||
@csrf | ||
<div class="form-group has-feedback {{ $errors->has('email') ? ' has-error' : '' }}"> | ||
<input id="email" type="email" class="form-control" name="email" required placeholder="Email Baru" value="{{ old('email') }}"> | ||
@if ($errors->has('email')) | ||
<span class="help-block"> | ||
<strong>{{ $errors->first('email') }}</strong> | ||
</span> | ||
@endif | ||
<span class="glyphicon glyphicon-lock form-control-feedback"></span> | ||
</div> | ||
|
||
<div class="form-group has-feedback {{ $errors->has('password') ? ' has-error' : '' }}"> | ||
<input id="password" type="password" class="form-control" name="password" required placeholder="Password"> | ||
@if ($errors->has('password')) | ||
<span class="help-block"> | ||
<strong>{{ $errors->first('password') }}</strong> | ||
</span> | ||
@endif | ||
<span class="glyphicon glyphicon-lock form-control-feedback"></span> | ||
</div> | ||
|
||
<div class="form-group has-feedback {{ $errors->has('password') ? ' has-error' : '' }}"> | ||
<input id="password_confirmation" type="password" class="form-control" name="password_confirmation" required placeholder="Ulangi Password"> | ||
@if ($errors->has('password_confirmation')) | ||
<span class="help-block"> | ||
<strong>{{ $errors->first('password_confirmation') }}</strong> | ||
</span> | ||
@endif | ||
<span class="glyphicon glyphicon-lock form-control-feedback"></span> | ||
</div> | ||
<div class="row"> | ||
|
||
<!-- /.col --> | ||
<div class="col-xs-12"> | ||
<button type="submit" class="btn btn-primary btn-block btn-flat">Simpan</button> | ||
</div> | ||
<!-- /.col --> | ||
</div> | ||
</form> | ||
|
||
<hr/> | ||
<div class="text-center"> | ||
<small>Hak Cipta © 2017 <a href="http://www.kompak.or.id">KOMPAK</a>, 2018-{{ date('Y') }} <a href="http://opendesa.id">OpenDesa</a> | ||
<br/> | ||
<b><a href="https://github.com/openSID/openDK" target="_blank">OpenDK</a></b> {{ config('app.version') }} | ||
</small> | ||
</div> | ||
</div> | ||
<!-- /.login-box-body --> | ||
</div> | ||
<!-- /.login-box --> | ||
<!-- jQuery 3 --> | ||
<script src="{{ asset ("/bower_components/jquery/dist/jquery.min.js") }}"></script> | ||
<!-- Bootstrap 3.3.7 --> | ||
<script src="{{ asset ("/bower_components/bootstrap/dist/js/bootstrap.min.js") }}"></script> | ||
<!-- iCheck --> | ||
<script src="{{ asset ("/bower_components/admin-lte/plugins/iCheck/icheck.min.js") }}"></script> | ||
<script> | ||
$(document).ready(function() { | ||
$('.iCheck').iCheck({ | ||
checkboxClass: 'icheckbox_square-blue', | ||
radioClass: 'iradio_square-blue', | ||
increaseArea: '20%' // optional | ||
}); | ||
window.setTimeout(function() { | ||
$("#notifikasi").fadeTo(500, 0).slideUp(500, function(){ | ||
$(this).remove(); | ||
}); | ||
}, 5000); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters