A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 GPL (General public license)
  7. =========================== */
  8. ?>
  9. <?php
  10. require_once('../config.php');
  11. include("../classes/user.class.php");
  12. $user = new user();
  13. if ($user->isAdmin()) {
  14. if ($_GET["action"]) {
  15. if ($_GET["action"] == "close") {
  16. session_start();
  17. if ($user->closeSession()) {
  18. echo "&nbsp;ending session...";
  19. } else {
  20. echo "&nbsp;failure ending session...";
  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. ?>