A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. if (!defined('entry')) {
  3. define('entry', true);
  4. }
  5. /* ===========================
  6. gelato CMS - A PHP based tumblelog CMS
  7. development version
  8. http://www.gelatocms.com/
  9. gelato CMS is a free software licensed under the GPL 2.0
  10. Copyright (C) 2007 by Pedro Santana <pecesama at gmail dot com>
  11. =========================== */
  12. ?>
  13. <?php
  14. require_once('../entry.php');
  15. global $user;
  16. if ($user->isAdmin()) {
  17. if ($_GET["action"]) {
  18. if ($_GET["action"] == "close") {
  19. if ($user->closeSession()) {
  20. echo __("&nbsp;ending session&hellip;");
  21. } else {
  22. echo __("&nbsp;failure ending session&hellip;");
  23. }
  24. } // $_GET["action"] == "close"
  25. if ($_GET["action"] == "verify") {
  26. if ($_GET["login"]=="") {
  27. echo "<div class=\"error\">".__("Required field cannot be left blank.")."</div>";
  28. } else {
  29. if (!$user->userExist($_GET["login"])) {
  30. echo "<div class=\"exito\">".__("Username available.")."</div>";
  31. } else {
  32. echo "<div class=\"error\">".__("The username is not available.")."</div>";
  33. }
  34. }
  35. } // $_GET["action"] == "verify"
  36. } // $_GET["action"]
  37. } // $user->isAdmin()
  38. ?>