A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. if (!defined('entry')) {
  3. define('entry', true);
  4. }
  5. /* ===========================
  6. Sorbet CMS - A PHP based tumblelog CMS forked from Gelato CMS
  7. Sorbet CMS is a free software licensed under the GPL 3.0
  8. =========================== */
  9. ?>
  10. <?php
  11. require_once('../entry.php');
  12. global $user;
  13. if ($user->isAdmin()) {
  14. if ($_GET["action"]) {
  15. if ($_GET["action"] == "close") {
  16. if ($user->closeSession()) {
  17. echo __("&nbsp;ending session&hellip;");
  18. } else {
  19. echo __("&nbsp;failure ending session&hellip;");
  20. }
  21. } // $_GET["action"] == "close"
  22. if ($_GET["action"] == "verify") {
  23. if ($_GET["login"]=="") {
  24. echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
  25. } else {
  26. if (!$user->userExist($_GET["login"])) {
  27. echo "<div class=\"exito\">".__("Username available.")."</div>";
  28. } else {
  29. echo "<div class=\"error\">".__("The username is not available.")."</div>";
  30. }
  31. }
  32. } // $_GET["action"] == "verify"
  33. } // $_GET["action"]
  34. } // $user->isAdmin()
  35. ?>