Commit 7321e5ab authored by lindonb's avatar lindonb

[REF] Revamp feedback method to centralize and standardize coding. Third of...

[REF] Revamp feedback method to centralize and standardize coding. Third of three commits at this time (continuation of r58746)- need all three to avoid errors. This commit replaces the usages of the $tikifeedback Smarty variable with Feedback functions.
parent 37ca6694
......@@ -71,7 +71,7 @@ if (isset($_REQUEST['mvimg']) && isset($_REQUEST['move_gallery'])) {
if ($mvresult['timeout']) {
$mvmsg.= ' ' . tra('a timeout occurred. Hit the reload button to move the rest');
}
$tikifeedback[]['mes'] = $mvmsg;
Feedback::note($mvmsg);
}
}
......@@ -109,7 +109,7 @@ if (isset($_REQUEST['mvimg']) && isset($_REQUEST['move_gallery'])) {
if ($mvresult['timeout']) {
$mvmsg .= ' ' . tra('a timeout occurred. Hit the reload button to move the rest');
}
$tikifeedback[]['mes'] = $mvmsg;
Feedback::note($mvmsg);
}
}
......
......@@ -17,9 +17,8 @@ $langLib = TikiLib::lib('language');
$languages = $langLib->list_languages(false, null, true);
$smarty->assign_by_ref('languages', $languages);
global $tikifeedback;
if (!empty($tikifeedback)) {
foreach ($tikifeedback as $item) {
if (isset($_SESSION['tikifeedback'])) {
foreach ($_SESSION['tikifeedback'] as $item) {
if ($item['name'] === 'available_languages' || $item['name'] === 'restrict_language') {
TikiLib::lib('cache')->empty_cache('temp_cache');
break;
......
......@@ -526,7 +526,6 @@ function initTikiDB( &$api, &$driver, $host, $user, $pass, $dbname, $client_char
}
);
global $tikifeedback;
$dbcon = false;
try {
$dbTiki = $initializer->getConnection(
......@@ -539,7 +538,7 @@ function initTikiDB( &$api, &$driver, $host, $user, $pass, $dbname, $client_char
)
);
} catch (Exception $e) {
$tikifeedback[] = array( 'num' => 1, 'mes' => $e->getMessage() );
Feedback::error($e->getMessage());
}
$dbcon = ! empty($dbTiki);
......@@ -557,22 +556,22 @@ function initTikiDB( &$api, &$driver, $host, $user, $pass, $dbname, $client_char
)
);
} catch (Exception $e) {
$tikifeedback[] = array( 'num' => 1, 'mes' => $e->getMessage() );
Feedback::error($e->getMessage());
}
$dbcon = ! empty($dbTiki);
// First check that suggested database name will not cause issues
$dbname_clean = preg_replace('/[^a-z0-9$_-]/', "", $dbname);
if ($dbname_clean != $dbname) {
$tikifeedback[] = array( 'num' => 1, 'mes'=> tra("Some invalid characters were detected in database name. Please use alphanumeric characters or _ or -.", '', false, array($dbname_clean)) );
Feedback::error(tra("Some invalid characters were detected in database name. Please use alphanumeric characters or _ or -.", '', false, [$dbname_clean]));
$dbcon = false;
} elseif ($dbcon) {
$error = '';
$sql="CREATE DATABASE IF NOT EXISTS `$dbname_clean` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;";
$dbTiki->queryError($sql, $error);
if ( empty($error) ) {
$tikifeedback[] = array( 'num' => 0, 'mes'=> tra("Database `%0` was created.", '', false, array($dbname_clean)) );
Feedback::success(tra("Database `%0` was created.", '', false, [$dbname_clean]));
} else {
$tikifeedback[] = array( 'num' => 1, 'mes'=> tra("Database `%0` creation failed. You need to create the database.", '', false, array($dbname_clean)) );
Feedback::error(tra("Database `%0` creation failed. You need to create the database.", '', false, [$dbname_clean]));
}
try {
......@@ -587,10 +586,10 @@ function initTikiDB( &$api, &$driver, $host, $user, $pass, $dbname, $client_char
);
$dbcon = ! empty($dbTiki);
} catch (Exception $e) {
$tikifeedback[] = array( 'num' => 1, 'mes' => $e->getMessage() );
Feedback::error($e->getMessage());
}
} else {
$tikifeedback[] = array( 'num' => 1, 'mes'=> tra("Database `%0`. Unable to connect to database.", '', false, array($dbname_clean)) );
Feedback::error(tra("Database `%0`. Unable to connect to database.", '', false, [$dbname_clean]));
}
}
......@@ -889,7 +888,7 @@ if (
}
} else {
$dbcon = false;
$tikifeedback[] = array('num'=>1, 'mes'=>tra("No database name specified"));
Feedback::error(tra('No database name specified'));
}
}
// Mark that InnoDB is to be used, if selected
......@@ -1068,8 +1067,6 @@ if ($install_step == '8') {
exit;
}
$smarty->assignByRef('tikifeedback', $tikifeedback);
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$email_test_tw = 'mailtest@tiki.org';
......
......@@ -42,8 +42,6 @@ if ( $prefs['log_sql'] == 'y' && $api_tiki == 'adodb' ) {
$ADODB_PERF_MIN = $prefs['log_sql_perf_min'];
}
$tikifeedback = array();
// TODO: check this only once per session or only if a feature ask for it
TikiSetup::check($tikidomain);
......
......@@ -164,8 +164,6 @@ class UserWizardPreferencesParams extends Wizard
if ($prefs['feature_wiki'] == 'y' and $prefs['feature_wiki_userpage'] == 'y') {
if ($tikilib->page_exists($prefs['feature_wiki_userpage_prefix'] . $user)) $smarty->assign('userPageExists', 'y');
}
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
return true;
}
......
......@@ -124,29 +124,6 @@
{/if}
</nav>
{if $tikifeedback}
{remarksbox type="feedback" title="{tr}The following list of changes has been applied{/tr}"}
<ul class="list-unstyled">
{section name=n loop=$tikifeedback}
<li>
{if $tikifeedback[n].st eq 0}
{icon name="disable"}
{elseif $tikifeedback[n].st eq 1}
{icon name="ok"}
{elseif $tikifeedback[n].st eq 2}
{icon name="edit"}
{elseif $tikifeedback[n].st eq 4}
{icon name="undo"}
{else}
{icon name="information"}
{/if}
{if $tikifeedback[n].st ne 3}{tr}Preference{/tr} {/if}<strong>{tr}{$tikifeedback[n].mes|stringfix}{/tr}</strong>
{if $tikifeedback[n].st ne 3}(<small>{tr}Preference name:{/tr} {$tikifeedback[n].name})</small>{/if}
</li>
{/section}
</ul>
{/remarksbox}
{/if}
{if isset($csrferror)}
{remarksbox type="error" title="{tr}Potential Cross-Site Request Forgery{/tr}"}
{$csrferror}
......
......@@ -20,7 +20,6 @@
{/if}
</div>
{/if}
{include file='utilities/feedback.tpl'}
{tabset}
{tab name="{tr}Forums{/tr}"}
......
......@@ -87,9 +87,6 @@
</table>
<a href="{bootstrap_modal controller=mailin action=replace_account}" class="btn btn-default">{icon name="add"} {tr}Add Account{/tr}</a>
{button _icon_name="cog" _text="{tr}Admin Mail-in Routes{/tr}" _type="link" href="tiki-admin_mailin_routes.php"}
{if $tikifeedback}
{section name=n loop=$tikifeedback}<div class="alert {if $tikifeedback[n].num > 0} alert-warning{/if}">{$tikifeedback[n].mes}</div>{/section}
{/if}
<h2>{tr}Check Mail-in accounts{/tr}</h2>
<form class="form-horizontal" action="tiki-admin_mailin.php" method="post">
......
......@@ -8,13 +8,6 @@
{/if}
<h2>{tr}Add notification{/tr}</h2>
{if !empty($tikifeedback)}
<div class="alert alert-info alert-dismissable">
{section name=ix loop=$tikifeedback}
{icon name='remove' alt="{tr}Alert{/tr}" style="vertical-align:middle"} {$tikifeedback[ix].mes}.
{/section}
</div>
{/if}
<form action="tiki-admin_notifications.php" method="post" class="form-horizontal" role="form">
<input type="hidden" name="find" value="{$find|escape}">
<input type="hidden" name="sort_mode" value="{$sort_mode|escape}">
......
......@@ -33,7 +33,6 @@
{if $prefs.feature_intertiki_import_preferences eq 'y'}{tr}Since this Tiki site is in slave mode and imports preferences, the master user preferences will be automatically reimported at each login{/tr}{/if}
{/remarksbox}
{/if}
{include file='utilities/feedback.tpl'}
{if !empty($added) or !empty($discarded) or !empty($discardlist)}
{remarksbox type="feedback" title="{tr}Batch Upload Results{/tr}"}
{tr}Updated users{/tr} {$added}
......
......@@ -81,7 +81,7 @@
</div>
<div class="col-md-9 install-steps">
{feedback}
{if $install_step eq '0' or !$install_step}{* start of installation *}
<div class="install-step0">
<h1 class="pagetitle">{tr}Welcome{/tr}</h1>
......@@ -251,18 +251,6 @@
<a href="#" onclick="$('#installer_3_new_db_form').toggle();return false;" class="btn btn-link">{tr}Modify database connection{/tr}</a>
</div>
{/if}
{if $tikifeedback}
<br>
{section name=n loop=$tikifeedback}
<div class="alert {if $tikifeedback[n].num > 0} alert-warning{/if}">
{if $tikifeedback[n].num > 0}
{icon name="error"} {$tikifeedback[n].mes}
{else}
{icon name="ok"} {$tikifeedback[n].mes}
{/if}
</div>
{/section}
{/if}
<div id="installer_3_new_db_form"{if $dbcon eq 'y'} style="display:none;"{/if}>
<p>{tr}Use this page to create a new database connection, or use the <a href="https://doc.tiki.org/Manual+Installation" target="_blank" title="manual installation">manual installation process</a>.{/tr} <a href="https://doc.tiki.org/Manual+Installation" target="_blank" title="{tr}Help{/tr}">{icon name="help"}</a></p>
<form action="tiki-install.php" method="post" role="form">
......
......@@ -142,15 +142,6 @@ function update_button_install() {
</form>
{/if}
<br>
{if $tikifeedback}
<br>
{section name=n loop=$tikifeedback}
<div class="alert {if $tikifeedback[n].num > 0} alert-warning{/if}">
{if $tikifeedback[n].num > 0}{icon name='remove' alt="Alert" style="vertical-align:middle;"}{/if}{$tikifeedback[n].mes}
</div><br>
{/section}
{/if}
{if not $installask}
<form method="get" action="tiki-mods.php">
{tr}Find{/tr}
......
......@@ -5,7 +5,7 @@
{button href="tiki-mods.php" class="btn btn-default" _text="{tr}Mods Install/uninstall{/tr}"}
</div>
{section name=n loop=$tikifeedback}<div class="alert{if $tikifeedback[n].num > 0} alert-warning{/if}">{$tikifeedback[n].mes}</div>{/section}
<br>
<form method="post" action="tiki-mods_admin.php" class="form-horizontal">
<div class="form-group">
......@@ -35,4 +35,3 @@
</div>
</div>
</form>
......@@ -45,10 +45,6 @@ Note: The show content block must be defined at root level to use the include. A
{/if}
{/if}
{if isset($saved_msg) && $saved_msg neq ''}
{remarksbox type="note" title="{tr}Note{/tr}"}{$saved_msg}{/remarksbox}
{/if}
{if $user and $prefs.feature_user_watches eq 'y' and (isset($category_watched) and $category_watched eq 'y')}
<div class="categbar" style="clear: both; text-align: right">
{tr}Watched by categories:{/tr}
......
......@@ -4,12 +4,6 @@
{include file='tiki-mytiki_bar.tpl'}
{if $tikifeedback}
<div class="alert alert-warning">
{section name=n loop=$tikifeedback}<div>{$tikifeedback[n].mes}</div>{/section}
</div>
{/if}
{tabset name="mytiki_user_preference"}
{tab name="{tr}Accounts{/tr}"}
<h2>{tr}Accounts{/tr}</h2>
......
......@@ -8,13 +8,6 @@
{button class="btn btn-default" _text="{tr}Export through Action Log{/tr}" href="tiki-admin_actionlog.php#Report"}
*}</div>
{if $tikifeedback}
<br>
{section name=n loop=$tikifeedback}
<div class="alert {if $tikifeedback[n].num > 0} alert-warning{/if}">{$tikifeedback[n].mes}</div>
{/section}
{/if}
<form method="get" action="tiki-syslog.php">
<label>{tr}Clean logs older than{/tr}&nbsp;
<input type="text" name="months" size="4"></label> {tr}months{/tr}
......
......@@ -22,11 +22,6 @@
}
</script>
{if $tikifeedback}
<br>
{section name=n loop=$tikifeedback}<div class="alert alert-info {if $tikifeedback[n].num > 0} alert-warning{/if}">{$tikifeedback[n].mes}</div>{/section}
<br>
{/if}
<p>{tr}Configure how your mailed-in wiki pages are to be linked / organized.{/tr}</p>
{tabset name="user_mailin"}
......
......@@ -14,13 +14,6 @@
{button href="tiki-user_information.php?view_user=$thisuser" _type="link" _text="{tr}User Information{/tr}"}
</div>
{/if}
{if $tikifeedback}
<div class="simplebox highlight">
{section name=n loop=$tikifeedback}
<div>{$tikifeedback[n].mes}</div>
{/section}
</div>
{/if}
{tabset name="mytiki_user_preference"}
{if $prefs.feature_userPreferences eq 'y'}
{tab name="{tr}Personal Information{/tr}"}
......
......@@ -124,7 +124,6 @@
<a class="link" href="{$forumId|sefurl:'forum'}">{$forum_info.name|addongroupname|escape}</a>
</div>
{include file='utilities/feedback.tpl'}
{if $tiki_p_forum_post_topic eq 'y'}
{if $comment_preview eq 'y'}
<br><br>
......
......@@ -16,7 +16,6 @@
{/if}
{button href="tiki-view_forum.php?forumId=$forumId" class="btn btn-default" _text="{tr}Topic List{/tr}"}
</div>
{include file="utilities/feedback.tpl"}
{if $post_reported eq 'y'}
{remarksbox type=warning title="{tr}The post has been reported and will be reviewed by a moderator.{/tr}"}{/remarksbox}
{/if}
......
......@@ -13,13 +13,6 @@ $section = 'admin';
require_once ('tiki-setup.php');
$adminlib = TikiLib::lib('admin');
if (! empty($_SESSION['tikifeedback'])) {
$tikifeedback = $_SESSION['tikifeedback'];
$_SESSION['tikifeedback'] = array();
} else {
$tikifeedback = array();
$_SESSION['tikifeedback'] = array();
}
$auto_query_args = array('page');
$access->check_permission('tiki_p_admin');
......@@ -37,13 +30,12 @@ $logslib = TikiLib::lib('logs');
function add_feedback( $name, $message, $st, $num = null )
{
TikiLib::lib('prefs')->addRecent($name);
$_SESSION['tikifeedback'][] = array(
'num' => $num,
Feedback::add(['num' => $num,
'mes' => $message,
'st' => $st,
'name' => $name,
);
'tpl' => 'pref',], 'session');
}
/**
......@@ -639,7 +631,6 @@ $smarty->assign('mysqlSSL', $isSSL);
$smarty->assign('admin_icons', $admin_icons);
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
// Display the template
......
......@@ -429,19 +429,6 @@ $smarty->assign(
)
);
if (isset($_POST['ajaxtype'])) {
$smarty->assign('ajaxfeedback', 'y');
$ajaxpost = array_intersect_key($_POST, [
'ajaxtype' => '',
'ajaxheading' => '',
'ajaxitems' => '',
'ajaxmsg' => '',
'ajaxtoMsg' => '',
'ajaxtoList' => '',
]);
$smarty->assign($ajaxpost);
}
$sections = $tikilib->get_forum_sections();
$smarty->assign_by_ref('sections', $sections);
include_once ('tiki-section_options.php');
......
......@@ -20,30 +20,24 @@ $accounts = $mailinlib->list_mailin_accounts(0, -1, 'account_asc', '');
$smarty->assign('accounts', $accounts['data']);
if (isset($_REQUEST['mailin_autocheck'])) {
if ($_REQUEST['mailin_autocheck'] == 'y' && !(preg_match('/[0-9]+/', $_REQUEST['mailin_autocheckFreq']) && $_REQUEST['mailin_autocheckFreq'] > 0)) {
$smarty->assign('msg', tra('Frequency should be a positive integer!'));
$smarty->display('error.tpl');
die;
if ($_REQUEST['mailin_autocheck'] == 'y' && !(preg_match('/[0-9]+/', $_REQUEST['mailin_autocheckFreq'])
&& $_REQUEST['mailin_autocheckFreq'] > 0))
{
Feedback::warning(tra('Frequency should be a positive integer!'));
} else {
$tikilib->set_preference('mailin_autocheck', $_REQUEST['mailin_autocheck']);
$tikilib->set_preference('mailin_autocheckFreq', $_REQUEST['mailin_autocheckFreq']);
if ($prefs['mailin_autocheck'] == 'y') {
$tikifeedback[] = array(
'num' => 1,
'mes' => sprintf(tra('Mail-in accounts set to be checked every %s minutes'), $prefs['mailin_autocheckFreq'])
);
Feedback::warning(sprintf(tra('Mail-in accounts set to be checked every %s minutes'),
$prefs['mailin_autocheckFreq']));
} else {
$tikifeedback[] = array(
'num' => 1,
'mes' => sprintf(tra('Automatic Mail-in accounts checking disabled'))
);
Feedback::warning(sprintf(tra('Automatic Mail-in accounts checking disabled')));
}
}
}
$artlib = TikiLib::lib('art');
$smarty->assign('tikifeedback', $tikifeedback);
$smarty->assign('mailin_types', $mailinlib->list_available_types());
ask_ticket('admin-mailin');
......
......@@ -51,41 +51,28 @@ if (isset($_REQUEST["add"])) {
if ($userlib->user_exists($_REQUEST['login'])) {
$login = $_REQUEST['login'];
} else {
$tikifeedback[] = array(
'num' => 0,
'mes' => tra("Invalid username")
);
Feedback::error(tra('Invalid username'));
$save = false;
}
} elseif (!empty($_REQUEST['email'])) {
if (validate_email($_REQUEST['email'], $prefs['validateEmail'])) {
$email = $_REQUEST['email'];
} else {
$tikifeedback[] = array(
'num' => 0,
'mes' => tra("Invalid email")
);
Feedback::error(tra('Invalid email'));
$save = false;
}
} else {
$tikifeedback[] = array(
'num' => 0,
'mes' => tra("You need to provide a username or an email")
);
Feedback::error(tra('You need to provide a username or an email'));
$save = false;
}
if ($save and isset($_REQUEST['event']) and isset($watches[$_REQUEST['event']])) {
$result = $tikilib->add_user_watch($login, $_REQUEST["event"], $watches[$_REQUEST['event']]['object'], $watches[$_REQUEST['event']]['type'], $watches[$_REQUEST['event']]['label'], $watches[$_REQUEST['event']]['url'], isset($email) ? $email : NULL);
if (!$result) {
$tikifeedback[] = array(
'mes' => tra("The user has no email set. No notifications will be sent.")
);
Feedback::error(tra('The user has no email set. No notifications will be sent.'));
}
}
}
if (!empty($tikifeedback)) {
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
}
if (isset($_REQUEST["removeevent"]) && isset($_REQUEST['removetype'])) {
$access->check_authenticity();
if ($_REQUEST['removetype'] == 'user') {
......
This diff is collapsed.
......@@ -276,7 +276,6 @@ if (isset($_REQUEST['focus'])) {
}
$smarty->assign('focus', $focus);
$smarty->assign('more', $more);
$smarty->assign('tikifeedback', $feedback);
$smarty->assign('types', $types);
$smarty->assign('versions', $versions);
$smarty->assign('mid', 'tiki-mods.tpl');
......
......@@ -22,7 +22,7 @@ if (isset($_REQUEST['save'])) {
if (is_dir($_REQUEST['mods_dir'])) {
$tikilib->set_preference('mods_dir', $_REQUEST['mods_dir']);
} else {
$tikifeedback[] = array('num' => 1, 'mes' => "Directory " . $_REQUEST['mods_dir'] . " not found.");
Feedback::warning(tr('Directory %0 not found.', $_REQUEST['mods_dir']));
}
} else {
$tikilib->set_preference('mods_dir', 'mods');
......@@ -33,7 +33,6 @@ if (isset($_REQUEST['save'])) {
$tikilib->set_preference('mods_server', 'http://mods.tiki.org');
}
}
$smarty->assign('tikifeedback', $tikifeedback);
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->assign('mid', 'tiki-mods_admin.tpl');
......
......@@ -19,8 +19,6 @@ $access->check_permission(array('tiki_p_send_mailin'));
$usermailinlib = TikiLib::lib('usermailin');
$tikifeedback = array();
if ($prefs['feature_wiki_structure'] === 'y') {
$structlib = TikiLib::lib('struct');
......@@ -52,10 +50,7 @@ if ($prefs['feature_wiki_structure'] === 'y') {
// Add new structure route
$usermailinlib->add_user_mailin_struct($user, $subj_pattern, $body_pattern, $structure_id, $page_id, $is_active);
$tikifeedback[] = array(
'num' => 1,
'mes' => tra('Mail-in added new structure route')
);
Feedback::success(tr('Added new structure route'));
}
}
......@@ -63,10 +58,7 @@ if ($prefs['feature_wiki_structure'] === 'y') {
if (isset($_REQUEST['delete']) && $_REQUEST['delete'] == 'y') {
if (isset($_REQUEST['mailin_struct_id']) && (int)$_REQUEST['mailin_struct_id'] > 0) {
$usermailinlib->delete_user_mailin_struct((int)$_REQUEST['mailin_struct_id']);
$tikifeedback[] = array(
'num' => 1,
'mes' => tra('Deleted structure route')
);
Feedback::success(tr('Deleted structure route'));
}
}
......@@ -101,10 +93,7 @@ if ($prefs['feature_wiki_structure'] === 'y') {
$is_active = ($_REQUEST['mailinAct'.$i] == "on") ? 'y' : 'n';
$usermailinlib->update_user_mailin_struct($mailin_struct_id, $username, $subj_pattern, $body_pattern, $structure_id, $page_id, $is_active);
$tikifeedback[] = array(
'num' => 1,
'mes' => tra('Updated structure route')
);
Feedback::success(tra('Updated structure route'));
}
// Prepare route display
......@@ -120,7 +109,6 @@ if ($prefs['feature_wiki_structure'] === 'y') {
$smarty->assign('addNewRoute', 'y');
}
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
// disallow robots to index page:
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
$smarty->assign('mid', 'tiki-user_mailin.tpl');
......
......@@ -282,7 +282,7 @@ if (isset($_REQUEST['chgadmin'])) {
}
if (!empty($_REQUEST['email']) && ($prefs['login_is_email'] != 'y' || $user == 'admin') && $_REQUEST['email'] != $userlib->get_user_email($userwatch)) {
$userlib->change_user_email($userwatch, $_REQUEST['email'], $pass);
$tikifeedback[] = array('num' => 1, 'mes' => sprintf(tra("Email is set to %s"), $_REQUEST['email']));
Feedback::success(sprintf(tra('Email is set to %s'), $_REQUEST['email']));
if ($prefs['feature_intertiki'] == 'y' && !empty($prefs['feature_intertiki_mymaster']) && $prefs['feature_intertiki_import_preferences'] == 'y') { //send to the master
$userlib->interSendUserInfo($prefs['interlist'][$prefs['feature_intertiki_mymaster']], $userwatch);
}
......@@ -306,8 +306,7 @@ if (isset($_REQUEST['chgadmin'])) {
$cryptlib = TikiLib::lib('crypt');
$cryptlib->onChangeUserPassword($_REQUEST["pass"], $_REQUEST["pass1"]);
}
$tikifeedback[] = array('num' => 1, 'mes' => sprintf(tra('Password has been changed')));
Feedback::success(sprintf(tra('Password has been changed')));
}
}
if (isset($_REQUEST['deleteaccount']) && $tiki_p_delete_account == 'y') {
......@@ -450,7 +449,6 @@ $smarty->assign('userPageExists', 'n');
if ($prefs['feature_wiki'] == 'y' and $prefs['feature_wiki_userpage'] == 'y') {
if ($tikilib->page_exists($prefs['feature_wiki_userpage_prefix'] . $user)) $smarty->assign('userPageExists', 'y');
}
$smarty->assign_by_ref('tikifeedback', $tikifeedback);
include_once ('tiki-section_options.php');
ask_ticket('user-prefs');
$smarty->assign('mid', 'tiki-user_preferences.tpl');
......
......@@ -480,9 +480,9 @@ if ($prefs['feature_forum_parse'] == 'y') {
}
$session = isset($_GET['deleted_parentId']) && !empty($_SESSION['ajaxpost' . $_GET['deleted_parentId']]) ?: false;
if (isset($_POST['ajaxtype']) || $session) {
if (!isset($_POST['ajaxtype']) && $session) {
$smarty->assign('ajaxfeedback', 'y');
$posted = isset($_POST['ajaxtype']) ? $_POST : $_SESSION['ajaxpost' . $_GET['deleted_parentId']];
$posted = $_SESSION['ajaxpost' . $_GET['deleted_parentId']];
if ($session) {
unset($_SESSION['ajaxpost' . $_GET['deleted_parentId']]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment