Esempio n. 1
0
 function sifreHatirlat()
 {
     # password reminder
     $tarih = date_tarih();
     global $email, $panelusername, $hash;
     $this->getVariable(array("email", 'panelusername', 'hash'));
     if ($email != "") {
         #validate email:
         $kayitliemail = $this->getField($this->conf['logintable']['tablename'], 'email', "email='{$email}'");
         $filt = "email='{$email}'";
         if ($kayitliemail != '') {
             if (!$hash) {
                 $hash = get_rand_id(10);
                 $r = $this->executequery("insert into  hash (email,hash)values('{$email}','{$hash}')");
                 if (!$r) {
                     return false;
                 }
                 $msg = "ehcp: \nSomebody at ({$this->clientip}) requested to reset your pass.\ngo to this url to reset your pass: "******"/?op=sifrehatirlat&email={$email}&hash={$hash} \nif you are accessing your server locally, replace ip in this url with local ip of server";
                 mail($email, $this->sitename . '- password reset info', $msg, $this->headers);
                 $this->output .= "Password reset info is sent to your email. (pass is same yet)";
                 return;
             }
             # get username
             $filt2 = $filt;
             if ($panelusername != '') {
                 $filt2 = "{$filt} and panelusername='******'";
             }
             $username = $this->getField($this->conf['logintable']['tablename'], $this->conf['logintable']['usernamefield'], $filt2);
             #validate hash
             $filt3 = "{$filt} and hash='{$hash}'";
             $sayi = $this->recordcount("hash", $filt3);
             if ($sayi == 0) {
                 $this->errorTextExit("Wrong password reset info, verify the password reset url in your email");
             }
             #reset pass
             $yenisifre = get_rand_id(5);
             if ($email == '*****@*****.**') {
                 $ek = ",status='active'";
             }
             $s = $this->executeQuery("update " . $this->conf['logintable']['tablename'] . " set " . $this->conf['logintable']['passwordfield'] . "=md5('{$yenisifre}') {$ek} where email='{$email}'", 'update user pass', 'update user pass');
             if ($s) {
                 $msg = "Your password is reset as ({$yenisifre}) Your username is ({$username}) Thank you for using {$this->sitename} -dnsip:" . $this->dnsip . $this->conf['dnsip'];
                 mail($email, $this->sitename . '- password reset info', $msg, $this->headers);
                 $this->echoln("Your pass is sent to your email. <br>");
                 $this->executequery("delete from hash where {$filt3}");
                 # delete hash after verify
             }
         } else {
             $this->output .= 'No such email';
         }
     } else {
         $inputparams = array(array('email', 'lefttext' => 'Enter your email:'), array('panelusername', 'righttext' => 'leave empty if you dont remember'), array('op', 'hidden', 'default' => __FUNCTION__));
         $this->output .= inputform5($inputparams);
         #inputform4($action,array('Enter your email:'),array('email'),array(),array("op"),array('sifrehatirlat'));
     }
     return true;
 }
Esempio n. 2
0
function my_shell_exec($cmd, $source = '')
{
    echo "\n{$source}: " . date_tarih() . " Executing command: ({$cmd})";
    echo shell_exec($cmd);
}