本文整理汇总了PHP中SecurityUtil::Encode方法的典型用法代码示例。如果您正苦于以下问题:PHP SecurityUtil::Encode方法的具体用法?PHP SecurityUtil::Encode怎么用?PHP SecurityUtil::Encode使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SecurityUtil
的用法示例。
在下文中一共展示了SecurityUtil::Encode方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$fullName = $_POST["fullName"];
$username = $_POST["username"];
$Password = $_POST["password"];
//$conPassword = $_POST["conPassword"];
$emailId = $_POST["emailId"];
$active = $_POST["active"];
$seq = $_POST["seq"];
$locationSeq = $_POST["l_DropDown"];
$otherLocations = $_POST["otherLocationSeqs"];
$user->setLocationSeq($locationSeq);
$user->setIsManager(false);
$user->setUserName($username);
$user->setFullName($fullName);
$encodedPassword = SecurityUtil::Encode($Password);
$user->setPassword($encodedPassword);
$user->setConfirmPassword(SecurityUtil::Encode($conPassword));
if (!empty($otherLocations)) {
$user->setOtherLocationSeqs(explode(",", $otherLocations));
}
$user->setEmailId($emailId);
$user->setIsActive($active);
$user->setSeq($seq);
//------------------------validations---------------------------------
$messageText = "";
$div = "";
$messageText = validator::validateform("User Name", $username, 56, false);
if ($locationSeq == 0) {
$messageText .= "- Please Select Location<br>";
}
$messageText .= validator::validateform("Password", $Password, 56, false);
// if($Password != $conPassword){
示例2: User
if ($newPassword != $confirmNewPassword) {
$messageText = "-New password and confirm password does not match";
}
if ($savedPasswordDecoded != $earlierPassword) {
if ($messageText != null && $messageText != "") {
$messageText = $messageText . "<br/>" . "-Earlier Password does not match with the one in the database";
} else {
$messageText = "-Earlier Password does not match with the one in the database";
}
}
}
if ($messageText != null && $messageText != "") {
$div = " <div class='ui-widget'>\n <div class='ui-state-error ui-corner-all' style='padding: 0 .7em;'>\n <p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span>\n <strong>Error during change password :</strong> <br/>" . $messageText . "</p>\n </div></div>";
} else {
$user = new User();
$user->setPassword(SecurityUtil::Encode($newPassword));
$user->setSeq($userSeq);
$userDataStore->updatePassword($user);
//$configuration->saveConfig($configuration->adminPassword,$newPassword);
$messageText = "Password updated successfully";
$div = "<div class='ui-widget'>\n <div class='ui-state-default ui-corner-all' style='padding: 0 .7em;'>\n <p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span>\n <strong>Message:</strong> " . $messageText . "</p>\n </div></div>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<?php
include "_jsAdminInclude.php";
?>
示例3:
if ($messageText == "") {
if ($newPassword != $confirmNewPassword) {
$messageText = "-New password and confirm password does not match";
}
if ($oldPassword != $earlierPassword) {
if ($messageText != null && $messageText != "") {
$messageText = $messageText . "<br/>" . "-Earlier Password does not match with the one in the database";
} else {
$messageText = "-Earlier Password does not match with the one in the database";
}
}
}
if ($messageText != null && $messageText != "") {
$div = StringUtils::getMessage("Change Passowrd", $messageText, true);
} else {
$newPassword = SecurityUtil::Encode($newPassword);
$user->setPassword($newPassword);
$UDS->updatePassword($user);
$messageText = "Password updated successfully";
$div = StringUtils::getMessage("", $messageText, false);
}
}
?>
<!DOCTYPE html>
<html>
<head>
</head>
示例4: ArrayObject
<?php
require_once 'IConstants.inc';
require $ConstantsArray['dbServerUrl'] . "DataStoreMgr/UserDataStore.php";
$div = "";
if ($_POST["submit"] != "") {
$username = $_POST["username"];
$password = $_POST["password"];
$password = SecurityUtil::Encode($password);
$UDS = UserDataStore::getInstance();
$manager = $UDS->FindManagerByUsernamePassword($username, $password);
if ($manager != NULL) {
session_start();
$arr = new ArrayObject();
$arr['username'] = $manager->getUserName();
$arr['seq'] = $manager->getSeq();
$arr['locSeq'] = $manager->getLocationSeq();
$_SESSION["managerSession"] = $arr;
header("Location:managerTabs.php");
$msg = "Welcome";
} else {
$msg = "-Invalid Password";
$div = "<div class='ui-widget'>\n <div class='ui-state-error ui-corner-all' style='padding: 0 .7em;'> \n <p><span class='ui-icon ui-icon-alert' style='float: left; margin-right: .3em;'></span> \n <strong>Error During Admin login :</strong> <br/>" . $msg . "</p>\n </div></div>";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<link type="text/css" href="css/cupertino/jquery-ui-1.8.14.custom.css" rel="stylesheet" />