0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 52.15.209.178


Current Path : /var/www/oasis/src/
Upload File :
Current File : /var/www/oasis/src/resetPasswordUser.php

<?php
    function resetPasswordUser($aobj_context){    
        // $college_code = $aobj_context->mobj_data["collcode"];
        session_start();
		$collcode=$_SESSION['collcode'];
        $user = $aobj_context->mobj_data["user"];

        $query="SELECT ifnull(email_id,'') as email_id  FROM s_sysdb WHERE real_name='{$user}' AND college_code='{$collcode}'";
        $results=$aobj_context->mobj_db->GetRow($query);
        var_dump($query);
        die();
        
        if($results){
            $data['data'] = $results;
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success"); 
        }else{
            $data['data'] = "something went wrong";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail"); 
            return;
        }
    }
    function newpasswordsubmit($aobj_context){
        
        $college_code = $aobj_context->mobj_data["collge_code"];
        $user = $aobj_context->mobj_data["user"];
       
        $password = $aobj_context->mobj_data["confirmpass"];
        
        $query="UPDATE s_sysdb SET fpassword='{$password}' 
                WHERE  college_code = '{$college_code}' 
                and sysusr = '{$user}'";

             
        $results = $aobj_context->mobj_db->Execute($query);
         
        if($results){
            $data['data'] = "successfully updated";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, 0,"success"); 
        }else{
            $data['data'] = "Failed to update";
            echo $aobj_context->mobj_output->ToJSONEnvelope($data, -1,"fail"); 
            return;
        }
    }

    function sendOTPForgotPassword($aobj_context){
        require_once('/var/www/html/sms/sendsmsapiv1.php');
        include("/var/www/html/sms/sendGridMail.php");
        
        $email = 'anitassa354@gmail.com';
        $message="<html>";
        $message.="<body>";
        $message.="<style>";		
        $message.=".mail_tbl td{text-align:left; padding:2px; font-size:12px; 
            font-family: Verdana, Arial, Helvetica, sans-serif;}";	
        $message.="</style>";
        $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif'>
        Dear Student,</p></br>";
        $message.="<p style='font-size:12px; font-family: Verdana, Arial, Helvetica, sans-serif'>
        Your Email OTP for Registration is ".rand(1000,9999)."</p></br>";

        $message.="</br>";
        $message.="</body>";
        $message.="</html>";
        $subject="Forgot Password Authentication";
        $resp = sendGridMail($email, $subject, $message);
        $data = json_decode($resp, true);
        $arr["mail"] = $data;
} 
    

?>