本文整理汇总了PHP中Configuration::create方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::create方法的具体用法?PHP Configuration::create怎么用?PHP Configuration::create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($applicationPath = null)
{
if (is_null($applicationPath)) {
$applicationPath = realpath($_SERVER["DOCUMENT_ROOT"] . '/../app');
}
$this->applicationPath = $applicationPath;
$this->configuration = Configuration::create($this->applicationPath);
}
示例2: CreateConfiguration
function CreateConfiguration($data, $fields)
{
try {
$Configuration = new Configuration();
$result = $Configuration->create($fields);
$this->domain->addDomainValue('CREATED_UID', $Configuration->getCfgUid());
$this->domain->addDomainValue('CREATED_OBJ', $Configuration->getObjUid());
$this->domain->addDomainValue('CREATED_PRO', $Configuration->getProUid());
$this->domain->addDomainValue('CREATED_USR', $Configuration->getUsrUid());
return $result;
} catch (Exception $e) {
return array('Exception!! ' => $e->getMessage());
}
}
示例3: sendNoteNotification
public function sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom = "")
{
try {
require_once 'classes/model/Configuration.php';
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
if (ConfigurationPeer::doCount($oCriteria) == 0) {
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
$aConfiguration = array();
} else {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
$passwd = $aConfiguration['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
$passwd = $auxPass[1];
} else {
array_shift($auxPass);
$passwd = implode('', $auxPass);
}
}
$aConfiguration['MESS_PASSWORD'] = $passwd;
} else {
$aConfiguration = array();
}
}
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
return false;
}
$oUser = new Users();
$aUser = $oUser->load($usrUid);
$authorName = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
G::LoadClass('case');
$oCase = new Cases();
$aFields = $oCase->loadCase($appUid);
$configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
$configNoteNotification['body'] = G::LoadTranslation('ID_CASE') . ": @#APP_TITLE<br />" . G::LoadTranslation('ID_AUTHOR') . ": {$authorName}<br /><br />{$noteContent}";
/*
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
*/
if (isset($aConfiguration['MESS_FROM_NAME']) && $aConfiguration['MESS_FROM_NAME'] != '') {
$sFrom = $aConfiguration['MESS_FROM_NAME'];
}
$hasEmailFrom = preg_match('/(.+)@(.+)\\.(.+)/', $sFrom, $match);
if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
} else {
if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
} else {
if ($aConfiguration['MESS_SERVER'] != '') {
if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
$sFrom .= ' <info@' . $sAux . '>';
} else {
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
}
} else {
$sFrom .= ' <info@processmaker.com>';
}
}
}
}
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
$sBody = nl2br(G::replaceDataField($configNoteNotification['body'], $aFields));
G::LoadClass('spool');
$oUser = new Users();
$recipientsArray = explode(",", $noteRecipients);
foreach ($recipientsArray as $recipientUid) {
$aUser = $oUser->load($recipientUid);
$sTo = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
$oSpool = new spoolRun();
if ($aConfiguration['MESS_RAUTH'] == false || is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false') {
$aConfiguration['MESS_RAUTH'] = 0;
} else {
$aConfiguration['MESS_RAUTH'] = 1;
}
$oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], 'MESS_PORT' => $aConfiguration['MESS_PORT'], 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'], 'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false, 'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''));
$oSpool->create(array('msg_uid' => '', 'app_uid' => $appUid, 'del_index' => 0, 'app_msg_type' => 'DERIVATION', 'app_msg_subject' => $sSubject, 'app_msg_from' => $sFrom, 'app_msg_to' => $sTo, 'app_msg_body' => $sBody, 'app_msg_cc' => '', 'app_msg_bcc' => '', 'app_msg_attach' => '', 'app_msg_template' => '', 'app_msg_status' => 'pending'));
if ($aConfiguration['MESS_BACKGROUND'] == '' || $aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1') {
$oSpool->sendMail();
}
}
//Send derivation notification - End
} catch (Exception $oException) {
throw $oException;
}
}
示例4: unserialize
$criteria->add(ConfigurationPeer::CFG_UID, "EE");
$criteria->add(ConfigurationPeer::OBJ_UID, $confEeUid);
$rsCriteria = ConfigurationPeer::doSelectRS($criteria);
if ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$data = unserialize($row[0]);
$data["internetConnection"] = $swInternetConnection;
//Update values
$criteria1 = new Criteria("workflow");
$criteria1->add(ConfigurationPeer::CFG_UID, "EE");
$criteria1->add(ConfigurationPeer::OBJ_UID, $confEeUid);
//Update set
$criteria2 = new Criteria("workflow");
$criteria2->add(ConfigurationPeer::CFG_VALUE, serialize($data));
BasePeer::doUpdate($criteria1, $criteria2, Propel::getConnection("workflow"));
} else {
$conf = new Configuration();
$data = array("internetConnection" => $swInternetConnection);
$conf->create(array("CFG_UID" => "EE", "OBJ_UID" => $confEeUid, "CFG_VALUE" => serialize($data), "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
}
$response["status"] = "OK";
} catch (Exception $e) {
$response["message"] = $e->getMessage();
$status = 0;
}
if ($status == 0) {
$response["status"] = "ERROR";
}
break;
}
echo G::json_encode($response);
示例5: listFirstExecution
/**
* This function checks if List tables are going to migrated
*
* return boolean value
*/
public function listFirstExecution ($action){
$this->initPropel(true);
switch ($action) {
case 'insert':
$conf = new Configuration();
if (!($conf->exists('MIGRATED_LIST', 'list', 'list', 'list', 'list'))) {
$data["CFG_UID"] ='MIGRATED_LIST';
$data["OBJ_UID"] ='list';
$data["CFG_VALUE"]='true';
$data["PRO_UID"] ='list';
$data["USR_UID"] ='list';
$data["APP_UID"] ='list';
$conf->create($data);
}
return true;
break;
case 'check':
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ConfigurationPeer::CFG_UID);
$criteria->add(ConfigurationPeer::CFG_UID, "MIGRATED_LIST", CRITERIA::EQUAL);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$aRows = array ();
while ($rsCriteria->next()) {
$aRows[] = $rsCriteria->getRow();
}
if(empty($aRows)){
return false; //If is false continue with the migrated
} else {
return true; //Stop
}
break;
default:
return true;
}
}
示例6: sendNotifications
public function sendNotifications($sCurrentTask, $aTasks, $aFields, $sApplicationUID, $iDelegation, $sFrom = "")
{
try {
$applicationData = $this->loadCase($sApplicationUID);
$aFields["APP_NUMBER"] = $applicationData["APP_NUMBER"];
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
if (ConfigurationPeer::doCount($oCriteria) == 0) {
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
$aConfiguration = array();
} else {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration["CFG_VALUE"]);
$passwd = $aConfiguration["MESS_PASSWORD"];
$passwdDec = G::decrypt($passwd, "EMAILENCRYPT");
$auxPass = explode('hash:', $passwdDec);
if (count($auxPass) > 1) {
if (count($auxPass) == 2) {
$passwd = $auxPass[1];
} else {
array_shift($auxPass);
$passwd = implode('', $auxPass);
}
}
$aConfiguration["MESS_PASSWORD"] = $passwd;
} else {
$aConfiguration = array();
}
}
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
return false;
}
//Send derivation notification - Start
$oTask = new Task();
$aTaskInfo = $oTask->load($sCurrentTask);
if ($aTaskInfo['TAS_SEND_LAST_EMAIL'] != 'TRUE') {
return false;
}
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
$hasEmailFrom = preg_match('/(.+)@(.+)\\.(.+)/', $sFrom, $match);
if (!$hasEmailFrom || strpos($sFrom, $aConfiguration['MESS_ACCOUNT']) === false) {
if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
} else {
if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
} else {
if ($aConfiguration['MESS_SERVER'] != '') {
if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
$sFrom .= ' <info@' . $sAux . '>';
} else {
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
}
} else {
$sFrom .= ' <info@processmaker.com>';
}
}
}
}
if (isset($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE']) && $aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'] != '') {
$sSubject = G::replaceDataField($aTaskInfo['TAS_DEF_SUBJECT_MESSAGE'], $aFields);
} else {
$sSubject = G::LoadTranslation('ID_MESSAGE_SUBJECT_DERIVATION');
}
//erik: new behaviour for messages
G::loadClass('configuration');
$oConf = new Configurations();
$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
$conf = $oConf->aConfig;
$pathEmail = PATH_DATA_SITE . "mailTemplates" . PATH_SEP . $aTaskInfo["PRO_UID"] . PATH_SEP;
$swtplDefault = 0;
$sBody = null;
if (isset($conf["TAS_DEF_MESSAGE_TYPE"]) && isset($conf["TAS_DEF_MESSAGE_TEMPLATE"]) && $conf["TAS_DEF_MESSAGE_TYPE"] == "template" && $conf["TAS_DEF_MESSAGE_TEMPLATE"] != "") {
if ($conf["TAS_DEF_MESSAGE_TEMPLATE"] == "alert_message.html") {
$swtplDefault = 1;
}
$fileTemplate = $pathEmail . $conf["TAS_DEF_MESSAGE_TEMPLATE"];
if (!file_exists($fileTemplate)) {
throw new Exception("Template file \"{$fileTemplate}\" does not exist.");
}
$sBody = G::replaceDataGridField(file_get_contents($fileTemplate), $aFields);
} else {
$sBody = nl2br(G::replaceDataGridField($aTaskInfo["TAS_DEF_MESSAGE"], $aFields));
}
G::LoadClass("tasks");
G::LoadClass("groups");
G::LoadClass("spool");
$task = new Tasks();
$group = new Groups();
$oUser = new Users();
foreach ($aTasks as $aTask) {
//.........这里部分代码省略.........
示例7: sendNoteNotification
public function sendNoteNotification($appUid, $usrUid, $noteContent, $noteRecipients, $sFrom = "")
{
try {
require_once 'classes/model/Configuration.php';
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
if (ConfigurationPeer::doCount($oCriteria) == 0) {
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
$aConfiguration = array();
} else {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
$passwd = $aConfiguration['MESS_PASSWORD'];
$passwdDec = G::decrypt($passwd, 'EMAILENCRYPT');
if (strpos($passwdDec, 'hash:') !== false) {
list($hash, $pass) = explode(":", $passwdDec);
$aConfiguration['MESS_PASSWORD'] = $pass;
}
} else {
$aConfiguration = array();
}
}
if (!isset($aConfiguration['MESS_ENABLED']) || $aConfiguration['MESS_ENABLED'] != '1') {
return false;
}
$oUser = new Users();
$aUser = $oUser->load($usrUid);
$authorName = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
G::LoadClass('case');
$oCase = new Cases();
$aFields = $oCase->loadCase($appUid);
$configNoteNotification['subject'] = G::LoadTranslation('ID_MESSAGE_SUBJECT_NOTE_NOTIFICATION') . " @#APP_TITLE ";
$configNoteNotification['body'] = G::LoadTranslation('ID_CASE') . ": @#APP_TITLE<br />" . G::LoadTranslation('ID_AUTHOR') . ": {$authorName}<br /><br />{$noteContent}";
if ($sFrom == '') {
$sFrom = '"ProcessMaker"';
}
if ($aConfiguration['MESS_ENGINE'] != 'MAIL' && $aConfiguration['MESS_ACCOUNT'] != '') {
$sFrom .= ' <' . $aConfiguration['MESS_ACCOUNT'] . '>';
} else {
if ($aConfiguration['MESS_ENGINE'] == 'MAIL') {
$sFrom .= ' <info@' . gethostbyaddr('127.0.0.1') . '>';
} else {
if ($aConfiguration['MESS_SERVER'] != '') {
if ($sAux = @gethostbyaddr($aConfiguration['MESS_SERVER'])) {
$sFrom .= ' <info@' . $sAux . '>';
} else {
$sFrom .= ' <info@' . $aConfiguration['MESS_SERVER'] . '>';
}
} else {
$sFrom .= ' <info@processmaker.com>';
}
}
}
$sSubject = G::replaceDataField($configNoteNotification['subject'], $aFields);
//erik: new behaviour for messages
//G::loadClass('configuration');
//$oConf = new Configurations;
//$oConf->loadConfig($x, 'TAS_EXTRA_PROPERTIES', $aTaskInfo['TAS_UID'], '', '');
//$conf = $oConf->aConfig;
/*
if( isset($conf['TAS_DEF_MESSAGE_TYPE']) && isset($conf['TAS_DEF_MESSAGE_TEMPLATE'])
&& $conf['TAS_DEF_MESSAGE_TYPE'] == 'template' && $conf['TAS_DEF_MESSAGE_TEMPLATE'] != '') {
$pathEmail = PATH_DATA_SITE . 'mailTemplates' . PATH_SEP . $aTaskInfo['PRO_UID'] . PATH_SEP;
$fileTemplate = $pathEmail . $conf['TAS_DEF_MESSAGE_TEMPLATE'];
if ( ! file_exists ( $fileTemplate ) ) {
throw new Exception("Template file '$fileTemplate' does not exist.");
}
$sBody = G::replaceDataField(file_get_contents($fileTemplate), $aFields);
} else {*/
$sBody = nl2br(G::replaceDataField($configNoteNotification['body'], $aFields));
/*}*/
G::LoadClass('spool');
$oUser = new Users();
$recipientsArray = explode(",", $noteRecipients);
foreach ($recipientsArray as $recipientUid) {
$aUser = $oUser->load($recipientUid);
$sTo = ($aUser['USR_FIRSTNAME'] != '' || $aUser['USR_LASTNAME'] != '' ? $aUser['USR_FIRSTNAME'] . ' ' . $aUser['USR_LASTNAME'] . ' ' : '') . '<' . $aUser['USR_EMAIL'] . '>';
$oSpool = new spoolRun();
$oSpool->setConfig(array('MESS_ENGINE' => $aConfiguration['MESS_ENGINE'], 'MESS_SERVER' => $aConfiguration['MESS_SERVER'], 'MESS_PORT' => $aConfiguration['MESS_PORT'], 'MESS_ACCOUNT' => $aConfiguration['MESS_ACCOUNT'], 'MESS_PASSWORD' => $aConfiguration['MESS_PASSWORD'], 'SMTPAuth' => $aConfiguration['MESS_RAUTH'] == '1' ? true : false, 'SMTPSecure' => isset($aConfiguration['SMTPSecure']) ? $aConfiguration['SMTPSecure'] : ''));
$oSpool->create(array('msg_uid' => '', 'app_uid' => $appUid, 'del_index' => 1, 'app_msg_type' => 'DERIVATION', 'app_msg_subject' => $sSubject, 'app_msg_from' => $sFrom, 'app_msg_to' => $sTo, 'app_msg_body' => $sBody, 'app_msg_cc' => '', 'app_msg_bcc' => '', 'app_msg_attach' => '', 'app_msg_template' => '', 'app_msg_status' => 'pending'));
if ($aConfiguration['MESS_BACKGROUND'] == '' || $aConfiguration['MESS_TRY_SEND_INMEDIATLY'] == '1') {
$oSpool->sendMail();
}
}
//Send derivation notification - End
} catch (Exception $oException) {
throw $oException;
}
}
示例8: createTaskExtraPropertiesRows
/**
* The current method is for filter every row that exist in
* the Configuration table
*
* @param array $aTaskExtraProperties
* @return void
*/
public function createTaskExtraPropertiesRows ($aTaskExtraProperties)
{
if (count($aTaskExtraProperties) > 0) {
foreach ($aTaskExtraProperties as $key => $row) {
$oConfig = new Configuration();
if ($oConfig->exists( $row['CFG_UID'], $row['OBJ_UID'], $row['PRO_UID'], $row['USR_UID'], $row['APP_UID']) ) {
$oConfig->remove( $row['CFG_UID'], $row['OBJ_UID'], $row['PRO_UID'], $row['USR_UID'], $row['APP_UID'] );
$oConfig->setDeleted(false);
}
$res = $oConfig->create( $row );
$oConfig->setNew(true);
if (method_exists($oConfig, "setProperties")) {
$oConfig->setProperties();
}
}
}
return;
}
示例9: Cases
case 'resendMessage':
//require_once 'classes/model/Configuration.php';
G::LoadClass('spool');
$oCase = new Cases();
$data = $oCase->getHistoryMessagesTrackerView($_POST['APP_UID'], $_POST['APP_MSG_UID']);
//print_r($data);
$oConfiguration = new Configuration();
$sDelimiter = DBAdapter::getStringDelimiter();
$oCriteria = new Criteria('workflow');
$oCriteria->add(ConfigurationPeer::CFG_UID, 'Emails');
$oCriteria->add(ConfigurationPeer::OBJ_UID, '');
$oCriteria->add(ConfigurationPeer::PRO_UID, '');
$oCriteria->add(ConfigurationPeer::USR_UID, '');
$oCriteria->add(ConfigurationPeer::APP_UID, '');
if (ConfigurationPeer::doCount($oCriteria) == 0) {
$oConfiguration->create(array('CFG_UID' => 'Emails', 'OBJ_UID' => '', 'CFG_VALUE' => '', 'PRO_UID' => '', 'USR_UID' => '', 'APP_UID' => ''));
$aConfiguration = array();
} else {
$aConfiguration = $oConfiguration->load('Emails', '', '', '', '');
if ($aConfiguration['CFG_VALUE'] != '') {
$aConfiguration = unserialize($aConfiguration['CFG_VALUE']);
} else {
$aConfiguration = array();
}
}
$oSpool = new spoolRun();
if ($aConfiguration['MESS_RAUTH'] == false || is_string($aConfiguration['MESS_RAUTH']) && $aConfiguration['MESS_RAUTH'] == 'false') {
$aConfiguration['MESS_RAUTH'] = 0;
} else {
$aConfiguration['MESS_RAUTH'] = 1;
}
示例10: processFilesUpgrade
/**
* Process-Files upgrade
*
* @param string $projectUid Unique id of Project
*
* return void
*/
public function processFilesUpgrade($projectUid = "")
{
try {
//Set variables
$conf = new \Configuration();
//Create/Get PROCESS_FILES_CHECKED
$arrayProjectUid = array();
$configuration = \ConfigurationPeer::retrieveByPK("PROCESS_FILES_CHECKED", "", "", "", "");
if (is_null($configuration)) {
$result = $conf->create(array(
"CFG_UID" => "PROCESS_FILES_CHECKED",
"OBJ_UID" => "",
"CFG_VALUE" => serialize($arrayProjectUid),
"PRO_UID" => "",
"USR_UID" => "",
"APP_UID" => ""
));
} else {
$arrayProjectUid = unserialize($configuration->getCfgValue());
}
//Set variables
$arrayPath = array("templates" => PATH_DATA_MAILTEMPLATES, "public" => PATH_DATA_PUBLIC);
$flagProjectUid = false;
//Query
$criteria = new \Criteria("workflow");
$criteria->addSelectColumn(\BpmnProjectPeer::PRJ_UID);
if ($projectUid != "") {
$criteria->add(
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN)->addAnd(
$criteria->getNewCriterion(\BpmnProjectPeer::PRJ_UID, $projectUid, \Criteria::EQUAL))
);
} else {
$criteria->add(\BpmnProjectPeer::PRJ_UID, $arrayProjectUid, \Criteria::NOT_IN);
}
$rsCriteria = \BpmnProjectPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(\ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
foreach ($arrayPath as $key => $value) {
$path = $key;
$dir = $value . $row["PRJ_UID"];
if (is_dir($dir)) {
if ($dirh = opendir($dir)) {
while (($file = readdir($dirh)) !== false) {
if ($file != "" && $file != "." && $file != "..") {
$f = $dir . PATH_SEP . $file;
if (is_file($f)) {
$arrayProcessFilesData = $this->getFileManagerUid($f);
if (is_null($arrayProcessFilesData["PRF_UID"])) {
rename($dir . PATH_SEP . $file, $dir . PATH_SEP . $file . ".tmp");
$arrayData = array(
"prf_path" => $path,
"prf_filename" => $file,
"prf_content" => ""
);
$arrayData = $this->addProcessFilesManager($row["PRJ_UID"], "00000000000000000000000000000001", $arrayData);
rename($dir . PATH_SEP . $file . ".tmp", $dir . PATH_SEP . $file);
}
}
}
}
closedir($dirh);
}
}
}
$arrayProjectUid[$row["PRJ_UID"]] = $row["PRJ_UID"];
$flagProjectUid = true;
}
//Update PROCESS_FILES_CHECKED
if ($flagProjectUid) {
$result = $conf->update(array(
"CFG_UID" => "PROCESS_FILES_CHECKED",
"OBJ_UID" => "",
"CFG_VALUE" => serialize($arrayProjectUid),
//.........这里部分代码省略.........
示例11: switch
* GNU Affero General Public License for more details.
*
* 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.
*
*/
try {
G::LoadInclude('ajax');
if (isset($_POST['form'])) {
$_POST = $_POST['form'];
}
$_POST['function'] = get_ajax_value('function');
switch ($_POST['function']) {
case 'getStarted_save':
require_once 'classes/model/Configuration.php';
$aData['CFG_UID'] = 'getStarted';
$aData['OBJ_UID'] = '';
$aData['CFG_VALUE'] = '1';
$aData['PRO_UID'] = '';
$aData['USR_UID'] = '';
$aData['APP_UID'] = '';
$oConfig = new Configuration();
$oConfig->create($aData);
break;
}
} catch (Exception $oException) {
die($oException->getMessage());
}
示例12: update
public function update($fields)
{
require_once "classes/model/AppCacheView.php";
require_once "classes/model/Configuration.php";
$con = Propel::getConnection(TaskPeer::DATABASE_NAME);
try {
$con->begin();
$this->load($fields["TAS_UID"]);
$this->fromArray($fields, BasePeer::TYPE_FIELDNAME);
if ($this->validate()) {
$taskDefTitlePrevious = null;
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ContentPeer::CON_VALUE);
$criteria->add(ContentPeer::CON_CATEGORY, "TAS_DEF_TITLE");
$criteria->add(ContentPeer::CON_ID, $fields["TAS_UID"]);
$criteria->add(ContentPeer::CON_LANG, SYS_LANG);
$rsCriteria = ContentPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
while ($rsCriteria->next()) {
$row = $rsCriteria->getRow();
$taskDefTitlePrevious = $row["CON_VALUE"];
}
$contentResult = 0;
if (array_key_exists("TAS_TITLE", $fields)) {
$contentResult += $this->setTasTitle($fields["TAS_TITLE"]);
}
if (array_key_exists("TAS_DESCRIPTION", $fields)) {
$contentResult += $this->setTasDescription($fields["TAS_DESCRIPTION"]);
}
if (array_key_exists("TAS_DEF_TITLE", $fields)) {
$contentResult += $this->setTasDefTitle($fields["TAS_DEF_TITLE"]);
}
if (array_key_exists("TAS_DEF_DESCRIPTION", $fields)) {
$contentResult += $this->setTasDefDescription($fields["TAS_DEF_DESCRIPTION"]);
}
if (array_key_exists("TAS_DEF_PROC_CODE", $fields)) {
$contentResult += $this->setTasDefProcCode($fields["TAS_DEF_PROC_CODE"]);
}
if (array_key_exists("TAS_DEF_MESSAGE", $fields)) {
$contentResult += $this->setTasDefMessage(trim($fields["TAS_DEF_MESSAGE"]));
}
if (array_key_exists("TAS_DEF_SUBJECT_MESSAGE", $fields)) {
$contentResult += $this->setTasDefSubjectMessage(trim($fields["TAS_DEF_SUBJECT_MESSAGE"]));
}
if (array_key_exists("TAS_CALENDAR", $fields)) {
$contentResult += $this->setTasCalendar($fields['TAS_UID'], $fields["TAS_CALENDAR"]);
}
$result = $this->save();
$result = $result == 0 ? $contentResult > 0 ? 1 : 0 : $result;
$con->commit();
if ($result == 1 && array_key_exists("TAS_DEF_TITLE", $fields) && $fields["TAS_DEF_TITLE"] != $taskDefTitlePrevious) {
$criteria = new Criteria("workflow");
$criteria->addAsColumn("APPCV_NUM_ROWS", "COUNT(DISTINCT " . AppCacheViewPeer::APP_UID . ")");
$criteria->add(AppCacheViewPeer::DEL_THREAD_STATUS, "OPEN");
$criteria->add(AppCacheViewPeer::TAS_UID, $fields["TAS_UID"]);
$rsCriteria = AppCacheViewPeer::doSelectRS($criteria);
$rsCriteria->setFetchmode(ResultSet::FETCHMODE_ASSOC);
$rsCriteria->next();
$row = $rsCriteria->getRow();
$appcvNumRows = intval($row["APPCV_NUM_ROWS"]);
if ($appcvNumRows <= 1000) {
$appcv = new AppCacheView();
$appcv->appTitleByTaskCaseLabelUpdate($fields["TAS_UID"], SYS_LANG);
$result = 2;
} else {
//Delete record
$criteria = new Criteria("workflow");
$criteria->add(ConfigurationPeer::CFG_UID, "TAS_APP_TITLE_UPDATE");
$criteria->add(ConfigurationPeer::OBJ_UID, $fields["TAS_UID"]);
$criteria->add(ConfigurationPeer::CFG_VALUE, SYS_LANG);
$numRowDeleted = ConfigurationPeer::doDelete($criteria);
//Insert record
$conf = new Configuration();
$conf->create(array("CFG_UID" => "TAS_APP_TITLE_UPDATE", "OBJ_UID" => $fields["TAS_UID"], "CFG_VALUE" => SYS_LANG, "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
$result = 3;
}
}
return $result;
} else {
$con->rollback();
throw new Exception("Failed Validation in class " . get_class($this) . ".");
}
} catch (Exception $e) {
$con->rollback();
throw $e;
}
}
示例13: setConfiguration
public function setConfiguration()
{
$confEeUid = "enterpriseConfiguration";
$criteria = new Criteria("workflow");
$criteria->addSelectColumn(ConfigurationPeer::CFG_VALUE);
$criteria->add(ConfigurationPeer::CFG_UID, "EE");
$criteria->add(ConfigurationPeer::OBJ_UID, $confEeUid);
$rsCriteria = ConfigurationPeer::doSelectRS($criteria);
if (!$rsCriteria->next()) {
$conf = new Configuration();
$data = array("internetConnection" => 1);
$conf->create(array("CFG_UID" => "EE", "OBJ_UID" => $confEeUid, "CFG_VALUE" => serialize($data), "PRO_UID" => "", "USR_UID" => "", "APP_UID" => ""));
}
}
示例14: unlink
if (isset($_POST['install'])) {
if (isset($_POST['password']) && trim($_POST['password']) != '' && isset($_POST['login']) && trim($_POST['login']) != '') {
//Supression de l'ancienne base si elle existe
if (file_exists(DB_NAME)) {
unlink(DB_NAME);
}
//Instanciation des managers d'entités
$user = new User();
$configuration = new Configuration();
$right = new Right();
$rank = new Rank();
$section = new Section();
$event = new Event();
$client = new Client();
//Création des tables SQL
$configuration->create();
$user->create();
$right->create();
$rank->create();
$section->create();
$event->create();
$client->create();
$configuration->put('UPDATE_URL', 'http://update.idleman.fr/yana?callback=?');
$configuration->put('DEFAULT_THEME', 'default');
$configuration->put('COOKIE_NAME', 'yana');
$configuration->put('COOKIE_LIFETIME', '7');
$configuration->put('VOCAL_ENTITY_NAME', 'YANA');
$configuration->put('PROGRAM_VERSION', '3.0.6');
$configuration->put('HOME_PAGE', 'index.php');
$configuration->put('VOCAL_SENSITIVITY', '0.0');
//Création du rang admin
示例15: Folder
$folderManager = new Folder();
$folderManager->create();
if ($folderManager->rowCount() == 0) {
//Création du dossier général
$folder = new Folder();
$folder->setName(_t('GENERAL_FOLDER'));
$folder->setParent(-1);
$folder->setIsopen(1);
$folder->save();
}
// REMET À ZÉRO LA CONFIGURATION
$configurationManager = new Configuration();
if ($configurationManager->tableExists()) {
$configurationManager->truncate();
}
$configurationManager->create();
$configurationManager->add('articleDisplayAnonymous', '0');
$configurationManager->add('articleDisplayAuthor', '1');
$configurationManager->add('articleDisplayDate', '1');
$configurationManager->add('articleDisplayFolderSort', '1');
$configurationManager->add('articleDisplayHomeSort', '1');
$configurationManager->add('articleDisplayLink', '1');
$configurationManager->add('articleDisplayMode', 'summary');
$configurationManager->add('articlePerPages', '5');
$configurationManager->add('cryptographicSalt', $cryptographicSalt);
$configurationManager->add('displayOnlyUnreadFeedFolder', 'false');
$configurationManager->add('feedMaxEvents', '50');
$configurationManager->add('language', $_POST['install_changeLngLeed']);
$configurationManager->add('optionFeedIsVerbose', 1);
$configurationManager->add('paginationScale', 5);
$configurationManager->add('syncGradCount', '10');