A tumblelog CMS built on AJAX, PHP and MySQL.

ajax.php 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?
  2. /* ===========================
  3. gelato CMS development version
  4. http://www.gelatocms.com/
  5. gelato CMS is a free software licensed under GPL (General public license)
  6. =========================== */
  7. ?>
  8. <?
  9. require_once('../config.php');
  10. include("../classes/user.class.php");
  11. $user = new user();
  12. if ($user->isAdmin()) {
  13. if ($_GET["action"]) {
  14. if ($_GET["action"] == "close") {
  15. session_start();
  16. if ($user->closeSession()) {
  17. echo "&nbsp;ending session...";
  18. } else {
  19. echo "&nbsp;failure ending session...";
  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. ?>