本文整理汇总了PHP中IEM::userGetCurrent方法的典型用法代码示例。如果您正苦于以下问题:PHP IEM::userGetCurrent方法的具体用法?PHP IEM::userGetCurrent怎么用?PHP IEM::userGetCurrent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IEM
的用法示例。
在下文中一共展示了IEM::userGetCurrent方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Process
/**
* Process
* Takes the appropriate action based on the action
*
* @return Void Doesn't return anything. Takes the appropriate action.
*/
function Process()
{
$GLOBALS['Message'] = '';
if(is_null($this->user)){$this->user = IEM::userGetCurrent();}
$action = (isset($_GET['Action'])) ? strtolower($_GET['Action']) : null;
$type = (isset($_GET['Type'])) ? strtolower($_GET['Type']) : '';
$typeId = (isset($_GET['TypeId'])) ? strtolower($_GET['TypeId']) : 0;
//trying to get another users images? that shouldn't happen
if($type == 'user' && $typeId != $this->user->userid){
$GLOBALS['Message'] = 'Unable to load images for another user ID';
exit();
}
if ($action == 'processpaging') {
$this->SetPerPage($_GET['PerPageDisplay']);
$action = 'manage';
}
switch ($action) {
case 'remoteupload':
$this->RemoteUpload($type, $typeId);
break;
case 'getimageslist':
$this->GetImagesList($type, $typeId);
break;
case 'noflashupload':
$this->NoFlashUpload();
break;
default:
$this->PrintHeader();
$this->ManageImages($this->user->userid);
}
$this->PrintFooter();
}
示例2: Process
/**
* Process
* This handles working out what stage you are up to and so on with workflow.
* It handles creating, editing, deleting, copying etc.
* It also uses the session to remember what you've done (eg chosen a text newsletter) so it only has to do one update at a time rather than doing everything separately.
*
* @see GetUser
* @see User_API::HasAccess
* @see PrintHeader
* @see GetApi
* @see Newsletter_API::Load
* @see Newsletter_API::GetBody
* @see Newsletter_API::Copy
* @see Newsletter_API::Create
* @see Newsletter_API::Save
* @see Newsletter_API::Delete
* @see ManageNewsletters
* @see PreviewWindow
* @see MoveFiles
* @see CreateNewsletter
* @see DisplayEditNewsletter
* @see EditNewsletter
*
* Doesn't return anything, handles processing (with the api) and prints out the results.
*/
function Process() {
$GLOBALS['Message'] = '';
$action = (isset($_GET['Action'])) ? strtolower(urldecode($_GET['Action'])) : null;
$id = (isset($_GET['id'])) ? strtolower(urldecode($_GET['id'])) : null;
$user = IEM::userGetCurrent();
$final_action = $action;
$secondary_actions = array('activate', 'deactivate', 'activatearchive', 'deactivatearchive');
if (in_array($action, $secondary_actions)) {
$final_action = 'approve';
}
// with 'change' actions, each separate action is checked further on, so we'll just check they can manage anything in this area.
if (in_array($action, array('change', 'checkspam', 'viewcompatibility', 'processpaging', 'sendpreview', 'preview'))) {
$final_action = 'manage';
}
if(is_null($id)){
$access = $user->HasAccess('newsletters', $final_action);
} else {
$access = $user->HasAccess('newsletters', $final_action, $id);
}
$popup = (in_array($action, $this->PopupWindows)) ? true : false;
if (!in_array($action, $this->SuppressHeaderFooter)) {
$this->PrintHeader($popup);
}
if (!$access && !$popup) {
$this->DenyAccess();
return;
}
if ($action == 'processpaging') {
$this->SetPerPage($_GET['PerPageDisplay']);
$this->ManageNewsletters();
if (!in_array($action, $this->SuppressHeaderFooter)) {
$this->PrintFooter($popup);
}
exit;
}
switch ($action) {
case 'viewcompatibility':
$newsletter_info = IEM::sessionGet('Newsletters');
$html = (isset($_POST['myDevEditControl_html'])) ? $_POST['myDevEditControl_html'] : false;
$text = (isset($_POST['TextContent'])) ? $_POST['TextContent'] : false;
$showBroken = isset($_REQUEST['ShowBroken']) && $_REQUEST['ShowBroken'] == 1;
$details = array();
$details['htmlcontent'] = $html;
$details['textcontent'] = $text;
$details['format'] = $newsletter_info['Format'];
$this->PreviewWindow($details, $showBroken);
exit;
break;
case 'checkspamdisplay':
$force = IEM::ifsetor($_GET['Force'], false);
$this->CheckContentForSpamDisplay($force);
break;
case 'checkspam':
$text = (isset($_POST['TextContent'])) ? $_POST['TextContent'] : false;
$html = (isset($_POST['myDevEditControl_html'])) ? $_POST['myDevEditControl_html'] : false;
$this->CheckContentForSpam($text, $html);
break;
case 'activate':
case 'deactivate':
case 'activatearchive':
case 'deactivatearchive':
$newsletterapi = $this->GetApi();
//.........这里部分代码省略.........
示例3: Show_Send_Step_3
//.........这里部分代码省略.........
foreach ($split_campaign_details['splittest_campaigns'] as $campaignid => $campaignname) {
$sendingCampaigns[$campaignid] = htmlspecialchars($campaignname, ENT_QUOTES, SENDSTUDIO_CHARSET);
$send_details['newsletters'][$campaignid] = $campaignid;
}
/**
* Before saving the job details, randomize the newsletter order.
* This is so we don't send the newsletters in the same order every time.
*/
shuffle($send_details['newsletters']);
$send_list = array();
switch ($send_details['sendingto']['sendtype']) {
case 'list':
require_once SENDSTUDIO_API_DIRECTORY . '/lists.php';
$list_api = new Lists_API();
foreach ($send_details['sendingto']['sendids'] as $listid) {
$list_api->Load($listid);
$send_list[] = htmlspecialchars($list_api->Get('name'), ENT_QUOTES, SENDSTUDIO_CHARSET);
}
$this->template_system->Assign('SendingToLists', true);
break;
case 'segment':
require_once SENDSTUDIO_API_DIRECTORY . '/segment.php';
$segment_api = new Segment_API();
foreach ($send_details['sendingto']['sendids'] as $segmentid) {
$segment_api->Load($segmentid);
$send_list[] = htmlspecialchars($segment_api->Get('segmentname'), ENT_QUOTES, SENDSTUDIO_CHARSET);
}
// The job expects a 'Segments' element, otherwise it will send to entire lists.
$send_details['Segments'] = $send_details['sendingto']['sendids'];
$this->template_system->Assign('SendingToSegments', true);
break;
}
$subscriber_count = $send_details['sendsize'];
$user = IEM::userGetCurrent();
if ($user->HasAccess('Newsletters')) {
$this->template_system->Assign('ApplicationUrl', $this->application_url, false);
$this->template_system->Assign('NewsletterView', true);
}
$send_criteria = array();
// can only send to active subscribers.
$send_criteria['Status'] = 'a';
$send_criteria['List'] = $send_details['sendingto']['Lists'];
$send_details['SendCriteria'] = $send_criteria;
$check_stats = $statsapi->CheckUserStats($user, $subscriber_count, $send_details['SendStartTime']);
list($ok_to_send, $not_ok_to_send_reason) = $check_stats;
if (!$ok_to_send) {
require_once SENDSTUDIO_LANGUAGE_DIRECTORY . '/default/send.php';
FlashMessage(GetLang($not_ok_to_send_reason), SS_FLASH_MSG_ERROR, $this->admin_url . '&Action=Send&Step=2');
return;
}
/**
* The 'job' expects a 'Lists' element, so just point it to the sendingto lists.
*/
$send_details['Lists'] = $send_details['sendingto']['Lists'];
$send_details['SendSize'] = $subscriber_count;
$jobcreated = $jobapi->Create('splittest', $send_details['SendStartTime'], $user->userid, $send_details, 'splittest', $send_details['splitid'], $send_details['sendingto']['Lists']);
$send_details['Job'] = $jobcreated;
IEM::sessionSet('JobSendSize', $subscriber_count);
// if we're not using scheduled sending, create the queue and start 'er up!
if (!self::CheckCronEnabled()) {
require_once SENDSTUDIO_API_DIRECTORY . '/subscribers.php';
$subscriberApi = new Subscribers_API();
$sendqueue = $subscriberApi->CreateQueue('splittest');
$jobapi->StartJob($jobcreated);
$queuedok = $jobapi->JobQueue($jobcreated, $sendqueue);
$queueinfo = array('queueid' => $sendqueue, 'queuetype' => 'splittest', 'ownerid' => $user->userid);
示例4: 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;
}
示例5: _GenerateSegmentRuleQuery
//.........这里部分代码省略.........
// Filter by confirmation status (confirmed or unconfirmed)
case 'confirmation':
array_push($conditions, 'subscribers.confirmed '
. $this->_TranslateSegmentOperator($eachRule['rules']['ruleOperator'])
. " '" . intval($eachRule['rules']['ruleValues'][0]) . "'");
break;
// Filter by subscribed date
case 'subscribe':
$tempOperator = $this->_TranslateSegmentOperator($eachRule['rules']['ruleOperator'], true);
$tempValues = $eachRule['rules']['ruleValues'];
/**
* Make sure that the time is always in chronological order
* (as there is only 2 times, we don't need to deply any sorting method --- This will do nicely)
*/
if (count($tempValues) == 2) {
list($tempDay, $tempMonth, $tempYear) = explode('/', $tempValues[0]);
$tempValue1 = mktime(null, null, null, $tempMonth, $tempDay, $tempYear);
list($tempDay, $tempMonth, $tempYear) = explode('/', $tempValues[1]);
$tempValue2 = mktime(null, null, null, $tempMonth, $tempDay, $tempYear);
if ($tempValue1 < $tempValue2) {
$tempValues = array($tempValues[0], $tempValues[1]);
} else {
$tempValues = array($tempValues[1], $tempValues[0]);
}
}
/**
* -----
*/
$user = IEM::userGetCurrent();
$DateConverter = new ConvertDate(SENDSTUDIO_SERVERTIMEZONE, $user->Get('usertimezone'));
// Convert date into unix timestamp
$tempTime = array();
if (count($tempValues) == 2) {
list($tempDay, $tempMonth, $tempYear) = explode('/', $tempValues[0]);
array_push($tempTime, $DateConverter->ConvertToGMTFromServer(0, 0, 0, $tempMonth, $tempDay, $tempYear));
list($tempDay, $tempMonth, $tempYear) = explode('/', $tempValues[1]);
array_push($tempTime, $DateConverter->ConvertToGMTFromServer(23, 59, 59, $tempMonth, $tempDay, $tempYear));
} else {
list($tempDay, $tempMonth, $tempYear) = explode('/', $tempValues[0]);
//array_push($tempTime, $DateConverter->ConvertToGMTFromServer(0, 0, 0, $tempMonth, $tempDay, $tempYear));
array_push($tempTime, $DateConverter->ConvertToGMTFromServer(23, 59, 59, $tempMonth, $tempDay, $tempYear));
}
$tempCondition = array();
foreach ($tempTime as $index => $each) {
array_push($tempCondition, ('subscribers.subscribedate '
. (is_array($tempOperator)? $tempOperator[$index] : $tempOperator)
. ' ' . $each));
}
$tempOperator = ' AND ';
if ($eachRule['rules']['ruleOperator'] == 'notequalto') {
$tempOperator = ' OR ';
}
array_push($conditions, '(' . implode($tempOperator, $tempCondition) . ')');
break;
// Filter by "have clicked" or "have not clicked" link
case 'link':
示例6: MoveFiles
/**
* MoveFiles
* Moves uploaded images from temporary storage under a user's id - to it's final location - under the type and it's id. Eg newsletter/1.
*
* @param String $destination The destination (eg newsletter or template).
* @param Int $id The destinations id.
*
* @see CreateDirectory
* @see list_files
*
* @return Boolean Returns false if it can't create the paths or it can't copy the necessary files. Returns true if everything worked ok.
*/
function MoveFiles($destination=false, $id=0)
{
if (!$destination) {return false;}
if($id <= 0){ return false; }
$user = IEM::userGetCurrent();
$tempid = $user->userid . "_tmp";
$destinationdir = TEMP_DIRECTORY . '/' . $destination . '/' . $id;
$tempdir = TEMP_DIRECTORY . '/' . $destination . '/' . $tempid;
if(!file_exists($destinationdir)){
$createdir = CreateDirectory($destinationdir,TEMP_DIRECTORY,0777);
if (!$createdir) {return false;}
}
//Get files from the 'temporary' folder, /destination/userid_tmp/, and move them to the final location
if(CopyDirectory($tempdir, $destinationdir)){remove_directory($tempdir);}
return true;
}
示例7: langLoad
public static function langLoad($language)
{
$user = IEM::userGetCurrent();
$user_language = 'default';
$language = strtolower($language);
// If it has been loaded before, return
if (in_array($language, self::$_langLoaded)) {
return true;
}
// If user have their own language preference, use that
if (!empty($user->user_language)) {
$users_language = $user->user_language;
}
// If their language preference not available, we use the default
if (empty($users_language) || !is_dir(IEM_PATH . "/language/{$users_language}")) {
$users_language = 'default';
}
// ----- Include language file
$langfile = IEM_PATH . "/language/{$users_language}/{$language}.php";
if (!is_file($langfile)) {
trigger_error("No Language file for {$language} area", E_USER_WARNING);
return false;
}
include_once $langfile;
// -----
self::$_langLoaded[] = $language;
return true;
}
示例8: SetFolderMode
/**
* SetFolderMode
* Sets the viewing mode to either the normal non-folder list mode or
* folder mode.
*
* @param String $mode Either 'list' (normal) or 'folder'.
*
* @uses GetPageName
* @uses GetUser
* @uses User_API::GetSettings
* @uses User_API::SetSettings
*
* @return Boolean True if the setting was saved, otherwise false.
*/
public function SetFolderMode($mode)
{
$mode = strtolower($mode);
if (!in_array($mode, array('list', 'folder'))) {
return false;
}
$user = IEM::userGetCurrent();
$page = $this->GetPageName();
$display_settings = $user->GetSettings('DisplaySettings');
if (!isset($display_settings['FolderMode']) || !is_array($display_settings['FolderMode'])) {
$display_settings['FolderMode'] = array();
}
$display_settings['FolderMode'][$page] = $mode;
$user->SetSettings('DisplaySettings', $display_settings);
$user->SaveSettings();
return true;
}
示例9: ReduceEmails
/**
* ReduceEmails
* Reduces the maximum amount of emails the current user can send.
*
* @param Int $reduce_emails_by The number of emails to reduce by.
*
* @return Boolean True if the reduction was completed successfully, otherwise false.
*/
function ReduceEmails($reduce_emails_by=0) {
if ($this->userid <= 0) {
return false;
}
$userid = intval($this->userid);
$reduce_emails_by = intval($reduce_emails_by);
if ($reduce_emails_by == 0) {
return true;
}
if ($this->hasUnlimitedTotalCredit()) {
return true;
}
$this->GetDb();
$currentUser = IEM::userGetCurrent();
if ($currentUser->userid == $this->userid) {
IEM::userFlushCache();
}
return true;
}
示例10: _TriggerEmailsStats_Access
/**
* _TriggerEmailsStats_Permission
* Check whether or not current user have the permission to access
*
* @param Integer $id ID of the trigger emails
* @return Boolean Returns TRUE if user is able to access record, FALSE otherwise
*/
function _TriggerEmailsStats_Access($id)
{
$id = intval($id);
$user = IEM::userGetCurrent();
if ($id == 0) {
return false;
}
// Admin can access all
if ($user->Admin()) {
return true;
}
// Only admin user and the owner of the trigger can access them.
$api = $this->GetApi('Triggeremails');
$record = $api->GetRecordByID($id);
return ($user->userid === $record['ownerid']);
}
示例11: SetPerPage
/**
* SetPerPage
* This is an internal only method which sets the number of results to show per page for a particular addon per user.
*
* Each addon (and each user) can have different per-page settings.
*
* @param Int $perpage The new perpage limit for the current addon. The default is 10 and if an invalid number is passed through, 10 is also the new number set.
*
* @uses addon_id
* @uses GetUser
* @uses User_API::GetSettings
* @uses User_API::SetSettings
*
* @return Int Returns the new perpage limit set.
*/
protected function SetPerPage($perpage = 10)
{
$perpage = (int) $perpage;
if ($perpage < 1) {
$perpage = 10;
}
$user = IEM::userGetCurrent();
$display_settings = $user->GetSettings('DisplaySettings');
if (!isset($display_settings['NumberToShow']) || !is_array($display_settings['NumberToShow'])) {
$display_settings['NumberToShow'] = array();
}
$display_settings['NumberToShow'][$this->addon_id] = $perpage;
$user->SetSettings('DisplaySettings', $display_settings);
$user->SaveSettings();
return $perpage;
}
示例12: Process
//.........这里部分代码省略.........
$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;
}
$rememberdetails = IEM::requestGetPOST('rememberme', false);
$rememberdetails = (bool)$rememberdetails;
$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'));
if ($rememberdetails) {
if (!$user) { $user = IEM::userGetCurrent(); }
if (!$rand_check) { $rand_check = uniqid(true); }
$usercookie_info = array('user' => $user->userid, 'time' => time(), 'rand' => $rand_check, 'takemeto' => $redirect);
IEM::requestSetCookie('IEM_CookieLogin', $usercookie_info, $oneyear);
$usercookie_info = array('takemeto' => $redirect);
IEM::requestSetCookie('IEM_LoginPreference', $usercookie_info, $oneyear);
}
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;
}
}
示例13: 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');
}
示例14: Process
/**
* Process
* This works out where you are up to in the send process and takes the appropriate action. Most is passed off to other methods in this class for processing and displaying the right forms.
*
* @return Void Doesn't return anything.
*/
function Process()
{
$action = (isset($_GET['Action'])) ? strtolower($_GET['Action']) : null;
$user = IEM::userGetCurrent();
$access = $user->HasAccess('Newsletters', 'send');
$popup = (in_array($action, $this->PopupWindows)) ? true : false;
$this->PrintHeader($popup);
if (!$access) {
$this->DenyAccess();
return;
}
if ($action == 'processpaging') {
$this->SetPerPage($_GET['PerPageDisplay']);
$action = '';
}
switch ($action) {
case 'viewsenderrors':
$job = (isset($_GET['Job'])) ? (int)$_GET['Job'] : 0;
if (!$this->CanAccessJobs($job)) {
$this->DenyAccess();
return;
}
echo $this->PrintSendFailureReport($job);
break;
case 'view_report':
$queueid = IEM::sessionGet('ReportQueue');
$report_type = (isset($_GET['ReportType'])) ? strtolower($_GET['ReportType']) : null;
switch ($report_type) {
case '1':
$GLOBALS['Heading'] = GetLang('SendProblem_Report_Subscriber_Problem_Heading');
$GLOBALS['Intro'] = GetLang('SendProblem_Report_Subscriber_Problem_Intro');
break;
case '10':
$GLOBALS['Heading'] = GetLang('SendProblem_Report_Email_Problem_Heading');
$GLOBALS['Intro'] = GetLang('SendProblem_Report_Email_Problem_Intro');
break;
case '20':
$GLOBALS['Heading'] = GetLang('SendProblem_Report_MailServer_Problem_Heading');
$GLOBALS['Intro'] = GetLang('SendProblem_Report_MailServer_Problem_Intro');
break;
case '30':
$GLOBALS['Heading'] = GetLang('SendProblem_Report_SMTPMailServer_Problem_Heading');
$GLOBALS['Intro'] = GetLang('SendProblem_Report_SMTPMailServer_Problem_Intro');
break;
default:
$GLOBALS['Heading'] = GetLang('SendProblem_Report_Invalid_Heading');
$GLOBALS['Intro'] = GetLang('SendProblem_Report_Invalid_Intro');
$GLOBALS['EmailList'] = GetLang('SendProblem_InvalidReportURL');
$this->ParseTemplate('SendProblem_Report_Results_View');
break 2;
}
$api = $this->GetApi('Subscribers');
$email_list = '';
$problem_email_addresses = $api->GetUnsentSubscribers($queueid, $report_type);
foreach ($problem_email_addresses as $emailaddress) {
$email_list .= htmlspecialchars($emailaddress, ENT_QUOTES, SENDSTUDIO_CHARSET) . "\n";
}
$GLOBALS['EmailList'] = $email_list;
$this->ParseTemplate('SendProblem_Report_Results_View');
break;
case 'pausesend':
$job = (int)$_GET['Job'];
if (!$this->CanAccessJobs($job)) {
$this->DenyAccess();
return;
}
$api = $this->GetApi('Jobs');
$paused = $api->PauseJob($job);
if ($paused) {
$GLOBALS['Message'] = $this->PrintSuccess('Send_Paused_Success');
} else {
$GLOBALS['Error'] = GetLang('Send_Paused_Failure');
$GLOBALS['Message'] = $this->ParseTemplate('ErrorMsg', true, false);
}
$this->ParseTemplate('Send_Step5_Paused');
break;
case 'sendfinished':
//.........这里部分代码省略.........
示例15: __construct
/**
* Constructor
* Initialize the image directory
*
* @return Void
*/
function __construct() {
if(is_null($this->user)){$this->user = IEM::userGetCurrent();}
$userid = $this->user->userid;
$this->imageDirectory = '/user/' . $userid;
//added userimageDirectory as a permanent place holder for the user's folder - imageDirectory will change inside Init
$this->userimageDirectory = '/user/' . $userid;
//---
if(!file_exists(TEMP_DIRECTORY . $this->imageDirectory)){
CreateDirectory(TEMP_DIRECTORY . $this->imageDirectory, TEMP_DIRECTORY, 0777);
}
}