Bootswatch, Summernote, and Captcheck mods for Mods for HESK (mods-for-hesk.com). In use at support.netsyms.com.
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <?php
  2. define('IN_SCRIPT', 1);
  3. define('HESK_PATH', './');
  4. // Get all the required files and functions
  5. require(HESK_PATH . 'hesk_settings.inc.php');
  6. require(HESK_PATH . 'inc/common.inc.php');
  7. hesk_load_database_functions();
  8. hesk_dbConnect();
  9. require(HESK_PATH . 'inc/posting_functions.inc.php');
  10. require(HESK_PATH . 'inc/htmLawed.php');
  11. require(HESK_PATH . 'inc/email_functions.inc.php');
  12. require_once(HESK_PATH . 'inc/header.inc.php');
  13. ?>
  14. <ol class="breadcrumb">
  15. <li><a href="<?php echo $hesk_settings['site_url']; ?>"><?php echo $hesk_settings['site_title']; ?></a></li>
  16. <li><a href="<?php echo $hesk_settings['hesk_url']; ?>"><?php echo $hesk_settings['hesk_title']; ?></a></li>
  17. <li class="active"><?php echo $hesklang['verify_email']; ?></li>
  18. </ol>
  19. <div class="row">
  20. <div class="col-md-8 col-md-offset-2 col-sm-12">
  21. <h3><?php echo $hesklang['verify_email']; ?></h3>
  22. <div class="footerWithBorder blankSpace"></div>
  23. <?php
  24. $showForm = true;
  25. if (isset($_GET['key']) || isset($_POST['key'])) {
  26. $key = isset($_GET['key'])
  27. ? $_GET['key']
  28. : $_POST['key'];
  29. $submittedTickets = array();
  30. $email = '';
  31. $getRs = hesk_dbQuery("SELECT `Email` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "pending_verification_emails`
  32. WHERE `ActivationKey` = '" . hesk_dbEscape($key) . "'");
  33. while ($result = hesk_dbFetchAssoc($getRs)) {
  34. $email = $result['Email'];
  35. $ticketRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets`
  36. WHERE `email` = '" . hesk_dbEscape($result['Email']) . "'");
  37. while ($innerResult = hesk_dbFetchAssoc($ticketRs)) {
  38. $ticket = hesk_newTicket($innerResult);
  39. // Notify the customer
  40. $modsForHesk_settings = mfh_getSettings();
  41. hesk_notifyCustomer($modsForHesk_settings);
  42. // Need to notify staff?
  43. // --> From autoassign?
  44. $getOwnerRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE ID = " . intval($ticket['owner']));
  45. $autoassign_owner = hesk_dbFetchAssoc($getOwnerRs);
  46. if ($ticket['owner'] && $autoassign_owner['notify_assigned']) {
  47. hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings);
  48. } // --> No autoassign, find and notify appropriate staff
  49. elseif (!$ticket['owner']) {
  50. hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' ", $modsForHesk_settings);
  51. }
  52. array_push($submittedTickets, $innerResult['trackid']);
  53. hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets`
  54. WHERE `id` = " . $innerResult['id']);
  55. }
  56. //Add email address to the verified emails table
  57. hesk_dbQuery('INSERT INTO `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'verified_emails` (`Email`) VALUES (\'' . hesk_dbEscape($email) . '\')');
  58. }
  59. hesk_dbQuery("DELETE FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "pending_verification_emails`
  60. WHERE `ActivationKey` = '" . hesk_dbEscape($key) . "'");
  61. //-- was there an email recorded for the key?
  62. if (!empty($email)) {
  63. $showForm = false;
  64. ?>
  65. <div class="alert alert-success">
  66. <p><i class="fa fa-check"></i> <?php echo sprintf($hesklang['email_verified'], $email) ?></p>
  67. <ul>
  68. <?php
  69. foreach ($submittedTickets as $ticket) {
  70. echo '<li><a href="' . $hesk_settings['hesk_url'] . '/ticket.php?track=' . $ticket . '">' . $ticket . '</a></li>';
  71. }
  72. if (count($submittedTickets) == 0) {
  73. echo '<li>' . $hesklang['no_tickets_created'] . '</li>';
  74. }
  75. ?>
  76. </ul>
  77. </div>
  78. <?php
  79. } else {
  80. //-- no tickets were activated. invalid key, or was email already activated??
  81. ?>
  82. <div class="alert alert-warning">
  83. <p><i class="fa fa-exclamation-triangle"></i> <?php echo $hesklang['verify_no_records']; ?></p>
  84. </div>
  85. <?php
  86. }
  87. }
  88. if ($showForm) {
  89. ?>
  90. <form class="form-horizontal" action="verifyemail.php" method="post">
  91. <div class="form-group">
  92. <label for="key"
  93. class="col-sm-3 control-label"><?php echo $hesklang['activation_key']; ?></label>
  94. <div class="col-sm-9">
  95. <input type="text" class="form-control" id="key" name="key"
  96. placeholder="<?php echo htmlspecialchars($hesklang['activation_key']); ?>">
  97. </div>
  98. </div>
  99. <div class="form-group">
  100. <div class="col-sm-9 col-sm-offset-3">
  101. <input type="submit" class="btn btn-default"
  102. value="<?php echo $hesklang['verify_email']; ?>">
  103. </div>
  104. </div>
  105. </form>
  106. <?php
  107. }
  108. ?>
  109. </div>
  110. </div>
  111. <?php
  112. require_once(HESK_PATH . 'inc/footer.inc.php');
  113. ?>