当前位置: 首页>>代码示例>>PHP>>正文


PHP IEM::sessionSet方法代码示例

本文整理汇总了PHP中IEM::sessionSet方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::sessionSet方法的具体用法?PHP IEM::sessionSet怎么用?PHP IEM::sessionSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEM的用法示例。


在下文中一共展示了IEM::sessionSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: FlashMessage

/**
* FlashMessage
* Save a message in the session for the next time we display the page.
* This allows us to do a redirect back to the same page we were on so we don't have issues with hitting f5 and re-saving data.
* If a url is passed in, then it will try to do a redirect to that url after saving the message in the session.
* If headers have already been sent, then a javascript redirection is done instead of a header('Location: $url') type redirect.
*
* @param String $msg The message we will store. This needs to be the whole string/description, not the language variable.
* @param Int $msg_type The type of message we're going to show. This will be one of 4 states. This is used to work out which template to show the msg in.
* @param String $url If a url is passed to FlashMessage, then immediately after storing the message in the session, we'll redirect to that location. The url you pass in will be relative to the admin/ folder.
*
* @uses SS_FLASH_MSG_SUCCESS
* @uses SS_FLASH_MSG_ERROR
* @uses SS_FLASH_MSG_WARNING
* @uses SS_FLASH_MSG_INFO
* @see GetFlashMessages
*
* @return Void Doesn't return anything, the message (and it's details) are just stored in the session.
*/
function FlashMessage($msg='', $msg_type=SS_FLASH_MSG_SUCCESS, $url=null)
{
	$flash_messages = IEM::sessionGet('FlashMessages', false);
	if (!$flash_messages) {
		$flash_messages = array();
	}
	$flash_messages[] = array('message' => $msg, 'type' => $msg_type);
	IEM::sessionSet('FlashMessages', $flash_messages);

	if ($url !== null) {

		/**
		* If the url doesn't start with http (or https), put the full url at the start of it.
		* If it does start with http (or https), don't touch it.
		*/
		if (substr($url, 0, 4) !== 'http') {
			$url = SENDSTUDIO_APPLICATION_URL . '/admin/' . $url;
		}

		if (!headers_sent()) {
			header('Location: ' . $url);
			exit;
		}
		?>
		<script>
			window.location.href = '<?php echo $url; ?>';
		</script>
		<?php
		exit;
	}
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:50,代码来源:flashmessages.php

示例2: userLogout

 /**
  * Log user out of the system
  *
  * NOTE: If the $completeLogout parameter is NOT specified, the application
  * will NOT log out ALL users. The application will use the next user ID in the stack
  * (unless the stack is empty).
  *
  * @param boolean $completeLogout Whether or not to logout all users in the stack
  * @return boolean Returns TRUE if user is loggout successfuly, FALSE otherwise
  */
 public static final function userLogout($compleLogout = false)
 {
     if (empty(self::$_userStack)) {
         return false;
     }
     if ($compleLogout) {
         self::$_userStack = array();
     } else {
         array_pop(self::$_userStack);
     }
     self::userFlushCache();
     return IEM::sessionSet('__IEM_SYSTEM_CurrentUser_Stack', self::$_userStack);
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:23,代码来源:IEM.class.php

示例3: ShowStep_2

	/**
	* ShowStep_2
	* This actually runs an upgrade step and updates the status report (from step1) using javascript.
	* If a process fails, then this step immediately takes you to step 4 which prints out the error reports.
	*
	* @return Void Prints the page out, doesn't return it.
	*/
	function ShowStep_2()
	{
		$upgrades_failed = IEM::sessionGet('DatabaseUpgradesFailed');

		require_once(SENDSTUDIO_API_DIRECTORY . '/upgrade.php');

		$upgrade_api = new Upgrade_API();

		$running_upgrade = $upgrade_api->GetNextUpgrade();

		$total_steps = IEM::sessionGet('TotalSteps');
		$step_number = IEM::sessionGet('StepNumber');

		if (!is_null($running_upgrade) && !empty($running_upgrade)) {

			$msg = sprintf(GetLang('Upgrade_Running_StepXofY'), $this->FormatNumber($step_number), $this->FormatNumber($total_steps))." ({$running_upgrade}) ";

			$percent = ceil(($step_number / $total_steps) * 100);

			echo "<script>";
			echo "self.parent.UpdateStatus('".$msg."', '".$percent."');\n";
			echo "</script>";
			flush();

			$upgrade_result = $upgrade_api->RunUpgrade($running_upgrade);

			$upgrades_done[] = $running_upgrade;
			IEM::sessionSet('DatabaseUpgradesCompleted', $upgrades_done);

			if ($upgrade_result === true || $upgrade_result === false) {
				$upgrades_todo = IEM::sessionGet('UpgradesToRun', array());
				$version = array_keys($upgrades_todo);

				do {
					if (empty($version)) {
						$upgrades_todo = array();
						break;
					}

					if (empty($upgrades_todo[$version[0]])) {
						unset($upgrades_todo[$version[0]]);
						array_shift($version);
						continue;
					}

					array_shift($upgrades_todo[$version[0]]);
					break;
				} while(true);

				IEM::sessionSet('UpgradesToRun', $upgrades_todo);
			}

			if (!$upgrade_result) {
				$upgrades_failed[] = $upgrade_api->Get('error');
				IEM::sessionSet('DatabaseUpgradesFailed', $upgrades_failed);
				echo "<script>\n";
				echo "self.parent.ProcessFailed();";
				echo "</script>";
				exit;
			}

			IEM::sessionSet('StepNumber', ($step_number + 1));

			// Throw back to this same page to continue the upgrade process
			echo "<script>\n";
			echo "setTimeout(function() { window.location = 'index.php?Page=UpgradeNX&Step=2&random=" . uniqid('ss') . "'; }, 10);\n";
			echo "</script>";
			exit;
		} else {
                    $upgrades_failed[] = $upgrade_api->Get('error');
                    IEM::sessionSet('DatabaseUpgradesFailed', $upgrades_failed);
                    echo "<script>\n";
                    echo "self.parent.ProcessFailed();";
                    echo "</script>";
                    exit;                    
                }

		echo "<script>\n";
		echo "self.parent.ProcessFinished();";
		echo "</script>";
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:88,代码来源:upgradenx.php

示例4: PrintManageUsers

	/**
	* PrintManageUsers
	* Prints a list of users to manage. If you are only allowed to manage your own account, only shows your account in the list. This allows you to edit, delete and so on.
	*
	* @see GetApi
	* @see GetPerPage
	* @see GetSortDetails
	* @see User_API::Admin
	* @see GetUsers
	* @see SetupPaging
	*
	* @return Void Prints out the list, doesn't return anything.
	*/
	function PrintManageUsers()
	{
		// ----- Sanitize and declare variables that is going to be used in this function
			$pageRecordPP		= 0;
			$pageCurrentIndex	= $this->GetCurrentPage();
			$pageSortInfo		= $this->GetSortDetails();

			$requestPreserveQuickSearch	= IEM::requestGetGET('PreserveQuickSearch', 0, 'intval');
			$requestSearch				= IEM::requestGetPOST('QuickSearchString', false);
			$requestGroupID				= IEM::requestGetGET('GroupID', 0, 'intval');

			$records			= array();
			$recordTotal		= 0;

			$api				= $this->GetApi('User');

			$currentUser		= IEM::getCurrentUser();

			$page = array(
				'messages'		=> GetFlashMessages(),
				'userreport'	=> '',
				'currentuserid'	=> $currentUser->userid
			);

			$permissions = array(
				'admin'				=> $currentUser->UserAdmin()
			);

			$groupInformation = array();
		// -----

		// Only admin/user admin able to view these pages
		if (!$currentUser->isAdmin()) {
			$this->DenyAccess();
		}

		$temp = ssk23twgezm2();
		if (is_array($temp) && isset($temp['message'])) {
			$page['userreport'] = $temp['message'];
		}

		if ($requestSearch === false && $requestPreserveQuickSearch) {
			$requestSearch = IEM::sessionGet('Users_Manage_QuickSearchString', '');
		} else {
			$requestSearch = trim($requestSearch);
			IEM::sessionSet('Users_Manage_QuickSearchString', $requestSearch);
		}

		// ----- Get "Record Per Page"
			if ($pageRecordPP == 0) {
				$pageRecordPP = $this->GetPerPage();
			}
		// -----

		$start = 0;
		if ($pageRecordPP != 'all') {
			$start = ($pageCurrentIndex - 1) * $pageRecordPP;
		}

		$recordTotal = $api->GetUsers(0, $pageSortInfo, true, $start, $pageRecordPP, $requestSearch, $requestGroupID);
		$records = $api->GetUsers(0, $pageSortInfo, false, $start, $pageRecordPP, $requestSearch, $requestGroupID);

		if (!empty($requestGroupID)) {
			$groupInformation = API_USERGROUPS::getRecordByID($requestGroupID);
		}

		for ($i = 0, $j = count($records); $i < $j; ++$i) {
			$records[$i]['processed_CreateDate'] = $this->PrintDate($records[$i]['createdate']);
			$records[$i]['processed_LastLoggedIn'] = ($records[$i]['lastloggedin'] ? $this->PrintDate($records[$i]['lastloggedin']) : '-');
		}

		// ----- Calculate pagination, this is using the older method of pagination
			$GLOBALS['PAGE'] = 'Users&PreserveQuickSearch=1' . (!empty($requestGroupID) ? "&GroupID={$requestGroupID}" : '');
			$GLOBALS['FormAction'] = 'Action=ProcessPaging&PreserveQuickSearch=1' . (!empty($requestGroupID) ? "&GroupID={$requestGroupID}" : '');

			$this->SetupPaging($recordTotal, $pageCurrentIndex, $pageRecordPP);
		// -----

		// ----- Print out HTML
			$tpl = GetTemplateSystem();
			$tpl->Assign('PAGE', $page);
			$tpl->Assign('records', $records);
			$tpl->Assign('permissions', $permissions);
			$tpl->Assign('quicksearchstring', $requestSearch);
			$tpl->Assign('groupInformation', $groupInformation);

			echo $tpl->ParseTemplate('Users', true);
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:users.php

示例5: Admin_Action_SaveResponse


//.........这里部分代码省略.........
                     $widgetErrors[$widget['id']][] = $error;
                     $errors++;
                 }
             }
             // validate file types
             if (isset($postWidgets[$widget['id']]) && $widget['allowed_file_types']) {
                 $typeArr = preg_split('/\\s*,\\s*/', strtolower($widget['allowed_file_types']));
                 $invalidType = false;
                 // foreach of the passed fields (most likely 1) check and see if they are valid file types
                 foreach ($postWidgets[$widget->id]['field'] as $field) {
                     $parts = explode('.', $field['value']);
                     $ext = strtolower(end($parts));
                     // only if the field has a value we will test its file type
                     if (trim($field['value']) != '' && !in_array($ext, $typeArr)) {
                         $invalidType = true;
                     }
                 }
                 // if the a file is not a valid file type, then the whole widget fails validation
                 if ($invalidType) {
                     $lastFileType = '<em>.' . array_pop($typeArr) . '</em>';
                     $firstFileTypes = '<em>.' . implode('</em>, <em>.', $typeArr) . '</em>';
                     $widgetErrors[$widget->id][] = sprintf(GetLang('errorInvalidFileType'), $firstFileTypes, $lastFileType);
                     $errors++;
                 }
             }
         }
         // if there were errors, redirect back and display the errors
         if ($errors) {
             echo '<pre style="border: 1px solid red";><b style="color:RED;">YUDI_DEBUG:' . __FILE__ . ' ON LINE: ' . __LINE__ . '</b><br />';
             print_r($widgetErrors);
             echo '</pre>';
             die;
             // set the widget errors so we can retrieve them for the user
             IEM::sessionSet('survey.addon.widgetErrors', $widgetErrors);
             IEM::sessionSet('MessageText', GetLang('Addon_Surveys_saveResponseMessageError'));
             IEM::sessionSet('MessageType', MSG_ERROR);
         } else {
             // isntantiate a new response object
             $response_api = $this->getSpecificApi('responses');
             $response_api->Load($responseId);
             // delete the values in this response, since they will be added back in
             $response_api->deleteValues();
             // if the response was saved, then associate values to the response
             if ($response_api->Save()) {
                 $responseValue = $this->getSpecificApi('responsesvalue');
                 // foreach of the posted widgets, check to see if it belongs in this form and save it if it does
                 foreach ($postWidgets as $postWidgetId => $postWidget) {
                     // iterate through each field and enter it in the feedback
                     foreach ($postWidget['field'] as $field) {
                         if (!isset($field['value'])) {
                             continue;
                         }
                         // foreign key for the response id
                         $responseValue->surveys_response_id = $responseId;
                         // set the widget id foreign key; widgets can have multiple field values and
                         // should be treated as such
                         $responseValue->surveys_widgets_id = $postWidgetId;
                         // set the value of the feedback; this should be a single value since widgets
                         // can have multiple feed back values
                         if ($field['value'] == '__other__') {
                             $responseValue->value = $field['other'];
                             $responseValue->is_othervalue = 1;
                         } else {
                             $responseValue->file_value = "";
                             if (substr($field['value'], 0, 5) == "file_") {
                                 $value = str_replace("file_", "", $field['value']);
开发者ID:solsticehc,项目名称:solsticehc,代码行数:67,代码来源:surveys.php

示例6: Process


//.........这里部分代码省略.........
							$autoresponderid = (int)$_GET['autoresponderid'];
						}

						if (!isset($_GET['Preview'])) {
							$GLOBALS['Body_Onload'] = 'window.focus();window.print();';
						}  else {
							$GLOBALS['Body_Onload'] = '';
						}

						header("Content-type: text/html; charset=" . SENDSTUDIO_DEFAULTCHARSET);

						$this->ParseTemplate('Stats_Print_Header');

						$calendar_restrictions = '';
						$statids = $statsapi->CheckIntVars($_GET['stats']);

						foreach ($statids as $index=>$statid) {

							if ($statstype == 'a') {
								// For autoresponders, $_GET['stats'] contains the autoresponderid
								$autoresponderid = $statid;
								$summary = $statsapi->GetAutoresponderSummary($autoresponderid, true, 0);
								$statid = $summary['statid'];
							}

							if ($statstype == 'n') {
								$summary = $statsapi->GetNewsletterSummary($statid, true, 0);
							}

							if ($statstype == 'l') {
								$summary = $statsapi->GetListSummary($statid);
								$listid = $statid;
								$statid = $summary['statids'];
								IEM::sessionSet('ListStatistics', $statid);
							}

							if ($statstype == 't') {
								$triggeremailsid = $this->_getGETRequest('triggermailsid', 0);

								if (isset($triggeremailsid[$index])) {
									$summary = $statsapi->GetTriggerEmailsStatsRecord($triggeremailsid[$index]);
								} else {
									$summary = array();
								}
							}

							$access = true;

							if (in_array($statstype, array('a', 'n'))) {
								$access = $this->CanAccessStats($statid, $statstype);
							} elseif ($statstype == 't') {
								// Admin access?
								$access = $user->Admin();

								// If this is NOT an admin, check whether or not he owns the trigger
								if (!$access && $this->IsOwner($summary['owneruserid'])) {
									$access = true;
								}
							} else {
								$access = $this->CanAccessList($listid);
							}

							if (!$access) {
								$this->DenyAccess();
								return;
							}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:67,代码来源:remote_stats.php

示例7: Process


//.........这里部分代码省略.........
                            if (is_array($newval)) {
                                $checkvals = array();
                                foreach ($newval as $k => $v) {
                                    if ($v != '') {
                                        $checkvals[] = $v;
                                    }
                                }
                                $newval = $checkvals;
                            }
                            $fieldapi->Settings[$name] = $newval;
                        }

                        $fieldapi->Save();

						$this->ManageCustomField_Lists($fieldid);

					break;
					default:
						$this->EditCustomField($fieldid);
				}
			break;

			case 'delete':
				$deletelist = (isset($_POST['customfields'])) ? $_POST['customfields'] : array();
				if (isset($_GET['id'])) {
					$deletelist = array((int)$_GET['id']);
				}
				$this->RemoveCustomFields($deletelist);
			break;

			case 'create':
				// see what step we're up to.
				$subaction = (isset($_GET['SubAction'])) ? strtolower($_GET['SubAction']) : '';
				switch ($subaction) {
					case 'step2':
						$newfield = array();
						$newfield['FieldName'] = $_POST['FieldName'];
						$newfield['FieldType'] = $_POST['FieldType'];
						$newfield['FieldRequired'] = '';
						if(isset($_POST['FieldRequired'])){ $newfield['FieldRequired'] = 'on'; $GLOBALS['ApplyDefault'] = ' CHECKED';} else { $GLOBALS['ApplyDefault'] = ''; }
						IEM::sessionSet('CustomFields', $newfield);
						$this->CreateCustomField_Step2($newfield);
					break;

					case 'step3':
						$customfield_settings = IEM::sessionGet('CustomFields');

						$fieldapi = $this->GetApi('CustomFields_' . $customfield_settings['FieldType']);
						if (!$fieldapi) {
							return false;
						}

						$alloptions = $fieldapi->GetOptions();

						$newoptions = array();
                        if(isset($_POST['ApplyDefault'])){$newoptions['ApplyDefault'] = 'on';}
						foreach ($alloptions as $fieldname => $option) {
						    if(isset($newoptions[$fieldname])){continue;}  
							$value = (isset($customfield_settings[$fieldname])) ? $customfield_settings[$fieldname] : $_POST[$fieldname];

							$newoptions[$fieldname] = $value;
						}

                        $AllOptions = array_merge($fieldapi->SharedOptions, $fieldapi->Options);

                        foreach ($AllOptions as $name => $val) {
                            $newval = $newoptions[$name];
                            if (is_array($newval)) {
                                $checkvals = array();
                                foreach ($newval as $k => $v) {
                                    if ($v != '') {
                                        $checkvals[] = $v;
                                    }
                                }
                                $newval = $checkvals;
                            }
                            $fieldapi->Settings[$name] = $newval;
                        }

						$fieldapi->ownerid = $user->userid;

						$create = $fieldapi->Create();

						if (!$create) {
							$GLOBALS['Error'] = GetLang('UnableToCreateCustomField');
							$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
							break;
						}
						$this->ManageCustomField_Lists($create, true);
					break;

					default:
						$this->CreateCustomField_Step1();
				}
			break;
			default:
				$this->ManageCustomFields();
		}
		$this->PrintFooter();
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:customfields.php

示例8: TestBounceSettingsDisplay

	/**
	 * TestBounceSettingsDisplay
	 * Loads the template for the bounce test thickbox.
	 *
	 * @param Array $param Any parameters that needed to be passed to this function
	 *
	 * @return Void Doesn't return anything.
	 */
	private function TestBounceSettingsDisplay($param)
	{
		$test_bounce_details = array (
			'server' => $_GET['bounce_server'],
			'username' => $_GET['bounce_username'],
			'password' => $_GET['bounce_password'],
			'extra_settings' => $_GET['bounce_extrasettings'],
			'imap' => (isset($_GET['bounce_imap']) && $_GET['bounce_imap'] == 1) ? 1 : 0,
		);

		// Decrypt the password.
		$test_bounce_details['password'] = IEM::decrypt($test_bounce_details['password'], IEM::sessionGet('RandomToken'));

		IEM::sessionSet('TestBounceDetails', $test_bounce_details);

		$GLOBALS['Page'] = 'Lists';
		$this->LoadLanguageFile('Bounce');
		return $this->ParseTemplate('Bounce_Test_Window', true);
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:27,代码来源:lists.php

示例9: printEditor

	protected function printEditor($record = array())
	{
		$user               = IEM::userGetCurrent();
		$group              = new record_UserGroups($record);
		$permissionList     = $user->getProcessedPermissionList();
		$availableLists     = $user->GetLists();
		$availableSegments  = $user->GetSegmentList();
		$availableTemplates = $user->GetTemplates();
		$requestToken       = md5(mt_rand());

		$page = array(
			'messages' => GetFlashMessages()
		);

		IEM::sessionSet('UsersGroups_Editor_RequestToken', $requestToken);

		if (!isset($record['permissions']) || !is_array($record['permissions'])) {
			$record['permissions'] = array();
		}

		if (!isset($record['access']) || !is_array($record['access'])) {
			$record['access'] = array();
		}

		$record['permissions_stupid_template'] = array();
		
		if (isset($record['permissions'])) {
			foreach ($record['permissions'] as $key => $value) {
				foreach ($value as $each) {
					$record['permissions_stupid_template'][] = "{$key}.{$each}";
				}
			}
		}
		
		$this->PrintHeader();
		
		$tpl = GetTemplateSystem();
		$tpl->Assign('PAGE', $page);
		$tpl->Assign('record', $record);
		$tpl->Assign('permissionList', $permissionList);
		$tpl->Assign('isSystemAdmin', $group->isAdmin());
		$tpl->Assign('isLastAdminWithUsers', $group->isLastAdminWithUsers());
		$tpl->Assign('availableLists', $availableLists, true);
		$tpl->Assign('availableSegments', $availableSegments, true);
		$tpl->Assign('availableTemplates', $availableTemplates, true);
		$tpl->Assign('requestToken', $requestToken);

		$tpl->ParseTemplate('UsersGroups_Form');

		$this->PrintFooter();

		return;
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:53,代码来源:usersgroups.php

示例10: ManageSubscribers_Step2


//.........这里部分代码省略.........
			}

			$GLOBALS['VisibleFields'] .= '>' . htmlspecialchars(GetLang($name),ENT_QUOTES, SENDSTUDIO_CHARSET) . '</option>';
		}

		$fieldslisted = array();
		foreach ($listids as $listidTemp) {
			$customfields = $listApi->GetCustomFields($listidTemp);
			foreach ($customfields as $key => $details) {
				if (in_array($details['fieldid'],$fieldslisted)) {
					continue;
				}

				$GLOBALS['VisibleFields'] .= '<option value="' . $details['fieldid'] . '"';

				if (in_array($details['fieldid'],$visiblefields)) {
					$GLOBALS['VisibleFields'] .= ' selected="selected"';
				}

				$GLOBALS['VisibleFields'] .= '>' . htmlspecialchars($details['name'],ENT_QUOTES, SENDSTUDIO_CHARSET) . '</option>';

				$fieldslisted[] = $details['fieldid'];
			}
		}

		$GLOBALS['VisibleFieldsInfo'] = $this->ParseTemplate('subscriber_manage_step2_visiblefields',true);

		$GLOBALS['FormAction'] = 'Manage';

		$format_either = '<option value="-1">' . GetLang('Either_Format') . '</option>';
		$format_html = '<option value="h">' . GetLang('Format_HTML') . '</option>';
		$format_text = '<option value="t">' . GetLang('Format_Text') . '</option>';

		if (is_numeric($listid)) {
			$listformat = $listApi->GetListFormat();
			switch ($listformat) {
				case 'h':
					$format = $format_html;
				break;
				case 't':
					$format = $format_text;
				break;
				default:
					$format = $format_either . $format_html . $format_text;
			}
		} else {
			$format = $format_either . $format_html . $format_text;
		}

		IEM::sessionRemove('LinksForList');
		if (is_numeric($listid)) {
			IEM::sessionSet('LinksForList', $listid);
		}

		$GLOBALS['ClickedLinkOptions'] = $this->ShowLinksClickedOptions();

		$GLOBALS['OpenedNewsletterOptions'] = $this->ShowOpenedNewsletterOptions();

		$GLOBALS['FormatList'] = $format;

		$this->PrintSubscribeDate();

		/**
		 * Print custom fields options if applicable
		 */
			if (is_numeric($listid)) {
				$customfields = $listApi->GetCustomFields($listid);

				if (!empty($customfields)) {
					$customfield_display = $this->ParseTemplate('Subscriber_Manage_Step2_CustomFields', true, false);
					foreach ($customfields as $pos => $customfield_info) {
						$manage_display = $this->Search_Display_CustomField($customfield_info);
						$customfield_display .= $manage_display;
					}
					$GLOBALS['CustomFieldInfo'] = $customfield_display;
				}
			}
		/**
		 * -----
		 */

		$this->ParseTemplate('Subscriber_Manage_Step2');

		if (sizeof(array_keys($user_lists)) == 1) {
			return;
		}

		if (isset($_GET['Reset'])) {
			return;
		}

		if (!$msg && (isset($_POST['ShowFilteringOptions']) && $_POST['ShowFilteringOptions'] == 2)) {
			?>
			<script>
				document.forms[0].submit();
			</script>
			<?php
			exit();
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:subscribers_manage.php

示例11: _handleSubmitAction


//.........这里部分代码省略.........

					// foreach of the passed fields (most likely 1) check and see if they are valid file types
					foreach ($postWidgets[$widget['id']]['field'] as $field) {
						$parts = explode('.', $field['value']);
						$ext   = strtolower(end($parts));



						// only if the field has a value we will test its file type
						if (trim($field['value']) != '' && !in_array($ext, $typeArr)) {
							$invalidType = true;
						}
					}

					// if the a file is not a valid file type, then the whole widget fails validation
					if ($invalidType) {
						$lastFileType   = '<em>.' . array_pop($typeArr) . '</em>';
						$firstFileTypes = '<em>.' . implode('</em>, <em>.', $typeArr) . '</em>';
						$widgetErrors[$widget['id']][] = sprintf(GetLang('Addon_Surveys_ErrorInvalidFileType'), $lastFileType, $firstFileTypes);
						$errors++;
					}
				}
			}

			if (isset($postWidgets[$widget['id']])) {
				// add a value to the values array so it can be passed to the email feedback template
				@$widgets[$widgetKey]['values'] = $postWidgets[$widget['id']]['field'];
			}
		}

		// if there were errors, redirect back and display the errors
		if ($errors) {
			// set a global error message to alert the user to the specific errors
			IEM::sessionSet('survey.addon.' . $formId . '.errorMessage', $surveyData['error_message']);
			// set the widget errors so we can retrieve them for the user
			IEM::sessionSet('survey.addon.' . $formId . '.widgetErrors', $widgetErrors);
			$this->redirectToReferer();
		}

		/****  END OF ERROR VALIDATION ****/

		// isntantiate a new response object
		$response = $this->getSpecificApi('responses');

		// associate the response to a particular form
		$response->surveys_id = $formId;

		// if the response was saved, then associate values to the response
		if ($response->Save()) {
			// foreach of the posted widgets, check to see if it belongs in this form and save it if it does

			foreach ($postWidgets as $postWidgetId => $postWidget) {
				// iterate through each field and enter it in the feedback

				foreach ($postWidget['field'] as $field) {
					// make sure it has a value first

					if (isset($field['value'])) {
						// since multiple values can be given, we treat them as an array
						$values = (array) $field['value'];

						foreach ($values as $value) {

							$responseValue = $this->getSpecificApi('responsesvalue');
							// foreign key for the response id
							$responseValue->surveys_response_id = $response->GetId();
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:67,代码来源:surveys_submit.php

示例12: RunUpgrade

	/**
	* RunUpgrade
	* Runs the query for the upgrade process
	* and returns the result from the query.
	* The calling function looks for a true or false result
	*
	* @return Mixed Returns true if the condition is already met (eg the column already exists).
	*  Returns false if the database query can't be run.
	*  Returns the resource from the query (which is then checked to be true).
	*/
	function RunUpgrade()
	{
		$tablePrefix = SENDSTUDIO_TABLEPREFIX;

		// ----- Splitting process into chunks
			$dbUpgradeStatus = IEM::sessionGet('DatabaseUpgradeStatusList');
			$thisQuery = null;
			if (isset($dbUpgradeStatus[get_class($this)])) {
				$thisQuery = $dbUpgradeStatus[get_class($this)];
			}

			if (is_null($thisQuery)) {
				$result = $this->Db->Query("	SELECT	COUNT(autoresponderid) AS listcount
												FROM 	{$tablePrefix}autoresponders");
				$row = $this->Db->Fetch($result);
				$this->Db->FreeResult($result);

				$thisQuery = array(
					'Total' 	=> $row['listcount'],
					'Processed' => 0,
					'Offset' 	=> 0,
					'Limit'		=> 10
				);
			}
		// -----

		$query = "	SELECT	autoresponderid, listid
					FROM 	{$tablePrefix}autoresponders
					LIMIT	{$thisQuery['Limit']}
					OFFSET	{$thisQuery['Offset']}";

		$result = $this->Db->Query($query);
		while ($row = $this->Db->Fetch($result)) {
			$statid = $this->Db->NextId(SENDSTUDIO_TABLEPREFIX . 'stats_sequence');

			$query = "INSERT INTO " . SENDSTUDIO_TABLEPREFIX . "stats_linkclicks(clicktime, clickip, subscriberid, statid, linkid) SELECT lc.timestamp, lc.ipaddress, lc.memberid, " . $statid . ", ln.linkid FROM " . SENDSTUDIO_TABLEPREFIX . "link_clicks lc, " . SENDSTUDIO_TABLEPREFIX . "links l, " . SENDSTUDIO_TABLEPREFIX . "links_new ln WHERE lc.linkid=l.linkid AND l.url=ln.url AND lc.ComposedID=l.ComposedID AND UPPER(lc.LinkType)='AUTO' AND lc.ListID='" . $row['listid'] . "'";

			$this->Db->Query($query);

			$query = "INSERT INTO " . SENDSTUDIO_TABLEPREFIX . "stats_emailopens(subscriberid, statid, opentime, openip) SELECT MemberID, " . $statid . ", TimeStamp, NULL FROM " . SENDSTUDIO_TABLEPREFIX . "email_opens WHERE SendID='" . $row['autoresponderid'] . "' AND UPPER(EmailType)='AUTO'";

			$this->Db->Query($query);


			$link_clicks_query = "SELECT COUNT(linkid) AS linkcount FROM " . SENDSTUDIO_TABLEPREFIX . "stats_links WHERE statid='" . $statid . "'";
			$clicks_result = $this->Db->Query($link_clicks_query);
			$link_clicks = $this->Db->FetchOne($clicks_result, 'linkcount');

			$link_clicks_query = "SELECT COUNT(openid) AS opencount FROM " . SENDSTUDIO_TABLEPREFIX . "stats_emailopens WHERE statid='" . $statid . "'";
			$opens_result = $this->Db->Query($link_clicks_query);
			$email_opens = $this->Db->FetchOne($opens_result, 'opencount');


			$insert_query = "INSERT INTO " . SENDSTUDIO_TABLEPREFIX . "stats_autoresponders(statid, htmlrecipients, textrecipients, multipartrecipients, bouncecount_soft, bouncecount_hard, bouncecount_unknown, unsubscribecount, autoresponderid, linkclicks, emailopens, emailforwards, emailopens_unique, hiddenby) VALUES ('" . $statid . "', '0', '0', '0', 0, 0, 0, 0, '" . $row['autoresponderid'] . "', '" . $link_clicks . "', '" . $email_opens . "', 0, '" . $email_opens . "', 0)";

			$insert_result = $this->Db->Query($insert_query);
		}

		// ----- Make sure the process run for the next chunk
			$thisQuery['Processed'] += $thisQuery['Limit'];
			if ($thisQuery['Processed'] > $thisQuery['Total']) {
				$thisQuery['Processed'] = $thisQuery['Total'];
			}
			$thisQuery['Offset'] = $thisQuery['Processed'] - 1;

			$dbUpgradeStatus[get_class($this)] = $thisQuery;
			IEM::sessionSet('DatabaseUpgradeStatusList', $dbUpgradeStatus);
		// -----

		// -----
		// Will return 1 if need to process the same table, TRUE if processing complete, FALSE if process failed
		// Will also process subsequent commands after finishing the main process
		// -----
			if ($thisQuery['Processed'] >= $thisQuery['Total']) {
				// save all of the stat -> link associations here.
				$query = "INSERT INTO " . SENDSTUDIO_TABLEPREFIX . "stats_links SELECT statid, linkid FROM " . SENDSTUDIO_TABLEPREFIX . "stats_linkclicks GROUP BY statid, linkid";
				$this->Db->Query($query);
				return true;
			} else {
				return 1;
			}
		// -----
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:93,代码来源:stats_autoresponders_convert.php

示例13: DisplayEditTemplate

	/**
	* DisplayEditTemplate
	* Prints out stage 2 of editing a template based on whether this is a text, html or multipart template. This information is stored in the session, so we need to retrieve those settings.
	* This function is used both when creating and editing a template.
	*
	* @param Int $templateid If there is a template id, we are updating an existing template. If there is no template id, we are creating a new template. This changes form actions depending on what we're doing.
	*
	* @see GetApi
	* @see GetUser
	* @see Templates_API::Load
	* @see Templates_API::GetBody
	* @see FetchEditor
	*
	* @return Void Prints out the form, doesn't return anything.
	*/
	function DisplayEditTemplate($templateid=0, $server_template=false)
	{
		$template = $this->GetApi();
		$templatecontents = array('text' => '', 'html' => '');

		$user = IEM::getCurrentUser();

		if ($templateid > 0) {
			$GLOBALS['SaveAction'] = 'Edit&SubAction=Save&id=' . $templateid;
			$GLOBALS['Heading'] = GetLang('EditTemplate');
			$GLOBALS['Intro'] = GetLang('EditTemplateIntro_Step2');
			$GLOBALS['Action'] = 'Edit&SubAction=Complete&id=' . $templateid;
			$GLOBALS['CancelButton'] = GetLang('EditTemplateCancelButton');

			$template->Load($templateid);

			$show_misc_options = false;
			if ($user->HasAccess('Templates', 'Approve')) {
				$show_misc_options = true;
				$GLOBALS['IsActive'] = ($template->Active()) ? ' CHECKED' : '';
			} else {
				$GLOBALS['ShowActive'] = 'none';
			}

			if ($user->HasAccess('Templates', 'Global')) {
				$show_misc_options = true;
				$GLOBALS['IsGlobal'] = ($template->IsGlobal() && $template->Active()) ? ' CHECKED' : '';
			} else {
				$GLOBALS['ShowGlobal'] = 'none';
			}

			if (!$show_misc_options) {
				$GLOBALS['ShowMiscOptions'] = 'none';
			}

			$templatecontents['text'] = $template->GetBody('text');
			$templatecontents['html'] = $template->GetBody('html');
		} else {
			$GLOBALS['SaveAction'] = 'Create&SubAction=Save&id=' . $templateid;
			$GLOBALS['Heading'] = GetLang('CreateTemplate');
			$GLOBALS['Intro'] = GetLang('CreateTemplateIntro_Step2');
			$GLOBALS['Action'] = 'Create&SubAction=Complete';
			$GLOBALS['CancelButton'] = GetLang('CreateTemplateCancelButton');

			if (!$user->HasAccess('Templates', 'Global')) {
				$GLOBALS['ShowGlobal'] = 'none';
			}

			$show_misc_options = false;
			if ($user->HasAccess('Templates', 'Approve')) {
				$GLOBALS['IsActive'] = ' CHECKED';
				$show_misc_options = true;
			} else {
				$GLOBALS['ShowActive'] = 'none';
			}

			if (!$show_misc_options) {
				$GLOBALS['ShowMiscOptions'] = 'none';
			}
		}

		if ($server_template) {
			$templatecontents['html'] = $template->ReadServerTemplate($server_template);
		}

		// we don't really need to get/set the stuff here.. we could use references.
		// if we do though, it segfaults! so we get and then set the contents.
		$session_template = IEM::sessionGet('Templates'.$templateid);
		$session_template['id'] = (int)$templateid;
		$session_template['contents'] = $templatecontents;
		IEM::sessionSet('Templates'.$templateid, $session_template);
		$editor = $this->FetchEditor('Templates'.$templateid);
		$GLOBALS['Editor'] = $editor;
		$this->ParseTemplate('Template_Form_Step2');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:90,代码来源:templates.php

示例14: Process


//.........这里部分代码省略.........
						$lines[] = 'latest=' . $_POST['latest'];
					}

					if (isset($_POST['feature'])) {
						$lines[] = 'feature=' . $_POST['feature'];
					}

					if (isset($_POST['latest_critical'])) {
						$lines[] = 'latest_critical=' . (int)$_POST['latest_critical'];
					}

					if (isset($_POST['feature_critical'])) {
						$lines[] = 'feature_critical=' . (int)$_POST['feature_critical'];
					}

					$fp = fopen(IEM_STORAGE_PATH . '/.version', 'w');
					if ($fp) {
						foreach ($lines as $line) {
							$line .= "\r\n";
							fputs($fp, $line);
						}
						fclose($fp);
					}
				break;

				case 'googlecalendar':
					$this->LoadLanguageFile('Subscribers');
					if (strlen($user->googlecalendarusername) && strlen($user->googlecalendarpassword)) {
						if (isset($_POST['google']) && is_array($_POST['google'])) {
							$google = $_POST['google'];
							$google['username'] = $user->googlecalendarusername;
							$google['password'] = $user->googlecalendarpassword;
							if (isset($google['allday']) && $google['allday']) {
								IEM::sessionSet('gcal_allday',true);
							} else {
								IEM::sessionSet('gcal_allday',false);
							}

							try {
								$this->GoogleCalendarAdd($google);
								echo 'top.tb_remove();';
							} catch (GoogleCalendarException $e) {
								switch ($e->getCode()) {
									case GoogleCalendarException::BADAUTH;
										echo 'alert("' . GetLang('GoogleCalendarAuth') . '");';
									break;
									default:
										echo 'alert("' . GetLang('GoogleCalendarException') . '");';
										echo "//" . $e->getMessage();
								}

							}
						}
					}
				break;
				case 'imagemanagerrename':
					$api = $this->GetApi('ImageManager');

					// lets get the extension from the old filename
					$ext = substr(strrchr($_POST['fromName'], "."), 0);
					$_POST['toName'] = $_POST['toName'] . $ext;

					$return = array();
					if(strpos($_POST['toName'], '/') !== false || strpos($_POST['toName'], '\\') !== false ){
						$return['success'] = false;
						$return['message'] = GetLang('ImageManagerRenameInvalidFileName');
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:67,代码来源:remote.php

示例15: Process


//.........这里部分代码省略.........
				if (!$founduser) {
					$this->ShowForgotForm('login_error', GetLang('BadLogin_Forgot'));
					break;
				}

				$user->Load($founduser, false);

				$code = md5(uniqid(rand(), true));

				$user->ResetForgotCode($code);

				$link = SENDSTUDIO_APPLICATION_URL . '/admin/index.php?Page=Login&Action=ConfirmCode&user=' . $founduser . '&code=' . $code;

				$message = sprintf(GetLang('ChangePasswordEmail'), $link);

				$email_api = $this->GetApi('Email');
				$email_api->Set('CharSet', SENDSTUDIO_CHARSET);
				$email_api->Set('Multipart', false);
				$email_api->AddBody('text', $message);
				$email_api->Set('Subject', GetLang('ChangePasswordSubject'));

				$email_api->Set('FromAddress', SENDSTUDIO_EMAIL_ADDRESS);
				$email_api->Set('ReplyTo', SENDSTUDIO_EMAIL_ADDRESS);
				$email_api->Set('BounceAddress', SENDSTUDIO_EMAIL_ADDRESS);

				$email_api->SetSmtp(SENDSTUDIO_SMTP_SERVER, SENDSTUDIO_SMTP_USERNAME, @base64_decode(SENDSTUDIO_SMTP_PASSWORD), SENDSTUDIO_SMTP_PORT);

				$user_fullname = $user->Get('fullname');

				$email_api->AddRecipient($user->emailaddress, $user_fullname, 't');

				$email_api->Send();

				$this->ShowForgotForm_Step2($username,'login_success', sprintf(GetLang('ChangePassword_Emailed'), $user->emailaddress));
			break;

			case 'confirmcode':
				$user = IEM::requestGetGET('user', false, 'intval');
				$code = IEM::requestGetGET('code', false, 'trim');

				if (empty($user) || empty($code)) {
					$this->ShowForgotForm('login_error', GetLang('BadLogin_Link'));
					break;
				}

				$userapi = GetUser(-1);
				$loaded = $userapi->Load($user, false);

				if (!$loaded || $userapi->Get('forgotpasscode') != $code) {
					$this->ShowForgotForm('login_error', GetLang('BadLogin_Link'));
					break;
				}

				IEM::sessionSet('ForgotUser', $user);

				$this->ShowForgotForm_Step2($userapi->Get('username'));
			break;

			case 'login':
				$auth_system = new AuthenticationSystem();
				$username = IEM::requestGetPOST('ss_username', '');
				$password = IEM::requestGetPOST('ss_password', '');
				$result = $auth_system->Authenticate($username, $password);
				if ($result === -1) {
					$this->ShowLoginForm('login_error', GetLang('PleaseWaitAWhile'));
					break;
				} elseif ($result === -2) {
					$this->ShowLoginForm('login_error', GetLang('FreeTrial_Expiry_Login'));
					break;
				} elseif (!$result) {
					$this->ShowLoginForm('login_error', GetLang('BadLogin'));
					break;
				} elseif ($result && defined('IEM_SYSTEM_ACTIVE') && !IEM_SYSTEM_ACTIVE) {
					$msg = (isset($result['admintype']) && $result['admintype'] == 'a') ? 'ApplicationInactive_Admin' : 'ApplicationInactive_Regular';
					$this->ShowLoginForm('login_error', GetLang($msg));
					break;
				}

                $user = false;
                $rand_check = false;

				IEM::userLogin($result['userid']);

				$oneyear = 365 * 24 * 3600; // one year's time.

				$redirect = $this->_validateTakeMeToRedirect(IEM::requestGetPOST('ss_takemeto', 'index.php'));

				header('Location: ' . SENDSTUDIO_APPLICATION_URL . '/admin/' . $redirect);
				exit();
			break;

			default:
				$msg = false; $template = false;
				if ($action == 'logout') {
					$this->LoadLanguageFile('Logout');
				}
				$this->ShowLoginForm($template, $msg);
			break;
		}
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:login.php


注:本文中的IEM::sessionSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。