本文整理汇总了PHP中G::is_https方法的典型用法代码示例。如果您正苦于以下问题:PHP G::is_https方法的具体用法?PHP G::is_https怎么用?PHP G::is_https使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G
的用法示例。
在下文中一共展示了G::is_https方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testIs_https
/**
* @covers G::is_https
* @todo Implement testIs_https().
*/
public function testIs_https()
{
$this->assertFalse(G::is_https());
$_SERVER̈́['HTTPS'] = '';
$this->assertFalse(G::is_https());
$_SERVER['HTTPS'] = 'on';
$this->assertTrue(G::is_https());
}
示例2: sendActionsByEmail
//.........这里部分代码省略.........
// Create
require_once 'classes/model/AbeRequests.php';
$abeRequest = array();
$abeRequest['ABE_REQ_UID'] = '';
$abeRequest['ABE_UID'] = $configuration['ABE_UID'];
$abeRequest['APP_UID'] = $data->APP_UID;
$abeRequest['DEL_INDEX'] = $data->DEL_INDEX;
$abeRequest['ABE_REQ_SENT_TO'] = $email;
$abeRequest['ABE_REQ_SUBJECT'] = $subject;
$abeRequest['ABE_REQ_BODY'] = '';
$abeRequest['ABE_REQ_ANSWERED'] = 0;
$abeRequest['ABE_REQ_STATUS'] = 'PENDING';
try {
$abeRequestsInstance = new AbeRequests();
$abeRequest['ABE_REQ_UID'] = $abeRequestsInstance->createOrUpdate($abeRequest);
} catch (Exception $error) {
throw $error;
}
if ($configuration['ABE_TYPE'] != '') {
// Email
$_SESSION['CURRENT_DYN_UID'] = $configuration['DYN_UID'];
$scriptCode = '';
// foreach ($dynaform->fields as $fieldName => $field) {
// if ($field->type == 'submit') {
// unset($dynaform->fields[$fieldName]);
// }
// }
$__ABE__ = '';
$link = (G::is_https() ? 'https://' : 'http://') . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/ActionsByEmail';
switch ($configuration['ABE_TYPE']) {
case 'LINK':
// $__ABE__ .= $dynaform->render(PATH_FEATURES . 'actionsByEmail/xmlform.html', $scriptCode) . '<br />';
$__ABE__ .= '<a href="' . $link . 'DataForm?APP_UID=' . G::encrypt($data->APP_UID, URL_KEY) . '&DEL_INDEX=' . G::encrypt($data->DEL_INDEX, URL_KEY) . '&DYN_UID=' . G::encrypt($configuration['DYN_UID'], URL_KEY) . '&ABER=' . G::encrypt($abeRequest['ABE_REQ_UID'], URL_KEY) . '" target="_blank">Please complete this form</a>';
break;
// coment
case 'FIELD':
$variableService = new \ProcessMaker\Services\Api\Project\Variable();
$variables = $variableService->doGetVariables($caseFields['PRO_UID']);
$field = new stdClass();
$field->label = 'Test';
$field->type = 'dropdown';
$field->options = array();
$actionField = str_replace('@@', '', $configuration['ABE_ACTION_FIELD']);
$dynaform = $configuration['DYN_UID'];
$variables = G::json_decode($configuration['DYN_CONTENT'], true);
if(isset($variables['items'][0]['items'])){
$fields = $variables['items'][0]['items'];
foreach ($fields as $key => $value) {
foreach($value as $var){ G::pr($var);
if(isset($var['variable'])){
if ($var['variable'] == $actionField) {
$field->label = $var['label'];
$field->type = $var['type'];
$values = $var['options'];
foreach ($values as $val){
$field->options[$val['value']] = $val['value'];
}
}
}
}
示例3: Task
try {
$pathProcess = PATH_DATA_SITE . 'public' . PATH_SEP . $sPRO_UID . PATH_SEP;
G::mk_dir($pathProcess, 0777);
$oTask = new Task();
$TaskFields = $oTask->load($sTASKS);
$WE_EVN_UID = $oTask->getStartingEvent($sTASKS);
if ($TaskFields['TAS_ASSIGN_TYPE'] != 'BALANCED') {
throw new Exception("The task '" . $TaskFields['TAS_TITLE'] . "' doesn't have a valid assignment type. The task needs to have a 'Cyclical Assignment'.");
}
G::LoadClass('tasks');
$oTask = new Tasks();
$user = $oTask->assignUsertoTask($sTASKS);
if ($user == 0) {
throw new Exception(G::LoadTranslation('ID_TASK') . "'" . $TaskFields['TAS_TITLE'] . "'" . G::LoadTranslation('ID_NOT_HAVE_USERS'));
}
$http = G::is_https() ? "https://" : "http://";
$sContent = '';
$infoProcess = new Process();
$resultProcess = $infoProcess->load($sPRO_UID);
if ($withWS) {
//creating sys.info;
$SITE_PUBLIC_PATH = '';
if (file_exists($SITE_PUBLIC_PATH . '')) {
}
//creating the first file
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";
示例4: trim
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
*
*/
/**
* process_SchedulerValidate_User
* validates if the username and password are valid data and if the user assigned
* to the process and task has the rights and persmissions required to create a cron task
*/
$sWS_USER = trim($_REQUEST['USERNAME']);
$sWS_PASS = trim($_REQUEST['PASSWORD']);
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@($client = new SoapClient($endpoint));
$user = $sWS_USER;
$pass = $sWS_PASS;
$params = array('userid' => $user, 'password' => $pass);
$result = $client->__SoapCall('login', array($params));
$fields['status_code'] = $result->status_code;
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
$fields['version'] = $result->version;
$fields['time_stamp'] = $result->timestamp;
$messageCode = $result->message;
示例5: createMySQLWorkspace
//.........这里部分代码省略.........
$langUri = 'en';
if (isset($sysConf['default_lang'])) {
$langUri = $sysConf['default_lang'];
}
$skinUri = 'neoclassic';
if (isset($sysConf['default_skin'])) {
$skinUri = $sysConf['default_skin'];
}
$updatedConf['default_lang'] = $langUri;
$updatedConf['default_skin'] = $skinUri;
$info->uri = PATH_SEP . 'sys' . $_REQUEST['workspace'] . PATH_SEP . $langUri . PATH_SEP . $skinUri . PATH_SEP . 'login' . PATH_SEP . 'login';
//register PMDesigner Client
$http = (G::is_https() == true) ? 'https' : 'http';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$endpoint = sprintf(
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
$workspace,
$langUri,
$skinUri
);
// inserting the outh_client
if (!$userLogged) {
$query = sprintf( "USE %s;", $wf );
} else {
$query = sprintf( "USE %s;", trim( $_REQUEST['wfDatabase']) );
示例6: render
/**
* Function render
*
* @author David S. Callizaya S. <davidsantos@colosa.com>
* @access public
* @param string value
* @return string
*/
public function render($value = null, $owner = null, $rowId = null, $row = -1, $therow = -1)
{
$permission = false;
$url = null;
switch ($owner->type) {
case "xmlform":
$pmtype = $this->NSFieldType();
break;
case "grid":
$pmtype = $this->NSGridType();
break;
}
if (isset($_SESSION["APPLICATION"]) && isset($_SESSION["USER_LOGGED"]) && isset($_SESSION["TASK"]) && isset($this->input) && $this->input != null && $this->mode == "view") {
require_once "classes/model/AppDocument.php";
G::LoadClass("case");
$case = new Cases();
$arrayField = $case->loadCase($_SESSION["APPLICATION"]);
$arrayPermission = $case->getAllObjects($arrayField["PRO_UID"], $_SESSION["APPLICATION"], $_SESSION["TASK"], $_SESSION["USER_LOGGED"]);
$criteria = new Criteria();
$criteria->add(AppDocumentPeer::APP_DOC_UID, $arrayPermission["INPUT_DOCUMENTS"], Criteria::IN);
switch ($owner->type) {
case "xmlform":
break;
case "grid":
$criteria->add(AppDocumentPeer::APP_DOC_FIELDNAME, $owner->name . "_" . $row . "_" . $this->name);
break;
}
$criteria->addDescendingOrderByColumn(AppDocumentPeer::APP_DOC_CREATE_DATE);
$rsCriteria = AppDocumentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$sw = 0;
while ($rsCriteria->next() && $sw == 0) {
$row = $rsCriteria->getRow();
if ($row["DOC_UID"] == $this->input) {
$permission = true;
$url = (G::is_https() ? "https://" : "http://") . $_SERVER["HTTP_HOST"] . dirname($_SERVER["REQUEST_URI"]) . "/cases_ShowDocument?a=" . $row["APP_DOC_UID"] . "&v=" . $row["DOC_VERSION"];
$sw = 1;
}
}
}
$html1 = null;
$html2 = null;
$mode = $this->mode == "view" ? " disabled=\"disabled\"" : null;
$styleDisplay = null;
if ($this->mode == "view") {
if ($permission) {
$html1 = "<a href=\"" . $url . "\"" . ($owner->type == "grid" ? " class=\"tableOption\" style=\"color: #006699; text-decoration: none; font-weight: normal;\"" : null) . ">";
$html2 = "</a>";
}
$html1 = $html1 . $value;
$styleDisplay = "display: none;";
}
$html = $html1 . "<input type=\"file\" " . $pmtype . " id=\"form" . $rowId . "[" . $this->name . "]\" name=\"form" . $rowId . "[" . $this->name . "]\" value=\"" . $value . "\" class=\"module_app_input___gray_file\" style=\"" . $styleDisplay . "\"" . $mode . " " . $this->NSRequiredValue() . " />" . $html2;
if (isset($this->input) && $this->input != null) {
require_once "classes/model/InputDocument.php";
try {
$indoc = new InputDocument();
$aDoc = $indoc->load($this->input);
$aDoc["INP_DOC_TITLE"] = isset($aDoc["INP_DOC_TITLE"]) ? $aDoc["INP_DOC_TITLE"] : null;
$html = $html . "<label><img src=\"/images/inputdocument.gif\" width=\"22px\" width=\"22px\" alt=\"\" /><font size=\"1\">(" . trim($aDoc["INP_DOC_TITLE"]) . ")</font></label>";
} catch (Exception $e) {
//Then the input document doesn"t exits, id referencial broken
$html = $html . " <font color=\"red\"><img src=\"/images/alert_icon.gif\" width=\"16px\" width=\"16px\" alt=\"\" /><font size=\"1\">(" . G::loadTranslation("ID_INPUT_DOC_DOESNT_EXIST") . ")</font></font>";
}
}
$html = $html . $this->renderHint();
return $html;
}
示例7: make_site
//.........这里部分代码省略.........
$this->log("Import database schema:\n");
$myPortA = explode(":", $this->options['database']['hostname']);
if (count($myPortA) < 2) {
$myPortA[1] = "3306";
}
$myPort = $myPortA[1];
$this->options['database']['hostname'] = $myPortA[0];
mysql_select_db($wf, $this->connection_database);
$pws = PATH_WORKFLOW_MYSQL_DATA . $schema;
$qws = $this->query_sql_file(PATH_WORKFLOW_MYSQL_DATA . $schema, $this->connection_database);
$this->log($qws, isset($qws['errors']));
$qwv = $this->query_sql_file(PATH_WORKFLOW_MYSQL_DATA . $values, $this->connection_database);
$this->log($qwv, isset($qwv['errors']));
$http = (G::is_https() == true) ? 'https' : 'http';
$lang = defined( 'SYS_LANG' ) ? SYS_LANG : 'en';
$host = $_SERVER['SERVER_NAME'] . ($_SERVER['SERVER_PORT'] != '80' ? ':' . $_SERVER['SERVER_PORT'] : '');
$workspace = $this->options['name'];
$endpoint = sprintf(
'%s://%s/sys%s/%s/%s/oauth2/grant',
$http,
$host,
$workspace,
$lang,
SYS_SKIN
);
// inserting the outh_client
$query = ( "INSERT INTO OAUTH_CLIENTS (CLIENT_ID,CLIENT_SECRET,CLIENT_NAME,CLIENT_DESCRIPTION,CLIENT_WEBSITE,REDIRECT_URI,USR_UID ) VALUES
('x-pm-local-client','179ad45c6ce2cb97cf1029e212046e81','PM Web Designer','ProcessMaker Web Designer App','www.processmaker.com','" . $endpoint . "','00000000000000000000000000000001' )");
示例8: listNewWebEntry
public function listNewWebEntry($sProcessUID, $sEventUID)
{
try {
global $G_PUBLISH;
global $G_FORM;
$G_PUBLISH = new Publisher();
require_once 'classes/model/Event.php';
$oEvent = new Event();
$arlink = '';
$oEvent = EventPeer::retrieveByPK($sEventUID);
if (!is_null($oEvent)) {
$oData = $oEvent->load($sEventUID);
$dynTitle = '';
$dynUid = '';
$task_name = '';
$usr_uid_evn = $oEvent->getEvnConditions();
if ($oData['EVN_ACTION'] != '' && $oData['EVN_ACTION'] != 'WEB_ENTRY') {
require_once 'classes/model/Content.php';
require_once 'classes/model/Task.php';
require_once 'classes/model/Dynaform.php';
$oContent = new Content();
$dynTitle = $oContent->load('DYN_TITLE', '', $oData['EVN_ACTION'], 'en');
$task_uid = $oEvent->getEvnTasUidTo();
$dyn = new Dynaform();
$dyn->load($oData['EVN_ACTION']);
$dynUid = $dyn->getDynUid();
$task = new Task();
$task->load($task_uid);
$task_name = $task->getTasTitle();
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$link = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/' . $sProcessUID . '/';
$row = array();
$c = 0;
/*
$oTask = new Task ( );
$TaskFields = $oTask->kgetassigType ( $sProcessUID , $tas='');
*/
$TaskFields['TAS_ASSIGN_TYPE'] = '';
//$row [] = array ('W_TITLE' => '', 'W_DELETE' => '', 'TAS_ASSIGN_TYPE' => $TaskFields ['TAS_ASSIGN_TYPE'] );
if (is_dir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID)) {
$dir = opendir(PATH_DATA . "sites" . PATH_SEP . SYS_SYS . PATH_SEP . "public" . PATH_SEP . $sProcessUID);
$dynTitle = str_replace(' ', '_', str_replace('/', '_', $dynTitle));
$arlink = $link . $dynTitle . '.php';
//$arlink = "<a href='" . $alink . "' target='blank'><font color='#9999CC'>" . $alink . "</font></a>";
}
}
}
$row = array('W_LINK' => $arlink, 'DYN_TITLE' => $dynTitle, 'TAS_TITLE' => $task_name, 'USR_UID' => $usr_uid_evn, 'DYN_UID' => $dynUid);
// $oJSON = new Services_JSON ( );
// $tmpData = $oJSON->encode( $row ) ;
// $tmpData = str_replace("\\/","/",'{success:true,data:'.$tmpData.'}'); // unescape the slashes
// $result = $tmpData;
$result = array();
$result['success'] = true;
$result['data'] = $row;
return $result;
} catch (Exception $oError) {
throw $oError;
}
}
示例9: save
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', 'md5:' . md5($sWS_PASS));
$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 . 'test' . PATH_SEP . 'unit' . PATH_SEP . 'ws' . 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);
//.........这里部分代码省略.........
示例10: getWebEntryDataFromRecord
/**
* Get data of a Web Entry from a record
*
* @param array $record Record
*
* return array Return an array with data Web Entry
*/
public function getWebEntryDataFromRecord(array $record)
{
try {
if ($record["WE_METHOD"] == "WS") {
$http = \G::is_https() ? "https://" : "http://";
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $record["PRO_UID"];
$record["WE_DATA"] = $url . "/" . $record["WE_DATA"];
}
$conf = new \Configurations();
$confEnvSetting = $conf->getFormats();
$dateTime = new \DateTime($record["WE_CREATE_DATE"]);
$webEntryCreateDate = $dateTime->format($confEnvSetting["dateFormat"]);
$webEntryUpdateDate = "";
if (!empty($record["WE_UPDATE_DATE"])) {
$dateTime = new \DateTime($record["WE_UPDATE_DATE"]);
$webEntryUpdateDate = $dateTime->format($confEnvSetting["dateFormat"]);
}
return array($this->getFieldNameByFormatFieldName("WE_UID") => $record["WE_UID"], $this->getFieldNameByFormatFieldName("TAS_UID") => $record["TAS_UID"], $this->getFieldNameByFormatFieldName("DYN_UID") => $record["DYN_UID"], $this->getFieldNameByFormatFieldName("USR_UID") => $record["USR_UID"] . "", $this->getFieldNameByFormatFieldName("WE_TITLE") => $record["WE_TITLE"] . "", $this->getFieldNameByFormatFieldName("WE_DESCRIPTION") => $record["WE_DESCRIPTION"] . "", $this->getFieldNameByFormatFieldName("WE_METHOD") => $record["WE_METHOD"], $this->getFieldNameByFormatFieldName("WE_INPUT_DOCUMENT_ACCESS") => (int) $record["WE_INPUT_DOCUMENT_ACCESS"], $this->getFieldNameByFormatFieldName("WE_DATA") => $record["WE_DATA"], $this->getFieldNameByFormatFieldName("WE_CREATE_USR_UID") => $record["WE_CREATE_USR_UID"], $this->getFieldNameByFormatFieldName("WE_UPDATE_USR_UID") => $record["WE_UPDATE_USR_UID"] . "", $this->getFieldNameByFormatFieldName("WE_CREATE_DATE") => $webEntryCreateDate, $this->getFieldNameByFormatFieldName("WE_UPDATE_DATE") => $webEntryUpdateDate);
} catch (\Exception $e) {
throw $e;
}
}
示例11: checkCredentials
function checkCredentials($params)
{
require_once 'classes/model/Event.php';
require_once 'classes/model/Users.php';
require_once 'classes/model/TaskUser.php';
require_once 'classes/model/GroupUser.php';
$sPRO_UID = $params->PRO_UID;
$sEVN_UID = $params->EVN_UID;
$sWS_USER = trim($params->WS_USER);
$sWS_PASS = trim($params->WS_PASS);
if (G::is_https()) {
$http = 'https://';
} else {
$http = 'http://';
}
$endpoint = $http . $_SERVER['HTTP_HOST'] . '/sys' . SYS_SYS . '/' . SYS_LANG . '/' . SYS_SKIN . '/services/wsdl2';
@($client = new SoapClient($endpoint));
$user = $sWS_USER;
$pass = $sWS_PASS;
$parameters = array('userid' => $user, 'password' => $pass);
$result = $client->__SoapCall('login', array($parameters));
$fields['status_code'] = $result->status_code;
$fields['message'] = 'ProcessMaker WebService version: ' . $result->version . "\n" . $result->message;
$fields['version'] = $result->version;
$fields['time_stamp'] = $result->timestamp;
$messageCode = true;
$message = $result->message;
G::LoadClass('Task');
//G::LoadClass ( 'Event' );
G::LoadClass('User');
G::LoadClass('TaskUser');
G::LoadClass('Groupwf');
$event = new Event();
$event->load($sEVN_UID);
$sTASKS = $event->getEvnTasUidTo();
$task = new Task();
$task->load($sTASKS);
$sTASKS_SEL = $task->getTasTitle();
if (!class_exists('GroupUser')) {
G::LoadClass('GroupUser');
}
// if the user has been authenticated, then check if has the rights or
// permissions to create the webentry
if ($result->status_code == 0) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addSelectColumn(TaskUserPeer::USR_UID);
$oCriteria->addSelectColumn(TaskUserPeer::TAS_UID);
$oCriteria->addJoin(TaskUserPeer::USR_UID, UsersPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(TaskUserPeer::TAS_UID, $sTASKS);
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
//$oCriteria->add(TaskUserPeer::TU_RELATION,1);
$userIsAssigned = TaskUserPeer::doCount($oCriteria);
// if the user is not assigned directly, maybe a have the task a group with the user
if ($userIsAssigned < 1) {
$oCriteria = new Criteria('workflow');
$oCriteria->addSelectColumn(UsersPeer::USR_UID);
$oCriteria->addJoin(UsersPeer::USR_UID, GroupUserPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->addJoin(GroupUserPeer::GRP_UID, TaskUserPeer::USR_UID, Criteria::LEFT_JOIN);
$oCriteria->add(TaskUserPeer::TAS_UID, $sTASKS);
$oCriteria->add(UsersPeer::USR_USERNAME, $sWS_USER);
$userIsAssigned = GroupUserPeer::doCount($oCriteria);
if (!($userIsAssigned >= 1)) {
$messageCode = false;
$message = "The User \"" . $sWS_USER . "\" doesn't have the task \"" . $sTASKS_SEL . "\" assigned.";
}
}
} else {
$messageCode = false;
}
$this->success = $messageCode;
$this->msg = $message;
}
示例12: getWebEntryEventDataFromRecord
/**
* Get data of a WebEntry-Event from a record
*
* @param array $record Record
*
* return array Return an array with data WebEntry-Event
*/
public function getWebEntryEventDataFromRecord(array $record)
{
try {
if ($record["WEE_WE_UID"] . "" != "") {
$http = \G::is_https() ? "https://" : "http://";
$url = $http . $_SERVER["HTTP_HOST"] . "/sys" . SYS_SYS . "/" . SYS_LANG . "/" . SYS_SKIN . "/" . $record["PRJ_UID"];
$record["WEE_WE_URL"] = $url . "/" . $record["WEE_WE_URL"];
}
return array($this->getFieldNameByFormatFieldName("WEE_UID") => $record["WEE_UID"], $this->getFieldNameByFormatFieldName("EVN_UID") => $record["EVN_UID"], $this->getFieldNameByFormatFieldName("ACT_UID") => $record["ACT_UID"], $this->getFieldNameByFormatFieldName("DYN_UID") => $record["DYN_UID"], $this->getFieldNameByFormatFieldName("USR_UID") => $record["USR_UID"], $this->getFieldNameByFormatFieldName("WEE_TITLE") => $record["WEE_TITLE"], $this->getFieldNameByFormatFieldName("WEE_DESCRIPTION") => $record["WEE_DESCRIPTION"] . "", $this->getFieldNameByFormatFieldName("WEE_URL") => $record["WEE_WE_URL"] . "", $this->getFieldNameByFormatFieldName("WEE_STATUS") => $record["WEE_STATUS"]);
} catch (\Exception $e) {
throw $e;
}
}
示例13: 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;
}
}