本文整理汇总了PHP中Bootstrap::hashPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Bootstrap::hashPassword方法的具体用法?PHP Bootstrap::hashPassword怎么用?PHP Bootstrap::hashPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bootstrap
的用法示例。
在下文中一共展示了Bootstrap::hashPassword方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$sContent .= "\$_SESSION['CURRENT_DYN_UID'] = '" . $sDYNAFORM . "';\n";
$sContent .= "\$G_PUBLISH = new Publisher;\n";
$sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n";
$sContent .= "G::RenderPage('publish', 'blank');";
file_put_contents($pathProcess . $dynTitle . '.php', $sContent);
//creating the second file, the post file who receive the post form.
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . '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', $sPRO_UID);
$template->assign('dynaformUid', $sDYNAFORM);
$template->assign('taskUid', $sTASKS);
$template->assign('wsUser', $sWS_USER);
$template->assign('wsPass', Bootstrap::hashPassword($sWS_PASS, '', true));
$template->assign('wsRoundRobin', $sWS_ROUNDROBIN);
G::auditLog('WebEntry', 'Generate web entry with web services (' . $dynTitle . '.php) in process "' . $resultProcess['PRO_TITLE'] . '"');
if ($sWE_USR == "2") {
$template->assign('USR_VAR', "\$cInfo = ws_getCaseInfo(\$caseId);\n\t \$USR_UID = \$cInfo->currentUsers->userId;");
} else {
$template->assign('USR_VAR', '$USR_UID = -1;');
}
$template->assign('dynaform', $dynTitle);
$template->assign('timestamp', date('l jS \\of F Y h:i:s A'));
$template->assign('ws', SYS_SYS);
$template->assign('version', System::getVersion());
$fileName = $pathProcess . $dynTitle . 'Post.php';
file_put_contents($fileName, $template->getOutputContent());
//creating the third file, only if this wsClient.php file doesn't exist.
$fileName = $pathProcess . 'wsClient.php';
示例2: updateUser
//.........这里部分代码省略.........
if (! empty( $lastName )) {
$arrayData["USR_LASTNAME"] = $lastName;
}
if (! empty( $email )) {
$arrayData["USR_EMAIL"] = $email;
}
if ($mktimeDueDate != 0) {
$arrayData["USR_DUE_DATE"] = $mktimeDueDate;
}
$arrayData["USR_UPDATE_DATE"] = date( "Y-m-d H:i:s" );
if (! empty( $status )) {
$arrayData["USR_STATUS"] = $status;
}
if ($strRole != null) {
$arrayData["USR_ROLE"] = $strRole;
}
if (! empty( $password )) {
$arrayData["USR_PASSWORD"] = Bootstrap::hashPassword( $password );
}
//Update user
if ($strRole != null) {
$RBAC->updateUser( $arrayData, $strRole );
} else {
$RBAC->updateUser( $arrayData );
}
$user = new Users();
$user->update( $arrayData );
//Response
//$res = new wsResponse(0, G::LoadTranslation("ID_OBJECT_UPDATE"));
$res = new wsResponse( 0, G::LoadTranslation( "ID_UPDATED_SUCCESSFULLY" ) );
$result = array ("status_code" => $res->status_code,"message" => $res->message,"timestamp" => $res->timestamp
);
return $result;
} catch (Exception $e) {
$result = new wsResponse(100, $e->getMessage());
return $result;
}
}
示例3:
$form['USR_UID'] = $_GET['USR_UID'];
} else {
$form['USR_UID'] = '';
}
if (isset($_FILES['form']['name']['USR_RESUME'])) {
if ($_FILES['form']['tmp_name']['USR_RESUME'] != '') {
$form['USR_RESUME'] = $_FILES['form']['name']['USR_RESUME'];
} else {
$form['USR_RESUME'] = '';
}
}
if (!isset($form['USR_NEW_PASS'])) {
$form['USR_NEW_PASS'] = '';
}
if ($form['USR_NEW_PASS'] != '') {
$form['USR_PASSWORD'] = Bootstrap::hashPassword($form['USR_NEW_PASS']);
}
if (!isset($form['USR_CITY'])) {
$form['USR_CITY'] = '';
}
if (!isset($form['USR_LOCATION'])) {
$form['USR_LOCATION'] = '';
}
if (!isset($form['USR_AUTH_USER_DN'])) {
$form['USR_AUTH_USER_DN'] = '';
}
if ($form['USR_UID'] == '') {
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
$aData['USR_FIRSTNAME'] = $form['USR_FIRSTNAME'];
$aData['USR_LASTNAME'] = $form['USR_LASTNAME'];
示例4: checkPassword
protected function checkPassword($user, $password)
{
return $user['USR_PASSWORD'] == \Bootstrap::hashPassword($password);
}
示例5: createUpdate
/**
* Create/Update CaseScheduler
*
* @param string $caseSchedulerUid Unique id of CaseScheduler
* @param string $projectUid Unique id of Project
* @param string $userUidCreatorUpdater Unique id of creator/updater User
* @param array $arrayData Data
* @param array $arrayDataPlugin Data plugin
*
* return void
*/
public function createUpdate($caseSchedulerUid, $projectUid, $userUidCreatorUpdater, array $arrayData, array $arrayDataPlugin = array())
{
try {
//Set variables
$flagInsert = $caseSchedulerUid == "" ? true : false;
$option = $flagInsert ? "INS" : "UPD";
//Set data
if ($flagInsert) {
$caseSchedulerUid = \ProcessMaker\Util\Common::generateUID();
}
foreach ($arrayData as $key => $value) {
if (is_array($value)) {
foreach ($value as $key2 => $value2) {
$arrayData[$key][$key2] = trim($value2);
}
} else {
$arrayData[$key] = trim($value);
}
}
$arrayCaseSchedulerData = array();
$arrayCaseSchedulerData["SCH_UID"] = $caseSchedulerUid;
$arrayCaseSchedulerData["SCH_NAME"] = $arrayData["SCH_NAME"];
$arrayCaseSchedulerData["PRO_UID"] = $projectUid;
$arrayCaseSchedulerData["TAS_UID"] = $arrayData["TAS_UID"];
$arrayCaseSchedulerData["SCH_DEL_USER_UID"] = $arrayData["SCH_USER_UID"];
$arrayCaseSchedulerData["SCH_DEL_USER_NAME"] = $arrayData["SCH_USER_NAME"];
switch ($option) {
case "INS":
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
$arrayCaseSchedulerData["SCH_STATE"] = "ACTIVE";
$arrayCaseSchedulerData["SCH_LAST_STATE"] = "CREATED";
$sDateTmp = $arrayData["SCH_START_DATE"] != "" ? $arrayData["SCH_START_DATE"] : date("Y-m-d");
break;
case "UPD":
if ($arrayData["SCH_USER_PASSWORD"] != "DefaultPM") {
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
}
$sDateTmp = $arrayData["SCH_START_DATE"];
break;
}
$caseSchedulerOption = (int) $arrayData["SCH_OPTION"];
$arrayCaseSchedulerData["USR_UID"] = $userUidCreatorUpdater;
$arrayCaseSchedulerData["SCH_OPTION"] = $caseSchedulerOption;
$arrayCaseSchedulerData["SCH_START_TIME"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
$arrayCaseSchedulerData["SCH_START_DATE"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
$sValue = "";
$sDaysPerformTask = "";
$sWeeks = "";
$sMonths = "";
switch ($option) {
case "INS":
$arrayCaseSchedulerData["SCH_START_DAY"] = "";
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = "";
$arrayCaseSchedulerData["SCH_REPEAT_UNTIL"] = "";
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = "";
break;
case "UPD":
break;
}
switch ($caseSchedulerOption) {
case 1:
//Option 1
$sValue = $arrayData["SCH_DAYS_PERFORM_TASK"];
switch ($sValue) {
case "1":
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = $arrayData["SCH_DAYS_PERFORM_TASK"] . "|1";
break;
case "2":
$arrayCaseSchedulerData["SCH_OPTION"] = "2";
$arrayCaseSchedulerData["SCH_EVERY_DAYS"] = "1";
$arrayCaseSchedulerData["SCH_WEEK_DAYS"] = "1|2|3|4|5|";
break;
case "3":
//Every [n] Days
$sDaysPerformTask = $arrayData["SCH_DAYS_PERFORM_TASK_OPT_3"];
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = $arrayData["SCH_DAYS_PERFORM_TASK"] . "|" . $arrayData["SCH_DAYS_PERFORM_TASK_OPT_3"];
break;
}
break;
case 2:
//If the option is zero, set by default 1
$arrayCaseSchedulerData["SCH_EVERY_DAYS"] = empty($arrayData["SCH_EVERY_DAYS"]) ? 1 : $arrayData["SCH_EVERY_DAYS"];
$sWeeks = "";
if (!empty($arrayData["SCH_WEEK_DAYS"])) {
$aWeekDays = $arrayData["SCH_WEEK_DAYS"];
foreach ($aWeekDays as $value) {
$sWeeks = $sWeeks . $value . "|";
}
}
//.........这里部分代码省略.........
示例6: update
//.........这里部分代码省略.........
}
if ($countPermission != 1) {
throw new \Exception(\G::LoadTranslation("ID_USER_CAN_NOT_UPDATE", array($userUidLogged)));
}
//Update
$cnn = \Propel::getConnection("workflow");
try {
$rbac = new \RBAC();
$user = new \Users();
$rbac->initRBAC();
if (isset($arrayData["USR_NEW_PASS"])) {
$arrayData["USR_PASSWORD"] = \Bootstrap::hashPassword($arrayData["USR_NEW_PASS"]);
}
$arrayData["USR_UID"] = $userUid;
$arrayData["USR_LOGGED_NEXT_TIME"] = (isset($arrayData["USR_LOGGED_NEXT_TIME"]))? $arrayData["USR_LOGGED_NEXT_TIME"] : 0;
$arrayData["USR_UPDATE_DATE"] = date("Y-m-d H:i:s");
$flagUserLoggedNextTime = false;
if (isset($arrayData["USR_PASSWORD"])) {
if ($arrayData["USR_PASSWORD"] != "") {
//require_once 'classes/model/UsersProperties.php';
$userProperty = new \UsersProperties();
$aUserProperty = $userProperty->loadOrCreateIfNotExists($userUid, array("USR_PASSWORD_HISTORY" => serialize(array(\Bootstrap::hashPassword($arrayData["USR_PASSWORD"])))));
$memKey = "rbacSession" . session_id();
示例7: createUpdate
/**
* Create/Update CaseScheduler
*
* @param string $caseSchedulerUid Unique id of CaseScheduler
* @param string $projectUid Unique id of Project
* @param string $userUidCreatorUpdater Unique id of creator/updater User
* @param array $arrayData Data
* @param array $arrayDataPlugin Data plugin
*
* return void
*/
public function createUpdate($caseSchedulerUid, $projectUid, $userUidCreatorUpdater, array $arrayData, array $arrayDataPlugin = array())
{
try {
//Set variables
$flagInsert = ($caseSchedulerUid == "")? true : false;
$option = ($flagInsert)? "INS" : "UPD";
//Set data
if ($flagInsert) {
$caseSchedulerUid = \ProcessMaker\Util\Common::generateUID();
}
foreach ($arrayData as $key => $value) {
if (is_array($value)) {
foreach ($value as $key2 => $value2) {
$arrayData[$key][$key2] = trim($value2);
}
} else {
$arrayData[$key] = trim($value);
}
}
$arrayCaseSchedulerData = array();
$arrayCaseSchedulerData["SCH_UID"] = $caseSchedulerUid;
$arrayCaseSchedulerData["SCH_NAME"] = $arrayData["SCH_NAME"];
$arrayCaseSchedulerData["PRO_UID"] = $projectUid;
$arrayCaseSchedulerData["TAS_UID"] = $arrayData["TAS_UID"];
$arrayCaseSchedulerData["SCH_DEL_USER_UID"] = $arrayData["SCH_USER_UID"];
$arrayCaseSchedulerData["SCH_DEL_USER_NAME"] = $arrayData["SCH_USER_NAME"];
switch ($option) {
case "INS":
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
$arrayCaseSchedulerData["SCH_STATE"] = "ACTIVE";
$arrayCaseSchedulerData["SCH_LAST_STATE"] = "CREATED";
$sDateTmp = ($arrayData["SCH_START_DATE"] != "")? $arrayData["SCH_START_DATE"] : date("Y-m-d");
break;
case "UPD":
if ($arrayData["SCH_USER_PASSWORD"] != "DefaultPM") {
$arrayCaseSchedulerData["SCH_DEL_USER_PASS"] = \Bootstrap::hashPassword($arrayData["SCH_USER_PASSWORD"]);
}
$sDateTmp = $arrayData["SCH_START_DATE"];
break;
}
$caseSchedulerOption = (int)($arrayData["SCH_OPTION"]);
$arrayCaseSchedulerData["USR_UID"] = $userUidCreatorUpdater;
$arrayCaseSchedulerData["SCH_OPTION"] = $caseSchedulerOption;
$arrayCaseSchedulerData["SCH_START_TIME"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
$arrayCaseSchedulerData["SCH_START_DATE"] = date("Y-m-d", strtotime($sDateTmp)) . " " . date("H:i:s", strtotime($arrayData["SCH_START_TIME"]));
$sValue = "";
$sDaysPerformTask = "";
$sWeeks = "";
$sMonths = "";
$sStartDay = "";
switch ($option) {
case "INS":
$arrayCaseSchedulerData["SCH_START_DAY"] = "";
$arrayCaseSchedulerData["SCH_REPEAT_EVERY"] = "";
$arrayCaseSchedulerData["SCH_REPEAT_UNTIL"] = "";
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = "";
break;
case "UPD":
break;
}
switch ($caseSchedulerOption) {
case 1:
//Option 1
$sValue = $arrayData["SCH_DAYS_PERFORM_TASK"];
switch ($sValue) {
case "1":
$arrayCaseSchedulerData["SCH_DAYS_PERFORM_TASK"] = $arrayData["SCH_DAYS_PERFORM_TASK"] . "|1";
break;
case "2":
$arrayCaseSchedulerData["SCH_OPTION"] = "2";
$arrayCaseSchedulerData["SCH_EVERY_DAYS"] = "1";
$arrayCaseSchedulerData["SCH_WEEK_DAYS"] = "1|2|3|4|5|";
break;
case "3":
//Every [n] Days
//.........这里部分代码省略.........
示例8: verifyHashPassword
public function verifyHashPassword($pass, $userPass)
{
$passwordHashConfig = Bootstrap::getPasswordHashConfig();
$hashTypeCurrent = $passwordHashConfig['current'];
$hashTypePrevious = $passwordHashConfig['previous'];
if (Bootstrap::hashPassword($pass, $hashTypeCurrent) == $userPass || $pass === $hashTypeCurrent . ':' . $userPass) {
return true;
}
if (Bootstrap::hashPassword($pass, $hashTypePrevious) == $userPass || $pass === $hashTypePrevious . ':' . $userPass) {
return true;
}
return false;
}
示例9: Users
<?php
require_once 'classes/model/Users.php';
$oUser = new Users();
$aUser = $oUser->load($_SESSION['USER_LOGGED']);
global $RBAC;
$aData['USR_UID'] = $aUser['USR_UID'];
$aData['USR_USERNAME'] = $aUser['USR_USERNAME'];
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($_POST['form']['USR_PASSWORD']);
$aData['USR_FIRSTNAME'] = $aUser['USR_FIRSTNAME'];
$aData['USR_LASTNAME'] = $aUser['USR_LASTNAME'];
$aData['USR_EMAIL'] = $aUser['USR_EMAIL'];
$aData['USR_DUE_DATE'] = $aUser['USR_DUE_DATE'];
$aData['USR_UPDATE_DATE'] = date('Y-m-d H:i:s');
$RBAC->updateUser($aData, $aUser['USR_ROLE']);
$aData['USR_COUNTRY'] = $aUser['USR_COUNTRY'];
$aData['USR_CITY'] = $aUser['USR_CITY'];
$aData['USR_LOCATION'] = $aUser['USR_LOCATION'];
$aData['USR_ADDRESS'] = $aUser['USR_ADDRESS'];
$aData['USR_PHONE'] = $aUser['USR_PHONE'];
$aData['USR_ZIP_CODE'] = $aUser['USR_ZIP_CODE'];
$aData['USR_POSITION'] = $aUser['USR_POSITION'];
$oUser->update($aData);
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->load($_SESSION['USER_LOGGED']);
$aHistory = unserialize($aUserProperty['USR_PASSWORD_HISTORY']);
if (!is_array($aHistory)) {
$aHistory = array();
}
if (!defined('PPP_PASSWORD_HISTORY')) {
示例10: UsersProperties
}
*/
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($aData['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hashPassword($aData['USR_PASSWORD'])))));
$aUserProperty['USR_LOGGED_NEXT_TIME'] = $form['USR_LOGGED_NEXT_TIME'];
$oUserProperty->update($aUserProperty);
} else {
$aData['USR_UID'] = $form['USR_UID'];
$aData['USR_USERNAME'] = $form['USR_USERNAME'];
if (isset($form['USR_PASSWORD'])) {
if ($form['USR_PASSWORD'] != '') {
$aData['USR_PASSWORD'] = $form['USR_PASSWORD'];
require_once 'classes/model/UsersProperties.php';
$oUserProperty = new UsersProperties();
$aUserProperty = $oUserProperty->loadOrCreateIfNotExists($form['USR_UID'], array('USR_PASSWORD_HISTORY' => serialize(array(Bootstrap::hashPassword($form['USR_PASSWORD'])))));
$memKey = 'rbacSession' . session_id();
$memcache =& PMmemcached::getSingleton(defined('SYS_SYS') ? SYS_SYS : '');
if (($RBAC->aUserInfo = $memcache->get($memKey)) === false) {
$RBAC->loadUserRolePermission($RBAC->sSystem, $_SESSION['USER_LOGGED']);
$memcache->set($memKey, $RBAC->aUserInfo, PMmemcached::EIGHT_HOURS);
}
if ($RBAC->aUserInfo['PROCESSMAKER']['ROLE']['ROL_CODE'] == 'PROCESSMAKER_ADMIN') {
$aUserProperty['USR_LAST_UPDATE_DATE'] = date('Y-m-d H:i:s');
$aUserProperty['USR_LOGGED_NEXT_TIME'] = $form['USR_LOGGED_NEXT_TIME'];
$oUserProperty->update($aUserProperty);
}
$aErrors = $oUserProperty->validatePassword($form['USR_NEW_PASS'], $aUserProperty['USR_LAST_UPDATE_DATE'], 0);
if (count($aErrors) > 0) {
$sDescription = G::LoadTranslation('ID_POLICY_ALERT') . ':,';
foreach ($aErrors as $sError) {
示例11: RbacUsers
require_once 'classes/model/Users.php';
G::LoadClass("system");
$rbacUser = new RbacUsers();
$user = new Users();
$data['USR_USERNAME'] = strip_tags($data['USR_USERNAME']);
$userData = $rbacUser->getByUsername($data['USR_USERNAME']);
if ($userData['USR_EMAIL'] != '' && $userData['USR_EMAIL'] === $data['USR_EMAIL'] && ($userData['USR_AUTH_TYPE'] === '' || $userData['USR_AUTH_TYPE'] == 'MYSQL')) {
$aSetup = System::getEmailConfiguration();
if (count($aSetup) == 0 || !isset($aSetup['MESS_ENGINE'])) {
G::SendTemporalMessage('ID_EMAIL_ENGINE_IS_NOT_ENABLED', "warning");
G::header('location: forgotPassword');
die;
}
$newPass = G::generate_password();
$aData['USR_UID'] = $userData['USR_UID'];
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($newPass);
/* **Save after sending the mail
$rbacUser->update($aData);
$user->update($aData);
*/
$sFrom = G::buildFrom($aSetup, $sFrom);
$sSubject = G::LoadTranslation('ID_RESET_PASSWORD') . ' - ProcessMaker';
$msg = '<h3>ProcessMaker Forgot password Service</h3>';
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_USERMANE_IS') . ' : <strong>' . $userData['USR_USERNAME'] . '</strong></p>';
$msg .= '<p>' . G::LoadTranslation('ID_YOUR_PASSWORD_IS') . ' : <strong>' . $newPass . '</strong></p>';
switch ($aSetup['MESS_ENGINE']) {
case 'MAIL':
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_1');
break;
case 'PHPMAILER':
$engine = G::LoadTranslation('ID_MESS_ENGINE_TYPE_2');
示例12: forgotPassword
public function forgotPassword($httpData)
{
$this->setResponseType('json');
global $RBAC;
require_once PATH_RBAC . "model/RbacUsers.php";
require_once 'classes/model/Users.php';
G::LoadClass("system");
$rbacUser = new RbacUsers();
$user = new Users();
try {
$userData = $rbacUser->getByUsername($httpData->username);
if (!$userData) {
$msg = G::LoadTranslation('ID_USER') . ' <b>' . $httpData->username . '</b> ' . G::LoadTranslation('ID_IS_NOT_REGISTERED');
throw new Exception($msg);
}
if (trim($userData['USR_EMAIL']) != trim($httpData->email)) {
$msg = G::LoadTranslation('ID_EMAIL_DOES_NOT_MATCH_FOR_USER') . ' <b>' . $httpData->username . '</b>';
throw new Exception($msg);
}
$newPass = G::generate_password();
$aData['USR_UID'] = $userData['USR_UID'];
$aData['USR_PASSWORD'] = Bootstrap::hashPassword($newPass);
$rbacUser->update($aData);
$user->update($aData);
$subject = G::loadTranslation('ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE');
$template = new TemplatePower(PATH_TPL . 'main/forgotPassword.tpl');
$template->prepare();
$template->assign('server', $_SERVER['SERVER_NAME']);
$template->assign('serviceMsg', G::loadTranslation('ID_PROCESSMAKER_FORGOT_PASSWORD_SERVICE'));
$template->assign('content', G::loadTranslation('ID_PASSWORD_CHANGED_SUCCESSFULLY'));
$template->assign('passwd', $newPass);
$template->assign('poweredBy', G::loadTranslation('ID_PROCESSMAKER_SLOGAN1'));
$template->assign('versionLabel', G::loadTranslation('ID_VERSION'));
$template->assign('version', System::getVersion());
$template->assign('visit', G::loadTranslation('ID_VISIT'));
$template->assign('footer', '');
$body = $template->getOutputContent();
G::sendMail('', 'ProcessMaker Service', $httpData->email, $subject, $body);
$result->success = true;
$result->message = G::LoadTranslation('ID_NEW_PASSWORD_SENT');
} catch (Exception $e) {
$result->success = false;
$result->message = $e->getMessage();
}
return $result;
}
示例13: die
break;
}
*/
require_once 'classes/model/CaseScheduler.php';
if (empty($_POST)) {
die('The information sended is empty!');
}
$aData['SCH_UID'] = $_POST['form']['SCH_UID'];
$aData['SCH_NAME'] = $_POST['form']['SCH_NAME'];
$aData['PRO_UID'] = $_POST['form']['PRO_UID'];
$aData['TAS_UID'] = $_POST['form']['TAS_UID'];
$oCaseScheduler = new CaseScheduler();
$oCaseScheduler->Load($aData['SCH_UID']);
$aData['SCH_DEL_USER_NAME'] = $_POST['form']['SCH_USER_NAME'];
if ($_POST['form']['SCH_USER_PASSWORD'] != 'DefaultPM') {
$aData['SCH_DEL_USER_PASS'] = Bootstrap::hashPassword($_POST['form']['SCH_USER_PASSWORD']);
}
$aData['SCH_DEL_USER_UID'] = $_POST['form']['SCH_USER_UID'];
// $aData['SCH_TIME_NEXT_RUN'] = time();
//$aData['SCH_LAST_RUN_TIME'] = time();
// $aData['SCH_STATE'] = 'ACTIVE';
// $aData['SCH_LAST_STATE'] = 'ACTIVE';
$aData['USR_UID'] = $_SESSION['USER_LOGGED'];
$sOption = $_POST['form']['SCH_OPTION'];
$aData['SCH_OPTION'] = $sOption;
$sDateTmp = $_POST['form']['SCH_START_DATE'];
$sTimeTmp = $_POST['form']['SCH_START_TIME'];
$aData['SCH_START_TIME'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$aData['SCH_START_DATE'] = date('Y-m-d', strtotime($sDateTmp)) . ' ' . date('H:i:s', strtotime($sTimeTmp));
$previousStartTime = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']));
$previousStartDate = date('Y-m-d', strtotime($_POST['form']['PREV_SCH_START_DATE'])) . ' ' . date('H:i:s', strtotime($_POST['form']['PREV_SCH_START_TIME']));
示例14: userLogin
/**
* User Login
*
* @param string $username Username
* @param string $password Password
*
* return object Return object $response
* $response->status_code, 0 when User has been authenticated, any number otherwise
* $response->message, message
*/
public function userLogin($username, $password)
{
try {
$http = \G::is_https() ? "https://" : "http://";
$client = new \SoapClient($http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/services/wsdl2");
$params = array("userid" => $username, "password" => Bootstrap::hashPassword($password, '', true));
$response = $client->login($params);
return $response;
} catch (\Exception $e) {
throw $e;
}
}
示例15: save
public function save($params)
{
require_once 'classes/model/Event.php';
global $G_FORM;
$sPRO_UID = $params->pro_uid;
$sEVN_UID = $params->evn_uid;
$sDYNAFORM = $params->initDyna;
$sWS_USER = trim($params->username);
$sWS_PASS = trim($params->password);
$sWS_ROUNDROBIN = '';
$sWE_USR = '';
$xDYNA = $params->dynaform;
if ($xDYNA != '') {
$pro_uid = $params->pro_uid;
$filename = $xDYNA;
$filename = $filename . '.php';
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . $filename);
unlink(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $pro_uid . PATH_SEP . str_replace(".php", "Post", $filename) . ".php");
}
//return $params;
G::LoadClass("system");
$pathProcess = PATH_DATA_SITE . 'public' . PATH_SEP . $sPRO_UID . PATH_SEP;
G::mk_dir($pathProcess, 0777);
$oEvent = new Event();
$oEvent->load($sEVN_UID);
$sTASKS = $oEvent->getEvnTasUidTo();
$oTask = new Task();
$oTask->load($sTASKS);
$tas_title = $oTask->getTasTitle();
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$sContent = '';
$SITE_PUBLIC_PATH = '';
if (file_exists($SITE_PUBLIC_PATH . '')) {
}
require_once 'classes/model/Dynaform.php';
$oDynaform = new Dynaform();
$aDynaform = $oDynaform->load($sDYNAFORM);
$dynTitle = str_replace(' ', '_', str_replace('/', '_', $aDynaform['DYN_TITLE']));
$sContent = "<?php\n";
$sContent .= "global \$_DBArray;\n";
$sContent .= "if (!isset(\$_DBArray)) {\n";
$sContent .= " \$_DBArray = array();\n";
$sContent .= "}\n";
$sContent .= "\$_SESSION['PROCESS'] = '" . $sPRO_UID . "';\n";
$sContent .= "\$_SESSION['CURRENT_DYN_UID'] = '" . $sDYNAFORM . "';\n";
$sContent .= "\$G_PUBLISH = new Publisher;\n";
$sContent .= "\$G_PUBLISH->AddContent('dynaform', 'xmlform', '" . $sPRO_UID . '/' . $sDYNAFORM . "', '', array(), '" . $dynTitle . 'Post.php' . "');\n";
$sContent .= "G::RenderPage('publish', 'blank');";
file_put_contents($pathProcess . $dynTitle . '.php', $sContent);
//creating the second file, the post file who receive the post form.
$pluginTpl = PATH_CORE . 'templates' . PATH_SEP . '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', $sPRO_UID);
$template->assign('dynaformUid', $sDYNAFORM);
$template->assign('taskUid', $sTASKS);
$template->assign('wsUser', $sWS_USER);
$template->assign('wsPass', Bootstrap::hashPassword($sWS_PASS, '', true));
$template->assign('wsRoundRobin', $sWS_ROUNDROBIN);
if ($sWE_USR == "2") {
$template->assign('USR_VAR', "\$cInfo = ws_getCaseInfo(\$caseId);\n\t \$USR_UID = \$cInfo->currentUsers->userId;");
} else {
$template->assign('USR_VAR', '$USR_UID = -1;');
}
$template->assign('dynaform', $dynTitle);
$template->assign('timestamp', date('l jS \\of F Y h:i:s A'));
$template->assign('ws', SYS_SYS);
$template->assign('version', System::getVersion());
$fileName = $pathProcess . $dynTitle . 'Post.php';
file_put_contents($fileName, $template->getOutputContent());
//creating the third file, only if this wsClient.php file doesn't exists.
$fileName = $pathProcess . 'wsClient.php';
$pluginTpl = PATH_CORE . "templates" . PATH_SEP . "processes" . PATH_SEP . "wsClient.php";
if (file_exists($fileName)) {
if (filesize($fileName) != filesize($pluginTpl)) {
@copy($fileName, $pathProcess . 'wsClient.php.bck');
@unlink($fileName);
$template = new TemplatePower($pluginTpl);
$template->prepare();
file_put_contents($fileName, $template->getOutputContent());
}
} else {
$template = new TemplatePower($pluginTpl);
$template->prepare();
file_put_contents($fileName, $template->getOutputContent());
}
require_once 'classes/model/Event.php';
$oEvent = new Event();
$aDataEvent = array();
$aDataEvent['EVN_UID'] = $sEVN_UID;
$aDataEvent['EVN_RELATED_TO'] = 'MULTIPLE';
$aDataEvent['EVN_ACTION'] = $sDYNAFORM;
$aDataEvent['EVN_CONDITIONS'] = $sWS_USER;
$output = $oEvent->update($aDataEvent);
//.........这里部分代码省略.........