Display an error message before redirect to a another page in Zend Framework - zend-controller

I'm trying to display an error message using flashMessenger and display the message before redirecting to a another page but it does not show up the error message, just do the redirection,
Below is the that i am using in my controller
$this->_helper->flashMessenger->addMessage('this user name is already taken please choose a another');
$message = $this->_helper->flashMessenger->getCurrentMessages();
echo($message[0]);
sleep(5);
$this->_redirect('index/login');
can any one tell me why

No need of Flash Messenger for this...
Check Username before this.
If Username exists You can set Message on the controller Itself.
Eg. $egForm = new EgForm();
$egForm->get('form_element_name')->setMessages(array('this user name is already taken please choose a anoth

Related

Email verification link using PHPmailer

I am trying to send out an email verification message with a link the user can click on, using phpmailer. However, when I include the URL it causes problems.
I've done a bit of troubleshooting and it appears to the the URL which causes the problem.
The code I have at the moment is:
$mail->Body = '
<p>We have recevied a registration request from this account. Please
use the following link to verify your email. If you did not attempt to register,
please ignore this email.</p>
<p>' . $url . '</p>';
$mail->AltBody = 'Welcome to the site, click on this link' . ;
$mail->send();
An example link is:
https://www.....co.uk/verifyemail.php?selector=aa2a233b3bb03a75&validator=ec4545a89cb1a9f3814f0e4d3f142f60fa14ebd9cbf3911a301b03756ab59b66
After the above code, I have the following:
header('Location: ../index.php?result=unverified');
exit();
If I run the code as above, the email is sent correctly, but instead of going back to the loading page, it just shows a page with all the communication between the server and the hosting server.
If I take out the 'AltBody' bit, it sends correctly and goes to index.html correctly.
If I take out all the URLs, it sends the email correctly and goes to index.html correctly.
Do I need to escape the URL somehow? Or am I missing something else?
Thanks
Chris

Retrieving PSID from messaging_optins

I'm a new developer building a facebook messenger chatbot using node.js and Microsoft's BotFramework. I've got my chatbot up and running nicely and I'm now trying to personalise the welcome message with the user's first name.
I have a welcome message set up when a user clicks the "Get Started" button and I believe I should be able to retrieve the PSID using messaging_optins.
If so, I've got a a function that processes the Facebook payload in onEvent from the EventActivity.Value:
This cycles through some if/else statements to detect whether the Facebook payload is a Postback, Optin or Quick Reply:
If an Optin is detected it then prints "Optin message received" to the console:
The problem I'm finding is that my code isn't detecting the Optin message and so I'm not then able to write any code to extract the PSID to use to personalise my welcome message.
Can anyone point me in the right direction?
I’ve solved this as I found from the documentation here that it’s messaging_postback that are sent when 'Get Started' is clicked.

Password Reset User Flow Account Doesn't Exist Error

I have a User Flow for Password Reset set up with Email Verification. When I verify an email account that doesn't exist in our AD group, there's an error
There appears the error "An Account Could Not Be Found for this user ID".
Hitting 'Continue' causes a "Please wait while we process your information" message.
Hitting continue again a few times seems to take me to an error url like: B2C_1_ResetPassword/api/SelfAsserted/error?code=UX012 ... max retries reached
I have a Hacky Fix of sorts that binds Clicking on the Continue when the Error message is present to disabling the Continue button.
<script>
$("#continue").click(function (){
var claimVerification = $('#claimVerificationServerError:contains("account could not be found for the provided user")');
if(claimVerification.length > 0){
$("#continue").prop("disabled", true);
}
});
</script>
I have to "Enable JavaScript enforcing page layout (preview)" option turned on for this to sort of work though.
Is there a more correct solution to this issue?
As I tested with our default experiences as well as the current available templates, it doesn't seem like "Please wait while we process your information" will ever display persistently. Can you check if your css is not adding additional properties to the element used for displaying such message?
For the second scenario, it is for now by design to redirect to your client where you can setup certain logic to handle the error code "AADB2C90157" we return from the url.

Netsuite, how to show popup after login into netsuite account?

I am new to Netsuite and I have a requirement to show one alert message displaying "welcomeuser" after the user loggedin into Netsuite account.
I have tried this client script but its not showing any message.
function employee_PageInit(type){
debugger;
alert('Dear UserName, The data in NetSuite is confidential and the property of the company.');
nlapiLogExecution('DEBUG', 'user role', nlapiGetContext().getName());
alert('ok'+ nlapiGetContext().getName());
}
I have logged in with the role ADMINISTRATOR,
any help is appreciated thank you.
Here is a sample with 2.0. It's not pretty and would need some work. But this is one way to inject javascript logic onto the homepage with a portlet.
/**
*#NApiVersion 2.x
*#NScriptType Portlet
*/
define(['N/runtime'],
function(runtime) {
function render(params) {
var user = runtime.getCurrentUser();
params.portlet.title = 'Welcome Message';
var content = '<script>alert(\'Hello ' + user.name + '\');</script>';
params.portlet.html = content;
}
return {
render: render
};
});
U can try using custom portlet it stands out in the dashboard for showing the content.Then also alert is not possible.
I've struggled with this idea in the past and what you want is not technically possible, since there are no scripts that run when you are viewing the homepage. Here are some weird workarounds:
Schedule a calendar reminder, which can trigger a pop-up with your message.
Before assigning their full NetSuite rights, tell users to go to a specific page or form: Maybe a custom record... (the record could serve as a log of who consented to and read your policy) On this form you could have your message. Then when the user fills it out, have a back-end script enable their permissions.
Make your text into a tiny image, and make it your company logo for all of NetSuite. ;)
You can add the custom Javasript to display the alert on a Suitelet which would be set as the Landing Page under General Preferences, then once the user accepts redirect to their home page, and if they don't accept send an alert to the admin...
E.g.
<script>
var accepted = confirm('Dear UserName, The data in NetSuite is confidential and the property of the company.');
if (accepted)
window.open('https://99999.app.netsuite.com/app/center/card.nl?sc=-29&whence=');
else
//Send email to admin
</script>
Hi please follow the following steps :
Create a suitelet script - Login Script with pageInit() in clientscript action to alert your welcome message.
Goto Setup > Company > General Preference and under Centers tab add appropriate URL of the Login Script Suitelet's deployment and save the preferences.
Note : You can add different messages to different center's based on the roles in your account.
General Preference > Centers Tab
Hope this solves your issue please revert back if anything is missed.
Basically, the homepage of NetSuite is not scriptable.
There are some ways to check if the record/page is scriptable:
Look up the specific record type in the NetSuite Help Center; specifically on the Records Browser
On the Browser's developer console, you may run nlapiGetRecordType() and if it returns the record name, it should be scriptable -- please note that the record should be on edit mode for the console tool to run correctly with NetSuite pages
Hope this helps with your development!
you can write a function
function pageInit(type){
var context= nlapiGetContext();
var username = context.getName();
alert(hello+username);
}

How to programmatically create a bookmark for another connections user?

We want to create bookmarks programmatically and this works fine if the email parameter matches the account of the currently authenticated user.
The question is, how can we create a bookmark for another user ?
Below is the pseudo we use from the SBT.
String apiPath = "/dogear/api/app";
Response<String> postResponse = restClient.doPost(apiPath).parameter("email","another users email").body(body, "application/atom+xml").asString();
The log files are not very helpful, in the client we get an ERROR 400 Bad Request

Resources