53 lines
1.7 KiB
PHP
53 lines
1.7 KiB
PHP
<?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(dirname(__FILE__)."/../../../../../modules3/web.auth.php");
|
|
require_once(dirname(__FILE__)."/../../../../../modules3/web.form.php");
|
|
require_once(dirname(__FILE__)."/../../../../../modules3/web.misc.php");
|
|
require_once(dirname(__FILE__)."/../../../../../modules3/data.json.php");
|
|
|
|
$db = DB();
|
|
$auth = new cAUTH();
|
|
$ajson = array();
|
|
$data = $ap->getParam("data");
|
|
|
|
if ( $data == "default") {
|
|
$form = new cFORM();
|
|
$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 = $ap->getParam("LPass");
|
|
$b_pass1 = $ap->getParam("BPass1");
|
|
$b_pass2 = $ap->getParam("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);
|
|
?>
|