本文整理汇总了PHP中IEM::userLogout方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::userLogout方法的具体用法?PHP IEM::userLogout怎么用?PHP IEM::userLogout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEM
的用法示例。
在下文中一共展示了IEM::userLogout方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Process
/**
* Process
* Logs you out and redirects you back to the login page.
*
* @see Login::Process
*
* @return Void Doesn't return anything. Unsets session variables, removes the "remember me" cookie if it's set and redirects you back to the login page.
*/
function Process()
{
$sessionuser = IEM::getCurrentUser();
$sessionuser->SaveSettings();
unset($sessionuser);
IEM::userLogout();
IEM::requestRemoveCookie('IEM_CookieLogin');
IEM::requestRemoveCookie('IEM_LoginPreference');
$url = SENDSTUDIO_APPLICATION_URL;
if (substr($url, -1, 1) != '/') {
$url .= '/';
}
$url .= 'admin/index.php';
header("Location: {$url}");
exit();
}
示例2: ProcessJob
/**
* ProcessJob
* Processes an autoresponder queue
* Checks a queue for duplicates, makes sure the queue is present and has recipients in it and then calls ActionJob to handle the rest
*
* @param Int $queueid Autoresponder queue to process. This is passed to ActionJob
*
* @see GetUser
* @see RemoveDuplicatesInQueue
* @see QueueSize
* @see ActionJob
* @see UnprocessQueue
*
* @return True Always returns true
*/
function ProcessJob($queueid=0)
{
$queueid = (int)$queueid;
$this->user = GetUser($this->jobowner);
IEM::userLogin($this->jobowner, false);
$queuesize = $this->QueueSize($queueid, 'autoresponder');
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "queuesize: " . $queuesize . " for queueid " . $queueid . "\n", 3, $this->LogFile);
}
$jobid_query = "SELECT jobid FROM " . SENDSTUDIO_TABLEPREFIX . "jobs WHERE queueid='" . $queueid . "'";
$jobid_result = $this->Db->Query($jobid_query);
$jobid = $this->Db->FetchOne($jobid_result, 'jobid');
if (!$jobid) {
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "no jobid (result " . gettype($jobid_result) . "; " . $jobid_result . ")" . "\n", 3, $this->LogFile);
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "Returning" . "\n", 3, $this->LogFile);
}
IEM::userLogout();
return true;
}
$timenow = $this->GetServerTime();
$query = "UPDATE " . SENDSTUDIO_TABLEPREFIX . "jobs SET lastupdatetime=" . $timenow . " WHERE jobid='" . $jobid . "'";
$update_job_result = $this->Db->Query($query);
if ($queuesize <= 0) {
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "Deleting job " . $jobid . " and then returning" . "\n", 3, $this->LogFile);
}
$this->Db->Query("DELETE FROM " . SENDSTUDIO_TABLEPREFIX . "jobs WHERE jobid='" . $jobid . "'");
IEM::userLogout();
return true;
}
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "Actioning jobid " . $jobid . "\n", 3, $this->LogFile);
}
$finished = $this->ActionJob($queueid, $jobid);
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "Finished: " . $finished . "\n", 3, $this->LogFile);
}
// we need to turn 'processed' emails back to normal so we can check them next time.
$this->UnprocessQueue($queueid);
if ($this->Debug) {
error_log(time() . "\t" . __FILE__ . "\t" . __LINE__ . "\t" . "Deleting jobid " . $jobid . "\n", 3, $this->LogFile);
}
$this->Db->Query('DELETE FROM ' . SENDSTUDIO_TABLEPREFIX . 'jobs_lists WHERE jobid=' . intval($jobid));
$this->Db->Query("DELETE FROM " . SENDSTUDIO_TABLEPREFIX . "jobs WHERE jobid=" . intval($jobid));
IEM::userLogout();
return true;
}
示例3: eventLinkClicked
/**
* eventLinkClicked
* This is a listener for "IEM_STATSAPI_RECORDLINKCLICK" event.
* It allows trigger email to capture "Newsletter Opened" and "Link Clicked"
*
* @param EventData_IEM_STATSAPI_RECORDLINKCLICK $eventData Event data object
* @return Void Returns nothing
*
* @uses EventData_IEM_STATSAPI_RECORDLINKCLICK
*/
static public function eventLinkClicked(EventData_IEM_STATSAPI_RECORDLINKCLICK $eventData)
{
// Only intrested if it is a newsletter
if ($eventData->statstype != 'newsletter') {
return;
}
// If this click has been recorded previously, ignore it
if ($eventData->have_been_recorded) {
return;
}
$api = new TriggerEmails_API();
$linkid = intval($eventData->click_details['linkid']);
$statid = intval($eventData->click_details['statid']);
$triggerrecords = $api->GetRecordByAssociatedLinkIDStatID($linkid, $statid);
// If no trigger records are found, return from function
if (!$triggerrecords || !is_array($triggerrecords) || !isset($triggerrecords['triggeremails']) || empty($triggerrecords['triggeremails'])) {
return;
}
$recipients = $api->_getSubscriberIDSFromList($eventData->click_details['subscriberid'], array_keys($triggerrecords['lists']));
foreach ($triggerrecords['triggeremails'] as $trigger) {
// If receipients has been added to the send queue or have been sent an email for this particular trigger, do not re-add the subscriber again
if (!$api->CanAddToQueue($trigger['triggeremailsid'], $eventData->click_details['subscriberid'], $trigger['queueid'])) {
continue;
}
$schedule = time() + ($trigger['triggerhours'] * 3600);
IEM::userLogin($trigger['ownerid'], false);
$api->AddToQueue($trigger['queueid'], 'triggeremail', $recipients, $schedule);
IEM::userLogout();
}
return;
}
示例4: ProcessJob
//.........这里部分代码省略.........
}
$this->Subscriber_API->RemoveDuplicatesInQueue($sendqueue, 'send', $this->jobdetails['Lists']);
$this->Subscriber_API->RemoveBannedEmails($this->jobdetails['Lists'], $sendqueue, 'send');
$this->Subscriber_API->RemoveUnsubscribedEmails($this->jobdetails['Lists'], $sendqueue, 'send');
$queueid = $sendqueue;
$newsletterstats = $this->jobdetails;
$newsletterstats['Job'] = $jobid;
$newsletterstats['Queue'] = $sendqueue;
$newsletterstats['SentBy'] = $queueinfo['ownerid'];
$real_queuesize = $this->Subscriber_API->QueueSize($queueid, 'send');
$newsletterstats['SendSize'] = $real_queuesize;
$statid = $this->Stats_API->SaveNewsletterStats($newsletterstats);
/**
* Process tracker request where because cron was not enabled, we need to parse the option straight away
* @todo Result for the call to module_Tracker::ParseOptionsForAllTracker() is not being processed and being ignored
*/
$tempAPIFile = dirname(__FILE__) . '/module_trackerfactory.php';
if (is_file($tempAPIFile)) {
require_once($tempAPIFile);
$temp = array_merge($this->jobdetails, array('statid' => $statid,
'stattype' => 'newsletter',
'newsletterid' => $this->jobdetails['Newsletter']));
$status = module_Tracker::ParseOptionsForAllTracker($temp);
}
/**
* -----
*/
/**
* So we can link user stats to send stats, we need to update it.
*/
$this->Stats_API->UpdateUserStats($queueinfo['ownerid'], $jobid, $statid);
/**
* The 'queuesize' in the stats_users table is updated by MarkNewsletterFinished in send.php
* so we don't need to worry about it while setting up the send.
* That takes into account whether some recipients were skipped because a html-only email was sent etc.
*/
/**
* We re-check the user stats in case a bunch of subscribers have joined, or the user has done something like:
* - create a list
* - added a few subscribers
* - scheduled a send
* - added more subscribers
*/
$check_stats = $this->Stats_API->ReCheckUserStats($user, $original_queuesize, $real_queuesize, AdjustTime());
list($ok_to_send, $not_ok_to_send_reason) = $check_stats;
if (!$ok_to_send) {
trigger_error(__CLASS__ . '::' . __METHOD__ . " -- " . GetLang($not_ok_to_send_reason), E_USER_WARNING);
$this->PauseJob($jobid);
$this->UnapproveJob($jobid);
IEM::userLogout();
return false;
}
API_USERS::creditEvaluateWarnings($user->GetNewAPI());
}
$this->statid = $this->LoadStats($jobid);
if (empty($this->statid)) {
trigger_error(__CLASS__ . '::' . __METHOD__ . " -- Cannot find statid. Previous preliminary job process did not get finalized (either CRON died, or it hasn't finished processing the job). Ignoring this job: jobid {$jobid}.", E_USER_NOTICE);
IEM::userLogout();
return false;
}
$queuesize = $this->Subscriber_API->QueueSize($queueid, 'send');
// used by send.php::CleanUp
$this->queuesize = $this->jobdetails['SendSize'];
/**
* There's nothing left? Just mark it as done.
*/
if ($queuesize == 0) {
$this->jobstatus = 'c';
$this->FinishJob($jobid);
IEM::userLogout();
return true;
}
$finished = $this->ActionJob($jobid, $queueid);
if ($finished) {
$this->jobstatus = 'c';
$this->FinishJob($jobid);
}
IEM::userLogout();
return true;
}
示例5: _ProcessJob
//.........这里部分代码省略.........
$this->_subscribers_api->GetSubscribers($send_criteria, array(), false, $queueinfo, $sendqueue);
}
if (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {
$this->Db->OptimizeTable(SENDSTUDIO_TABLEPREFIX . "queues");
}
$this->_subscribers_api->RemoveDuplicatesInQueue($sendqueue, 'splittest', $jobdetails['Lists']);
$this->_subscribers_api->RemoveBannedEmails($jobdetails['Lists'], $sendqueue, 'splittest');
$this->_subscribers_api->RemoveUnsubscribedEmails($jobdetails['Lists'], $sendqueue, 'splittest');
if (SENDSTUDIO_DATABASE_TYPE == 'pgsql') {
$this->Db->OptimizeTable(SENDSTUDIO_TABLEPREFIX . "queues");
}
$jobdetails['SendSize'] = $this->_subscribers_api->QueueSize($sendqueue, 'splittest');
$jobdetails['Stats'] = array();
$jobdetails['SendQueue'] = $sendqueue;
/**
* Delete the old user stats allocations.
* They were all allocated under one stat/job before so the user recorded their send info
* so they couldn't set up split test sends and go over their send quota.
*
* Now, we need to re-allocate them per newsletter being sent.
*/
$this->_stats_api->DeleteUserStats($jobinfo['ownerid'], $this->_jobid);
$statids = array();
foreach ($jobdetails['newsletters'] as $newsletterid) {
$newsletterstats = $jobdetails;
$newsletterstats['Job'] = $jobid;
$newsletterstats['Queue'] = $sendqueue;
$newsletterstats['SentBy'] = $queueinfo['ownerid'];
$newsletterstats['SendType'] = 'splittest';
$newsletterstats['Newsletter'] = $newsletterid;
$newsletterstats['Lists'] = $jobdetails['sendingto']['Lists'];
$newsletterstats['SendCriteria'] = $jobdetails['SendCriteria'];
$statid = $this->_stats_api->SaveNewsletterStats($newsletterstats);
$statids[] = $statid;
$jobdetails['Stats'][$newsletterid] = $statid;
$this->_stats_api->RecordUserStats($jobinfo['ownerid'], $this->_jobid, $jobdetails['SendSize'], $jobdetails['SendStartTime'], $statid);
}
$this->SaveSplitStats($jobdetails['splitid'], $this->_jobid, $statids);
/**
* If it's a percentage send,
* work out the number of emails to send for the first percentage
* It gets stored in the jobdetails array so it can be saved in the database.
*/
if ($this->splitcampaign_details['splittype'] == 'percentage') {
$max_to_email = ceil($this->splitcampaign_details['splitdetails']['percentage'] / 100 * $jobdetails['SendSize']);
$jobdetails['percentage_send_maximum'] = $max_to_email;
}
/**
* Save the job stat details.
* Otherwise we could potentially end up with a 'start'ed queue but no stats.
*/
$this->Set('jobdetails', $jobdetails);
$this->UpdateJobDetails();
/**
* This is to process the 'queueid' later in the code.
*/
$queueid = $sendqueue;
// This will make sure that the credit warning emails are also being send out from splittest
API_USERS::creditEvaluateWarnings($user->GetNewAPI());
}
$this->Db->OptimizeTable(SENDSTUDIO_TABLEPREFIX . "queues");
$queuesize = $this->_subscribers_api->QueueSize($queueid, 'splittest');
$this->_queueid = $queueid;
/**
* If there is a "percentage_send_maximum" variable in the jobdetails array,
* we are sending to the first part of a 'percentage' split test.
*
* We have to send to the rest of the percentage maximum before we pause the job,
* work out the "best" performing campaign and send to that.
*/
if (isset($jobdetails['percentage_send_maximum'])) {
$this->_percentage_send_maximum = (int) $jobdetails['percentage_send_maximum'];
}
/**
* If the _percentage_send_maximum is 0, then "timeout" the job.
* We must have hit "pause" right at the end of the initial send process or something.
*/
if ($this->_percentage_send_maximum !== null && $this->_percentage_send_maximum <= 0) {
$this->TimeoutJob($jobid, $this->splitcampaign_details['splitid'], $this->splitcampaign_details['splitdetails']['hoursafter']);
IEM::userLogout();
return true;
}
$this->Set('statids', $jobdetails['Stats']);
$this->Set('jobdetails', $jobdetails);
$this->Set('jobowner', $jobinfo['ownerid']);
/**
* There's nothing left? Just mark it as done.
*/
if ($queuesize == 0) {
$this->_FinishJob();
IEM::userLogout();
return true;
}
$finished = $this->_ActionJob($jobid, $queueid);
if ($finished) {
$this->_FinishJob();
}
IEM::userLogout();
return true;
}