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


PHP IEM::sessionRemove方法代码示例

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


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

示例1: GetFlashMessages

/**
* GetFlashMessages
* Gets the messages from the session and works out which template etc to display them in based on the message type.
* If there are multiple messages, they are all returned (based on which type/template etc) in one long string.
*
* It will not combine all 'success' messages into one box and all 'error' messages into another box.
* Each message is displayed in it's own box and they are returned in the order they were created.
*
* If you create a 'success' message then an 'info' message then an 'error' message, that is the order they are returned in.
*
* @see FlashMessage
* @uses SS_FLASH_MSG_SUCCESS
* @uses SS_FLASH_MSG_ERROR
* @uses SS_FLASH_MSG_WARNING
* @uses SS_FLASH_MSG_INFO
*
* @return String Returns the message ready for displaying.
*/
function GetFlashMessages()
{
	$flash_messages = IEM::sessionGet('FlashMessages', false);

	if (!$flash_messages) {
		return '';
	}

	$template_system = GetTemplateSystem();

	$print_msg = '';
	foreach ($flash_messages as $msg) {
		switch ($msg['type']) {
			case SS_FLASH_MSG_SUCCESS:
				$GLOBALS['Success'] = $msg['message'];
				$print_msg .= $template_system->ParseTemplate('successmsg', true);
			break;

			case SS_FLASH_MSG_ERROR:
				$GLOBALS['Error'] = $msg['message'];
				$print_msg .= $template_system->ParseTemplate('errormsg', true);
			break;

			case SS_FLASH_MSG_INFO:
				$GLOBALS['Message'] = $msg['message'];
				$print_msg .= $template_system->ParseTemplate('infomsg', true);
			break;

			case SS_FLASH_MSG_WARNING:
				$GLOBALS['Warning'] = $msg['message'];
				$print_msg .= $template_system->ParseTemplate('warningmsg', true);
			break;
		}
	}
	IEM::sessionRemove('FlashMessages');

	return $print_msg;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:56,代码来源:flashmessages.php

示例2: Process


//.........这里部分代码省略.........
                            if ($attachments_status) {
                                if ($attachments_status_msg != '') {
                                    $GLOBALS['Success'] = $attachments_status_msg;
                                    $GLOBALS['Message'] .= $this->ParseTemplate('SuccessMsg', true, false);
                                }
                            } else {
                                $GLOBALS['Error'] = $attachments_status_msg;
                                $GLOBALS['Message'] .= $this->ParseTemplate('ErrorMsg', true, false);
                            }
                        }

                        if (!$newsletter->Active() && isset($_POST['archive'])) {
                            $GLOBALS['Error'] = GetLang('NewsletterCannotBeInactiveAndArchive');
                            $GLOBALS['Message'] .= $this->ParseTemplate('ErrorMsg', true, false);
                        }

                        if ($newsletter_img_warnings) {
                            $GLOBALS['Message'] .= $this->PrintWarning('UnableToLoadImage_Newsletter_List', $newsletter_img_warnings);
                        }

                        if (!$html_unsubscribelink_found) {
                            $GLOBALS['Message'] .= $this->PrintWarning('NoUnsubscribeLinkInHTMLContent');
                        }

                        if (!$text_unsubscribelink_found) {
                            $GLOBALS['Message'] .= $this->PrintWarning('NoUnsubscribeLinkInTextContent');
                        }

                        $GLOBALS['Message'] = str_replace('<br><br>', '<br>', $GLOBALS['Message']);
                        
                        if ($subaction == 'save') {
                            $this->DisplayEditNewsletter($id);
                        } else {
                            IEM::sessionRemove("Newsletters");
                            $this->ManageNewsletters();
                        }
                        
                        break;

                    default:
                    case 'step1':
                        $this->EditNewsletter($id);
                        break;
                }
                break;

            case 'create':
                $subaction = (isset($_GET['SubAction'])) ? strtolower(urldecode($_GET['SubAction'])) : '';

                switch ($subaction) {
                    default:
                        $this->CreateNewsletter(); 
                    break;
                    case 'step2':
                        if(is_dir(TEMP_DIRECTORY . "/newsletters/".$user->userid."_tmp")){remove_directory(TEMP_DIRECTORY . "/newsletters/".$user->userid."_tmp");}
                        $newnewsletter = array();
                        $checkfields = array('Name', 'Format');
                        $valid = true;
                        $errors = array();
                        foreach ($checkfields as $p => $field) {
                            if (!isset($_POST[$field]) || empty($_POST[$field])) {
                                $valid = false;
                                $errors[] = GetLang('Newsletter' . $field . 'IsNotValid');
                                break;
                            } else {
                                $value = $_POST[$field];
开发者ID:hungnv0789,项目名称:vhtm,代码行数:67,代码来源:newsletters.php

示例3: 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

示例4: Admin_Action_PreConfig

 /**
  * Admin_Action_PreConfig
  *
  * is use to preconfigured any request before hitting any of of the Action..
  * Perhaps this can be used to setup any prerequeisite like seting error messages or warning
  * and other related used that can be used accross action..
  *
  *
  * @return void
  */
 public function Admin_Action_PreConfig()
 {
     $messageText = IEM::sessionGet('MessageText');
     $messageType = IEM::sessionGet('MessageType');
     if ($messageText) {
         $message['type'] = $messageType;
         $message['message'] = $messageText;
         $messageArr[] = $message;
         IEM::sessionSet('FlashMessages', $messageArr);
         // removing the session for next usage
         IEM::sessionRemove('MessageText');
         IEM::sessionRemove('MessageType');
     }
 }
开发者ID:solsticehc,项目名称:solsticehc,代码行数:24,代码来源:surveys.php

示例5: ShowStep_0

	/**
	* ShowStep_0
	* This works out which upgrades are going to need to run, sets session variables and sets up javascript functionality to process the actions.
	*
	* @return Void Prints the page out, doesn't return it.
	*/
	function ShowStep_0()
	{
		$this->PrintHeader();

		$api = $this->GetApi('Settings');
		$current_db_version = $api->GetDatabaseVersion();

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

		$upgrade_api = new Upgrade_API();

		$upgrades_to_run = $upgrade_api->GetUpgradesToRun($current_db_version, SENDSTUDIO_DATABASE_VERSION);

		IEM::sessionSet('UpgradesToRun', $upgrades_to_run['upgrades']);

		$upgrades_done = array();
		IEM::sessionSet('DatabaseUpgradesCompleted', $upgrades_done);
		$upgrades_failed = array();
		IEM::sessionSet('DatabaseUpgradesFailed', $upgrades_failed);
		IEM::sessionSet('TotalSteps', $upgrades_to_run['number_to_run']);
		IEM::sessionSet('StepNumber', 1);
		IEM::sessionRemove('SendServerDetails');

		$previous_version = 'NX1.0';
		if (isset($upgrade_api->versions[$current_db_version])) {
			$previous_version = $upgrade_api->versions[$current_db_version];
		}
		IEM::sessionSet('PreviousVersion', $previous_version);
		IEM::sessionSet('PreviousDBVersion', $current_db_version);

		?>
			<br /><br /><br /><br />
			<table style="margin:auto;"><tr><td style="border:solid 2px #DDD; padding:20px; background-color:#FFF; width:450px;">
			<table>
				<tr>

					<td class="Heading1">
						<img src="images/logo.jpg" />
					</td>
				</tr>
				<tr>
					<td style="padding:10px 0px 5px 0px">
						<div style="display: ">
							<strong><?php echo GetLang('Upgrade_Header'); ?></strong>

							<p><?php echo sprintf(GetLang('Upgrade_Introduction'), $previous_version, GetLang('SENDSTUDIO_VERSION')); ?></p>
							<p><?php echo GetLang('Upgrade_Introduction_Part2'); ?></p>
							<p>
								<label for="sendServerDetails"><input type="checkbox" name="sendServerDetails" id="sendServerDetails" value="1" checked="checked" style="vertical-align: middle;" /> <?php echo GetLang('Upgrade_SendAnonymous_Stats'); ?></label>

								<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:void(0)" onclick="alert('<?php echo GetLang('Upgrade_SendAnonymous_Stats_Alert'); ?>');" style="color:gray"><?php echo GetLang('Upgrade_SendAnonymous_Stats_What'); ?></a>
							</p>
							<input type="button" value="<?php echo GetLang('Upgrade_Button_Start'); ?>" onclick="RunUpgrade()" class="FormButton_wide" />
						</div>
					</td>
				</tr>
			</table>
			</td></tr></table>
		<script>
			function RunUpgrade() {
				var urlAppend = '';
				if($('#sendServerDetails:checked').val()) {
					urlAppend = '&sendServerDetails=1';
				}
				x = 'index.php?Page=UpgradeNX'+urlAppend+'&Step=1&keepThis=true&TB_iframe=true&height=240&width=400&modal=true&random='+new Date().getTime();
				tb_show('', x, '');
			}
		</script>
		<?php

		$this->PrintFooter();
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:78,代码来源:upgradenx.php

示例6: Process


//.........这里部分代码省略.........
						$session_form[$field] = $_POST[$field];
					} else {
						$session_form[$field] = false;
					}
				}

				if (isset($_GET['id'])) {
					$session_form['FormID'] = (int)$_GET['id'];
				}

				if (!$valid) {
					if (!isset($session_form['FormID'])) {
						$id = 0;
						$GLOBALS['Error'] = GetLang('UnableToCreateForm') . '<br/>- ' . implode('<br/>- ',$errors);
					} else {
						$id = $session_form['FormID'];
						$GLOBALS['Error'] = GetLang('UnableToUpdateForm') . '<br/>- ' . implode('<br/>- ',$errors);
					}
					$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
					$this->Form_Step1($id);
					break;
				}

				$session_form['CustomFieldsOrder'] = array();
				if (isset($_POST['hidden_fieldorder'])) {
					$order = explode(';', $_POST['hidden_fieldorder']);
					foreach ($order as $order_pos => $order_field) {
						if (!$order_field) {
							continue;
						}
						$session_form['CustomFieldsOrder'][] = $order_field;
					}
				}

				$session_form['CustomFields'] = array();

				$ftypes = array('s','m');
				if (in_array($session_form['FormType'], $ftypes)) {
					foreach ($session_form['CustomFieldsOrder'] as $each) {
						if (is_numeric($each)) {
							array_push($session_form['CustomFields'], $each);
						}
					}
				}

				IEM::sessionSet('Form', $session_form);

				if ($session_form['FormType'] == 'f') {
					$this->ShowFriendStep();
					$this->ShowThanksHTML('Step5');
					break;
				}

				if ($session_form['RequireConfirmation'] == '1') {
					$this->ShowConfirmationStep();
					break;
				}

				if ($session_form['SendThanks'] == '1') {
					$this->ShowThanksStep();
				}

				if (isset($session_form['FormID']) && $session_form['FormID'] > 0) {
					$GLOBALS['CancelButton'] = GetLang('EditFormCancelButton');
					$GLOBALS['Heading'] = GetLang('EditForm');
					$GLOBALS['Intro'] = GetLang('ThanksPageIntro_Edit');
					if ($session_form['FormType'] == 'm' || $session_form['SendThanks'] != 1) {
						$GLOBALS['Intro'] = GetLang('ThanksPageIntro_Edit_NoEmail');
					}
				} else {
					$GLOBALS['CancelButton'] = GetLang('CreateFormCancelButton');
					$GLOBALS['Heading'] = GetLang('CreateForm');
					$GLOBALS['Intro'] = GetLang('ThanksPageIntro');
					if ($session_form['FormType'] == 'm' || $session_form['SendThanks'] != 1) {
						$GLOBALS['Intro'] = GetLang('ThanksPageIntro_NoEmail');
					}
				}

				$this->ShowThanksHTML();
			break;

			case 'edit':
				IEM::sessionRemove('Form');
				$id = (isset($_GET['id'])) ? (int)$_GET['id'] : 0;
				$this->Form_Step1($id);
			break;

			case 'create':
				IEM::sessionRemove('Form');
				$this->Form_Step1();
			break;

			default:
				$this->ManageForms();
		}

		if (!in_array($action, $this->DontShowHeader)) {
			$this->PrintFooter($popup);
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:forms.php

示例7: ShowStep_0

	/**
	* ShowStep_0
	* This shows the first "thanks for purchasing" page.
	* Doesn't do anything else.
	*
	* @return Void Doesn't return anything.
	*/
	function ShowStep_0()
	{
		?>
		<form method="post" action="index.php?Page=Upgrade&Step=1">
		<table cellSpacing="0" cellPadding="0" width="95%" align="center">
			<TR>
				<TD class="Heading1">Welcome to the Sendstudio Upgrade Wizard</TD>
			</TR>
			<TR>
				<TD class="Gap">&nbsp;</TD>
			</TR>
			<TR>
				<TD>
					<table class="Panel" id="Table14" width="100%">
						<TR>
							<TD class="Content" colSpan="2">
								<TABLE id="Table2" style="BORDER-RIGHT: #adaaad 1px solid; BORDER-TOP: #adaaad 1px solid; BORDER-LEFT: #adaaad 1px solid; BORDER-BOTTOM: #adaaad 1px solid; BACKGROUND-COLOR: #f7f7f7"
									cellSpacing="0" cellPadding="10" width="100%" border="0">
									<TR>
										<TD>
											<TABLE width="100%" class="Message" cellSpacing="0" cellPadding="0" border="0">
												<TR>
													<TD width="20"><IMG height="18" hspace="5" src="images/success.gif" width="18" align="middle" vspace="5"></TD>
													<TD class="Text">Thank you for upgrading Sendstudio!<BR>
													</TD>
												</TR>
											</TABLE>
											<DIV class="Text">
												Welcome to the Sendstudio upgrade wizard. Over the next 4 steps your current copy of SendStudio (including your database) will be upgraded.<br>Click the "Proceed" button below to get started and create a backup of your database.
											</DIV>
										</TD>
									</TR>
									<TR>

										<TD>
											<input type="submit" name="WelcomeProceedButton" value="Proceed" class="FormButton" />
										</TD>
									</TR>
								</TABLE>
							</TD>
						</TR>
					</TABLE>
				</TD>
			</TR>
		</TABLE>
		</form>
		<?php

		$vars = array(
			'DatabaseTables_BackupErrors',
			'BackupFile',
			'DatabaseTables_Todo',
			'DatabaseTables_Done',

			'DatabaseUpgradesCompleted',
			'DatabaseUpgradesFailed',

			'DirectoriesToCopy',
			'DirectoriesCopied',
			'DirectoriesNotCopied'
		);
		foreach ($vars as $k => $var) {
			IEM::sessionRemove($var);
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:72,代码来源:upgrade.php

示例8: Process


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

				$removelist = array();
				$removetype = strtolower($_POST['RemoveOption']);
				if (!empty($_POST['RemoveEmailList'])) {
					$removelist = explode("\r\n", trim($_POST['RemoveEmailList']));
				}

				if (isset($_FILES['RemoveFile']) && $_FILES['RemoveFile']['tmp_name'] != 'none' && $_FILES['RemoveFile']['name'] != '') {
					$filename = TEMP_DIRECTORY . '/removelist.' . $user->userid . '.txt';
					if (is_uploaded_file($_FILES['RemoveFile']['tmp_name'])) {
						move_uploaded_file($_FILES['RemoveFile']['tmp_name'], $filename);
					} else {
						$GLOBALS['Error'] = sprintf(GetLang('UnableToOpenFile'), $_FILES['RemoveFile']['name']);
						$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
						$this->RemoveSubscriber_Step2($listid);
						break;
					}

					if (!$fp = fopen($filename, 'r')) {
						$GLOBALS['Error'] = sprintf(GetLang('UnableToOpenFile'), $_FILES['RemoveFile']['name']);
						$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
						$this->RemoveSubscriber_Step2($listid);
						break;
					}

					$data = fread($fp, filesize($filename));
					fclose($fp);
					unlink($filename);
					$data = str_replace("\r\n", "\n", $data);
					$data = str_replace("\r", "\n", $data);
					$emailaddresses = explode("\n", $data);

					if (empty($emailaddresses)) {
						$GLOBALS['Error'] = sprintf(GetLang('EmptyFile'), $_FILES['RemoveFile']['name']);
						$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
						$this->RemoveSubscriber_Step2($listid);
						break;
					}
					$removelist = $emailaddresses;
				}

				if (is_array($removelist)) {
					$removelist = array_unique($removelist);
				}

				if (empty($removelist)) {
					$GLOBALS['Error'] = GetLang('EmptyRemoveList');
					$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
					$this->RemoveSubscriber_Step2($listid);
					break;
				}

				// reset the session so it can be set up again next time GetLists is called.
				IEM::sessionRemove('UserLists');

				$this->RemoveSubscribers($listid, $removetype, $removelist);

			break;
			case 'step2':
				$listid = (isset($_POST['list'])) ? (int)$_POST['list'] : $_GET['list'];
				// ----- get jobs running for this user
				$db = IEM::getDatabase();
				$jobs_to_check = array();
				$query = "SELECT jobid FROM [|PREFIX|]jobs_lists WHERE listid = {$listid}";
				$result = $db->Query($query);
				if(!$result){
					trigger_error(mysql_error());
					FlashMessage(mysql_error(). "<br />Line: ".__LINE__, SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));
					exit();
				}
				while($row = $db->Fetch($result)){
					$jobs_to_check[] = $row['jobid'];
				}
				$db->FreeResult($result);
				if(!empty($jobs_to_check)){
                    $query = "SELECT jobstatus FROM [|PREFIX|]jobs WHERE jobtype='send' AND jobid IN (" . implode(',', $jobs_to_check) . ")";
					$result = $db->Query($query);
					if(!$result){
						trigger_error(mysql_error());
						FlashMessage(mysql_error(). "<br />Line: ".__LINE__, SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));
						exit();
					}
					while($row = $db->Fetch($result)){
						if($row['jobstatus'] != 'c'){
							FlashMessage('Unable to delete contacts from list(s). Please cancel any campaigns sending to the list(s) in order to delete them.', SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));
							exit();
						}
					}
					$db->FreeResult($result);
				}
				// -----
				$this->RemoveSubscriber_Step2($listid);
			break;
			default:
				$this->ChooseList('Remove', 'Step2');
		}
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:subscribers_remove.php

示例9: Process

	/**
	* Process
	* Standard process function. Works out what you're trying to do and passes action off to other functions.
	*
	* @return Void Doesn't return anything. Hands control off to other functions.
	*/
	function Process()
	{
		$action = (isset($_GET['Action'])) ? strtolower($_GET['Action']) : null;
		$user = IEM::userGetCurrent();
		$access = $user->HasAccess('Statistics');

		$subaction = (isset($_GET['SubAction'])) ? strtolower($_GET['SubAction']) : null;

		$popup = ($action == 'print') ? true : false;

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

		$this->PrintHeader($popup);

		// Print the loading indicator for the charts
		$GLOBALS['TableType'] = 'chart';
		$this->ParseTemplate('Loading_Indicator', false);

		if (!$access) {
			$this->DenyAccess();
		}

		foreach (array('lc', 'uc', 'oc', 'bc', 'fc', 'rc', '') as $k => $area) {
			if ($action == 'processpaging' . $area) {
				$page = null;
				if ($area) {
					$page = 'stats_processpaging' . $area;
				}
				if (isset($_GET['PerPageDisplay' . $area])) {
					$this->SetPerPage($_GET['PerPageDisplay' . $area], $page);
				}
				$action = $subaction;
				if (isset($_GET['NextAction'])) {
					$subaction = strtolower($_GET['NextAction']);
				}
				break;
			}
		}

		if ($action == 'processcalendar') {
			if (isset($_POST['Calendar'])) {
				$calendar_settings = $_POST['Calendar'];
				$user->SetSettings('Calendar', $calendar_settings);
				$this->CalculateCalendarRestrictions($calendar_settings);
				$user->SetSettings('CalendarDates', $this->CalendarRestrictions);
				$user->SaveSettings();
			}
			$action = $subaction;
			if (isset($_GET['NextAction'])) {
				$subaction = strtolower($_GET['NextAction']);
			}
		}

		$this->CalculateCalendarRestrictions();

		switch ($action) {
			case 'list':
				if (!$user->HasAccess('statistics', 'list')) {
					$this->DenyAccess();
				}
				switch ($subaction) {
					case 'step2':
					case 'viewsummary':
						$listid = 0;
						if (isset($_GET['list'])) {
							$listid = (int)$_GET['list'];
						}

						$this->PrintListStats_Step2($listid);
					break;

					default:
						// if they have changed paging, we'll have a 'default' action but the userid will still be in the url.
						if (isset($_GET['list'])) {
							$this->PrintListStats_Step2($_GET['list']);
							break;
						}

						IEM::sessionRemove('ListStatistics');
						$this->PrintListStats_Step1();
				}
			break;

			case 'triggeremails':
				$this->TriggerEmailsStats($subaction);
			break;

			case 'user':
				if (!$user->HasAccess('statistics', 'user')) {
					$this->DenyAccess();
				}
				IEM::sessionRemove('ListStatistics');
				switch ($subaction) {
					case 'step2':
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:stats.php

示例10: CleanupPartialSends

 /**
  * CleanupPartialSends
  * Cleans up any sends that haven't been completed if a browser crashes or a user navigates away from the "send" process.
  *
  * This is needed so if a user gets to the last step and decides to not send a split test
  * or if they navigate away to another page,
  * it credits the user back with their now "used" email credits.
  *
  * @param EventData_IEM_SENDSTUDIOFUNCTIONS_CLEANUPOLDQUEUES $data The data passed in contains an array of the current pagename which is used to work out whether to do anything or not.
  *
  * @return Void Doesn't return anything.
  * @uses EventData_IEM_SENDSTUDIOFUNCTIONS_CLEANUPOLDQUEUES
  */
 public static function CleanupPartialSends(EventData_IEM_SENDSTUDIOFUNCTIONS_CLEANUPOLDQUEUES $data)
 {
     /**
      * We want to clean up the "job" if:
      * - we're not looking at an addons page
      * - if we are looking at an addon, make sure it's not the 'splittest' addon.
      * - if we are looking at the 'splittest' addon, make sure we're not in the middle of the 'send' process somewhere.
      */
     if ($data->page == 'addons') {
         if (isset($_GET['Addon']) && strtolower($_GET['Addon']) == 'splittest') {
             if (isset($_GET['Action']) && strtolower($_GET['Action']) === 'send') {
                 return;
             }
         }
     }
     $send_details = IEM::sessionGet('SplitTestSend_Cleanup');
     if (!$send_details || empty($send_details)) {
         return;
     }
     if (!isset($send_details['Job'])) {
         return;
     }
     $user = IEM::userGetCurrent();
     require_once dirname(__FILE__) . '/api/splittest_send.php';
     $send_api = new Splittest_Send_API();
     $send_api->DeleteJob($send_details['Job'], $send_details['splitid']);
     if (isset($send_details['Stats'])) {
         if (!class_exists('Stats_API', false)) {
             require_once SENDSTUDIO_API_DIRECTORY . '/stats.php';
         }
         $stats_api = new Stats_API();
         /**
          * Delete any left over stats.
          * 
          * These might have been created if the user is sending via the popup window
          * but they clicked 'cancel' on the last step.
          */
         $stats = array_values($send_details['Stats']);
         $stats_api->Delete($stats, 'n');
     }
     IEM::sessionRemove('SplitTestSend_Cleanup');
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:55,代码来源:splittest.php

示例11: ShowBannedList

	/**
	* ShowBannedList
	* Shows a list of banned addresses for a particular list. It handles paging, sorting and so on.
	*
	* @param Mixed $listid The listid can either be an integer (if it's for a particular list), or if it's not a number it's for the "global" banned list.
	*
	* @see GetApi
	* @see User_API::ListAdmin
	* @see GetPerPage
	* @see GetCurrentPage
	* @see GetSortDetails
	* @see Subscriber_API::FetchBannedSubscribers
	*
	* @return Void Prints out the manage area, doesn't return anything.
	*/
	function ShowBannedList($listid=null)
	{
		$subscriber_api = $this->GetApi('Subscribers');

		$user = IEM::getCurrentUser();

		IEM::sessionRemove('ListBansCount');

		$search_details = array();
		$search_details['List'] = $listid;

		IEM::sessionSet('Banned_Search_Subscribers', $search_details);

		$banned_search_info = IEM::sessionGet('Banned_Search_Subscribers');

		if (!is_numeric($banned_search_info['List']) && strtolower($banned_search_info['List']) == 'global') {
			if (!$user->HasAccess('Lists', 'Global')) {
				$this->DenyAccess();
			}
		}

		$listname = '';
		if (is_numeric($banned_search_info['List'])) {
			$ListApi = $this->GetApi('Lists');
			$ListApi->Load($banned_search_info['List']);
			$listname = $ListApi->name;
		} else {
			$listname = GetLang('Subscribers_GlobalBan');
		}

		$GLOBALS['SubscribersBannedManage'] = sprintf(GetLang('SubscribersManageBanned'), htmlspecialchars($listname, ENT_QUOTES, SENDSTUDIO_CHARSET));

		$perpage = $this->GetPerPage();
		$pageid = $this->GetCurrentPage();

		$sortinfo = $this->GetSortDetails();

        $visiblefields_set = array('emailaddress','bandate');

        if(!in_array($sortinfo['SortBy'], $visiblefields_set)){
            $sortinfo['SortBy'] = 'emailaddress';
        }

		$subscriber_list = $subscriber_api->FetchBannedSubscribers($pageid, $perpage, $banned_search_info, $sortinfo);

		$totalbans = $subscriber_list['count'];

		IEM::sessionSet('ListBansCount', $totalbans);

		if ($totalbans == 0) {
			IEM::sessionSet('EmptyBannedSubscriberMessage', $listname);
			$this->ChooseList('banned', 'step2');
			return;
		}

		unset($subscriber_list['count']);

		$GLOBALS['TotalSubscriberCount'] = $this->FormatNumber($totalbans);
		if ($totalbans == 1) {
			$GLOBALS['SubscribersReport'] = GetLang('Banned_Subscribers_FoundOne');
		} else {
			$GLOBALS['SubscribersReport'] = sprintf(GetLang('Banned_Subscribers_FoundMany'), $GLOBALS['TotalSubscriberCount']);
		}

		$DisplayPage = $pageid;
		$start = 0;
		if ($perpage != 'all') {
			$start = ($DisplayPage - 1) * $perpage;
		}

		$GLOBALS['PAGE'] = 'Subscribers&Action=Banned&SubAction=Step2&list=' . $banned_search_info['List'];
		$this->SetupPaging($totalbans, $DisplayPage, $perpage);
		$GLOBALS['FormAction'] = 'Action=Banned&SubAction=ProcessPaging&list=' . $banned_search_info['List'];
		$paging = $this->ParseTemplate('Paging', true, false);

		$GLOBALS['SubscribersManageBanned'] = sprintf(GetLang('SubscribersManageBanned'), htmlspecialchars($listname, ENT_QUOTES, SENDSTUDIO_CHARSET));

		$GLOBALS['List'] = $banned_search_info['List'];

		$template = $this->ParseTemplate('Subscribers_Banned_Manage', true, false);

		$subscriberdetails = '';

		foreach ($subscriber_list['subscriberlist'] as $pos => $subscriberinfo) {
			$GLOBALS['Email'] = $subscriberinfo['emailaddress'];
//.........这里部分代码省略.........
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:subscribers_banned.php

示例12: getSurveyContent

 /**
  * getSurveyContent
  * Render the actual survey question for the specified form id that passed .
  *
  * @return string rendered template
  *
  * @param int    $formId   The id of the survey to get the content for.
  * @param tpl 	 $tpl	   This is the actual template system parsed from the front end
  */
 public function getSurveyContent($surveyId, $tpl)
 {
     // give the form an action to handle the submission
     // $tpl->Assign('action', 'admin/index.php?Page=Addons&Addon=surveys&Action=Submit&ajax=1&formId=' . $surveyId);
     $success_message = IEM::sessionGet('survey.addon.' . $surveyId . '.successMessage');
     if ($success_message) {
         IEM::sessionRemove('survey.addon.' . $surveyId . '.successMessage');
         $tpl->Assign('successMessage', $success_message);
         return $tpl->ParseTemplate('survey_success');
     }
     $tpl->Assign('action', 'surveys_submit.php?ajax=1&formId=' . $surveyId);
     // check for valid ID
     if (!isset($surveyId)) {
         return;
     }
     require_once 'widgets.php';
     $widgets_api = new Addons_survey_widgets_api();
     $loadRes = $this->Load($surveyId);
     if ($loadRes === false) {
         echo 'invalid form id';
         return;
     }
     $surveyData = $this->GetData();
     $widgets = $this->getWidgets($this->id);
     // and if there are widgets
     // iterate through each one
     $widgetErrors = array();
     if ($widgets) {
         $widgetErrors = IEM::sessionGet('survey.addon.' . $surveyId . '.widgetErrors');
         foreach ($widgets as $k => &$widget) {
             if ($widget['is_visible'] == 1 || $widget['type'] == 'section.break') {
                 // $widget->className = Interspire_String::camelCase($widget->type, true);
                 // Getting error from form..
                 $widget['className'] = 'Widget_' . str_replace('.', '_', $widget['type']);
                 $widgets_api->SetId($widget['id']);
                 $widget['fields'] = $widgets_api->getFields(false);
                 // if there are errors for this widget, set them
                 if ($widgetErrors && count($widgetErrors[$widget['id']]) > 0) {
                     $widget['errors'] = $widgetErrors[$widget['id']];
                 }
                 // randomize the fields if told to do so
                 if ($widget['is_random'] == 1) {
                     shuffle($widget['fields']);
                 }
                 // tack on an other field if one exists
                 if ($otherField = $widgets_api->getOtherField()) {
                     $otherField['value'] = '__other__';
                     $widget['fields'][] = $otherField;
                 }
                 // if it is a file widget, then grab the file types
                 if ($widget['type'] == 'file') {
                     $widget['fileTypes'] = preg_split('/\\s*,\\s*/', $widget['allowed_file_types']);
                     $widget['lastFileType'] = array_pop($widget['fileTypes']);
                 }
                 // assign the widget information to the view
                 $tpl->Assign('widget', $widget);
                 // render the widget template
                 $widget['template'] = $tpl->parseTemplate('widget.front.' . $widget['type'], true);
             } else {
                 unset($widgets[$k]);
             }
         }
         // clear the widget errors session variable
         IEM::sessionRemove('survey.addon.' . $surveyId . '.widgetErrors');
     }
     // assign the form, widget and widget-field data to the template
     $tpl->Assign('errorMessage', IEM::sessionGet('survey.addon.' . $surveyId . '.errorMessage'));
     $tpl->Assign('successMessage', IEM::sessionGet('survey.addon.' . $surveyId . '.successMessage'));
     $tpl->Assign('survey', $surveyData);
     $tpl->Assign('widgets', $widgets);
     // unset the message that was set, so it doesn't get displayed again
     IEM::sessionRemove('survey.addon.' . $surveyId . '.errorMessage');
     IEM::sessionRemove('survey.addon.' . $surveyId . '.successMessage');
     //return $this->template->parseTemplate('form', true);
     return $tpl->ParseTemplate('survey');
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:85,代码来源:surveys.php

示例13: ResendJob

	/**
	 * ResendJob
	 *
	 * @return Void Does not return anything
	 *
	 * @todo more phpdoc
	 */
	function ResendJob()
	{
		$job = (int)$_GET['Job'];
		if (!$this->CanAccessJobs($job)) {
			$this->DenyAccess();
			return;
		}

		$jobApi = $this->GetApi('Jobs');

		IEM::sessionRemove('SendDetails');

		$jobinfo = $jobApi->LoadJob($job);
		$send_details = $jobinfo['jobdetails'];

		$GLOBALS['JobID'] = $job;

		$sendqueue = $jobinfo['queueid'];
		$queuesize = $jobApi->UnsentQueueSize($sendqueue);
		$statsid = $jobApi->LoadStats($job);
		//if they need to resend but the queuesize is 0 then they most likely deleted some subscribers while campaign was sending or before it could be resent
		if($queuesize <= 0){ 
			$send_api = $this->GetApi('Send');
			$stats_api = $this->GetApi("Stats");
			$email_api = $this->GetApi("Email");
			echo "<h3>No recipients found in the unsent queue!</h3><br />";
			//need to clean up the job so it won't show up as a resend
			echo "Cleaned up job and removed resend flag.<br />";
			$stats_api->MarkNewsletterFinished($statsid, $queuesize);
			$send_api->ClearQueue($sendqueue, 'send');
			$email_api->CleanupImages();
			echo "<br /><a href='javascript:history.go(-1)'>Go Back</a>";
			exit();	
		}

		$send_details['StatID'] = $statsid;

		$newslettername = '';
		$newsletterApi = $this->GetApi('Newsletters');
		$newsletterApi->Load($send_details['Newsletter']);
		$newslettername = $newsletterApi->Get('name');
		$newslettersubject = $newsletterApi->Get('subject');

		$listdetails = array();
		$listApi = $this->GetApi('Lists');
		foreach ($send_details['Lists'] as $l => $listid) {
			$listApi->Load($listid);
			$listdetails[] = $listApi->Get('name');
		}
		$listnames = implode(', ', $listdetails);

		if ($jobinfo['resendcount'] > 0) {
			if ($jobinfo['resendcount'] == 1) {
				$left_to_send = SENDSTUDIO_RESEND_MAXIMUM - 1;
				if ($left_to_send > 1) {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_One', $this->FormatNumber($left_to_send));
				} else {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_One_OneLeft');
				}
			} else {
				$left_to_send = SENDSTUDIO_RESEND_MAXIMUM - $jobinfo['resendcount'];
				if ($left_to_send > 1) {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_Many', $this->FormatNumber($jobinfo['resendcount']), $this->FormatNumber($left_to_send));
				} else {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_Many_OneLeft', $this->FormatNumber($jobinfo['resendcount']));
				}
			}
		}

		$GLOBALS['Send_NewsletterName'] = sprintf(GetLang('Send_NewsletterName'), htmlspecialchars($newslettername, ENT_QUOTES, SENDSTUDIO_CHARSET));
		$GLOBALS['Send_NewsletterSubject'] = sprintf(GetLang('Send_NewsletterSubject'), htmlspecialchars($newslettersubject, ENT_QUOTES, SENDSTUDIO_CHARSET));

		$GLOBALS['Send_SubscriberList'] = sprintf(GetLang('Send_SubscriberList'), $listnames);

		$GLOBALS['Send_TotalRecipients'] = sprintf(GetLang('Send_Resend_TotalRecipients'), $this->FormatNumber($queuesize));

		IEM::sessionSet('SendDetails', $send_details);

		if ($jobinfo['resendcount'] < SENDSTUDIO_RESEND_MAXIMUM) {
			if (SENDSTUDIO_CRON_ENABLED && SENDSTUDIO_CRON_SEND > 0) {
				$this->ParseTemplate('Send_Resend_Cron');
				return;
			}

			$this->ParseTemplate('Send_Resend');
			return;
		}

		$GLOBALS['Error'] = sprintf(GetLang('Send_Resend_Count_Maximum'), $this->FormatNumber(SENDSTUDIO_RESEND_MAXIMUM));
		$GLOBALS['Send_ResendCount'] = $this->ParseTemplate('ErrorMsg', true, false);

		$this->ParseTemplate('Send_Resend_Maximum');
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:100,代码来源:send.php

示例14: ResendJob

	/**
	 * ResendJob
	 *
	 * @return Void Does not return anything
	 *
	 * @todo more phpdoc
	 */
	function ResendJob()
	{
		$job = (int)$_GET['Job'];
		if (!$this->CanAccessJobs($job)) {
			$this->DenyAccess();
			return;
		}

		$jobApi = $this->GetApi('Jobs');

		IEM::sessionRemove('SendDetails');

		$jobinfo = $jobApi->LoadJob($job);
		$send_details = $jobinfo['jobdetails'];

		$GLOBALS['JobID'] = $job;

		$sendqueue = $jobinfo['queueid'];
		$queuesize = $jobApi->UnsentQueueSize($sendqueue);
		$statsid = $jobApi->LoadStats($job);
		//if they need to resend but the queuesize is 0 then they most likely deleted some subscribers while campaign was sending or before it could be resent
		if($queuesize <= 0){ 
			$send_api = $this->GetApi('Send');
			$stats_api = $this->GetApi("Stats");
			$email_api = $this->GetApi("Email");
			echo "<div class='FlashError'><img align='left' width='18' height='18' class='FlashError' src='images/error.gif'> <h3>No recipients found in the unsent queue!</h3><br>Cleaned up job and removed resend flag.<br><br><a href='#' onclick='window.location=\"index.php?Page=Newsletters\";'>Go Back</a></div>";
			//need to clean up the job so it won't show up as a resend
			$stats_api->MarkNewsletterFinished($statsid, $jobinfo['jobdetails']['EmailResults']['success']);
			$send_api->ClearQueue($sendqueue, 'send');
			$email_api->CleanupImages();
			$db = IEM::getDatabase();
            $query = "UPDATE [|PREFIX|]stats_newsletters SET sendsize=".$jobinfo['jobdetails']['EmailResults']['success']." WHERE statid={$statsid}";
			$update_result = $db->Query($query);
			exit();	
		}

		$send_details['StatID'] = $statsid;

		$newslettername = '';
		$newsletterApi = $this->GetApi('Newsletters');
		$newsletterApi->Load($send_details['Newsletter']);
		$newslettername = $newsletterApi->Get('name');
		$newslettersubject = $newsletterApi->Get('subject');

		$listdetails = array();
		$listApi = $this->GetApi('Lists');
		foreach ($send_details['Lists'] as $l => $listid) {
			$listApi->Load($listid);
			$listdetails[] = $listApi->Get('name');
		}
		$listnames = implode(', ', $listdetails);

		if ($jobinfo['resendcount'] > 0) {
			if ($jobinfo['resendcount'] == 1) {
				$left_to_send = SENDSTUDIO_RESEND_MAXIMUM - 1;
				if ($left_to_send > 1) {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_One', $this->FormatNumber($left_to_send));
				} else {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_One_OneLeft');
				}
			} else {
				$left_to_send = SENDSTUDIO_RESEND_MAXIMUM - $jobinfo['resendcount'];
				if ($left_to_send > 1) {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_Many', $this->FormatNumber($jobinfo['resendcount']), $this->FormatNumber($left_to_send));
				} else {
					$GLOBALS['Send_ResendCount'] = $this->PrintWarning('Send_Resend_Count_Many_OneLeft', $this->FormatNumber($jobinfo['resendcount']));
				}
			}
		}

		$GLOBALS['Send_NewsletterName'] = sprintf(GetLang('Send_NewsletterName'), htmlspecialchars($newslettername, ENT_QUOTES, SENDSTUDIO_CHARSET));
		$GLOBALS['Send_NewsletterSubject'] = sprintf(GetLang('Send_NewsletterSubject'), htmlspecialchars($newslettersubject, ENT_QUOTES, SENDSTUDIO_CHARSET));

		$GLOBALS['Send_SubscriberList'] = sprintf(GetLang('Send_SubscriberList'), $listnames);

		$GLOBALS['Send_TotalRecipients'] = sprintf(GetLang('Send_Resend_TotalRecipients'), $this->FormatNumber($queuesize));

		IEM::sessionSet('SendDetails', $send_details);

		if ($jobinfo['resendcount'] < SENDSTUDIO_RESEND_MAXIMUM) {
			if (SENDSTUDIO_CRON_ENABLED && SENDSTUDIO_CRON_SEND > 0) {
				$this->ParseTemplate('Send_Resend_Cron');
				return;
			}

			$this->ParseTemplate('Send_Resend');
			return;
		}

		$GLOBALS['Error'] = sprintf(GetLang('Send_Resend_Count_Maximum'), $this->FormatNumber(SENDSTUDIO_RESEND_MAXIMUM));
		$GLOBALS['Send_ResendCount'] = $this->ParseTemplate('ErrorMsg', true, false);

		$this->ParseTemplate('Send_Resend_Maximum');
//.........这里部分代码省略.........
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:send.php

示例15: SetSecret

	/**
	* SetSecret
	*
	* Sets the session variable to the current secret code
	*
	* @return unknown
	*/
	function SetSecret()
	{
		IEM::sessionRemove('CaptchaCode');

		$new_code = $this->GetSecret();

		// set new secret to the session
		IEM::sessionSet('CaptchaCode', $new_code);
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:16,代码来源:captcha.php


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