Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

osTicket v1.10 (stable) and Maintenance Release v1.9.15 are now available! Go get it now

Trouble adding message to login page..??

We use WordPress / WooCommerce to sell products, and people create accounts on our WP site when they buy.  Often, when they go to create a ticket at our store they expect the same un/pw to work, so I end up with quite a few failed login attempts.  Not a good user experience.  I'm trying to add a message to the login page but for some reason it's not working for me and I can't figure out why.  Seems real simple.

I opened up /include/client/login.inc.php and I see the following:

    $body = __('To better serve you, we encourage our clients to register for an account and verify the email address we have on record.');

Of course that's the message I see displayed on my login page, and I'd like to add on to that message, so I do this:

    $body = __('To better serve you, we encourage our clients to register for an account and verify the email address we have on record.');
    $body .= __('NOTE: This login is different from our store site.  If you created an account during purchase of a product / service on our site you will need to create a separate account here for support purposes.');

I've uploaded that file, cleared cache, but for some reason my additional message is not showing up.  I also tried adding it into the existing $body variable without appending it, but it doesn't show up that way either.  I even tried commenting out the $body line altogether, but it still displayed the default message.

What's interesting is that if I have a syntax error (missing ; at the end) it does not render correctly, so the page itself does seem to be taking affect, however, I cannot seem to get this $body value to update for some reason.

Any information on how I can get this working would be greatly appreciated.  Thanks!
Tagged:

Comments

  • Ah, I didn't even realize that portion of code was the else half of an if/else statement.  The part that's running is inside the if($content) part, so now it makes sense why my adjustments weren't being displayed.  So I guess I need to make the adjustment inside getbody() instead..??  Some guideance on doing that properly would be great.  
  • Okay, I just did it like this:

            array($content->getName(), $content->getBody() . '<br /><br />NOTE: This login is different from our store site.  If you created an account during purchase of a product / service on our site you will need to create a separate account here for support purposes.'));

    If there's a better way please let me know.  Thanks!
  • That should work.

    Personally I think that I would alter the WP user creation script to also insert the data needed into the osTicket database so when they create an account at WP it also created the same account in osticket.  Or write a Authentication:WP plugin.
  • Thanks for the feedback.  I agree, and plan on doing so.  Just needed a short-term note as a stop gap.
  • It would help me a lot to know how you, @angelleye, managed this setup. Did you manage to insert your WP users into the Osticket user table?
    I have been trying to get the Keyce osticket bridge working, but I didn't succeeded with this. So maybe I can learn from you?
  • @wassie Sorry, but I never went any further with this.  Would still like to at some point but it hasn't been a priority.  The simple message helped enough to keep them from trying the WP login credentials.
  • Here's an attempt at a plugin that will let you authenticate to wordpress

    What it'll do is connect to the wordpress database and check if there is a user with the specified username/email and if there is it'll check with wordpress password check and see if the entered password returns an acceptable hash comparison.
    If the user succesfully authenticates, a new user will be created in osticket with the details that were available in wordpress.
Sign In or Register to comment.