diff --git a/include/class.i18n.php b/include/class.i18n.php index 7335495d5bd75ecdc9547a27d5af35f8f5de5076..5392446120db7060b610eeff3c88f7816a2d86f0 100644 --- a/include/class.i18n.php +++ b/include/class.i18n.php @@ -85,9 +85,12 @@ class Internationalization { } } - // Pages + // Pages and content $_config = new OsticketConfig(); - foreach (array('landing','thank-you','offline') as $type) { + foreach (array('landing','thank-you','offline', + 'registration-staff', 'pwreset-staff', 'banner-staff', + 'registration-client', 'pwreset-client', 'banner-client', + 'access-link') as $type) { $tpl = $this->getTemplate("templates/page/{$type}.yaml"); if (!($page = $tpl->getData())) continue; diff --git a/include/client/login.inc.php b/include/client/login.inc.php index 2a505ef84771440cf6cb4399d11ef4fa3bee9263..806560464ab7d29ae780c0dc50e8223c1f700583 100644 --- a/include/client/login.inc.php +++ b/include/client/login.inc.php @@ -3,8 +3,12 @@ if(!defined('OSTCLIENTINC')) die('Access Denied'); $email=Format::input($_POST['luser']?:$_GET['e']); $passwd=Format::input($_POST['lpasswd']?:$_GET['t']); + +$content = Page::lookup(Page::getIdByType('registration-policy')); + ?> -<h1>Sign In</h1> +<h1><?php echo Format::display($content->getName()); ?></h1> +<p><?php echo Format::viewableImages($content->getBody()); ?></p> <form action="login.php" method="post" id="clientLogin"> <?php csrf_token(); ?> <div style="display:table-row"> diff --git a/include/i18n/en_US/templates/page/access-link.yaml b/include/i18n/en_US/templates/page/access-link.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cd445d171e1e9b243ffc5aa8a969e4245f18eda3 --- /dev/null +++ b/include/i18n/en_US/templates/page/access-link.yaml @@ -0,0 +1,28 @@ +# +# access-link.yaml +# +# Ticket access link sent to clients for guest-only systems where the ticket +# number and email address will trigger an access link sent via email +# +--- +notes: > + Ticket access link sent to clients for guest-only systems where the ticket + number and email address will trigger an access link sent via email +name: "Ticket [#%{ticket.number}] Access Link" +body: > + <h3><strong>Hi %{recipient.name.first},</strong></h3> + An access link request for ticket #%{ticket.number} has been submitted + on your behalf for the helpdesk at %{url}.<br /> + <br /> + Follow the link below to check the status of the ticket + #%{ticket.number}.<br /> + <br /> + <a href="%{recipient.ticket_link}">%{recipient.ticket_link}</a><br /> + <br /> + If you <strong>did not</strong> make the request, please delete and + disregard this email. Your account is still secure and no one has been + given access to the ticket. Someone could have mistakenly entered your + email address.<br /> + <br /> + --<br /> + %{company.name} diff --git a/include/i18n/en_US/templates/page/banner-client.yaml b/include/i18n/en_US/templates/page/banner-client.yaml new file mode 100644 index 0000000000000000000000000000000000000000..95c4d51ac46895edef7a43fd9b2830c613396417 --- /dev/null +++ b/include/i18n/en_US/templates/page/banner-client.yaml @@ -0,0 +1,14 @@ +# +# banner-client.yaml +# +# This forms the header on the staff login page. It can be useful to inform +# your clients about your login and registration policies. +--- +notes: > + This forms the header on the staff login page. It can be useful to + inform your clients about your login and registration policies. +name: "Sign In" +body: > + This help desk is for registered customers only. Please contact our + support team directly to have an account created so you can access the + help desk to submit tickets. diff --git a/include/i18n/en_US/templates/page/banner-staff.yaml b/include/i18n/en_US/templates/page/banner-staff.yaml new file mode 100644 index 0000000000000000000000000000000000000000..cde341856b768d108f378bf7f2d5086e0fd7714e --- /dev/null +++ b/include/i18n/en_US/templates/page/banner-staff.yaml @@ -0,0 +1,9 @@ +# +# banner-staff.yaml +# +# This is the initial message and banner shown on the staff login page +--- +notes: > + This is the initial message and banner shown on the staff login page +name: "Authentication Required" +body: "" diff --git a/include/i18n/en_US/templates/page/pwreset-client.yaml b/include/i18n/en_US/templates/page/pwreset-client.yaml new file mode 100644 index 0000000000000000000000000000000000000000..29ad10eab1918d266456fc56d97e58f58530bc98 --- /dev/null +++ b/include/i18n/en_US/templates/page/pwreset-client.yaml @@ -0,0 +1,28 @@ +# +# pwreset-client.yaml +# +# Template of the email sent to clients when using the Forgot My Password +# link on the login page +--- +notes: > + Template of the email sent to clients when using the Forgot My Password + link on the login page +name: "%{company.name} Help Desk Access" +body: > + <h3><strong>Hi %{user.name.first},</strong></h3> + A password reset request has been submitted on your behalf for the + helpdesk at %{url}.<br /> + <br /> + If you feel that this has been done in error, delete and disregard this + email. Your account is still secure and no one has been given access to + it. It is not locked and your password has not been reset. Someone could + have mistakenly entered your email address.<br /> + <br /> + Follow the link below to login to the help desk and change your + password.<br /> + <br /> + <a href="%{reset_link}">%{reset_link}</a><br /> + <br /> + <em style="font-size: small">Your friendly Customer Support System + <br /> + %{company.name}</em> diff --git a/include/i18n/en_US/templates/page/pwreset-staff.yaml b/include/i18n/en_US/templates/page/pwreset-staff.yaml new file mode 100644 index 0000000000000000000000000000000000000000..b742ff5b3de69a27fb31bdb9acd0ea50e67b4d74 --- /dev/null +++ b/include/i18n/en_US/templates/page/pwreset-staff.yaml @@ -0,0 +1,29 @@ +# +# pwreset-staff.yaml +# +# Template of the email sent to staff members when using the Forgot My +# Password link +--- +notes: > + Template of the email sent to staff members when using the Forgot My + Password link +name: "osTicket Staff Password Reset" +body: > + <h3><strong>Hi %{staff.name.first},</strong></h3> + A password reset request has been submitted on your behalf for the + helpdesk at %{url}.<br /> + <br /> + If you feel that this has been done in error, delete and disregard this + email. Your account is still secure and no one has been given access to + it. It is not locked and your password has not been reset. Someone could + have mistakenly entered your email address.<br /> + <br /> + Follow the link below to login to the help desk and change your + password.<br /> + <br /> + <a href="%{reset_link}">%{reset_link}</a><br /> + <br /> + <em style="font-size: small">Your friendly Customer Support System</em> + <br /> + <img src="cid:b56944cb4722cc5cda9d1e23a3ea7fbc" alt="Powered by + osTicket" width="126" height="19" style="width: 126px" /> diff --git a/include/i18n/en_US/templates/page/registration-client.yaml b/include/i18n/en_US/templates/page/registration-client.yaml new file mode 100644 index 0000000000000000000000000000000000000000..3f8586f8c0f8bd6db3b4acd83cffb1907d46f6e9 --- /dev/null +++ b/include/i18n/en_US/templates/page/registration-client.yaml @@ -0,0 +1,24 @@ +# +# registration-staff.yaml +# +# Confirmation email sent to clients when accounts are created for them by +# staff or via the client portal. This email serves as an email address +# verification. +# +--- +notes: > + Confirmation email sent to clients when accounts are created for them by + staff or via the client portal. This email serves as an email address + verification. +name: "Welcome to %{company.name}" +body: > + <h3><strong>Hi %{user.name.first},</strong></h3> We've created an + account for you at our help desk at %{url}.<br /> + <br /> + Please follow the link below to confirm your account and gain access to + your tickets.<br /> + <br /> + <a href="%{reset_link}">%{confirmation_link}</a><br /> + <br /> + <em style="font-size: small">Your friendly Customer Support System<br + />%{company.name}</em> diff --git a/include/i18n/en_US/templates/page/registration-staff.yaml b/include/i18n/en_US/templates/page/registration-staff.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0c458fb4b536a226a45e0b830b7a6bd93918754c --- /dev/null +++ b/include/i18n/en_US/templates/page/registration-staff.yaml @@ -0,0 +1,22 @@ +# +# registration-staff.yaml +# +# Initial (optional) email sent to staff members when accounts are created +# for them in the staff control panel +# +--- +notes: > + Initial (optional) email sent to staff members when accounts are created + for them in the staff control panel +name: "Welcome to osTicket" +body: > + <h3><strong>Hi %{user.name.first},</strong></h3> + We've created an account for you at our help desk at %{url}.<br /> + <br /> + Please follow the link below to confirm your account and gain access to + your tickets.<br /> + <br /> + <a href="%{reset_link}">%{confirmation_link}</a><br /> + <br /> + <em style="font-size: small">Your friendly Customer Support System + <br />%{company.name}</em> diff --git a/include/staff/login.tpl.php b/include/staff/login.tpl.php index 35fffcc98ebb9374656b9f4fee90945e15c89d3b..4a1d2f7272a520d65e3f2a56b59d1a86080f68cc 100644 --- a/include/staff/login.tpl.php +++ b/include/staff/login.tpl.php @@ -5,6 +5,7 @@ $info = ($_POST && $errors)?Format::htmlchars($_POST):array(); <div id="loginBox"> <h1 id="logo"><a href="index.php">osTicket Staff Control Panel</a></h1> <h3><?php echo Format::htmlchars($msg); ?></h3> + <div><?php echo Format::viewableImages($content->getBody()); ?></div> <form action="login.php" method="post"> <?php csrf_token(); ?> <input type="hidden" name="do" value="scplogin"> diff --git a/include/staff/settings-access.inc.php b/include/staff/settings-access.inc.php index 4e57cb2763adc3855cd528731262d41a50b7ec59..a4da0611311d5e7afbbd3e720c48b02d2dc7a8f2 100644 --- a/include/staff/settings-access.inc.php +++ b/include/staff/settings-access.inc.php @@ -137,12 +137,24 @@ if(!defined('OSTADMININC') || !$thisstaff || !$thisstaff->isAdmin() || !$config) <em><b>Authentication and Registration Templates</b></em> </th> </tr> +<?php foreach (array( + 'pwreset-staff' => 'Password Reset for Staff', + 'staff-banner' => 'Login banner for Staff', + 'registration-staff' => 'New Staff Account', + + 'pwreset-client' => 'Password Reset for Clients', + 'registration-client' => 'Account Registration Email', + 'registration-policy' => 'Client Registration Policy', + ) as $content => $title) { ?> <tr> - <td>New Registration Email</td> - <td><a href="ajax.php/content/new-registration/manage" + <td><?php echo $title; ?></td> + <td><a href="ajax.php/content/<?php echo $content; ?>/manage" onclick="javascript: $.dialog($(this).attr('href'), 200); - return false;">Manage</a></td> + return false;">Manage</a> + </td> + </tr> +<?php } ?> </tbody> </table> <p style="text-align:center"> diff --git a/include/staff/templates/content-manage.tmpl.php b/include/staff/templates/content-manage.tmpl.php new file mode 100644 index 0000000000000000000000000000000000000000..f3498670ba0cd26a535b98385eda8ff50f765755 --- /dev/null +++ b/include/staff/templates/content-manage.tmpl.php @@ -0,0 +1,23 @@ +<h3>Manage Content — <?php echo Format::htmlchars($content->getName()); ?></h3> +<a class="close" href=""><i class="icon-remove-circle"></i></a> +<hr/> +<form method="post" action="#content/<?php echo $content->getId(); ?>"> + <input type="text" style="width: 100%; font-size: 14pt" name="name" value="<?php + echo Format::htmlchars($content->getName()); ?>" /> + <div style="margin-top: 5px"></div> + <textarea class="richtext no-bar" name="body"><?php + echo Format::viewableImages($content->getBody()); +?></textarea> + <hr/> + <p class="full-width"> + <span class="buttons" style="float:left"> + <input type="reset" value="Reset"> + <input type="button" name="cancel" class="<?php echo $user ? 'cancel' : 'close' ?>" value="Cancel"> + </span> + <span class="buttons" style="float:right"> + <input type="submit" value="Save Changes"> + </span> + </p> +</form> +</div> +<div class="clear"></div> diff --git a/scp/login.php b/scp/login.php index 20f53938e163334af2db7e8f83d2d0e450ac35fa..4bb0df8c96902a19a0a67a6fb58e7a2c2afb2f27 100644 --- a/scp/login.php +++ b/scp/login.php @@ -19,9 +19,11 @@ if(!defined('INCLUDE_DIR')) die('Fatal Error. Kwaheri!'); require_once(INCLUDE_DIR.'class.staff.php'); require_once(INCLUDE_DIR.'class.csrf.php'); +$content = Page::lookup(Page::getIdByType('staff-banner')); + $dest = $_SESSION['_staff']['auth']['dest']; $msg = $_SESSION['_staff']['auth']['msg']; -$msg = $msg?$msg:'Authentication Required'; +$msg = $msg ?: $content->getName(); $dest=($dest && (!strstr($dest,'login.php') && !strstr($dest,'ajax.php')))?$dest:'index.php'; $show_reset = false; if($_POST) {