本文整理汇总了PHP中FlashMessage函数的典型用法代码示例。如果您正苦于以下问题:PHP FlashMessage函数的具体用法?PHP FlashMessage怎么用?PHP FlashMessage使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FlashMessage函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printPage
/**
* printPage
*
* @return Void Doesn't return anything.
*/
public function printPage()
{
$user = GetUser();
$split_api = $this->GetApi('Splittest');
// for permission checks
$subaction = $this->_getGetRequest('subaction', 'print');
$perpage = $this->_getGetRequest('PerPageDisplay', null);
$jobids = $this->_getGETRequest('jobids', null);
$listids = $this->_getGETRequest('split_statids', null);
$jobids = explode(",", $jobids);
$listids = explode(",", $listids);
SendStudio_Functions::LoadLanguageFile('Stats');
if (!SplitTest_API::OwnsJobs($user->Get('userid'), $jobids) && !$user->Admin()) {
FlashMessage(GetLang('NoAccess'), SS_FLASH_MSG_ERROR, $this->base_url);
return;
}
// Get some setup parameters for the API
$sortdetails = array('sort' => 'splitname', 'direction' => 'asc');
$page_number = 0;
$perpage = 20;
$displayAll = false;
// just show a single splitest campaign send. If you want every campaign send for a split test set to true
$dateFromat = self::getDateFormat();
$statitics = array();
$jobid = 0;
for ($i = 0; $i < count($jobids); $i++) {
$stats = array();
$stats_api = new Splittest_Stats_API();
$jobid = $jobids[$i];
$splitid = $listids[$i];
// get the array of stats data
$stats = $stats_api->GetStats(array($splitid), $sortdetails, false, $page_number, $perpage, $displayAll, $jobid);
foreach ($stats as $stats_id => $stats_details) {
$stats[$stats_id]['splitname'] = htmlspecialchars($stats_details['splitname'], ENT_QUOTES, SENDSTUDIO_CHARSET);
$stats[$stats_id]['campaign_names'] = htmlspecialchars($stats_details['campaign_names'], ENT_QUOTES, SENDSTUDIO_CHARSET);
$stats[$stats_id]['list_names'] = htmlspecialchars($stats_details['list_names'], ENT_QUOTES, SENDSTUDIO_CHARSET);
}
// A Splittest can be sent multiple times hence we might have multiple campaign record sets here
while (list($id, $data) = each($stats)) {
$charts = $this->generateCharts($data['splitname'], $data['campaigns'], $subaction);
foreach ($charts as $type => $data) {
$stats[$id][$type] = $data;
}
}
$statistics[] = $stats;
}
$template = GetTemplateSystem(dirname(__FILE__) . '/templates');
$template->Assign('DateFormat', $dateFromat);
$template->Assign('statsData', $statistics);
$template->Assign('subaction', $subaction);
$options = $this->_getGETRequest('options', null);
for ($i = 0; $i < count($options); $i++) {
$template->Assign($options[$i], $options[$i]);
}
$template->ParseTemplate('Stats_Summary_Splittest');
}
示例2: SaveUpdatedOrderSettings
public function SaveUpdatedOrderSettings()
{
$newField = array("scriptvalue" => $_POST['campaigncode']);
$GLOBALS['ISC_CLASS_DB']->UpdateQuery("order_scripts", $newField, "scripttype='orderscript'");
$newField1 = array("scriptvalue" => $this->FormatWYSIWYGHTML($_POST['wysiwyg']));
$GLOBALS['ISC_CLASS_DB']->UpdateQuery("order_scripts", $newField1, "scripttype='ordermsg'");
/*if ($settings->CommitSettings($messages)) {*/
$GLOBALS['ISC_CLASS_LOG']->LogAdminAction();
FlashMessage(GetLang('OrderSettingsSavedSuccessfully'), MSG_SUCCESS, 'index.php?ToDo=viewScriptSettings¤tTab=' . (int) $_POST['currentTab']);
/*}
else {
FlashMessage(GetLang('OrderSettingsNotSaved'), MSG_ERROR, 'index.php?ToDo=viewScriptSettings¤tTab='.((int) $_POST['currentTab']));
}*/
}
示例3: EditCustomerStep2
/**
* Edit a customer
*
* Method will edit a customer from the edit customer screen
*
* @access public
* @return Void
*/
public function EditCustomerStep2()
{
// Get the information from the form and add it to the database
$customerId = isc_html_escape((int)$_POST['customerId']);
$StoreCustomer = array();
$PostCustomer = $this->_GetCustomerData(0, false);
$err = "";
if (!$this->_ValidateCustomerFormData($customerId, $Error)) {
$_GET['customerId'] = (int)$_POST['customerId'];
return $this->EditCustomerStep1($Error, MSG_ERROR, true);
}
$StoreCustomer = $PostCustomer;
$StoreCustomer['customerid'] = $customerId;
if ($StoreCustomer['custgroupid'] == '') {
$StoreCustomer['custgroupid'] = '0';
}
if (array_key_exists("custpassword", $StoreCustomer) && trim($StoreCustomer["custpassword"]) == "") {
unset($StoreCustomer["custpassword"]);
}
if (gzte11(ISC_MEDIUMPRINT)) {
$existingCustomer = $this->customerEntity->get($customerId);
if (isId($existingCustomer['custformsessionid'])) {
$GLOBALS['ISC_CLASS_FORM']->saveFormSession(FORMFIELDS_FORM_ACCOUNT, true, $existingCustomer['custformsessionid']);
} else {
$formSessionId = $GLOBALS['ISC_CLASS_FORM']->saveFormSession(FORMFIELDS_FORM_ACCOUNT);
if (isId($formSessionId)) {
$StoreCustomer['custformsessionid'] = $formSessionId;
}
}
}
if ($this->customerEntity->edit($StoreCustomer)) {
// Log this action
$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($customerId, trim($PostCustomer['custconfirstname'] . ' ' . $PostCustomer['custconlastname']));
if (isset($_POST['addanother'])) {
$_GET['customerId'] = $customerId;
$this->EditCustomerStep1(GetLang('CustomerUpdatedSuccessfully'), MSG_SUCCESS);
} else {
FlashMessage(GetLang('CustomerUpdatedSuccessfully'), MSG_SUCCESS, 'index.php?ToDo=viewCustomers');
}
} else {
$_GET['customerId'] = $customerId;
$this->EditCustomerStep1(sprintf(GetLang("CustomerUpdatedFailed"), $GLOBALS["ISC_CLASS_DB"]->GetErrorMsg()), MSG_ERROR);
}
}
示例4: DeleteUsers
/**
* DeleteUsers
* Deletes a list of users from the database via the api. Each user is checked to make sure you're not going to accidentally delete your own account and that you're not going to delete the 'last' something (whether it's the last active user, admin user or other).
* If you aren't an admin user, you can't do anything at all.
*
* @param integer[] $users An array of userid's to delete
* @param boolean $deleteData Whether or not to delete data owned by user along
*
* @see GetUser
* @see User_API::UserAdmin
* @see DenyAccess
* @see CheckUserSystem
* @see PrintManageUsers
*
* @return Void Doesn't return anything. Works out the relevant message about who was/wasn't deleted and prints that out. Returns control to PrintManageUsers.
*/
function DeleteUsers($users = array(), $deleteData = false)
{
$thisuser = GetUser();
if (!$thisuser->UserAdmin()) {
$this->DenyAccess();
return;
}
if (!is_array($users)) {
$users = array($users);
}
$not_deleted_list = array();
$not_deleted = $deleted = 0;
foreach ($users as $p => $userid) {
if ($userid == $thisuser->Get('userid')) {
$not_deleted++;
$not_deleted_list[$userid] = array('username' => $thisuser->Get('username'), 'reason' => GetLang('User_CantDeleteOwn'));
continue;
}
$error = $this->CheckUserSystem($userid);
if (!$error) {
$result = API_USERS::deleteRecordByID($userid, $deleteData);
if ($result) {
$deleted++;
} else {
$not_deleted++;
$user = GetUser($userid);
if ($user instanceof User_API) {
$not_deleted_list[$userid] = array('username' => $user->Get('username'), 'reason' => '');
} else {
$not_deleted_list[$userid] = array('username' => $userid, 'reason' => '');
}
}
} else {
$not_deleted++;
$user = GetUser($userid);
if ($user instanceof User_API) {
$not_deleted_list[$userid] = array('username' => $user->Get('username'), 'reason' => $error);
} else {
$not_deleted_list[$userid] = array('username' => $userid, 'reason' => $error);
}
}
}
if ($not_deleted > 0) {
foreach ($not_deleted_list as $uid => $details) {
FlashMessage(sprintf(GetLang('UserDeleteFail'), htmlspecialchars($details['username'], ENT_QUOTES, SENDSTUDIO_CHARSET), htmlspecialchars($details['reason'], ENT_QUOTES, SENDSTUDIO_CHARSET)), SS_FLASH_MSG_ERROR);
}
}
if ($deleted > 0) {
if ($deleted == 1) {
FlashMessage(GetLang('UserDeleteSuccess_One'), SS_FLASH_MSG_SUCCESS, IEM::urlFor('Users'));
} else {
FlashMessage(sprintf(GetLang('UserDeleteSuccess_Many'), $this->FormatNumber($deleted)), SS_FLASH_MSG_SUCCESS, IEM::urlFor('Users'));
}
}
IEM::redirectTo('Users');
}
示例5: RunExport
private function RunExport()
{
try {
// check for a selected template
if (!isset($_POST["template"]) || !$_POST["template"]) {
throw new Exception(GetLang("NoTemplateSelected"));
}
if (!isset($_POST['format'])) {
throw new Exception(GetLang("NoMethodSelected"));
}
$templateid = $_POST["template"];
// check template exists
$template = $this->templates->GetTemplate($templateid);
// check the file type is available for this template
if (!in_array($this->type, explode(",", $template['usedtypes']))) {
throw new Exception(sprintf(GetLang("TypeNotAvailable"), $this->type));
}
$where = "";
// get the custom search fields
if (isset($_POST['ids'])) {
$ids = explode(',', $_POST['ids']);
$ids = implode(', ', array_map(array($GLOBALS['ISC_CLASS_DB'], "Quote"), $ids));
$details = $this->filetype->GetTypeDetails();
$where = $details['idfield'] . " IN (" . $_POST["ids"] . ")";
} elseif (isset($_POST['searchId'])) {
// get the where statement for this search
$ret = $this->filetype->GetWhereFromSearch($_POST['searchId']);
$where = $ret['where'];
} elseif (isset($_POST['params'])) {
$params = $this->GetParams($_POST['params']);
$where = $this->filetype->GetWhereFromParams($params);
}
//$_SESSION['mywhere'] = $where; // this variable used in the function ExportRows() by blessen
// get the export method the user has chosen
$method = ISC_ADMIN_EXPORTMETHOD_FACTORY::GetExportMethod($_POST['format']);
// Initialise the export
$method->Init($this->filetype, $templateid, $where, $this->vendorid);
$details = $this->filetype->GetTypeDetails();
if ($_POST['format'] == "CSV" && $details['name'] == "customers" && $method->settings['AltCustomers']) {
// hackery to use alternate customers class
$this->filetype = ISC_ADMIN_EXPORTFILETYPE_FACTORY::GetExportFileType("customersalt");
// reinitialise the method with alternate file type
$method->Init($this->filetype, $templateid, $where, $this->vendorid);
}
// run the export
$file = $method->Export();
$method_details = $method->GetMethodDetails();
// log the export
$GLOBALS['ISC_CLASS_LOG']->LogAdminAction($this->type_title, $template['exporttemplatename'], $method_details['name']);
// send the file to the user
DownloadFile($file, $this->type . "-" . isc_date("Y-m-d") . "." . $method_details['extension']);
exit;
} catch (Exception $ex) {
FlashMessage($ex->getMessage(), MSG_ERROR);
$this->StartExport();
}
}
示例6: Admin_Action_Edit
/**
* Admin_Action_Edit
* This will display the edition/creation page for dynamic content tag
*
*/
public function Admin_Action_Edit()
{
$ssf = new SendStudio_Functions();
$id = $this->_getGETRequest('id', 0);
$userAPI = GetUser();
$userLists = $userAPI->GetLists();
$userListsId = array_keys($userLists);
if (sizeof($userListsId) < 1) {
$GLOBALS['Intro_Help'] = GetLang('Addon_dynamiccontenttags_Form_Intro');
$GLOBALS['Intro'] = GetLang('Addon_dynamiccontenttags_Form_CreateHeading');
$GLOBALS['Lists_AddButton'] = '';
if ($userAPI->CanCreateList() === true) {
FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListCreate')), SS_FLASH_MSG_SUCCESS);
$GLOBALS['Message'] = GetFlashMessages();
$GLOBALS['Lists_AddButton'] = $this->template_system->ParseTemplate('Dynamiccontenttags_List_Create_Button', true);
} else {
FlashMessage(sprintf(GetLang('Addon_dynamiccontenttags_Tags_NoLists'), GetLang('Addon_dynamiccontenttags_ListAssign')), SS_FLASH_MSG_SUCCESS);
$GLOBALS['Message'] = GetFlashMessages();
}
$this->template_system->ParseTemplate('Dynamiccontenttags_Subscribers_No_Lists');
return;
}
$listIDs = array();
$this->template_system->Assign('DynamicContentTagId', intval($id));
if ($id === 0) {
$this->template_system->Assign('FormType', 'create');
} else {
$this->template_system->Assign('FormType', 'edit');
// Load the existing Tags.
$tag = new DynamicContentTag_Api_Tag($id);
if (!$tag->getTagId()) {
FlashMessage(GetLang('NoAccess'), SS_FLASH_MSG_ERROR, $this->admin_url);
return false;
}
$tag->loadLists();
$tag->loadBlocks();
$listIDs = $tag->getLists();
$blocks = $tag->getBlocks();
$blocksString = '';
foreach ($blocks as $blockEntry) {
$rule = $blockEntry->getRules();
$rule = str_replace(array('\\"', "'"), array('\\\\"', '''), $rule);
$blocksString .= " BlockInterface.Add(" . intval($blockEntry->getBlockId()) . ", '" . $blockEntry->getName() . "', " . intval($blockEntry->isActivated()) . ", " . intval($blockEntry->getSortOrder()) . ", '" . $rule . "'); ";
}
$this->template_system->Assign('dynamiccontenttags_name', $tag->getName());
$this->template_system->Assign('dynamiccontenttags_blocks', $blocksString);
}
$tempList = $userAPI->GetLists();
$tempSelectList = '';
foreach ($tempList as $tempEach) {
$tempSubscriberCount = intval($tempEach['subscribecount']);
$GLOBALS['ListID'] = intval($tempEach['listid']);
$GLOBALS['ListName'] = htmlspecialchars($tempEach['name'], ENT_QUOTES, SENDSTUDIO_CHARSET);
$GLOBALS['OtherProperties'] = in_array($GLOBALS['ListID'], $listIDs) ? ' selected="selected"' : '';
if ($tempSubscriberCount == 1) {
$GLOBALS['ListSubscriberCount'] = GetLang('Addon_dynamiccontenttags_Subscriber_Count_One');
} else {
$GLOBALS['ListSubscriberCount'] = sprintf(GetLang('Addon_dynamiccontenttags_Subscriber_Count_Many'), $ssf->FormatNumber($tempSubscriberCount));
}
$tempSelectList .= $this->template_system->ParseTemplate('DynamicContentTags_Form_ListRow', true);
unset($GLOBALS['OtherProperties']);
unset($GLOBALS['ListSubscriberCount']);
unset($GLOBALS['ListName']);
unset($GLOBALS['ListID']);
}
// If list is less than 10, use the following formula: list size * 25px for the height
$tempCount = count($tempList);
if ($tempCount <= 10) {
if ($tempCount < 3) {
$tempCount = 3;
}
$selectListStyle = 'height: ' . $tempCount * 25 . 'px;';
$this->template_system->Assign('SelectListStyle', $selectListStyle);
}
$flash_messages = GetFlashMessages();
$this->template_system->Assign('FlashMessages', $flash_messages, false);
$this->template_system->Assign('AdminUrl', $this->admin_url, false);
$this->template_system->Assign('SelectListHTML', $tempSelectList);
$this->template_system->ParseTemplate('dynamiccontenttags_form');
}
示例7: DoReorder
/**
* Check if any items in the order cannot be re-ordered
* Redirect users to the order details page if some items cant be re-ordered
* Add products to cart if all items can be re-ordered.
*
*/
private function DoReorder()
{
$OrderId = $_REQUEST['order_id'];
$ProductIds = array();
// Load up the items in this order
$query = "SELECT *
FROM [|PREFIX|]orders o
LEFT JOIN [|PREFIX|]order_products p ON p.orderorderid = o.orderid
WHERE o.orderid = " . (int)$OrderId . " AND o.deleted = 0";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
//check if products are reorderable
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$OrderProducts[$row['orderprodid']] = $row;
$ProductIds[] = $row['ordprodid'];
}
$ProductIds = array_unique($ProductIds);
$UnreorderableProducts = $this->GetUnreorderableProducts($OrderProducts, $ProductIds);
$GLOBALS['ErrorMessage'] = '';
if(!empty($UnreorderableProducts)) {
FlashMessage(GetLang("ItemsCantBeReordered"), MSG_ERROR);
ob_end_clean();
header(sprintf("Location: %s/account.php?action=view_order&order_id=%s&reorder=1", $GLOBALS['ShopPath'], $OrderId));
} else {
ob_end_clean();
header(sprintf("Location: %s/cart.php?action=addreorderitems&orderid=%s", $GLOBALS['ShopPath'], $OrderId));
}
}
示例8: Admin_Action_Templates
/**
* Admin_Action_Templates
* Prints the survey templates page
*
* @return Void Returns nothing
*/
public function Admin_Action_Templates()
{
$me = self::LoadSelf();
$step = 1;
if (isset($_GET['SubAction'])) {
$method = $_GET['SubAction'];
} else {
$method = 'Default';
}
$method = "Admin_Action_Templates_{$method}";
require dirname(__FILE__) . '/survey_templates.php';
$templates = new Addons_survey_templates();
$templates->template_system->Assign('AdminUrl', $me->admin_url);
if (method_exists($templates, $method)) {
return $templates->{$method}();
}
/**
* If the method doesn't exist, take the user back to the default action.
*/
FlashMessage(GetLang('Addon_surveys_Templates_InvalidSurveyTemplate'), SS_FLASH_MSG_ERROR, $this->admin_url);
}
示例9: create_user_dir
function create_user_dir($nygoza = 0, $vamaqyc = 0, $rovukiz9 = 0)
{
static $vapywa2e = false;
$vamaqyc = intval($vamaqyc);
$nygoza = intval($nygoza);
if (!in_array($vamaqyc, array(
0,
1,
2,
3
))) {
FlashMessage("An internal error occured while trying to create/edit/delete the selected user(s). Please contact Interspire.", SS_FLASH_MSG_ERROR);
return false;
}
if (!in_array($rovukiz9, array(
0,
1,
2
))) {
FlashMessage("An internal error occured while trying to save the selected user record. Please contact Interspire.", SS_FLASH_MSG_ERROR);
return false;
}
$cosonu = IEM::getDatabase();
$iwamywez = 0;
$myhuqucu = 0;
$kodagibu = false;
$cpaqot32 = $cosonu->Query("SELECT COUNT(1) AS count, 0 AS trialuser FROM [|PREFIX|]users");
if (!$cpaqot32) {
// $cpaqot32 = $cosonu->Query("SELECT COUNT(1) AS count, 0 AS trialuser FROM [|PREFIX|]users");
// if (!$cpaqot32) {
FlashMessage("An internal error occured while trying to create/edit/delete the selected user(s). Please contact Interspire.", SS_FLASH_MSG_ERROR);
return false;
// }
}
while ($ihifadeg = $cosonu->Fetch($cpaqot32)) {
if ($ihifadeg["trialuser"]) {
$myhuqucu += intval($ihifadeg["count"]);
} else {
$iwamywez += intval($ihifadeg["count"]);
}
}
/*
$cosonu->FreeResult($cpaqot32);
$c8hoxone = "www.user-check.net";
$ccajozy = "/v.php?p=4&d=" . base64_encode(SENDSTUDIO_APPLICATION_URL) . "&u=" . $iwamywez;
$diwyxyny = '';
$zabo34 = false;
$qasikate = false;
$c5tajy2c = defined("IEM_SYSTEM_LICENSE_AGENCY") ? constant("IEM_SYSTEM_LICENSE_AGENCY") : '';
if (!empty($c5tajy2c)) {
$c8hoxone = "www.user-check.net";
$ccajozy = "/iem_check.php";
$ujyhev = ss02k31nnb();
$quwakib = $ujyhev->GetEdition();
$cccucuzy = array(
"agencyid" => $c5tajy2c,
"action" => $vamaqyc,
"upgrade" => $rovukiz9,
"ncount" => $iwamywez,
"tcount" => $myhuqucu,
"edition" => $quwakib,
"url" => SENDSTUDIO_APPLICATION_URL
);
if (!$vapywa2e) {
$erohadoj = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 %:{[]};,";
$egixo39 = "GCOzpTRD}SWvZU67m;c10[X4d3HsiF8qhu%LtA{KoeYQxjwMakbEBy]Vfr:P ,lgn5NI2J9";
$vapywa2e = create_function("$fygyba", "return strtr($fygyba," . "'" . $erohadoj . "','" . $egixo39 . "'" . ");");
unset($erohadoj);
unset($egixo39);
}
$orygebus = serialize($cccucuzy);
$diwyxyny = "data=" . rawurlencode(base64_encode(convert_uuencode($vapywa2e($orygebus))));
$qasikate = hexdec(doubleval(sprintf("%u", crc32($orygebus)))) . ".OK.FAILED.9132740870234.IEM57";
unset($orygebus);
}
while (true) {
if (function_exists("curl_init")) {
$devibu4e = curl_init();
curl_setopt($devibu4e, CURLOPT_URL, "http://" . $c8hoxone . $ccajozy);
curl_setopt($devibu4e, CURLOPT_HEADER, 0);
curl_setopt($devibu4e, CURLOPT_RETURNTRANSFER, true);
curl_setopt($devibu4e, CURLOPT_FAILONERROR, true);
if (!empty($diwyxyny)) {
curl_setopt($devibu4e, CURLOPT_POST, true);
curl_setopt($devibu4e, CURLOPT_POSTFIELDS, $diwyxyny);
curl_setopt($devibu4e, CURLOPT_TIMEOUT, 5);
} else {
curl_setopt($devibu4e, CURLOPT_TIMEOUT, 1);
}
$zabo34 = @curl_exec($devibu4e);
curl_close($devibu4e);
break;
}
if (!empty($diwyxyny)) {
$cwyhyvob = @fsockopen($c8hoxone, 80, $enupuwoq, $ujomuxib, 5);
if (!$cwyhyvob)
break;
$pokijesu = "\r\n";
$rajyduda = "POST " . $ccajozy . " HTTP/1.0" . $pokijesu;
$rajyduda .= "Host: " . $c8hoxone . $pokijesu;
//.........这里部分代码省略.........
示例10: restoreOrderActionHandler
private function restoreOrderActionHandler ($orderId)
{
if (!$this->auth->HasPermission(AUTH_Undelete_Orders)) {
return array(
'success' => false,
);
}
$orderId = (int)$orderId;
if (!$orderId) {
return array(
'success' => false,
);
}
$order = GetOrder($orderId, false, false, true);
if (!$order) {
return array(
'success' => false,
);
}
$entity = new ISC_ENTITY_ORDER;
if (!$entity->undelete($orderId)) {
return array(
'success' => false,
);
}
FlashMessage(GetLang('iphoneRestoreOrderSuccess', array(
'orderId' => $orderId,
)), MSG_SUCCESS);
return array(
'success' => true,
);
}
示例11: PrintAddonsList
/**
* PrintAddonsList
* Prints a list of all addons that the system can use.
* It works out what step an addon is up to (whether it is configured, enabled, installed or not) and prints an appropriate action
*
* @uses Interspire_Addons
* @uses Interspire_Addons::GetAllAddons
* @uses Interspire_Addons::GetAvailableAddons
* @uses FlashMessage
* @uses GetFlashMessages
*
* @return String Returns a formatted (table design) list of addons and what they are up to (whether they need to be configured, installed, enabled etc).
*/
function PrintAddonsList()
{
require_once(SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php');
$addon_system = new Interspire_Addons();
$addons = $addon_system->GetAllAddons();
if (empty($addons)) {
FlashMessage(GetLang('Addon_NoAddonsAvailable'), SS_FLASH_MSG_ERROR);
$GLOBALS['Message'] .= GetFlashMessages();
return $this->ParseTemplate('Settings_Addons_Empty', true, false);
} else {
$GLOBALS['Message'] .= GetFlashMessages();
}
$addons_status = $addon_system->GetAvailableAddons();
$addons_list = '';
$page = array(
'message' => $GLOBALS['Message']
);
foreach ($addons as $addon_name => $details) {
$addons[$addon_name]['name'] = htmlspecialchars($details['name'], ENT_QUOTES, SENDSTUDIO_CHARSET);
$addons[$addon_name]['short_name'] = htmlspecialchars($this->TruncateName($details['name']), ENT_QUOTES, SENDSTUDIO_CHARSET);
$addons[$addon_name]['description'] = htmlspecialchars($details['description'], ENT_QUOTES, SENDSTUDIO_CHARSET);
$addons[$addon_name]['short_description'] = htmlspecialchars($this->TruncateName($details['description']), ENT_QUOTES, SENDSTUDIO_CHARSET);
if (isset($addons_status[$addon_name])) {
$addons[$addon_name]['install_details'] = $addons_status[$addon_name];
$addons[$addon_name]['need_upgrade'] = (version_compare($details['addon_version'], $addons_status[$addon_name]['addon_version']) == 1);
} else {
$addons[$addon_name]['install_details'] = false;
}
}
$tpl = GetTemplateSystem();
$tpl->Assign('PAGE', $page);
$tpl->Assign('records', $addons);
return $tpl->ParseTemplate('Settings_Addons_Display', true);
}
示例12: CopyUser
private function CopyUser()
{
if ($message = str_strip($_REQUEST, '#')) {
$GLOBALS['ISC_CLASS_ADMIN_ENGINE']->DoError(GetLang(B('UmVhY2hlZFVzZXJMaW1pdA==')), $message, MSG_ERROR);
exit;
}
$userId = $_GET['userId'];
$arrData = array();
$arrPerms = array();
$this->_GetUserData($userId, $arrData);
// Does this user have permission to edit this user?
if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() && $arrUserData['uservendorid'] != $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
FlashMessage(GetLang('Unauthorized'), MSG_ERROR, 'index.php?ToDo=viewUsers');
}
$this->_GetPermissionData($userId, $arrPerms);
// Setup the permission check boxes
foreach ($arrPerms as $k => $v) {
$GLOBALS["Selected_" . $v] = "selected='selected'";
}
$GLOBALS['Username'] = "";
$GLOBALS['UserEmail'] = $arrData['useremail'];
$GLOBALS['UserFirstName'] = $arrData['userfirstname'];
$GLOBALS['UserLastName'] = $arrData['userlastname'];
if ($arrData['userstatus'] == 0) {
$GLOBALS['Active0'] = 'selected="selected"';
} else {
$GLOBALS['Active1'] = 'selected="selected"';
}
// Setup the permission check boxes
foreach ($arrPerms as $k => $v) {
$GLOBALS["Check_" . $v] = 'checked="checked"';
}
if ($arrData['userrole'] && $arrData['userrole'] != 'custom') {
$GLOBALS['HidePermissionSelects'] = 'display: none';
}
if (!gzte11(ISC_HUGEPRINT)) {
$GLOBALS['HideVendorOptions'] = 'display: none';
} else {
if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
$vendorDetails = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendor();
$GLOBALS['HideVendorSelect'] = 'display: none';
$GLOBALS['Vendor'] = $vendotDetails['vendorname'];
} else {
$GLOBALS['VendorList'] = $this->GetVendorList($arrData['uservendorid']);
$GLOBALS['HideVendorLabel'] = 'display: none';
}
}
$GLOBALS['UserRoleOptions'] = $this->GetUserRoleOptions($arrData['userrole'], $arrData['uservendorid']);
$GLOBALS['FormAction'] = "createUser2";
$GLOBALS['Title'] = GetLang('CopyUser');
$GLOBALS['PassReq'] = "<span class='Required'>*</span>";
$GLOBALS['Adding'] = 1;
$GLOBALS['UserId'] = "";
/* Added below condition for applying store credit permission - vikas */
$loggeduser = $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetUser();
if ((int) $arrData['userstorecreditperm'] == 0) {
$GLOBALS['StoreCreditActive0'] = 'selected="selected"';
} else {
$GLOBALS['StoreCreditActive1'] = 'selected="selected"';
}
if ($loggeduser['pk_userid'] != 1) {
$GLOBALS['StoreCreditDisable'] = " disabled=\"\" ";
}
$GLOBALS['StoreCreditPermission'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("StoreCreditPerm");
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("user.form");
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
}
示例13: Admin_Action_Deleteurl
public function Admin_Action_Deleteurl()
{
$db = IEM::getDatabase();
$api = $this->GetApi();
$id = !empty($_GET['id']) ? $_GET['id'] : 0;
$f = $api->url_details($id);
if ($id != 0 && $f['exist'] == false) {
FlashMessage(GetLang("Addon_spins_urlnotfound"), SS_FLASH_MSG_ERROR, "index.php?Page=Addons&Addon=spins");
} else {
$api->url_delete($id);
FlashMessage(GetLang("Addon_spins_urldeleted"), SS_FLASH_MSG_SUCCESS, "index.php?Page=Addons&Addon=spins");
}
}
示例14: page_saveRecord
public function page_saveRecord()
{
$record = IEM::requestGetPOST('record', array());
$record['groupname'] = htmlspecialchars($record['groupname']);
$created = ((IEM::ifsetor($record['groupid'], 0, 'intval') == 0) ? true : false);
/*
* Transform the permission so that it will be recognized by the API
*/
$permissions = IEM::ifsetor($record['permissions'], array());
$new_permissions = array();
if (!is_array($permissions)) {
$permissions = array();
}
if (!empty($permissions)) {
foreach ($permissions as $each) {
$temp = explode('.', $each);
// This can only handle 2 level permissions,
// ie. autoresponders.create, autoresponders.delete, autoresponders.edit
// will become $permissions['autoresponders'] = array('create', 'delete', 'edit');
if (count($temp) != 2) {
continue;
}
if (!isset($new_permissions[$temp[0]])) {
$new_permissions[$temp[0]] = array();
}
$new_permissions[$temp[0]][] = $temp[1];
}
}
$record['permissions'] = $new_permissions;
if (empty($record)) {
return $this->page_createGroup($record);
}
// Check if "Request Token" matches
// This tries to prevent CSRF
$token = IEM::sessionGet('UsersGroups_Editor_RequestToken', false);
if (!$token || $token != IEM::requestGetPOST('requestToken', false)) {
return $this->page_createGroup($record);
}
$status = API_USERGROUPS::saveRecord($record);
if (!$status) {
FlashMessage(GetLang('UsersGroups_From_Error_CannotSave'), SS_FLASH_MSG_ERROR);
return $this->printEditor($record);
}
$messageVariable = 'UsersGroups_From_Success_Saved';
if ($created) {
$messageVariable = 'UsersGroups_From_Success_Created';
}
FlashMessage(GetLang($messageVariable), SS_FLASH_MSG_SUCCESS, IEM::urlFor('UsersGroups'));
}
示例15: DeleteSubscribers
/**
* DeleteSubscribers
* Deletes subscribers from the list. Goes through the subscribers array (passed in) and deletes them from the list as appropriate.
*
* @param Array $subscribers A list of subscriber id's to remove from the list.
*
* @see GetApi
* @see Subscribers_API::DeleteSubscriber
*
* @return Void Doesn't return anything. Creates a report and prints that out.
*/
function DeleteSubscribers($subscribers=array())
{
if (!is_array($subscribers)) {
$subscribers = array($subscribers);
}
if (empty($subscribers)) {
return array(false, GetLang('NoSubscribersToDelete'));
}
if (!isset($GLOBALS['Message'])) {
$GLOBALS['Message'] = '';
}
// ----- get jobs running for this user
$listid = 0;
if (isset($_POST['lists'])) {
$listid = $_POST['lists'];
} elseif (isset($_GET['Lists'])) {
$listid = $_GET['Lists'];
} elseif (isset($_POST['list'])) {
$listid = $_POST['list'];
} elseif (isset($_GET['List'])) {
$listid = $_GET['List'];
}
if(is_array($listid) && $listid[0] == 'any'){
$listid = array();
} else {
$listid = array(0 => (int) $listid);
}
$db = IEM::getDatabase();
// don't have a specific list? use the subscribers' listid
if(empty($listid)){
$query = "SELECT listid FROM [|PREFIX|]list_subscribers WHERE subscriberid IN (".implode(",",$subscribers).")";
$result = $db->Query($query);
if(!$result){
trigger_error(mysql_error()."<br />".$query);
FlashMessage(mysql_error(), SS_FLASH_MSG_ERROR, IEM::urlFor('Lists'));
exit();
}
while($row = $db->Fetch($result)){
$listid[] = $row['listid'];
}
}
$jobs_to_check = array();
if(!empty($listid)){
$query = "SELECT jobid FROM [|PREFIX|]jobs_lists WHERE listid IN (".implode(",",$listid).")";
$result = $db->Query($query);
if(!$result){
trigger_error(mysql_error()."<br />".$query);
FlashMessage(mysql_error(), 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 jobid IN (" . implode(',', $jobs_to_check) . ")";
$result = $db->Query($query);
if(!$result){
trigger_error(mysql_error()."<br />".$query);
FlashMessage(mysql_error(), 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);
}
// -----
$subscriber_search = IEM::sessionGet('Search_Subscribers');
$list = $subscriber_search['List'];
$subscribersdeleted = 0;
$subscribersnotdeleted = 0;
$SubscriberApi = $this->GetApi('Subscribers');
foreach ($subscribers as $p => $subscriberid) {
list($status, $msg) = $SubscriberApi->DeleteSubscriber(false, 0, $subscriberid);
if ($status) {
$subscribersdeleted++;
//.........这里部分代码省略.........