first commit
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
/*******************************************************************
|
||||
|
||||
Module : /apps/php/sys/chpasswd.php
|
||||
Desc. : PHP - Perubahan Password Operator
|
||||
Created By : Siau Pheng ([email protected]).
|
||||
Created Date : December 7th, 2008.
|
||||
Last Modified : April 25th, 2020.
|
||||
|
||||
(c) 2008 - 2020, 3FONIA Software; WWW.3FONIA.COM.
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
require_once(__DIR__."/../../../../../vendor/autoload.php");
|
||||
|
||||
use siaupheng\fonia3\DB\MySQL;
|
||||
use siaupheng\fonia3\DB\SQL;
|
||||
use siaupheng\fonia3\Web\Auth;
|
||||
use siaupheng\fonia3\Web\Param;
|
||||
use siaupheng\fonia3\Web\Form;
|
||||
|
||||
$db = $db ?? new MySQL();
|
||||
$auth = new Auth($db);
|
||||
$ajson = [];
|
||||
$data = Param::Get("data");
|
||||
|
||||
if ( $data == "default") {
|
||||
$form = new Form($db);
|
||||
$form->password("Password Lama", "LPass", $l_pass, true, true, "masukkan password lama", 20);
|
||||
$form->password("Password Baru 1", "BPass1", $b_pass1, true, true, "masukkan password baru 1", 20);
|
||||
$form->password("Password Baru 2", "BPass2", $b_pass2, true, true, "masukkan password baru 2", 20);
|
||||
$form->show(' _LPass_ _BPass1_ _BPass2_ ');
|
||||
|
||||
} else if ( $data == "chpasswd") {
|
||||
$l_pass = Param::Get("LPass");
|
||||
$b_pass1 = Param::Get("BPass1");
|
||||
$b_pass2 = Param::Get("BPass2");
|
||||
|
||||
$ajson['status'] = false;
|
||||
if ($auth->user_check(user_user(), $l_pass)) {
|
||||
$db->Query("UPDATE app_operator SET Password=MD5('".$b_pass1."') WHERE UserID='".user_id()."'");
|
||||
$ajson['status'] = true;
|
||||
$ajson['msg'] = "Sukses merubah password Anda!";
|
||||
} else {
|
||||
$ajson['msg'] = "Password lama Anda salah!";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
send_json($ajson);
|
||||
?>
|
||||
Reference in New Issue
Block a user