C:\xampp\htdocs\kptv2\admin\modules\settings\act_adminpass.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<?php
require_once("../conf_/siteconf_.php");
require_once(
$LIBPATH "module_.php");
require_once(
$BASEPATH "dbincl.php");
require_once(
$LIBPATH "utilfunc.php");
class 
act_adminpass extends module_ {
    var 
$resultArr NULL;    
    function 
Data_() {
        global 
$TBL_ACCOUNTS;
        
parent::session_connect_();
        if(!
parent::check_session("logged_""yes")) {
            
$this->status_ 6// session expired or invalid credentials
        
}
        else {
            
parent::db_connect_();                
            if(
$this->status_ == 1) {            
                if(
TestVars(array("Password""NewPassword"), $_POST)) {                    
                    
$this->resultArr $this->db_->Select($TBL_ACCOUNTSnull"UserName"$_SESSION['uname'], "AND"falsetrue);                
                }
                else
                    
$this->status_ 5;
            }
        }
    }                
    function 
Process_() {
        global 
$TBL_ACCOUNTS;
        if(
$this->status_ == 1) {
            if(
count($this->resultArr) != 0) {
                 if(
crypt($_POST['Password'], $this->resultArr[0]->Password) == $this->resultArr[0]->Password) {
                     if(
$this->db_->Update($TBL_ACCOUNTS"UserName"$_SESSION['uname'], array(crypt($_POST['NewPassword'])), array("Password")))
                        
$this->status_ 551;
                    else
                        
$this->status_ 2;
                 }
                 else
                    
$this->status_ 451;
            }
            else
                
$this->status_ 451;
        }
    }        
        
    function 
Results_() {
        if(
$this->status_==6) {
            
header("location:index.php?st=6");            
            exit();
        }
        else    
            
header("location:" caller() . "?st=$this->status_");    
    }
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586