A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.1KB

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