本文整理汇总了PHP中Bootstrap::getPasswordHashType方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::getPasswordHashType方法的具体用法?PHP Bootstrap::getPasswordHashType怎么用?PHP Bootstrap::getPasswordHashType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::getPasswordHashType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: caseSchedulerCron
public function caseSchedulerCron ($date, &$log = array(), $cron = 0)
{
try {
require_once("classes" . PATH_SEP . "model" . PATH_SEP . "LogCasesScheduler.php");
//Set variables
$port = "";
if (isset($_SERVER["SERVER_PORT"])) {
$port = ($_SERVER["SERVER_PORT"] . "" != "80")? ":" . $_SERVER["SERVER_PORT"] : "";
} else {
if (defined("SERVER_PORT")) {
$port = (SERVER_PORT . "" != "80")? ":" . SERVER_PORT : "";
}
}
$wsdl = "http://" . SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
$timeDate = strtotime($date);
$dateHour = date("H", $timeDate);
$dateMinutes = date("i", $timeDate);
$dateCurrentIni = date("Y-m-d", $timeDate) . " 00:00:00";
$dateCurrentEnd = date("Y-m-d", $timeDate) . " 23:59:59";
//Query
$criteria = $this->getAllCriteria();
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_STATE, "INACTIVE", Criteria::NOT_EQUAL)->addAnd(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_STATE, "PROCESSED", Criteria::NOT_EQUAL))
);
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentIni, Criteria::GREATER_EQUAL)->addAnd(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentEnd, Criteria::LESS_EQUAL))->addOr(
//$criteria->getNewCriterion(CaseSchedulerPeer::SCH_OPTION, 5, Criteria::GREATER_EQUAL))->addOr(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dateCurrentIni, Criteria::LESS_THAN))
);
$criteria->add(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_END_DATE, null, Criteria::EQUAL)->addOr(
$criteria->getNewCriterion(CaseSchedulerPeer::SCH_END_DATE, $dateCurrentIni, Criteria::GREATER_EQUAL))
);
$rsCriteria = CaseSchedulerPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
if ($cron == 1) {
$arrayCron = unserialize(trim(@file_get_contents(PATH_DATA . "cron")));
$arrayCron["processcTimeStart"] = time();
@file_put_contents(PATH_DATA . "cron", serialize($arrayCron));
}
$caseSchedulerUid = $row["SCH_UID"];
$caseSchedulerOption = (int)($row["SCH_OPTION"]);
$caseSchedulerTimeNextRun = $row["SCH_TIME_NEXT_RUN"];
//Create the new case
$flagNewCase = false;
$caseSchedulerTimeNextRunNew = "";
if (strtotime($caseSchedulerTimeNextRun) < strtotime($dateCurrentIni)) {
//Generate new date for old SCH_TIME_NEXT_RUN
$flagNewCase = true; //Create the old case
$caseSchedulerTimeNextRunNew = $this->getTimeNextRunByDate($row, $date, false);
} else {
$caseSchedulerTimeNextRunHour = date("H", strtotime($row["SCH_TIME_NEXT_RUN"]));
$caseSchedulerTimeNextRunMinutes = date("i", strtotime($row["SCH_TIME_NEXT_RUN"]));
if ((int)($dateHour . $dateMinutes) <= (int)($caseSchedulerTimeNextRunHour . $caseSchedulerTimeNextRunMinutes)) {
$flagNewCase = $caseSchedulerTimeNextRunHour == $dateHour && $caseSchedulerTimeNextRunMinutes == $dateMinutes;
} else {
$flagNewCase = true; //Create the old case
}
}
if ($flagNewCase) {
println(" CASE SCHEDULER: " . $row["SCH_NAME"]);
println(" - Connecting webservice: $wsdl");
$user = $row["SCH_DEL_USER_NAME"];
$pass = $row["SCH_DEL_USER_PASS"];
$processId = $row["PRO_UID"];
$taskId = $row["TAS_UID"];
$client = new SoapClient($wsdl);
$result = $client->__SoapCall("login",
array(
array("userid" => $user, "password" => Bootstrap::getPasswordHashType() . ":" . $pass)
)
);
eprintln(" - Logging as user \"$user\"...");
$paramsLog = array(
"PRO_UID" => $processId,
//.........这里部分代码省略.........
示例2: hashPassword
public function hashPassword($pass, $hashType = '', $includeHashType = false)
{
if ($hashType == '') {
$hashType = Bootstrap::getPasswordHashType();
}
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$hashType = $filter->validateInput($hashType);
$pass = $filter->validateInput($pass);
eval("\$var = hash('" . $hashType . "', '" . $pass . "');");
if ($includeHashType) {
$var = $hashType . ':' . $var;
}
return $var;
}
示例3: setWeData
/**
* Set value in WE_DATA
*
* @param string $webEntryUid Unique id of Web Entry
*
* return void
*/
public function setWeData($webEntryUid)
{
try {
//Verify data
$this->throwExceptionIfNotExistsWebEntry($webEntryUid, $this->arrayFieldNameForException["webEntryUid"]);
//Set variables
$arrayWebEntryData = $this->getWebEntry($webEntryUid, true);
$processUid = $arrayWebEntryData["PRO_UID"];
$taskUid = $arrayWebEntryData["TAS_UID"];
$dynaFormUid = $arrayWebEntryData["DYN_UID"];
$webEntryMethod = $arrayWebEntryData["WE_METHOD"];
$webEntryInputDocumentAccess = $arrayWebEntryData["WE_INPUT_DOCUMENT_ACCESS"];
$webEntryData = "";
$wsRoundRobin = 0;
//0, 1 //0 - Cyclical Assignment
$pathDataPublicProcess = PATH_DATA_PUBLIC . $processUid;
//Delete previous files
if (trim($arrayWebEntryData["WE_DATA"]) != "") {
$fileName = str_replace(".php", "", trim($arrayWebEntryData["WE_DATA"]));
$file = $pathDataPublicProcess . PATH_SEP . $fileName . ".php";
if (is_file($file) && file_exists($file)) {
unlink($file);
unlink($pathDataPublicProcess . PATH_SEP . $fileName . "Post.php");
}
}
//Create files
\G::mk_dir($pathDataPublicProcess, 0777);
$http = \G::is_https() ? "https://" : "http://";
switch ($webEntryMethod) {
case "WS":
require_once PATH_RBAC . "model" . PATH_SEP . "RbacUsers.php";
$user = new \RbacUsers();
$arrayUserData = $user->load($arrayWebEntryData["USR_UID"]);
$usrUsername = $arrayUserData["USR_USERNAME"];
$usrPassword = $arrayUserData["USR_PASSWORD"];
$dynaForm = new \Dynaform();
$arrayDynaFormData = $dynaForm->Load($arrayWebEntryData["DYN_UID"]);
//Creating sys.info;
$sitePublicPath = "";
if (file_exists($sitePublicPath . "")) {
}
//Creating the first file
$weTitle = $this->sanitizeFilename($arrayWebEntryData["WE_TITLE"]);
$fileName = $weTitle;
$fileContent = "<?php\n";
$fileContent .= "global \$_DBArray;\n";
$fileContent .= "if (!isset(\$_DBArray)) {\n";
$fileContent .= " \$_DBArray = array();\n";
$fileContent .= "}\n";
$fileContent .= "\$_SESSION[\"PROCESS\"] = \"" . $processUid . "\";\n";
$fileContent .= "\$_SESSION[\"CURRENT_DYN_UID\"] = \"" . $dynaFormUid . "\";\n";
$fileContent .= "\$G_PUBLISH = new Publisher();\n";
$fileContent .= "G::LoadClass(\"pmDynaform\");\n";
$fileContent .= "\$a = new pmDynaform(array(\"CURRENT_DYNAFORM\" => \"" . $arrayWebEntryData["DYN_UID"] . "\"));\n";
$fileContent .= "if (\$a->isResponsive()) {";
$fileContent .= " \$a->printWebEntry(\"" . $fileName . "Post.php\");";
$fileContent .= "} else {";
$fileContent .= " \$G_PUBLISH->AddContent(\"dynaform\", \"xmlform\", \"" . $processUid . PATH_SEP . $dynaFormUid . "\", \"\", array(), \"" . $fileName . "Post.php\");\n";
$fileContent .= " G::RenderPage(\"publish\", \"blank\");";
$fileContent .= "}";
file_put_contents($pathDataPublicProcess . PATH_SEP . $fileName . ".php", $fileContent);
//Creating the second file, the post file who receive the post form.
$pluginTpl = PATH_TPL . "processes" . PATH_SEP . "webentryPost.tpl";
$template = new \TemplatePower($pluginTpl);
$template->prepare();
$template->assign("wsdlUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2");
$template->assign("wsUploadUrl", $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/upload");
$template->assign("processUid", $processUid);
$template->assign("dynaformUid", $dynaFormUid);
$template->assign("taskUid", $taskUid);
$template->assign("wsUser", $usrUsername);
$template->assign("wsPass", \Bootstrap::getPasswordHashType() . ':' . $usrPassword);
$template->assign("wsRoundRobin", $wsRoundRobin);
if ($webEntryInputDocumentAccess == 0) {
//Restricted to process permissions
$template->assign("USR_VAR", "\$cInfo = ws_getCaseInfo(\$caseId);\n\t \$USR_UID = \$cInfo->currentUsers->userId;");
} else {
//No Restriction
$template->assign("USR_VAR", "\$USR_UID = -1;");
}
$template->assign("dynaform", $arrayDynaFormData["DYN_TITLE"]);
$template->assign("timestamp", date("l jS \\of F Y h:i:s A"));
$template->assign("ws", SYS_SYS);
$template->assign("version", \System::getVersion());
$fileName = $pathDataPublicProcess . PATH_SEP . $weTitle . "Post.php";
file_put_contents($fileName, $template->getOutputContent());
//Creating the third file, only if this wsClient.php file doesn't exist.
$fileName = $pathDataPublicProcess . PATH_SEP . "wsClient.php";
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
if (file_exists($fileName)) {
if (filesize($fileName) != filesize($pluginTpl)) {
copy($fileName, $pathDataPublicProcess . PATH_SEP . "wsClient.php.bak");
unlink($fileName);
//.........这里部分代码省略.........
示例4: caseSchedulerCron
public function caseSchedulerCron ($date, &$log = array(), $cron = 0)
{
G::LoadClass( 'dates' );
require_once ('classes/model/LogCasesScheduler.php');
$oDates = new dates();
$nTime = strtotime( $date );
$dCurrentDate = date( 'Y-m-d', $nTime ) . ' 00:00:00';
$dNextDay = date( 'Y-m-d', strtotime( "$dCurrentDate" ) ) . ' 23:59:59';
$oCriteria = $this->getAllCriteria();
$oCriteria->addAnd( CaseSchedulerPeer::SCH_STATE, 'INACTIVE', Criteria::NOT_EQUAL );
$oCriteria->addAnd( CaseSchedulerPeer::SCH_STATE, 'PROCESSED', Criteria::NOT_EQUAL );
$oCriteria->add( $oCriteria->getNewCriterion(CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dCurrentDate, Criteria::GREATER_EQUAL )->
addAnd( $oCriteria->getNewCriterion( CaseSchedulerPeer::SCH_TIME_NEXT_RUN, $dNextDay, Criteria::LESS_EQUAL ) )->
addOr( $oCriteria->getNewCriterion( CaseSchedulerPeer::SCH_OPTION, '5', Criteria::GREATER_EQUAL ) )
);
$oCriteria->add( CaseSchedulerPeer::SCH_END_DATE, null, Criteria::EQUAL );
$oCriteria->addOr( CaseSchedulerPeer::SCH_END_DATE, $dCurrentDate, Criteria::GREATER_EQUAL );
$oDataset = CaseSchedulerPeer::doSelectRS( $oCriteria );
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$sValue = '';
$sActualTime = '';
$sDaysPerformTask = '';
$sWeeks = '';
$sStartDay = '';
$sMonths = '';
while ($oDataset->next()) {
$aRow = $oDataset->getRow();
if ($cron == 1) {
$arrayCron = unserialize( trim( @file_get_contents( PATH_DATA . "cron" ) ) );
$arrayCron["processcTimeStart"] = time();
@file_put_contents( PATH_DATA . "cron", serialize( $arrayCron ) );
}
$sSchedulerUid = $aRow['SCH_UID'];
$sOption = $aRow['SCH_OPTION'];
switch ($sOption) {
case '1':
$sDaysPerformTask = $aRow['SCH_DAYS_PERFORM_TASK'];
$aDaysPerformTask = explode( '|', $sDaysPerformTask );
$sValue = $aDaysPerformTask[0];
if ($sValue != 1) {
$sDaysPerformTask = $aDaysPerformTask[1];
}
break;
case '2':
$sDaysPerformTask = $aRow['SCH_EVERY_DAYS'];
$sWeeks = $aRow['SCH_WEEK_DAYS'];
break;
case '3':
$sStartDay = $aRow['SCH_START_DAY'];
$sMonths = $aRow['SCH_MONTHS'];
$aStartDay = explode( '|', $sStartDay );
$sValue = $aStartDay[0];
break;
case '4':
$aRow['SCH_STATE'] = 'PROCESSED';
break;
case '5':
break;
}
$sActualTime = $aRow['SCH_TIME_NEXT_RUN'];
$sActualDataHour = (int)(date("H", strtotime($aRow["SCH_TIME_NEXT_RUN"])));
$sActualDataMinutes = (int)(date("i", strtotime($aRow["SCH_TIME_NEXT_RUN"])));
$dActualSysHour = (int)(date("H", $nTime));
$dActualSysMinutes = (int)(date("i", $nTime));
$sActualDataTime = strtotime( $aRow['SCH_TIME_NEXT_RUN'] );
$sActualSysTime = strtotime( $nTime );
if ($sActualDataHour == $dActualSysHour && $sActualDataMinutes <= $dActualSysMinutes) {
//if ($sActualDataHour == $dActualSysHour && $sActualDataMinutes == $dActualSysMinutes) {
$port = "";
if (isset($_SERVER["SERVER_PORT"])) {
$port = ($_SERVER["SERVER_PORT"] . "" != "80")? ":" . $_SERVER["SERVER_PORT"] : "";
} else {
if (defined("SERVER_PORT")) {
$port = (SERVER_PORT . "" != "80")? ":" . SERVER_PORT : "";
}
}
$defaultEndpoint = "http://" . SERVER_NAME . $port . "/sys" . SYS_SYS . "/" . SYS_LANG . "/classic/services/wsdl2";
println( " - Connecting webservice: $defaultEndpoint" );
$user = $aRow["SCH_DEL_USER_NAME"];
$pass = $aRow["SCH_DEL_USER_PASS"];
$processId = $aRow["PRO_UID"];
$taskId = $aRow["TAS_UID"];
$client = new SoapClient( $defaultEndpoint );
$params = array ('userid' => $user,'password' => Bootstrap::getPasswordHashType() . ':' . $pass);
$result = $client->__SoapCall( 'login', array ($params) );
eprint( " - Logging as user $user............." );
if ($result->status_code == 0) {
eprintln( "OK+", 'green' );
$sessionId = $result->message;
$newCaseLog = new LogCasesScheduler();
$newRouteLog = new LogCasesScheduler();
//.........这里部分代码省略.........