/**
  * 处理登陆请求
  */
 public function postHandleSignIn()
 {
     // 获取输入
     $phone = I('post.phone');
     $password = I('post.password');
     $autoSignIn = I('post.autoSignIn');
     $result = D('Common/User')->handleSignIn($phone, $password);
     // 登陆失败
     if (!is_array($result)) {
         return $this->ajaxReturn(['status' => 400, 'msg' => $result]);
     }
     // 成功了,将用户的资料放进session里面
     session('user', $row);
     // 判断需不需要保存自动登陆信息
     if ($autoSignIn) {
         $md5Passwd = md5($password);
         $cookieText = my_encrypt("{$phone}|{$md5Passwd}");
         cookie("user_autoSignIn", $cookieText, 10 * 24 * 60 * 60);
         // 保存10天
     }
     return $this->ajaxReturn(['status' => 200]);
 }
                $temp_str[$i] = '0';
            } else {
                if ($temp_str[$i] == '9') {
                    $temp_str[$i] = '1';
                } else {
                    if ($temp_str[$i] >= '0' && $temp_str[$i] <= '7') {
                        $temp_str[$i] = chr(ord($temp_str[$i]) + 2);
                    }
                }
            }
        }
        $pieces[$p] = $temp_str;
    }
    return $pieces[1] . 'hotchuk666403' . $pieces[0];
}
// ***************************************************************
// ***************************************************************
//$EmpEmail000='test_email@test_host.com.tr';
$Activate_Str = my_encrypt($EmpEmail000);
$MAIL_to = $EmpEmail000;
$MAIL_subject = "College CornerStone - Employer account activation";
$MAIL_header = "MIME-version: 1.0 \r\n" . "Content-type: text/html; charset=iso-8859-1 \r\n" . "From: Admin - College CornerStone <*****@*****.**>";
$MAIL_message = "<html> " . "<body> " . "<br> " . "<div> " . "    <h3>Thank you for your patience. Your company will be activated whenever you " . "        <a href='http://collegecornerstone.com/assets/416832cc/app85473.php?pwd=" . $Activate_Str . "'><b>click this link.</b></a>" . "    </h3>" . "    <br>" . "    <h3><font color=blue>Collegecornerstone.com welcomes you as an employer. Please feel free to use at any time. Best wishes !</font></h3> " . "    <br>" . "    <p>After activation you may log in with your <strong>Username / E-Mail and Password</strong>.</p> " . "    <br> " . "    <p style=\"text-decoration: underline;\">College Cornerstone can offer an employer the following benefits: </p> " . "    <ul> " . "       <li>Seek out student volunteers who can add strength and new possibilities to your business.</li> " . "       <li>Browse student resumes</li> " . "       <li>Display any certifications associated with your line of work.</li> " . "       <li>Set-up and advertise your very own workshop to <b>thousands</b> of students. <b>We'll take care of all the dirty work!</b></li> " . "       <li>Much more! Log into your account and explore!</li> " . "    </ul> " . "</div> " . "<br> " . "<hr> " . "<div> " . "    Note: This email is sent from an automated email address, please do not reply to this address. " . "</div> " . "</body> " . "</html> ";
mail($MAIL_to, $MAIL_subject, $MAIL_message, $MAIL_header);
// echo $MAIL_message;
// ***************************************************************
// ***************************************************************
?>


$MTfile = 'LocalSafeList.txt';
$AllWords = NULL;
echo '<BR> open file next ';
if (filesize($MTfile) == 0) {
    $fp = fopen($FTfile, "w") or exit("Unable to open {$FTfile} file for write!");
    fclose($fp);
    exit;
}
$fp = fopen($MTfile, "r") or exit("Unable to open {$MTfile} file for read!");
if ($fp) {
    $AllWords = fread($fp, filesize($MTfile));
}
fclose($fp);
if (strpos("\n", $AllWords) === TRUE) {
    echo '<BR> it true!!!!!!!!!!!!!!!!';
} else {
    echo 'not sure!!!!';
}
echo ' <BR> Data to be loaded: $AllWords =';
var_dump($AllWords);
echo '<BR> Now encrypt and write safe words to ' . $FTfile;
$FileContents = NULL;
/* -----------------------------    setup encryption parms, and modules & encrypt OWs --------------------------------------------------------------------------------------- */
$FileContents = my_encrypt($AllWords, $key);
$fp = fopen($FTfile, "w") or exit("Unable to open {$FTfile} file for write!");
if (!fwrite($fp, $FileContents)) {
    echo '  FILECONTENTS WRITE ERROR!!    ';
}
fclose($fp);
echo '<BR> encrypted safe list $FileContents=';
print_r($FileContents);
Beispiel #4
0
 /**
  * 
  * @author unknown, Christophe
  */
 public function amazone_violator()
 {
     $this->load->model("amazon_settings_m", "AmazonSetting");
     $this->load->helper("password_helper");
     //$amazon_proxy_setting = $this->db->get("amazon_violator_proxy")->result_array();
     //$this->data->proxy_address	= "";
     //$this->data->proxy_port		= "";
     //$this->data->proxy_user		= "";
     //$this->data->proxy_password	= "";
     $this->data->email_settings = array();
     if ($this->input->post("store_button")) {
         $this->AmazonSetting->deleteAmazonEmailSettingByStoreID($this->store_id);
         //var_dump($_POST); //exit();
         for ($i = 1; $i <= 10; $i++) {
             $str = $this->input->post("ID" . $i . "_email");
             if (!empty($str)) {
                 $setting_info['store_id'] = $this->store_id;
                 $setting_info['email'] = $this->input->post("ID" . $i . "_email");
                 $setting_info['password'] = my_encrypt($this->input->post("ID" . $i . "_password"));
                 $setting_info['marketplace'] = $this->input->post("ID" . $i . "_marketplace");
                 //$setting_info['message'] = $this->input->post("message");
                 $this->db->insert($this->_table_amazon_violator_email_settings, $setting_info);
             }
         }
         $this->data->email_message = 'Amazon violator email settings successfully updated.';
         //$this->db->query("DELETE FROM amazon_violator_proxy");
         //if ($this->input->post('proxy_address')) { // save proxy settings
         //	$this->data->proxy_address	= $this->input->post('proxy_address');
         //	$this->data->proxy_port		= $this->input->post('proxy_port');
         //	$this->data->proxy_user		= $this->input->post('proxy_user');
         //	$this->data->proxy_password	= $this->input->post('proxy_password');
         //
         //	$this->db->insert("amazon_violator_proxy", array(
         //		"proxy_address"	=> $this->data->proxy_address,
         //		"proxy_port"	=> $this->data->proxy_port,
         //		"proxy_user"	=> $this->data->proxy_user,
         //		"proxy_password"=> $this->data->proxy_password
         //	));
         //}
         //if ( count($amazon_proxy_setting) > 0 ) {
         //	$this->data->proxy_address	= $amazon_proxy_setting[0]['proxy_address'];
         //	$this->data->proxy_port		= $amazon_proxy_setting[0]['proxy_port'];
         //	$this->data->proxy_user		= $amazon_proxy_setting[0]['proxy_user'];
         //	$this->data->proxy_password	= $amazon_proxy_setting[0]['proxy_password'];
         //}
     }
     $this->data->email_settings = $this->AmazonSetting->getAmazonEmailSettingByStoreID($this->store_id);
     $this->javascript('views/settings.js.php');
     $this->javascript('views/enforcement/amazon_violator.js.php');
 }
Beispiel #5
0
function show_checksum($path)
{
    show_header();
    $_SESSION['last_seen'] = my_encrypt(time());
    $username = my_decrypt($_SESSION['username']);
    $fullname = my_decrypt($_SESSION['fullname']);
    echo "<div class='row'>\n";
    echo "\t<h1 class='col-md-7'><a href='/'>" . htmlentities($GLOBALS['config']['my_site_name']) . "</a></h1>\n";
    echo "\t<div class='col-md-5 text-right my-userinfo'>\n";
    echo "\t\t" . htmlentities($fullname) . " \n";
    echo "\t\t(" . htmlentities($username) . ") \n";
    echo "\t\t<a class='btn btn-primary' href='/index.php?logout'>Sign out <i class='fa fa-sign-out'></i></a>\n";
    echo "\t</div>\n";
    echo "</div>\n";
    echo "<div class='panel panel-default'>\n";
    echo "\t<div class='panel-heading'>" . basename($path) . "</div>\n";
    echo "\t<table class='table'>\n";
    echo "\t<tbody>\n";
    if (filesize($path) > 1 * 1024 * 1024 * 1024) {
        echo "\t\t<tr><td>[ File too large to hash online ]</td></tr>\n";
    } else {
        echo "\t\t<tr><td class='col-md-1'>MD5</td><td class='col-md-11'>" . hash_file('md5', $path) . "</td></tr>\n";
        echo "\t\t<tr><td class='col-md-1'>SHA1</td><td class='col-md-11'>" . hash_file('sha1', $path) . "</td></tr>\n";
    }
    echo "\t</tbody>\n";
    echo "\t</table>\n";
    echo "</div>\n\n\n\n\n";
    show_footer();
}