A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.2KB

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