本文整理汇总了PHP中encrypt_string函数的典型用法代码示例。如果您正苦于以下问题:PHP encrypt_string函数的具体用法?PHP encrypt_string怎么用?PHP encrypt_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encrypt_string函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: transform_string
function transform_string($array, $array2)
{
$res = encrypt($array, $array2);
$res2 = implode($res);
$array4 = str_split($res2, 2);
return encrypt_string($array4);
}
开发者ID:jabouzi,项目名称:cms,代码行数:7,代码来源:encrtest.php
示例2: create
/**
* Create customer data
*
* @access public
* @param $username
* @param $password
* @param $email
* @return boolean
*/
public function create($username, $password, $email)
{
//insert into admin table
$result = $this->db->insert('administrators', array('user_name' => $username, 'user_password' => encrypt_string($password), 'email_address' => $email));
if ($result) {
//get administartor id
$administrators_id = $this->db->insert_id();
//add access
return $this->db->insert('administrators_access', array('administrators_id' => $administrators_id, 'module' => '*'));
}
return FALSE;
}
开发者ID:colonia,项目名称:tomatocart-v2,代码行数:21,代码来源:administrators_model.php
示例3: batchAddFeeds
function batchAddFeeds()
{
$cat_id = $this->dbh->escape_string($_REQUEST['cat']);
$feeds = explode("\n", $_REQUEST['feeds']);
$login = $this->dbh->escape_string($_REQUEST['login']);
$pass = trim($_REQUEST['pass']);
foreach ($feeds as $feed) {
$feed = $this->dbh->escape_string(trim($feed));
if (validate_feed_url($feed)) {
$this->dbh->query("BEGIN");
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'{$cat_id}'";
}
$result = $this->dbh->query("SELECT id FROM ttrss_feeds\n\t\t\t\t\tWHERE feed_url = '{$feed}' AND owner_uid = " . $_SESSION["uid"]);
if (strlen(FEED_CRYPT_KEY) > 0) {
require_once "crypt.php";
$pass = substr(encrypt_string($pass), 0, 250);
$auth_pass_encrypted = 'true';
} else {
$auth_pass_encrypted = 'false';
}
$pass = $this->dbh->escape_string($pass);
if ($this->dbh->num_rows($result) == 0) {
$result = $this->dbh->query("INSERT INTO ttrss_feeds\n\t\t\t\t\t\t\t(owner_uid,feed_url,title,cat_id,auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$feed}',\n\t\t\t\t\t\t\t'[Unknown]', {$cat_qpart}, '{$login}', '{$pass}', 0, {$auth_pass_encrypted})");
}
$this->dbh->query("COMMIT");
}
}
}
开发者ID:AHinMaine,项目名称:ttrss,代码行数:31,代码来源:feeds.php
示例4: subscribe_to_feed
/**
* @return array (code => Status code, message => error message if available)
*
* 0 - OK, Feed already exists
* 1 - OK, Feed added
* 2 - Invalid URL
* 3 - URL content is HTML, no feeds available
* 4 - URL content is HTML which contains multiple feeds.
* Here you should call extractfeedurls in rpc-backend
* to get all possible feeds.
* 5 - Couldn't download the URL content.
* 6 - Content is an invalid XML.
*/
function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '')
{
global $fetch_last_error;
require_once "include/rssfuncs.php";
$url = fix_url($url);
if (!$url || !validate_feed_url($url)) {
return array("code" => 2);
}
$contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
if (!$contents) {
return array("code" => 5, "message" => $fetch_last_error);
}
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_SUBSCRIBE_FEED) as $plugin) {
$contents = $plugin->hook_subscribe_feed($contents, $url, $auth_login, $auth_pass);
}
if (is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents);
if (count($feedUrls) == 0) {
return array("code" => 3);
} else {
if (count($feedUrls) > 1) {
return array("code" => 4, "feeds" => $feedUrls);
}
}
//use feed url as new URL
$url = key($feedUrls);
}
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'{$cat_id}'";
}
$result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]);
if (strlen(FEED_CRYPT_KEY) > 0) {
require_once "crypt.php";
$auth_pass = substr(encrypt_string($auth_pass), 0, 250);
$auth_pass_encrypted = 'true';
} else {
$auth_pass_encrypted = 'false';
}
$auth_pass = db_escape_string($auth_pass);
if (db_num_rows($result) == 0) {
$result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})");
$result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
$feed_id = db_fetch_result($result, 0, "id");
if ($feed_id) {
set_basic_feed_info($feed_id);
}
return array("code" => 1);
} else {
return array("code" => 0);
}
}
开发者ID:nota-ja,项目名称:tt-rss,代码行数:66,代码来源:functions.php
示例5: wp2moodle_generate_hyperlink
function wp2moodle_generate_hyperlink($cohort, $group)
{
// needs authentication; ensure userinfo globals are populated
global $current_user;
get_currentuserinfo();
$update = get_option('wp2m_update_details') ?: "true";
$enc = array("offset" => rand(1234, 5678), "stamp" => time(), "firstname" => $current_user->user_firstname, "lastname" => $current_user->user_lastname, "email" => $current_user->user_email, "username" => $current_user->user_login, "passwordhash" => $current_user->user_pass, "idnumber" => $current_user->ID, "cohort" => $cohort, "group" => $group, "updatable" => $update);
// encode array as querystring
$details = http_build_query($enc);
// encryption = 3des using shared_secret
return get_option('wp2m_moodle_url') . WP2M_MOODLE_PLUGIN_URL . encrypt_string($details, get_option('wp2m_shared_secret'));
//return get_option('wp2m_moodle_url').WP2M_MOODLE_PLUGIN_URL.'=>'.$details;
}
开发者ID:fia3876,项目名称:iqmas-portal,代码行数:13,代码来源:wp2m.php
示例6: set_password
/** Set password to session
* @param string
* @param string
* @param string
* @param string
* @return null
*/
function set_password($vendor, $server, $username, $password)
{
$_SESSION["pwds"][$vendor][$server][$username] = $_COOKIE["adminer_key"] && is_string($password) ? array(encrypt_string($password, $_COOKIE["adminer_key"])) : $password;
}
开发者ID:K0n24d,项目名称:adminer,代码行数:11,代码来源:functions.inc.php
示例7: subscribe_to_feed
/**
* @return array (code => Status code, message => error message if available)
*
* 0 - OK, Feed already exists
* 1 - OK, Feed added
* 2 - Invalid URL
* 3 - URL content is HTML, no feeds available
* 4 - URL content is HTML which contains multiple feeds.
* Here you should call extractfeedurls in rpc-backend
* to get all possible feeds.
* 5 - Couldn't download the URL content.
* 6 - Content is an invalid XML.
*/
function subscribe_to_feed($url, $cat_id = 0, $auth_login = '', $auth_pass = '')
{
global $fetch_last_error;
require_once "include/rssfuncs.php";
$url = fix_url($url);
if (!$url || !validate_feed_url($url)) {
return array("code" => 2);
}
$contents = @fetch_file_contents($url, false, $auth_login, $auth_pass);
if (!$contents) {
return array("code" => 5, "message" => $fetch_last_error);
}
if (is_html($contents)) {
$feedUrls = get_feeds_from_html($url, $contents);
if (count($feedUrls) == 0) {
return array("code" => 3);
} else {
if (count($feedUrls) > 1) {
return array("code" => 4, "feeds" => $feedUrls);
}
}
//use feed url as new URL
$url = key($feedUrls);
}
/* libxml_use_internal_errors(true);
$doc = new DOMDocument();
$doc->loadXML($contents);
$error = libxml_get_last_error();
libxml_clear_errors();
if ($error) {
$error_message = format_libxml_error($error);
return array("code" => 6, "message" => $error_message);
} */
if ($cat_id == "0" || !$cat_id) {
$cat_qpart = "NULL";
} else {
$cat_qpart = "'{$cat_id}'";
}
$result = db_query("SELECT id FROM ttrss_feeds\n\t\t\tWHERE feed_url = '{$url}' AND owner_uid = " . $_SESSION["uid"]);
if (strlen(FEED_CRYPT_KEY) > 0) {
require_once "crypt.php";
$auth_pass = substr(encrypt_string($auth_pass), 0, 250);
$auth_pass_encrypted = 'true';
} else {
$auth_pass_encrypted = 'false';
}
$auth_pass = db_escape_string($auth_pass);
if (db_num_rows($result) == 0) {
$result = db_query("INSERT INTO ttrss_feeds\n\t\t\t\t\t(owner_uid,feed_url,title,cat_id, auth_login,auth_pass,update_method,auth_pass_encrypted)\n\t\t\t\tVALUES ('" . $_SESSION["uid"] . "', '{$url}',\n\t\t\t\t'[Unknown]', {$cat_qpart}, '{$auth_login}', '{$auth_pass}', 0, {$auth_pass_encrypted})");
$result = db_query("SELECT id FROM ttrss_feeds WHERE feed_url = '{$url}'\n\t\t\t\t\tAND owner_uid = " . $_SESSION["uid"]);
$feed_id = db_fetch_result($result, 0, "id");
if ($feed_id) {
update_rss_feed($feed_id, true);
}
return array("code" => 1);
} else {
return array("code" => 0);
}
}
开发者ID:cs-team,项目名称:tiny_tiny_rss-openshift-quickstart,代码行数:74,代码来源:functions.php
示例8: find_theme
}
$theme = find_theme($fp, $personal, $default_theme);
// Following variables are stored in an array in the session in this order
// user - user who is logging in
// pass - users encrypted (if supported) password
// server - server connected too
// port - port connected on
// dir - current directory
// warn - warning messagez
// IP - remote IP address
// level - warning severity level
// Server Name - Display name for the ftp server (selected from the login dropdown)
$sess_Data = array("user" => $ftp_User, "pass" => $enc_ftp_Pass, "server" => $ftp_Server, "port" => $ftp_Port, "dir" => ftp_pwd($fp), "warn" => "", "level" => 0, "Server Name" => $login_server, "IP" => $REMOTE_ADDR);
if (isset($ftp_Remember) && $ftp_remember_me) {
$cookie_string = $ftp_User . "::" . $ftp_Pass;
$cookie_string = encrypt_string($cookie_string, $key, session_id(), $pref_ciphers);
setcookie("WeebleFM_cookie", $cookie_string, time() + 31536000, "/", $HTTP_SERVER_VARS["SERVER_NAME"], 0);
setcookie("WeebleFM_SID", session_id(), time() + 31536000, "/", $HTTP_SERVER_VARS["SERVER_NAME"], 0);
setcookie("WeebleFM_Server", $login_server, time() + 31536000, "/", $HTTP_SERVER_VARS["SERVER_NAME"], 0);
}
// Set passive mode if desired.
if ($ftp_Passive_Mode) {
$result = @ftp_pasv($fp, TRUE);
if ($result == 0) {
$sess_Data["warn"] = sprintf("{$code_err}: {$err_ftp}.");
$sess_Data["level"] = "medium";
}
}
// log sign in if set too
if ($log["level"] > 0) {
log_message($log, $ftp_User . "/" . $REMOTE_ADDR . " - Logged in.\n");
开发者ID:BackupTheBerlios,项目名称:vhcs-svn,代码行数:31,代码来源:check_login.php
示例9: array
}
$permanent = array();
if ($_COOKIE["adminer_permanent"]) {
foreach (explode(" ", $_COOKIE["adminer_permanent"]) as $val) {
list($key) = explode(":", $val);
$permanent[$key] = $val;
}
}
if (isset($_POST["server"])) {
session_regenerate_id();
// defense against session fixation
$_SESSION["pwds"][$_POST["driver"]][$_POST["server"]][$_POST["username"]] = $_POST["password"];
if ($_POST["permanent"]) {
$key = base64_encode($_POST["driver"]) . "-" . base64_encode($_POST["server"]) . "-" . base64_encode($_POST["username"]);
$private = $adminer->permanentLogin();
$permanent[$key] = "{$key}:" . base64_encode($private ? encrypt_string($_POST["password"], $private) : "");
cookie("adminer_permanent", implode(" ", $permanent));
}
if (count($_POST) == ($_POST["permanent"] ? 5 : 4) || DRIVER != $_POST["driver"] || SERVER != $_POST["server"] || $_GET["username"] !== $_POST["username"]) {
redirect(auth_url($_POST["driver"], $_POST["server"], $_POST["username"]));
}
} elseif ($_POST["logout"]) {
if ($token && $_POST["token"] != $token) {
page_header(lang('Logout'), lang('Invalid CSRF token. Send the form again.'));
page_footer("db");
exit;
} else {
foreach (array("pwds", "dbs", "queries") as $key) {
set_session($key, null);
}
$key = base64_encode(DRIVER) . "-" . base64_encode(SERVER) . "-" . base64_encode($_GET["username"]);
开发者ID:nishant368,项目名称:newlifeoffice-new,代码行数:31,代码来源:auth.inc.php
示例10: getCountryByIP
$reason = 1;
}
if (empty($_POST["repassword"])) {
$proceed = false;
$reason = 1;
}
if ($_POST["password"] != $_POST["repassword"]) {
$proceed = false;
$reason = 3;
}
// Now we see if we have a problem
if ($proceed == true) {
// No problem? Show a welcome message.
$msg = "<p>You are successfuly registered to QCS Asia Members Area.<br />We sent you an email with your password, you have to click on the link in this email to confirm account creation and access the Members Area, check your mailbox now.<br /></p>";
$country_ip = getCountryByIP($_SERVER['REMOTE_ADDR']);
$sqlQuery = "INSERT INTO qcs_members (firstname, lastname , company_name, country, email, password, date_creation , address , website , type , country_ip)\n VALUES (\n '" . addslashes($_POST["firstname"]) . "'\n , '" . addslashes($_POST["lastname"]) . "'\n , '" . addslashes($_POST["company_name"]) . "'\n , '" . addslashes($_POST["country"]) . "'\n , '" . $_POST["email"] . "'\n , '" . encrypt_string($_POST["password"]) . "'\n , '" . date('Y-m-d H:i:s') . "'\n , '" . $_POST["company_address"] . "'\n , '" . $_POST["company_website"] . "'\n , '" . $_POST["company_type"] . "'\n , '" . $country_ip . "'\n )";
// echo "sqlQuery = " . $sqlQuery;
// insert in database
$wpdb->query($sqlQuery);
/////////////////////////////////////////////////////////////////////////////////////////////////
// Build our subject line fo the email
$subject = 'Your subscription to QCS Asia Members Area';
// And our actual message
$message = 'You are successfuly registered to QCS Asia Members Area.<br /><br />';
$message .= 'Your id: ' . $_POST['email'] . '<br />';
$message .= 'Your password: ' . $_POST['password'] . '<br /><br />';
$message .= 'To start to access QCS Asia Members Area confirm your email address by clicking on the link below.<br /><br />';
$message .= '<a href="' . get_bloginfo('url') . '/confirm.php?email=' . $_POST['email'] . '">' . get_bloginfo('url') . '/confirm.php?email=' . $_POST['email'] . '</a><br /><br />';
$message .= 'If it does not works Copy and Paste this link directly into your browser.<br /></br>';
$message .= 'Thanks! Regards.<br /><br />---<br />';
$message .= 'Please do not delete this email.';
开发者ID:qcstw-dev,项目名称:qcsasia,代码行数:31,代码来源:template-members-area-login.php
示例11: getCountryByIP
if ($proceed == true) {
// No problem? Show a welcome message.
$msg = '<p style="font-size: 20px;">Application form is completed.</p><p style="font-size: 17px;">You will receive shortly an e-mail with a link to click to confirm your e-mail address.</p>';
$country_ip = getCountryByIP($_SERVER['REMOTE_ADDR']);
$sqlQuery = "INSERT INTO qcs_members (firstname, lastname , company_name, country, email, password, date_creation , address , website , type , country_ip)
VALUES (
'" . addslashes($_POST["firstname"]) . "'
, '" . addslashes($_POST["lastname"]) . "'
, '" . addslashes($_POST["company_name"]) . "'
, '" . addslashes($_POST["country"]) . "'
, '" . $_POST["email"] . "'
, '" . encrypt_string($_POST["password"]) . "'
, '" . date('Y-m-d H:i:s') . "'
, '" . $_POST["company_address"] . "'
, '" . $_POST["company_website"] . "'
, '" . $_POST["company_type"] . "'
, '" . $country_ip . "'
)";
// echo "sqlQuery = " . $sqlQuery;
// insert in database
$wpdb->query($sqlQuery);
/////////////////////////////////////////////////////////////////////////////////////////////////
// Build our subject line fo the email
开发者ID:qcstw-dev,项目名称:qcsasia,代码行数:31,代码来源:template-members-area-login.php
示例12: fsockopen
if ($issecure == "Y") {
$host = "ssl://" . $host;
}
$fsok = fsockopen(trim($host), intval(trim($port)));
if (FALSE == $fsok) {
echo "Target Host not Found/Down";
return;
}
fwrite($fsok, $bodyData);
$port = "";
$host = "";
$hostport = "";
$bodyData = "";
while ($line = fread($fsok, 25000)) {
if ($encryptEnable == "Y") {
echo encrypt_string($line);
} else {
echo $line;
}
}
fclose($fsok);
}
function encrypt_string($input)
{
global $encKey;
$line = "";
for ($i = 0; $i < strlen($input); $i++) {
$line .= chr(ord($input[$i]) + $encKey);
}
return $line;
}
开发者ID:codegooglecom,项目名称:webpage-tunnel,代码行数:31,代码来源:proxy.php
示例13: smtp_options_validate
function smtp_options_validate($input)
{
$smtp_options = get_option('smtp_options');
$input['host'] = stripslashes(wp_filter_kses(addslashes(strip_tags($input['host']))));
if ($input['host'] == '') {
$input['host'] = $smtp_options['host'];
}
$input['port'] = absint($input['port']);
if ($input['port'] == 0 || $input['port'] == 1) {
$input['port'] = $smtp_options['port'];
}
if ($input['smtp_secure'] != '' && $input['smtp_secure'] != 'ssl' && $input['smtp_secure'] != 'tls') {
$input['smtp_secure'] = $smtp_options['smtp_secure'];
}
$input['username'] = stripslashes(wp_filter_kses(addslashes(strip_tags($input['username']))));
if ($input['username'] == '') {
$input['username'] = $smtp_options['username'];
}
$input['password'] = stripslashes(wp_filter_kses(addslashes(strip_tags($input['password']))));
if ($input['password'] == '') {
$input['password'] = $smtp_options['password'];
} else {
$input['password'] = encrypt_string($input['password'], CRYPT_KEY);
}
return $input;
}
开发者ID:JSpier,项目名称:smacamp,代码行数:26,代码来源:smtp.php
示例14: encrypt_string_and_encode
function encrypt_string_and_encode($salt, $string)
{
return base64_encode(encrypt_string($salt, $string));
}
开发者ID:kamy333,项目名称:rajah,代码行数:4,代码来源:security_mcrypt_functions.php
注:本文中的encrypt_string函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论