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


PHP IEM::getCurrentUser方法代码示例

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


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

示例1: init

 public static final function init($reset = false)
 {
     $GLOBALS['ApplicationUrl'] = SENDSTUDIO_APPLICATION_URL;
     if (defined('SENDSTUDIO_IS_SETUP') && SENDSTUDIO_IS_SETUP && !InterspireEvent::eventExists('IEM_MARKER_20090701')) {
         IEM_Installer::RegisterEventListeners();
         require_once IEM_ADDONS_PATH . '/interspire_addons.php';
         $addons = new Interspire_Addons();
         $addons->FixEnabledEventListeners();
         InterspireEvent::eventCreate('IEM_MARKER_20090701');
     }
     if (!self::configInit($reset)) {
         return false;
     }
     if (!self::sessionInit($reset)) {
         return false;
     }
     if (!self::userInit($reset)) {
         return false;
     }
     $tempUser = IEM::getCurrentUser();
     $tempUserLanguage = 'default';
     if (!empty($tempUser->user_language) && is_dir(IEM_PATH . "/language/{$tempUser->user_language}")) {
         $tempUserLanguage = $tempUser->user_language;
     }
     require_once IEM_PATH . "/language/{$tempUserLanguage}/whitelabel.php";
     require_once IEM_PATH . "/language/{$tempUserLanguage}/language.php";
     self::$_enableInfoTips = false;
     if (isset($tempUser->infotips) && $tempUser->infotips) {
         self::$_enableInfoTips = true;
     }
     unset($tempUserLanguage);
     unset($tempUser);
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:33,代码来源:IEM.class.php

示例2: __construct

 /**
  * CONSTRUCTOR
  * Override parant's constructor.
  *
  * We will need to check whether or not current user have the correct
  * privilage to use "AdminTools"
  *
  * TODO better PHPDOC
  */
 public function __construct()
 {
     // ----- Make sure that current user is an admin
     $currentUser = IEM::getCurrentUser();
     if (!$currentUser || !$currentUser->isAdmin()) {
         IEM::redirectTo('index');
         return false;
     }
     // -----
     return parent::__construct();
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:20,代码来源:AdminTools.class.php

示例3: RemoteStats

	/**
	* RemoteStats
	* Loads up the language file.
	*
	* @return Void Doesn't return anything.
	*/
	function RemoteStats()
	{
		if (!IEM::getCurrentUser()) {
			if (defined('SENDSTUDIO_APPLICATION_URL') && SENDSTUDIO_APPLICATION_URL !== false) {
				header('Location: ' . SENDSTUDIO_APPLICATION_URL . '/admin/index.php');
			} else {
				header('Location: ../index.php');
			}
			exit;
		}

		$this->LoadLanguageFile('Stats');
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:19,代码来源:remote_stats.php

示例4: 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();
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:28,代码来源:logout.php

示例5: init

 /**
  * Initialize the framework
  * @param Boolean $reset Whether or not to re-initialize the framework again
  * @return Boolean Returns TRUE the application initializes without encountering any errors, FALSE otherwise
  */
 public static final function init($reset = false)
 {
     $GLOBALS['ApplicationUrl'] = SENDSTUDIO_APPLICATION_URL;
     // Defining IEM_MARKER in the event is part of the installation procedure
     // If it is not there, we can assume that the stash file has been overwritten
     // So we will need to restore it.
     // TODO change reference to SENSTUDIO_IS_SETUP
     if (defined('SENDSTUDIO_IS_SETUP') && SENDSTUDIO_IS_SETUP && !InterspireEvent::eventExists('IEM_MARKER_20090701')) {
         IEM_Installer::RegisterEventListeners();
         // Restore Addons listeners
         require_once IEM_ADDONS_PATH . '/interspire_addons.php';
         $addons = new Interspire_Addons();
         $addons->FixEnabledEventListeners();
         InterspireEvent::eventCreate('IEM_MARKER_20090701');
     }
     if (!self::configInit($reset)) {
         return false;
     }
     if (!self::sessionInit($reset)) {
         return false;
     }
     if (!self::userInit($reset)) {
         return false;
     }
     // ----- Include common language variables
     $tempUser = IEM::getCurrentUser();
     $tempUserLanguage = 'default';
     if (!empty($tempUser->user_language) && is_dir(IEM_PATH . "/language/{$tempUser->user_language}")) {
         $tempUserLanguage = $tempUser->user_language;
     }
     require_once IEM_PATH . "/language/{$tempUserLanguage}/whitelabel.php";
     require_once IEM_PATH . "/language/{$tempUserLanguage}/language.php";
     self::$_enableInfoTips = false;
     if (isset($tempUser->infotips) && $tempUser->infotips) {
         self::$_enableInfoTips = true;
     }
     unset($tempUserLanguage);
     unset($tempUser);
     // -----
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:45,代码来源:IEM.class.php

示例6: PrintEditForm

	/**
	* PrintEditForm
	* Prints the editing form for the userid passed in.
	* If the user doesn't have access to edit their details, it will only display them.
	* Also makes sure that the user doesn't try to edit another users' details.
	*
	* @param Int $userid UserID to show the form for. This will load up the user and use their details as the defaults.
	*
	* @see User_API::Admin
	* @see GetLang
	* @see GetUser
	*
	* @return Void Doesn't return anything, prints out the appropriate form and that's it.
	*/
	function PrintEditForm($userid=0)
	{
		$thisuser = IEM::getCurrentUser();
		if (!$thisuser->Admin()) {
			if ($userid != $thisuser->userid) {
				$this->DenyAccess();
			}
		}

		$user = GetUser($userid);

		$activity = $user->GetEventActivityType();
		if (!is_array($activity)) {
			$activity = array();
		}
		$GLOBALS['EventActivityType'] = implode("\n", $activity);

		$GLOBALS['UserID'] = $user->userid;
		$GLOBALS['UserName'] = $user->username;
		$GLOBALS['FullName'] = $user->fullname;
		$GLOBALS['EmailAddress'] = $user->emailaddress;

		$GLOBALS['TextFooter'] = $user->textfooter;
		$GLOBALS['HTMLFooter'] = $user->htmlfooter;

		$GLOBALS['CustomSmtpServer_Display'] = '0';

		if ($user->HasAccess('User', 'SMTP')) {
			$GLOBALS['SmtpServer'] = $user->Get('smtpserver');
			$GLOBALS['SmtpUsername'] = $user->Get('smtpusername');
			$GLOBALS['SmtpPassword'] = $user->Get('smtppassword');
			$GLOBALS['SmtpPort'] = $user->Get('smtpport');
			$smtp_access = true;
		} else {
			$GLOBALS['SmtpServer'] = '';
			$GLOBALS['SmtpUsername'] = '';
			$GLOBALS['SmtpPassword'] = '';
			$GLOBALS['SmtpPort'] = '';
			$smtp_access = false;
		}

		$GLOBALS['ShowSMTPInfo'] = 'none';
		$GLOBALS['DisplaySMTP'] = '0';

		if ($smtp_access) {
			$GLOBALS['ShowSMTPInfo'] = '';
		}

		if ($GLOBALS['SmtpServer']) {
			$GLOBALS['CustomSmtpServer_Display'] = '1';
			if ($smtp_access) {
				$GLOBALS['DisplaySMTP'] = '1';
			}
		}

		if ($user->Get('usewysiwyg')) {
			$GLOBALS['UseWysiwyg'] = ' CHECKED';
			$GLOBALS['UseXHTMLDisplay'] = ' style="display:block;"';
		} else {
			$GLOBALS['UseXHTMLDisplay'] = ' style="display:none;"';
		}

		if ($user->Get('enableactivitylog')) {
			$GLOBALS['EnableActivityLog'] = ' CHECKED';
		} else {
			$GLOBALS['EnableActivityLog'] = '';
		}

		$GLOBALS['UseXHTMLCheckbox'] = $user->Get('usexhtml')? ' CHECKED' : '';

		$GLOBALS['FormAction'] = 'Action=Save&UserID=' . $user->userid;

		$timezone = $user->usertimezone;
		$GLOBALS['TimeZoneList'] = $this->TimeZoneList($timezone);

		$GLOBALS['InfoTipsChecked'] = ($user->InfoTips()) ? ' CHECKED' : '';

		if ($smtp_access && $user->HasAccess('User', 'SMTPCOM')) {
		} else {
			$GLOBALS['ShowSMTPCOMOption'] = 'none';
		}
		$GLOBALS['googlecalendarusername'] = $user->googlecalendarusername;
		$GLOBALS['googlecalendarpassword'] = $user->googlecalendarpassword;

		if ($thisuser->EditOwnSettings()) {
			$this->ParseTemplate('User_Edit_Own');
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:manageaccount.php

示例7: IEM_Menu

 /**
  * IEM_Menu
  * This builds both the nav menu (with the dropdown items) and the text menu links at the top
  * It gets the main nav items from SendStudio_Functions::GenerateMenuLinks
  * It gets the text menu items from SendStudio_Functions::GenerateTextMenuLinks
  *
  * It will also see if test-mode is enabled (and display an appropriate message)
  * and also generate the right headers at the top (user is logged in as 'X', the current time is 'Y' etc).
  *
  * <b>Do *not* put any "ParseTemplate" calls inside IEM_Menu as you will cause an infinite loop.</b>
  * "ParseTemplate" calls "IEM_Menu" via IEM_DefaultVariables
  * Since the header menu has not yet finished building (ie the $menu variable is still null),
  * calling IEM_Menu at this stage will then call ParseTemplate (which then calls IEM_Menu).
  *
  * It returns an array:
  * - the first item is the main nav menu (contact lists, contacts, email campaigns etc)
  * - the second item is the text menu links at the top of the page (templates, users/manage account, logout etc)
  *
  * @uses SendStudio_Functions::GenerateMenuLinks
  * @uses SendStudio_Functions::GenerateTextMenuLinks
  *
  * @return Array Returns an array containing the main nav menu (the first item of the array) and the text menu items (the second item of the array).
  */
 private function IEM_Menu()
 {
     static $menu = null;
     // we've already built the menu? just return it.
     if ($menu !== null) {
         return $menu;
     }
     // see if there is an upgrade required or problem with the lk.
     if (!isset($_GET['Page']) || strtolower($_GET['Page']) != 'upgradenx') {
         if (IEM::sessionGet('LicenseError')) {
             if (!isset($_GET['Page']) || strtolower($_GET['Page']) != 'settings') {
                 header('Location: index.php?Page=Settings');
                 exit;
             }
         }
     }
     $user = IEM::getCurrentUser();
     // we're not logged in? we don't have a menu so just return empty items.
     if (!$user) {
         $menu = array('', '');
         return $menu;
     }
     $textlinks = SendStudio_Functions::GenerateTextMenuLinks();
     $nav_menus = '';
     if (!IEM::sessionGet('LicenseError')) {
         $nav_menus = SendStudio_Functions::GenerateMenuLinks();
     }
     $GLOBALS['UsingWYSIWYG'] = '0';
     if ($user->Get('usewysiwyg') == 1) {
         $GLOBALS['UsingWYSIWYG'] = '1';
     }
     $adjustedtime = AdjustTime();
     $GLOBALS['SystemDateTime'] = sprintf(GetLang('UserDateHeader'), AdjustTime($adjustedtime, false, GetLang('UserDateFormat'), true), $user->Get('usertimezone'));
     $name = $user->Get('username');
     $fullname = $user->Get('fullname');
     if ($fullname != '') {
         $name = $fullname;
     }
     $GLOBALS['UserLoggedInAs'] = sprintf(GetLang('LoggedInAs'), htmlentities($name, ENT_QUOTES, SENDSTUDIO_CHARSET));
     $unlimited_total_emails = $user->hasUnlimitedTotalCredit();
     if (!$unlimited_total_emails) {
         $creditUsed = API_USERS::getRecordById($user->userid)->getUsedCredit();
         $creditLeft = (int) $user->group->limit_totalemailslimit - (int) $creditUsed;
         $GLOBALS['TotalEmailCredits'] = sprintf(GetLang('User_Total_CreditsLeft'), SendStudio_Functions::FormatNumber($creditLeft));
     }
     $GLOBALS['MonthlyEmailCredits'] = '';
     $unlimited_monthly_emails = $user->hasUnlimitedMonthlyCredit();
     if (!$unlimited_monthly_emails) {
         $creditUsed = API_USERS::getRecordById($user->userid)->getUsedMonthlyCredit();
         $creditLeft = (int) $user->group->limit_emailspermonth - (int) $creditUsed;
         $GLOBALS['MonthlyEmailCredits'] = sprintf(GetLang('User_Monthly_CreditsLeft'), SendStudio_Functions::FormatNumber($creditLeft), SendStudio_Functions::FormatNumber($user->group->limit_emailspermonth));
         if (!$unlimited_total_emails) {
             $GLOBALS['MonthlyEmailCredits'] .= '&nbsp;&nbsp;|';
         }
     }
     $menu = array($nav_menus, $textlinks);
     return $menu;
 }
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:81,代码来源:InterspireTemplate.class.php

示例8: page_manageGroups

	/**
	 * This method will display a "manage user" page
	 *
	 * @return void
	 * @todo phpdocs
	 */
	public function page_manageGroups()
	{
		// ----- Sanitize and declare variables that is going to be used in this function
			$pageRecordPP		= 0;
			$pageCurrentIndex	= $this->GetCurrentPage();
			$pageSortInfo		= $this->GetSortDetails();

			$reqProcessPaging	= IEM::requestGetGET('ProcessPaging', 0, 'intval');

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

			$currentUser		= IEM::getCurrentUser();

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

		// Do we need to process paging?
		if ($reqProcessPaging) {
			$temp = IEM::requestGetGET('PerPageDisplay', 0, 'intval');
			if ($temp) {
				$this->SetPerPage($temp);
			}
		}

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

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

		$recordTotal = API_USERGROUPS::getRecords(true);
		if (!$recordTotal) {
			$recordTotal = 0;
		}

		$records = API_USERGROUPS::getRecords(false, false, $pageRecordPP, $start, $pageSortInfo['SortBy'], ($pageSortInfo['Direction'] == 'desc'));
		if (!$records) {
			$records = array();
		} else {
			for ($i = 0, $j = count($records); $i < $j; ++$i) {
				$records[$i]['processed_CreateDate'] = $this->PrintDate($records[$i]['createdate']);
			}
		}


		// ----- Calculate pagination, this is using the older method of pagination
			$GLOBALS['PAGE'] = 'UsersGroups';
			$GLOBALS['FormAction'] = 'Action=manageGroups&ProcessPaging=1';

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

		// ----- Print out HTML
			$this->PrintHeader();

			$tpl = GetTemplateSystem();
			$tpl->Assign('PAGE', $page);
			$tpl->Assign('records', $records);

			$tpl->ParseTemplate('UsersGroups_ManageGroups');

			$this->PrintFooter();
		// -----

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

示例9: preg_replace

     $newPage = IEM::requestGetGET('page', false);
     $newPage = preg_replace('/[^\\w]/', '_', $newPage);
     if (!is_file(IEM_PATH . "/pages/{$newPage}.class.php")) {
         $newPage = false;
         $page = 'index';
     }
 }
 // --------------------------------------------------------------------------------
 // Check whether or not the request is coming from a user that's already logged in.
 //
 // If the user have not logged in yet, we need to check for "IEM_CookieLogin"
 // and "IEM_LoginPreference" cookie. This cookie is used in "remember me" feature.
 //
 // TODO refactor this to IEM::login() function
 // --------------------------------------------------------------------------------
 if (!IEM::getCurrentUser()) {
     $tempValid = false;
     $tempCookie = false;
     $tempUser = false;
     // This is not a loop, rather a way to "return early" to avoid nested if
     // * Comment from a later developer: If you have to do this, there is
     // * probably a better way to code it. Programming doesn't necessarily
     // * mean "hacking".
     while (true) {
         // if we are installing or upgrading then we need to bypass this
         if (!IEM::isInstalled() && IEM::isInstalling() || IEM::hasUpgrade() && IEM::isUpgrading() || IEM::isCompletingUpgrade()) {
             $tempValid = true;
             break;
         }
         // Get cookie
         $tempCookie = IEM::requestGetCookie('IEM_CookieLogin', array());
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:init.php

示例10: 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 || !$id) {
         return false;
     }
     $destinationdir = TEMP_DIRECTORY . '/' . $destination . '/' . $id;
     $createdir = CreateDirectory($destinationdir);
     if (!$createdir) {
         return false;
     }
     $user = IEM::getCurrentUser();
     $sourcedir = TEMP_DIRECTORY . '/user/' . $user->userid;
     $file_list = list_files($sourcedir);
     $dir_list = list_directories($sourcedir);
     if (empty($file_list) && empty($dir_list)) {
         return true;
     }
     $result = true;
     foreach ($file_list as $p => $filename) {
         if (!copy($sourcedir . '/' . $filename, $destinationdir . '/' . $filename)) {
             $result = false;
         }
     }
     if ($result) {
         foreach ($dir_list as $dir) {
             $dirname = str_replace($sourcedir, '', $dir);
             if ($dirname == 'attachments') {
                 continue;
             }
             $copy_dir_result = CopyDirectory($dir, $destinationdir . $dirname);
             if (!$copy_dir_result) {
                 $resut = false;
             }
         }
     }
     return $result;
 }
开发者ID:hungnv0789,项目名称:vhtm,代码行数:49,代码来源:Functions.php

示例11: ManageSubscribers_Step3

	/**
	* ManageSubscribers_Step3
	* Prints out the subscribers for the list chosen and criteria selected in steps 1 & 2. This handles sorting, paging and searching. If you are coming in for the first time, it remembers your search criteria in the session. If you change number per page, sorting criteria, it fetches the search criteria from the session again before continuing.
	*
	* @see ManageSubscribers_Step2
	* @see GetApi
	* @see GetPerPage
	* @see GetCurrentPage
	* @see GetSortDetails
	* @see Subscribers_API::FetchSubscribers
	* @see SetupPaging
	* @see Lists_API::Load
	*
	* @return Void Doesn't return anything. Prints out the results and that's it.
	*/
	function ManageSubscribers_Step3($change=false)
	{
		$subscriber_api = $this->GetApi('Subscribers');
		$user = IEM::getCurrentUser();
		$search_info = IEM::sessionGet('Search_Subscribers');

		$this->SetupGoogleCalendar();

		$user_lists = $user->GetLists();

		if (!isset($GLOBALS['Message'])) {
			$GLOBALS['Message'] = '';
		}

		// if we are posting a form, we are most likely resetting the search criteria.
		// we are also resetting the search criteria once we detect "Lists" variable in the GET Request
		$resetsearch = ((isset($_POST) && !empty($_POST)) || isset($_GET['Lists']) || isset($_GET['Segment'])) ? true : false;

		// except if we're changing paging!
		if (isset($_GET['SubAction'])) {
			$subaction =  strtolower($_GET['SubAction']);
			if ($subaction == 'processpaging' || $subaction == 'change') {
				$resetsearch = false;
			}
		}

		if (!$search_info || $resetsearch) {
			$this->SetCurrentPage(1); // forget current page
			$search_details = array();
			if (isset($_POST['emailaddress']) && $_POST['emailaddress'] != '') {
				$search_details['Email'] = trim($_POST['emailaddress']);
			}

			if (isset($_POST['format']) && $_POST['format'] != '-1') {
				$search_details['Format'] = $_POST['format'];
			}

			if (isset($_POST['confirmed']) && $_POST['confirmed'] != '-1') {
				$search_details['Confirmed'] = $_POST['confirmed'];
			}

			if (isset($_POST['status']) && $_POST['status'] != '-1') {
				$search_details['Status'] = $_POST['status'];
			}

			if (isset($_POST['datesearch']) && isset($_POST['datesearch']['filter'])) {
				$search_details['DateSearch'] = $_POST['datesearch'];

				$search_details['DateSearch']['StartDate'] = AdjustTime(array(0, 0, 1, $_POST['datesearch']['mm_start'], $_POST['datesearch']['dd_start'], $_POST['datesearch']['yy_start']));

				$search_details['DateSearch']['EndDate'] = AdjustTime(array(0, 0, 1, $_POST['datesearch']['mm_end'], $_POST['datesearch']['dd_end'], $_POST['datesearch']['yy_end']));
			}

			$customfields = array();
			if (isset($_POST['CustomFields']) && !empty($_POST['CustomFields'])) {
				$customfields = $_POST['CustomFields'];
			}

			$search_details['CustomFields'] = $customfields;

			if (isset($_GET['Lists']) || isset($_GET['List'])) {
				$search_details['List'] = isset($_GET['Lists'])? $_GET['Lists'] : $_GET['List'];
			} else {
				$search_details['List'] = 'any';
			}

			// Get segment, and make sure user have access permission to it
			if ($user->HasAccess('Segments')) {
				$search_details['Segment'] = null;
				if (isset($_GET['Segment'])) {
					$tempSegmentList = array_keys($user->GetSegmentList());
					$tempSegment = $_GET['Segment'];

					// Make sure that selected segment is allowed for user
					if (!is_array($tempSegment)) {
						if (!in_array($tempSegment, $tempSegmentList)) {
							$tempSegment = null;
						}
					} else {
						$tempSegment = array_intersect($tempSegment, $tempSegmentList);
					}

					if (!is_null($tempSegment)) {
						$search_details['Segment'] = $tempSegment;
					}
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:subscribers_manage.php

示例12: SelectNewsletter

	/**
	* SelectNewsletter
	* Displays a list of newsletters you can send.
	* Only gets live newsletters.
	* If cron scheduling is enabled, then you get extra options to choose from (whether to notify the owner and of course what time to send the newsletter).
	* You can also choose the character set for the send to use.
	*
	* @see GetApi
	* @see Newsletters_API::GetLiveNewsletters
	* @see CreateDateTimeBox
	* @see CharsetList
	* @see SENDSTUDIO_CRON_ENABLED
	*
	* @return Void Doesn't return anything, prints out the step where you select the newsletter you want to send to your list(s).
	*/
	function SelectNewsletter($errormsg=false)
	{
		$send_details = IEM::sessionGet('SendDetails');
		$user = IEM::getCurrentUser();
		$newsletterapi = $this->GetApi('Newsletters');

		$sendsize = $send_details['SendSize'];
		if ($sendsize == 1) {
			$sendSizeInfo = GetLang('SendSize_One');
		} else {
			$sendinfo = IEM::sessionGet('SendInfoDetails');
			$sendSizeInfo = $sendinfo['Msg'];
		}

		if (SENDSTUDIO_CRON_ENABLED && SENDSTUDIO_CRON_SEND > 0) {
			$sendSizeInfo .= sprintf(' <a href="javascript:void(0)" onClick="alert(\'%s\')">%s</a>', GetLang('ReadMoreWhyApprox'), GetLang('ReadMore'));
		}

		$GLOBALS['Message'] = '';

		if (!IEM::sessionGet('MyError')) {
			$GLOBALS['Success'] = $sendSizeInfo;
			$GLOBALS['Message'] = $this->ParseTemplate('SuccessMsg', true, false);
		}

		if ($errormsg) {
			$GLOBALS['Error'] = $errormsg;
			$GLOBALS['Message'] .= $this->ParseTemplate('ErrorMsg', true, false);
		}

		if (IEM::sessionGet('MyError')) {
			$GLOBALS['Message'] .= IEM::sessionGet('MyError') . IEM::sessionGet('ExtraMessage');
		}

		$newsletterowner = ($user->Admin() ? 0 : $user->userid);

		$newsletters = $newsletterapi->GetLiveNewsletters($newsletterowner);
		$newsletterlist = '';
		$count = sizeof(array_keys($newsletters));
		$newsletterlist = '<option value="0">' . GetLang('SelectNewsletterToSend') . '</option>';

		foreach ($newsletters as $pos => $newsletterinfo) {
			$chosen = '';
			if ($newsletterinfo['newsletterid'] == $send_details['NewsletterChosen']) {
				$chosen = ' SELECTED';
			}
			$newsletterlist .= '<option value="' . $newsletterinfo['newsletterid'] . '"' . $chosen . '>' . htmlspecialchars($newsletterinfo['name'], ENT_QUOTES, SENDSTUDIO_CHARSET) . '</option>';
		}

		$list = $send_details['Lists'][0]; // always choose the first list. doesn't matter if there are multiple lists to choose from.
		$listapi = $this->GetApi('Lists');
		$listapi->Load($list);

		$customfields = $listapi->GetCustomFields($send_details['Lists'], 'text');

		if (empty($customfields)) {
			$GLOBALS['DisplayNameOptions'] = 'none';
		} else {
			$GLOBALS['NameOptions'] = '';
			foreach ($customfields as $p => $details) {
				$GLOBALS['NameOptions'] .= "<option value='" . $details['fieldid'] . "'>" . htmlspecialchars($details['name'], ENT_QUOTES, SENDSTUDIO_CHARSET) . "</option>";
			}
		}

		$GLOBALS['SendFromEmail'] = $listapi->Get('owneremail');
		$GLOBALS['SendFromName'] = $listapi->Get('ownername');
		$GLOBALS['ReplyToEmail'] = $listapi->Get('replytoemail');
		$GLOBALS['BounceEmail'] = $listapi->Get('bounceemail');

		$GLOBALS['ShowBounceInfo'] = 'none';

		if ($user->HasAccess('Lists', 'BounceSettings')) {
			$GLOBALS['ShowBounceInfo'] = '';
		}

		$GLOBALS['SendCharset'] = SENDSTUDIO_CHARSET;

		$GLOBALS['SendTimeBox'] = $this->CreateDateTimeBox(0, false, 'datetime', true);

		$GLOBALS['NewsletterList'] = $newsletterlist;

		$GLOBALS['DisplayEmbedImages'] = 'none';
		if (SENDSTUDIO_ALLOW_EMBEDIMAGES) {
			$GLOBALS['DisplayEmbedImages'] = '';
			if (SENDSTUDIO_DEFAULT_EMBEDIMAGES) {
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:send.php

示例13: EditAutoresponderStep4

	/**
	* EditAutoresponderStep4
	* Loads up step 4 of editing an autoresponder which is editing the actual content.
	* If you pass in an autoresponderid, it will load it up and set the appropriate language variables.
	*
	* @param Int $autoresponderid AutoresponderID to edit.
	*
	* @return Void Prints out step 4, doesn't return anything.
	*/
	function EditAutoresponderStep4($autoresponderid=0)
	{

		$autoapi = $this->GetApi();
		$autorespondercontents = array('text' => '', 'html' => '');

		$this->DisplayCronWarning();

		$user = GetUser();
		$GLOBALS['FromPreviewEmail'] = $user->Get('emailaddress');

		//$GLOBALS['DisplayAttachmentsHeading'] = 'none';
		$tpl = GetTemplateSystem();
		if ($autoresponderid > 0) {
			$GLOBALS['SaveAction'] = 'Edit&SubAction=Save&id=' . $autoresponderid;
			$GLOBALS['Heading'] = GetLang('EditAutoresponder');
			$GLOBALS['Intro'] = GetLang('EditAutoresponderIntro_Step4');
			$GLOBALS['Action'] = 'Edit&SubAction=Complete&id=' . $autoresponderid;
			$GLOBALS['CancelButton'] = GetLang('EditAutoresponderCancelButton');

			$autoapi->Load($autoresponderid);
			$autorespondercontents['text'] = $autoapi->GetBody('text');
			$autorespondercontents['html'] = $autoapi->GetBody('html');

			$GLOBALS['Subject'] = htmlspecialchars($autoapi->subject, ENT_QUOTES, SENDSTUDIO_CHARSET);

		} else {

			$GLOBALS['SaveAction'] = 'Create&SubAction=Save&id=' . $autoresponderid;
			$GLOBALS['Heading'] = GetLang('CreateAutoresponder');
			$GLOBALS['Intro'] = GetLang('CreateAutoresponderIntro_Step4');
			$GLOBALS['Action'] = 'Create&SubAction=Complete';
			$GLOBALS['CancelButton'] = GetLang('CreateAutoresponderCancelButton');
		}

		if (SENDSTUDIO_ALLOW_ATTACHMENTS) {
				$attachmentsarea = strtolower(get_class($this));
				$attachments_list = $this->GetAttachments($attachmentsarea, $autoresponderid);
				$GLOBALS['AttachmentsList'] = $attachments_list;
				$tpl->Assign('ShowAttach', true);
		} else {
			$GLOBALS['DisplayAttachments'] = 'none';
			$user = IEM::getCurrentUser();
			if($user) {
				if ($user->isAdmin()) {
					$GLOBALS['AttachmentsMsg'] = GetLang('NoAttachment_Admin');
				} else {
					$GLOBALS['AttachmentsMsg'] = GetLang('NoAttachment_User');
				}
			}
			$tpl->Assign('ShowAttach', false);
		}

		$GLOBALS['PreviewID'] = $autoresponderid;

		// 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_autoresponder = IEM::sessionGet('Autoresponders');

		$GLOBALS['List'] = $session_autoresponder['list'];

		if (isset($session_autoresponder['TemplateID'])) {
			$templateApi = $this->GetApi('Templates');
			if (is_numeric($session_autoresponder['TemplateID'])) {
				$templateApi->Load($session_autoresponder['TemplateID']);
				$autorespondercontents['text'] = $templateApi->textbody;
				$autorespondercontents['html'] = $templateApi->htmlbody;
			} else {
				$autorespondercontents['html'] = $templateApi->ReadServerTemplate($session_autoresponder['TemplateID']);
			}
			unset($session_autoresponder['TemplateID']);
		}

		$session_autoresponder['id'] = (int)$autoresponderid;

		$session_autoresponder['contents'] = $autorespondercontents;

		// we use the lowercase variable when we save, but the editor expects the uppercased version.
		$session_autoresponder['Format'] = $session_autoresponder['format'];

		IEM::sessionSet('Autoresponders', $session_autoresponder);
		$editor = $this->FetchEditor();
		$GLOBALS['Editor'] = $editor;

		unset($session_autoresponder['Format']);
		$GLOBALS['MaxFileSize'] = SENDSTUDIO_ATTACHMENT_SIZE*1024;

		$user = GetUser();
		if ($user->Get('forcespamcheck')) {
			$GLOBALS['ForceSpamCheck'] = 1;
		}
//.........这里部分代码省略.........
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:101,代码来源:autoresponders.php

示例14: ExportSubscribers_Step3

	/**
	* ExportSubscribers_Step3
	* Checks that there are subscribers to export. Creates a 'queue' of subscribers to export and lets you choose which fields you want to export.
	*
	* @see GetApi
	* @see Lists_API::Load
	* @see Lists_API::GetCustomFields
	* @see GetSortDetails
	* @see Subscribers_API::GetSubscribers
	* @see ExportSubscribers_Step2
	* @see API::CreateQueue
	*
	* @return Void Prints out the form, doesn't return anything.
	*/
	function ExportSubscribers_Step3()
	{
		$subscriber_api = $this->GetApi('Subscribers');
		$user = IEM::getCurrentUser();
		$exportinfo = IEM::sessionGet('ExportInfo');

		$listApi = $this->GetApi('Lists');
		$listid = $exportinfo['List'];
		$CustomFieldsList = array();

		if (is_numeric($listid)) {
			$listApi->Load($listid);
			$listname = $listApi->name;
			$GLOBALS['List'] = $listid;
			$GLOBALS['Heading'] = GetLang('Subscribers_Export');
			$CustomFieldsList = $listApi->GetCustomFields($listid);
		} elseif (is_array($listid)) {
			// Load list name for each of the selected mailing list
			$listnames = array();
			$eachCustomFieldList = array();
			foreach ($listid as $id) {
				if ($listApi->Load($id)) {
					array_push($listnames, $listApi->name);
					$eachCustomFieldList = $listApi->getCustomFields($id);
					$CustomFieldsList = array_merge($CustomFieldsList, $eachCustomFieldList);
				}
			}
			$GLOBALS['List'] = implode('&Lists[]=',$listid);
			$GLOBALS['Heading'] = sprintf(GetLang('Subscribers_Export_MultipleList'), htmlspecialchars("'".implode("', '", $listnames)."'", ENT_QUOTES, SENDSTUDIO_CHARSET));
		} else {
			$GLOBALS['List'] = $listid;
			$GLOBALS['Heading'] = GetLang('Subscribers_Export_AnyList');
		}

		if (!$exportinfo || !empty($_POST)) {
			$export_details = array();
			if (isset($_POST['emailaddress']) && $_POST['emailaddress'] != '') {
				$export_details['Email'] = $_POST['emailaddress'];
			}

			if (isset($_POST['format']) && $_POST['format'] != '-1') {
				$export_details['Format'] = $_POST['format'];
			}

			if (isset($_POST['confirmed']) && $_POST['confirmed'] != '-1') {
				$export_details['Confirmed'] = $_POST['confirmed'];
			}

			if (isset($_POST['status']) && $_POST['status'] != '-1') {
				$export_details['Status'] = $_POST['status'];
			}

			if (isset($_POST['datesearch']) && isset($_POST['datesearch']['filter'])) {
				$export_details['DateSearch'] = $_POST['datesearch'];

				$export_details['DateSearch']['StartDate'] = AdjustTime(array(0, 0, 1, $_POST['datesearch']['mm_start'], $_POST['datesearch']['dd_start'], $_POST['datesearch']['yy_start']));

				$export_details['DateSearch']['EndDate'] = AdjustTime(array(0, 0, 1, $_POST['datesearch']['mm_end'], $_POST['datesearch']['dd_end'], $_POST['datesearch']['yy_end']));
			}

			$customfields = array();
			if (isset($_POST['CustomFields']) && !empty($_POST['CustomFields'])) {
				$customfields = $_POST['CustomFields'];
			}

			if (isset($_POST['clickedlink']) && isset($_POST['linkid'])) {
				$export_details['LinkType'] = 'clicked';
				if (isset($_POST['linktype']) && $_POST['linktype'] == 'not_clicked') {
					$export_details['LinkType'] = 'not_clicked';
				}

				$export_details['Link'] = $_POST['linkid'];
			}

			if (isset($_POST['openednewsletter']) && isset($_POST['newsletterid'])) {
				$export_details['OpenType'] = 'opened';
				if (isset($_POST['opentype']) && $_POST['opentype'] == 'not_opened') {
					$export_details['OpenType'] = 'not_opened';
				}

				$export_details['Newsletter'] = $_POST['newsletterid'];
			}

			if (isset($_POST['Search_Options'])) {
				$export_details['Search_Options'] = $_POST['Search_Options'];
			}
//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:subscribers_export.php

示例15: ManageCustomField_Lists

	/**
	* ManageCustomField_Lists
	* Prints out the custom field to list associations.
	*
	* @param Int $fieldid Fieldid to print associations for.
	* @param Boolean $newfield Whether we're creating a new field or not. This changes language variables accordingly.
	*
	* @see GetApi
	* @see CustomFields_API::Load
	* @see CustomFields_API::Settings
	* @see CustomFields_API::Associations
	* @see User_API::GetLists
	*
	* @return Void Doesn't return anything, just prints out the results.
	*/
	function ManageCustomField_Lists($fieldid=0, $newfield=false)
	{
		if ($fieldid <= 0) {
			return false;
		}

		$api = $this->GetApi();
		if (!$api->Load($fieldid)) {
			return false;
		}

		if ($newfield) {
			$GLOBALS['Heading'] = GetLang('CreateCustomField_Step3');
			$GLOBALS['Intro'] = GetLang('CreateCustomField_Step3_Intro');
			$GLOBALS['CancelButton'] = GetLang('CreateCustomField_CancelPrompt');
		} else {
			$GLOBALS['Heading'] = GetLang('EditCustomField_Step3');
			$GLOBALS['Intro'] = GetLang('EditCustomField_Step3_Intro');
			$GLOBALS['CancelButton'] = GetLang('EditCustomField_CancelPrompt');
		}

		$fieldapi = $this->GetApi('CustomFields_' . $api->fieldtype);
		$fieldapi->Load($fieldid);

		$user = IEM::getCurrentUser();
		$lists = $user->GetLists();

		$GLOBALS['fieldid'] = $fieldid;
		$GLOBALS['CustomFieldListAssociation'] = sprintf(GetLang('CustomFieldListAssociation'), $fieldapi->Settings['FieldName']);

		$list_assoc = '';

		$GLOBALS['ListAssociations'] = '';

		foreach ($lists as $listid => $listdetails) {
			$GLOBALS['ListAssociations'] .= '<option value="'. $listid . '"';

			if (in_array($listid, $fieldapi->Associations)) {
				$GLOBALS['ListAssociations'] .= ' selected="selected"';
			}
			$GLOBALS['ListAssociations'] .= '>' . htmlspecialchars($listdetails['name'], ENT_QUOTES, SENDSTUDIO_CHARSET) . '</option>';
		}

		$this->ParseTemplate('CustomField_Form_Step3');
	}
开发者ID:Apeplazas,项目名称:plazadelatecnologia,代码行数:60,代码来源:customfields.php


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